@xwiki/cristal-electron-renderer 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -16
- package/dist/AttachmentPreview-CIOMG1_u.js +0 -2
- package/dist/AttachmentPreview-CIOMG1_u.js.map +0 -1
- package/dist/AttachmentPreview-DNQ6Ebkw.css +0 -1
- package/dist/AuthServiceBanner-BArubXdu.css +0 -1
- package/dist/AuthServiceBanner-GEdSAYEm.js +0 -2
- package/dist/AuthServiceBanner-GEdSAYEm.js.map +0 -1
- package/dist/DeletePage-CLcDso4C.js +0 -2
- package/dist/DeletePage-CLcDso4C.js.map +0 -1
- package/dist/FloatingComposerController-KlxX35Kg-Cuq2B2Tu.js +0 -2
- package/dist/FloatingComposerController-KlxX35Kg-Cuq2B2Tu.js.map +0 -1
- package/dist/GitHubLoginMenu-BNybTTq9.js +0 -2
- package/dist/GitHubLoginMenu-BNybTTq9.js.map +0 -1
- package/dist/LoggedInMenu-C73cJ53z.js +0 -2
- package/dist/LoggedInMenu-C73cJ53z.js.map +0 -1
- package/dist/LoginMenu-CssV8KKA.js +0 -2
- package/dist/LoginMenu-CssV8KKA.js.map +0 -1
- package/dist/MovePage-BHS998Jm.css +0 -1
- package/dist/MovePage-DLHXylYc.js +0 -2
- package/dist/MovePage-DLHXylYc.js.map +0 -1
- package/dist/NextcloudLoginMenu-CfBoPILQ.js +0 -2
- package/dist/NextcloudLoginMenu-CfBoPILQ.js.map +0 -1
- package/dist/NextcloudLoginMenu-DGCgMCya.css +0 -1
- package/dist/RenamePage-C3mjame-.js +0 -2
- package/dist/RenamePage-C3mjame-.js.map +0 -1
- package/dist/SettingsConfigurations-B9GWI5mw.css +0 -1
- package/dist/SettingsConfigurations-C9USPgZ5.js +0 -2
- package/dist/SettingsConfigurations-C9USPgZ5.js.map +0 -1
- package/dist/c-config-menu-BGV5XXU8.css +0 -1
- package/dist/c-config-menu-GJ2n1TMZ.js +0 -2
- package/dist/c-config-menu-GJ2n1TMZ.js.map +0 -1
- package/dist/c-edit-blocknote-B6mEty1W.css +0 -1
- package/dist/c-edit-blocknote-BDXBHJ_D.js +0 -173
- package/dist/c-edit-blocknote-BDXBHJ_D.js.map +0 -1
- package/dist/chunk.24ZZSBUF-BmQPh48m.js +0 -89
- package/dist/chunk.24ZZSBUF-BmQPh48m.js.map +0 -1
- package/dist/chunk.36O46B5H-Cv2poSyf.js +0 -64
- package/dist/chunk.36O46B5H-Cv2poSyf.js.map +0 -1
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js +0 -77
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js.map +0 -1
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js +0 -2
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js.map +0 -1
- package/dist/chunk.4TUIT776-BvlNwMXD.js +0 -18
- package/dist/chunk.4TUIT776-BvlNwMXD.js.map +0 -1
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js +0 -2
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js.map +0 -1
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js +0 -75
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js.map +0 -1
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js +0 -2
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js.map +0 -1
- package/dist/chunk.B4BZKR24-B0iVuGLD.js +0 -2
- package/dist/chunk.B4BZKR24-B0iVuGLD.js.map +0 -1
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js +0 -2
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js.map +0 -1
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js +0 -86
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js.map +0 -1
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js +0 -2
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js.map +0 -1
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js +0 -244
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js.map +0 -1
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js +0 -622
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js.map +0 -1
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js +0 -24
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js.map +0 -1
- package/dist/chunk.JQBT7BOV-CMuspUnt.js +0 -3378
- package/dist/chunk.JQBT7BOV-CMuspUnt.js.map +0 -1
- package/dist/chunk.JXOKFADN-D3ZKW4nG.js +0 -785
- package/dist/chunk.JXOKFADN-D3ZKW4nG.js.map +0 -1
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js +0 -163
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js.map +0 -1
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js +0 -2
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js.map +0 -1
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js +0 -2
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js.map +0 -1
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js +0 -181
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js.map +0 -1
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js +0 -2
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js.map +0 -1
- package/dist/chunk.RY756JLP-BUknFjxa.js +0 -22
- package/dist/chunk.RY756JLP-BUknFjxa.js.map +0 -1
- package/dist/chunk.SI4ACBFK-BB831ml8.js +0 -58
- package/dist/chunk.SI4ACBFK-BB831ml8.js.map +0 -1
- package/dist/chunk.TRHSUYII-DFnBKJNh.js +0 -140
- package/dist/chunk.TRHSUYII-DFnBKJNh.js.map +0 -1
- package/dist/chunk.XA43ZQPC-maNlqVLX.js +0 -395
- package/dist/chunk.XA43ZQPC-maNlqVLX.js.map +0 -1
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js +0 -178
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js.map +0 -1
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js +0 -109
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js.map +0 -1
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js +0 -2
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js.map +0 -1
- package/dist/chunk.ZH2AND3P-CzagA8cz.js +0 -288
- package/dist/chunk.ZH2AND3P-CzagA8cz.js.map +0 -1
- package/dist/class-map-DmaCJs8c.js +0 -2
- package/dist/class-map-DmaCJs8c.js.map +0 -1
- package/dist/filesystem-internal-link-serializer-D_jo1Aww.js +0 -2
- package/dist/filesystem-internal-link-serializer-D_jo1Aww.js.map +0 -1
- package/dist/floating-ui.dom-AjS1hz1P.js +0 -2
- package/dist/floating-ui.dom-AjS1hz1P.js.map +0 -1
- package/dist/github-CTLFo_VH.js +0 -3
- package/dist/github-CTLFo_VH.js.map +0 -1
- package/dist/github-internal-link-serializer-CcT9sA8-.js +0 -2
- package/dist/github-internal-link-serializer-CcT9sA8-.js.map +0 -1
- package/dist/if-defined-O-hFrvt0.js +0 -2
- package/dist/if-defined-O-hFrvt0.js.map +0 -1
- package/dist/index-BQdFAtKy.css +0 -1
- package/dist/index-CCWBEKc7.js +0 -258
- package/dist/index-CCWBEKc7.js.map +0 -1
- package/dist/index-DWPjg9z3.js +0 -2
- package/dist/index-DWPjg9z3.js.map +0 -1
- package/dist/index-x-rRBFyA.js +0 -3
- package/dist/index-x-rRBFyA.js.map +0 -1
- package/dist/index.html +0 -13
- package/dist/live-z5w0O4st.js +0 -2
- package/dist/live-z5w0O4st.js.map +0 -1
- package/dist/module-RjUF93sV.js +0 -717
- package/dist/module-RjUF93sV.js.map +0 -1
- package/dist/native-48B9X9Wg.js +0 -2
- package/dist/native-48B9X9Wg.js.map +0 -1
- package/dist/nextcloud-CYt9DN65.js +0 -31
- package/dist/nextcloud-CYt9DN65.js.map +0 -1
- package/dist/nextcloud-internal-link-serializer-CUyXgW04.js +0 -7
- package/dist/nextcloud-internal-link-serializer-CUyXgW04.js.map +0 -1
- package/dist/offline-Diq5U-E3.js +0 -4
- package/dist/offline-Diq5U-E3.js.map +0 -1
- package/dist/query-x48B6FB_.js +0 -2
- package/dist/query-x48B6FB_.js.map +0 -1
- package/dist/shoelace-KCScRbrk.js +0 -3
- package/dist/shoelace-KCScRbrk.js.map +0 -1
- package/dist/static-Dm20cmTz.js +0 -3
- package/dist/static-Dm20cmTz.js.map +0 -1
- package/dist/staticBuild-BOgweg16.js +0 -2
- package/dist/staticBuild-BOgweg16.js.map +0 -1
- package/dist/translations-D5nOIu3x.js +0 -2
- package/dist/translations-D5nOIu3x.js.map +0 -1
- package/dist/translations-Ds9OkLNv.js +0 -2
- package/dist/translations-Ds9OkLNv.js.map +0 -1
- package/dist/vuetify-CnK2Qji3.js +0 -21
- package/dist/vuetify-CnK2Qji3.js.map +0 -1
- package/dist/vuetify-yTaAqVoQ.css +0 -1
- package/dist/worker-8k1RWHy1.js +0 -202
- package/dist/worker-8k1RWHy1.js.map +0 -1
- package/dist/x-alert-8XhM2R9T.js +0 -2
- package/dist/x-alert-8XhM2R9T.js.map +0 -1
- package/dist/x-alert-BhErtBtU.css +0 -1
- package/dist/x-alert-DfYpLdml.css +0 -1
- package/dist/x-alert-SyNcMWYD.js +0 -2
- package/dist/x-alert-SyNcMWYD.js.map +0 -1
- package/dist/x-avatar-2efH4gNX.css +0 -1
- package/dist/x-avatar-D7rAcJG4.js +0 -2
- package/dist/x-avatar-D7rAcJG4.js.map +0 -1
- package/dist/x-avatar-DOwl-V_M.js +0 -2
- package/dist/x-avatar-DOwl-V_M.js.map +0 -1
- package/dist/x-breadcrumb-BMSNlvvi.css +0 -1
- package/dist/x-breadcrumb-Dm5qM-E4.js +0 -2
- package/dist/x-breadcrumb-Dm5qM-E4.js.map +0 -1
- package/dist/x-breadcrumb-QPITko8O.js +0 -2
- package/dist/x-breadcrumb-QPITko8O.js.map +0 -1
- package/dist/x-btn-DPGq6Sd-.css +0 -1
- package/dist/x-btn-Djv28wbf.js +0 -2
- package/dist/x-btn-Djv28wbf.js.map +0 -1
- package/dist/x-btn-IM3rnGCu.js +0 -2
- package/dist/x-btn-IM3rnGCu.js.map +0 -1
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-BfELgZ-g.js +0 -2
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-BfELgZ-g.js.map +0 -1
- package/dist/x-card-BVIatBG7.js +0 -2
- package/dist/x-card-BVIatBG7.js.map +0 -1
- package/dist/x-card-GR2LwNNz.js +0 -2
- package/dist/x-card-GR2LwNNz.js.map +0 -1
- package/dist/x-checkbox-BoqoQxdA.css +0 -1
- package/dist/x-checkbox-CvXj01Ni.js +0 -2
- package/dist/x-checkbox-CvXj01Ni.js.map +0 -1
- package/dist/x-checkbox-Dwtf4j8T.js +0 -2
- package/dist/x-checkbox-Dwtf4j8T.js.map +0 -1
- package/dist/x-col-CkqsL6R6.js +0 -2
- package/dist/x-col-CkqsL6R6.js.map +0 -1
- package/dist/x-container-G8-ySp-b.js +0 -2
- package/dist/x-container-G8-ySp-b.js.map +0 -1
- package/dist/x-dialog-Bk9LE0HR.css +0 -1
- package/dist/x-dialog-De-sv7Mm.js +0 -2
- package/dist/x-dialog-De-sv7Mm.js.map +0 -1
- package/dist/x-dialog-DxfbQB-Y.js +0 -2
- package/dist/x-dialog-DxfbQB-Y.js.map +0 -1
- package/dist/x-dialog-VzzVz38L.css +0 -1
- package/dist/x-divider-2VUJwNX0.js +0 -2
- package/dist/x-divider-2VUJwNX0.js.map +0 -1
- package/dist/x-divider-BCHM_vRn.js +0 -2
- package/dist/x-divider-BCHM_vRn.js.map +0 -1
- package/dist/x-dropdown-CVsz59DB.js +0 -2
- package/dist/x-dropdown-CVsz59DB.js.map +0 -1
- package/dist/x-dropdown-CsPhxqwI.js +0 -2
- package/dist/x-dropdown-CsPhxqwI.js.map +0 -1
- package/dist/x-dropdown-CxWpPIwn.css +0 -1
- package/dist/x-dropdown-GNs7ILlc.css +0 -1
- package/dist/x-file-input-BSstA5LD.css +0 -1
- package/dist/x-file-input-CINFUmR_.js +0 -2
- package/dist/x-file-input-CINFUmR_.js.map +0 -1
- package/dist/x-file-input-DioKYTRp.js +0 -2
- package/dist/x-file-input-DioKYTRp.js.map +0 -1
- package/dist/x-form-CK24VrXN.css +0 -1
- package/dist/x-form-CsGPlCcU.js +0 -2
- package/dist/x-form-CsGPlCcU.js.map +0 -1
- package/dist/x-form-DGUS5Veh.css +0 -1
- package/dist/x-form-OLhYS7Pe.js +0 -2
- package/dist/x-form-OLhYS7Pe.js.map +0 -1
- package/dist/x-img-CDa7fXz7.js +0 -2
- package/dist/x-img-CDa7fXz7.js.map +0 -1
- package/dist/x-img-D0T62Q-K.js +0 -2
- package/dist/x-img-D0T62Q-K.js.map +0 -1
- package/dist/x-load-BlPeW_ej.css +0 -1
- package/dist/x-load-BsACA7Yh.css +0 -1
- package/dist/x-load-CxmsPAk1.js +0 -2
- package/dist/x-load-CxmsPAk1.js.map +0 -1
- package/dist/x-load-DHKEgXWu.js +0 -2
- package/dist/x-load-DHKEgXWu.js.map +0 -1
- package/dist/x-menu-BWEqzbov.js +0 -2
- package/dist/x-menu-BWEqzbov.js.map +0 -1
- package/dist/x-menu-BmuGyRjl.css +0 -1
- package/dist/x-menu-BvFt6ZQC.js +0 -2
- package/dist/x-menu-BvFt6ZQC.js.map +0 -1
- package/dist/x-menu-item-DWjQwgJO.js +0 -2
- package/dist/x-menu-item-DWjQwgJO.js.map +0 -1
- package/dist/x-menu-item-DtD2NUGa.js +0 -2
- package/dist/x-menu-item-DtD2NUGa.js.map +0 -1
- package/dist/x-menu-label-8wvYr7d2.js +0 -2
- package/dist/x-menu-label-8wvYr7d2.js.map +0 -1
- package/dist/x-menu-label-DhRAj-fk.css +0 -1
- package/dist/x-menu-label-dVGBH64z.js +0 -2
- package/dist/x-menu-label-dVGBH64z.js.map +0 -1
- package/dist/x-row-CkqsL6R6.js +0 -2
- package/dist/x-row-CkqsL6R6.js.map +0 -1
- package/dist/x-search-BW5n0R02.js +0 -2
- package/dist/x-search-BW5n0R02.js.map +0 -1
- package/dist/x-search-DdfuJ8m0.js +0 -2
- package/dist/x-search-DdfuJ8m0.js.map +0 -1
- package/dist/x-select-ByfZfFMe.js +0 -2
- package/dist/x-select-ByfZfFMe.js.map +0 -1
- package/dist/x-select-R4a_-Bdz.js +0 -2
- package/dist/x-select-R4a_-Bdz.js.map +0 -1
- package/dist/x-tab-ClYE3cii.js +0 -2
- package/dist/x-tab-ClYE3cii.js.map +0 -1
- package/dist/x-tab-DaNeuiT_.js +0 -2
- package/dist/x-tab-DaNeuiT_.js.map +0 -1
- package/dist/x-tab-group-BXepgVbd.js +0 -2
- package/dist/x-tab-group-BXepgVbd.js.map +0 -1
- package/dist/x-tab-group-CNwwWr7e.js +0 -2
- package/dist/x-tab-group-CNwwWr7e.js.map +0 -1
- package/dist/x-tab-panel-BvMrfGru.js +0 -2
- package/dist/x-tab-panel-BvMrfGru.js.map +0 -1
- package/dist/x-tab-panel-D7cMQTqi.js +0 -2
- package/dist/x-tab-panel-D7cMQTqi.js.map +0 -1
- package/dist/x-text-field-DFHPCvyd.js +0 -2
- package/dist/x-text-field-DFHPCvyd.js.map +0 -1
- package/dist/x-text-field-Dgt67jOY.js +0 -2
- package/dist/x-text-field-Dgt67jOY.js.map +0 -1
- package/dist/x-tree-D0WG-8EM.css +0 -1
- package/dist/x-tree-DyXSXOLh.js +0 -2
- package/dist/x-tree-DyXSXOLh.js.map +0 -1
- package/dist/x-tree-OLo4IKf9.css +0 -1
- package/dist/x-tree-xjxifOp4.js +0 -2
- package/dist/x-tree-xjxifOp4.js.map +0 -1
- package/dist/xwiki-DMzRUTcj.js +0 -4
- package/dist/xwiki-DMzRUTcj.js.map +0 -1
- package/dist/xwiki-internal-link-serializer-Cd8xorru-tUzhWt61.js +0 -2
- package/dist/xwiki-internal-link-serializer-Cd8xorru-tUzhWt61.js.map +0 -1
- package/dist/xwiki-logo-color-DZ9bdNW4.svg +0 -18
package/dist/worker-8k1RWHy1.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hl={};var pl;function Ud(){if(pl)return hl;pl=1;var n;return(function(e){(function(t){var i=typeof globalThis=="object"?globalThis:typeof dr=="object"?dr:typeof self=="object"?self:typeof this=="object"?this:d(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),t(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(p,y){return function(m,w){Object.defineProperty(p,m,{configurable:!0,writable:!0,value:w}),y&&y(m,w)}}function a(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function d(){return a()||l()}})(function(t,i){var r=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",a=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",d=typeof Object.create=="function",p={__proto__:[]}instanceof Array,y=!d&&!p,m={create:d?function(){return nt(Object.create(null))}:p?function(){return nt({__proto__:null})}:function(){return nt({})},has:y?function(S,T){return r.call(S,T)}:function(S,T){return T in S},get:y?function(S,T){return r.call(S,T)?S[T]:void 0}:function(S,T){return S[T]}},w=Object.getPrototypeOf(Function),P=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:st(),K=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ke(),O=typeof WeakMap=="function"?WeakMap:vt(),D=s?Symbol.for("@reflect-metadata:registry"):void 0,ee=V(),J=z(ee);function oe(S,T,M,U){if(ve(M)){if(!Pe(S))throw new TypeError;if(!Fn(T))throw new TypeError;return rt(S,T)}else{if(!Pe(S))throw new TypeError;if(!Ae(T))throw new TypeError;if(!Ae(U)&&!ve(U)&&!ht(U))throw new TypeError;return ht(U)&&(U=void 0),M=pt(M),mn(S,T,M,U)}}t("decorate",oe);function G(S,T){function M(U,F){if(!Ae(U))throw new TypeError;if(!ve(F)&&!Mt(F))throw new TypeError;dt(S,T,U,F)}return M}t("metadata",G);function Z(S,T,M,U){if(!Ae(M))throw new TypeError;return ve(U)||(U=pt(U)),dt(S,T,M,U)}t("defineMetadata",Z);function ae(S,T,M){if(!Ae(T))throw new TypeError;return ve(M)||(M=pt(M)),zt(S,T,M)}t("hasMetadata",ae);function fe(S,T,M){if(!Ae(T))throw new TypeError;return ve(M)||(M=pt(M)),ft(S,T,M)}t("hasOwnMetadata",fe);function Y(S,T,M){if(!Ae(T))throw new TypeError;return ve(M)||(M=pt(M)),tt(S,T,M)}t("getMetadata",Y);function ge(S,T,M){if(!Ae(T))throw new TypeError;return ve(M)||(M=pt(M)),pe(S,T,M)}t("getOwnMetadata",ge);function Re(S,T){if(!Ae(S))throw new TypeError;return ve(T)||(T=pt(T)),St(S,T)}t("getMetadataKeys",Re);function We(S,T){if(!Ae(S))throw new TypeError;return ve(T)||(T=pt(T)),Ue(S,T)}t("getOwnMetadataKeys",We);function ke(S,T,M){if(!Ae(T))throw new TypeError;if(ve(M)||(M=pt(M)),!Ae(T))throw new TypeError;ve(M)||(M=pt(M));var U=he(T,M,!1);return ve(U)?!1:U.OrdinaryDeleteMetadata(S,T,M)}t("deleteMetadata",ke);function rt(S,T){for(var M=S.length-1;M>=0;--M){var U=S[M],F=U(T);if(!ve(F)&&!ht(F)){if(!Fn(F))throw new TypeError;T=F}}return T}function mn(S,T,M,U){for(var F=S.length-1;F>=0;--F){var ye=S[F],xe=ye(T,M,U);if(!ve(xe)&&!ht(xe)){if(!Ae(xe))throw new TypeError;U=xe}}return U}function zt(S,T,M){var U=ft(S,T,M);if(U)return!0;var F=Rt(T);return ht(F)?!1:zt(S,F,M)}function ft(S,T,M){var U=he(T,M,!1);return ve(U)?!1:$n(U.OrdinaryHasOwnMetadata(S,T,M))}function tt(S,T,M){var U=ft(S,T,M);if(U)return pe(S,T,M);var F=Rt(T);if(!ht(F))return tt(S,F,M)}function pe(S,T,M){var U=he(T,M,!1);if(!ve(U))return U.OrdinaryGetOwnMetadata(S,T,M)}function dt(S,T,M,U){var F=he(M,U,!0);F.OrdinaryDefineOwnMetadata(S,T,M,U)}function St(S,T){var M=Ue(S,T),U=Rt(S);if(U===null)return M;var F=St(U,T);if(F.length<=0)return M;if(M.length<=0)return F;for(var ye=new K,xe=[],be=0,L=M;be<L.length;be++){var re=L[be],ce=ye.has(re);ce||(ye.add(re),xe.push(re))}for(var ue=0,Se=F;ue<Se.length;ue++){var re=Se[ue],ce=ye.has(re);ce||(ye.add(re),xe.push(re))}return xe}function Ue(S,T){var M=he(S,T,!1);return M?M.OrdinaryOwnMetadataKeys(S,T):[]}function _t(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function ve(S){return S===void 0}function ht(S){return S===null}function ci(S){return typeof S=="symbol"}function Ae(S){return typeof S=="object"?S!==null:typeof S=="function"}function Wt(S,T){switch(_t(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var M="string",U=Qt(S,a);if(U!==void 0){var F=U.call(S,M);if(Ae(F))throw new TypeError;return F}return Xt(S)}function Xt(S,T){var M,U;{var F=S.toString;if(At(F)){var U=F.call(S);if(!Ae(U))return U}var M=S.valueOf;if(At(M)){var U=M.call(S);if(!Ae(U))return U}}throw new TypeError}function $n(S){return!!S}function de(S){return""+S}function pt(S){var T=Wt(S);return ci(T)?T:de(T)}function Pe(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function At(S){return typeof S=="function"}function Fn(S){return typeof S=="function"}function Mt(S){switch(_t(S)){case 3:return!0;case 4:return!0;default:return!1}}function sn(S,T){return S===T||S!==S&&T!==T}function Qt(S,T){var M=S[T];if(M!=null){if(!At(M))throw new TypeError;return M}}function li(S){var T=Qt(S,l);if(!At(T))throw new TypeError;var M=T.call(S);if(!Ae(M))throw new TypeError;return M}function ui(S){return S.value}function vn(S){var T=S.next();return T.done?!1:T}function mt(S){var T=S.return;T&&T.call(S)}function Rt(S){var T=Object.getPrototypeOf(S);if(typeof S!="function"||S===w||T!==w)return T;var M=S.prototype,U=M&&Object.getPrototypeOf(M);if(U==null||U===Object.prototype)return T;var F=U.constructor;return typeof F!="function"||F===S?T:F}function $(){var S;!ve(D)&&typeof i.Reflect<"u"&&!(D in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(S=X(i.Reflect));var T,M,U,F=new O,ye={registerProvider:xe,getProvider:L,setProvider:ce};return ye;function xe(ue){if(!Object.isExtensible(ye))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===ue:break;case ve(T):T=ue;break;case T===ue:break;case ve(M):M=ue;break;case M===ue:break;default:U===void 0&&(U=new K),U.add(ue);break}}function be(ue,Se){if(!ve(T)){if(T.isProviderFor(ue,Se))return T;if(!ve(M)){if(M.isProviderFor(ue,Se))return T;if(!ve(U))for(var je=li(U);;){var Ve=vn(je);if(!Ve)return;var Pt=ui(Ve);if(Pt.isProviderFor(ue,Se))return mt(je),Pt}}}if(!ve(S)&&S.isProviderFor(ue,Se))return S}function L(ue,Se){var je=F.get(ue),Ve;return ve(je)||(Ve=je.get(Se)),ve(Ve)&&(Ve=be(ue,Se),ve(Ve)||(ve(je)&&(je=new P,F.set(ue,je)),je.set(Se,Ve))),Ve}function re(ue){if(ve(ue))throw new TypeError;return T===ue||M===ue||!ve(U)&&U.has(ue)}function ce(ue,Se,je){if(!re(je))throw new Error("Metadata provider not registered.");var Ve=L(ue,Se);if(Ve!==je){if(!ve(Ve))return!1;var Pt=F.get(ue);ve(Pt)&&(Pt=new P,F.set(ue,Pt)),Pt.set(Se,je)}return!0}}function V(){var S;return!ve(D)&&Ae(i.Reflect)&&Object.isExtensible(i.Reflect)&&(S=i.Reflect[D]),ve(S)&&(S=$()),!ve(D)&&Ae(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,D,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function z(S){var T=new O,M={isProviderFor:function(re,ce){var ue=T.get(re);return ve(ue)?!1:ue.has(ce)},OrdinaryDefineOwnMetadata:xe,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:ye,OrdinaryOwnMetadataKeys:be,OrdinaryDeleteMetadata:L};return ee.registerProvider(M),M;function U(re,ce,ue){var Se=T.get(re),je=!1;if(ve(Se)){if(!ue)return;Se=new P,T.set(re,Se),je=!0}var Ve=Se.get(ce);if(ve(Ve)){if(!ue)return;if(Ve=new P,Se.set(ce,Ve),!S.setProvider(re,ce,M))throw Se.delete(ce),je&&T.delete(re),new Error("Wrong provider for target.")}return Ve}function F(re,ce,ue){var Se=U(ce,ue,!1);return ve(Se)?!1:$n(Se.has(re))}function ye(re,ce,ue){var Se=U(ce,ue,!1);if(!ve(Se))return Se.get(re)}function xe(re,ce,ue,Se){var je=U(ue,Se,!0);je.set(re,ce)}function be(re,ce){var ue=[],Se=U(re,ce,!1);if(ve(Se))return ue;for(var je=Se.keys(),Ve=li(je),Pt=0;;){var on=vn(Ve);if(!on)return ue.length=Pt,ue;var yn=ui(on);try{ue[Pt]=yn}catch(Ui){try{mt(Ve)}finally{throw Ui}}Pt++}}function L(re,ce,ue){var Se=U(ce,ue,!1);if(ve(Se)||!Se.delete(re))return!1;if(Se.size===0){var je=T.get(ce);ve(je)||(je.delete(ue),je.size===0&&T.delete(je))}return!0}}function X(S){var T=S.defineMetadata,M=S.hasOwnMetadata,U=S.getOwnMetadata,F=S.getOwnMetadataKeys,ye=S.deleteMetadata,xe=new O,be={isProviderFor:function(L,re){var ce=xe.get(L);return!ve(ce)&&ce.has(re)?!0:F(L,re).length?(ve(ce)&&(ce=new K,xe.set(L,ce)),ce.add(re),!0):!1},OrdinaryDefineOwnMetadata:T,OrdinaryHasOwnMetadata:M,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:ye};return be}function he(S,T,M){var U=ee.getProvider(S,T);if(!ve(U))return U;if(M){if(ee.setProvider(S,T,J))return J;throw new Error("Illegal state.")}}function st(){var S={},T=[],M=(function(){function be(L,re,ce){this._index=0,this._keys=L,this._values=re,this._selector=ce}return be.prototype["@@iterator"]=function(){return this},be.prototype[l]=function(){return this},be.prototype.next=function(){var L=this._index;if(L>=0&&L<this._keys.length){var re=this._selector(this._keys[L],this._values[L]);return L+1>=this._keys.length?(this._index=-1,this._keys=T,this._values=T):this._index++,{value:re,done:!1}}return{value:void 0,done:!0}},be.prototype.throw=function(L){throw this._index>=0&&(this._index=-1,this._keys=T,this._values=T),L},be.prototype.return=function(L){return this._index>=0&&(this._index=-1,this._keys=T,this._values=T),{value:L,done:!0}},be})(),U=(function(){function be(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(be.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),be.prototype.has=function(L){return this._find(L,!1)>=0},be.prototype.get=function(L){var re=this._find(L,!1);return re>=0?this._values[re]:void 0},be.prototype.set=function(L,re){var ce=this._find(L,!0);return this._values[ce]=re,this},be.prototype.delete=function(L){var re=this._find(L,!1);if(re>=0){for(var ce=this._keys.length,ue=re+1;ue<ce;ue++)this._keys[ue-1]=this._keys[ue],this._values[ue-1]=this._values[ue];return this._keys.length--,this._values.length--,sn(L,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},be.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},be.prototype.keys=function(){return new M(this._keys,this._values,F)},be.prototype.values=function(){return new M(this._keys,this._values,ye)},be.prototype.entries=function(){return new M(this._keys,this._values,xe)},be.prototype["@@iterator"]=function(){return this.entries()},be.prototype[l]=function(){return this.entries()},be.prototype._find=function(L,re){if(!sn(this._cacheKey,L)){this._cacheIndex=-1;for(var ce=0;ce<this._keys.length;ce++)if(sn(this._keys[ce],L)){this._cacheIndex=ce;break}}return this._cacheIndex<0&&re&&(this._cacheIndex=this._keys.length,this._keys.push(L),this._values.push(void 0)),this._cacheIndex},be})();return U;function F(be,L){return be}function ye(be,L){return L}function xe(be,L){return[be,L]}}function Ke(){var S=(function(){function T(){this._map=new P}return Object.defineProperty(T.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),T.prototype.has=function(M){return this._map.has(M)},T.prototype.add=function(M){return this._map.set(M,M),this},T.prototype.delete=function(M){return this._map.delete(M)},T.prototype.clear=function(){this._map.clear()},T.prototype.keys=function(){return this._map.keys()},T.prototype.values=function(){return this._map.keys()},T.prototype.entries=function(){return this._map.entries()},T.prototype["@@iterator"]=function(){return this.keys()},T.prototype[l]=function(){return this.keys()},T})();return S}function vt(){var S=16,T=m.create(),M=U();return(function(){function L(){this._key=U()}return L.prototype.has=function(re){var ce=F(re,!1);return ce!==void 0?m.has(ce,this._key):!1},L.prototype.get=function(re){var ce=F(re,!1);return ce!==void 0?m.get(ce,this._key):void 0},L.prototype.set=function(re,ce){var ue=F(re,!0);return ue[this._key]=ce,this},L.prototype.delete=function(re){var ce=F(re,!1);return ce!==void 0?delete ce[this._key]:!1},L.prototype.clear=function(){this._key=U()},L})();function U(){var L;do L="@@WeakMap@@"+be();while(m.has(T,L));return T[L]=!0,L}function F(L,re){if(!r.call(L,M)){if(!re)return;Object.defineProperty(L,M,{value:m.create()})}return L[M]}function ye(L,re){for(var ce=0;ce<re;++ce)L[ce]=Math.random()*255|0;return L}function xe(L){if(typeof Uint8Array=="function"){var re=new Uint8Array(L);return typeof crypto<"u"?crypto.getRandomValues(re):typeof msCrypto<"u"?msCrypto.getRandomValues(re):ye(re,L),re}return ye(new Array(L),L)}function be(){var L=xe(S);L[6]=L[6]&79|64,L[8]=L[8]&191|128;for(var re="",ce=0;ce<S;++ce){var ue=L[ce];(ce===4||ce===6||ce===8)&&(re+="-"),ue<16&&(re+="0"),re+=ue.toString(16).toLowerCase()}return re}}function nt(S){return S.__=void 0,delete S.__,S}})})(n||(n={})),hl}Ud();function qd(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Wa={},ws=()=>{},Ha=Object.assign,Kd=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},Vd=Object.prototype.hasOwnProperty,Es=(n,e)=>Vd.call(n,e),Ut=Array.isArray,rr=n=>Ds(n)==="[object Map]",zd=n=>Ds(n)==="[object Set]",dn=n=>typeof n=="function",Wd=n=>typeof n=="string",ni=n=>typeof n=="symbol",jn=n=>n!==null&&typeof n=="object",Hd=n=>(jn(n)||dn(n))&&dn(n.then)&&dn(n.catch),Gd=Object.prototype.toString,Ds=n=>Gd.call(n),Yd=n=>Ds(n).slice(8,-1),Jd=n=>Ds(n)==="[object Object]",Us=n=>Wd(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,nn=(n,e)=>!Object.is(n,e),Xd=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})};let gl;const Ga=()=>gl||(gl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let ot;class Qd{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ot&&(ot.active?(this.parent=ot,this.index=(ot.scopes||(ot.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ot;try{return ot=this,e()}finally{ot=t}}}on(){++this._on===1&&(this.prevScope=ot,ot=this)}off(){if(this._on>0&&--this._on===0){if(ot===this)ot=this.prevScope;else{let e=ot;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Zd(n){return new Qd(n)}function ru(){return ot}function eh(n,e=!1){ot&&ot.cleanups.push(n)}let Fe;const jo=new WeakSet;class th{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ot&&(ot.active?ot.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,jo.has(this)&&(jo.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ou(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ml(this),au(this);const e=Fe,t=Yt;Fe=this,Yt=!0;try{return this.fn()}finally{cu(this),Fe=e,Yt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Xa(e);this.deps=this.depsTail=void 0,ml(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?jo.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){la(this)&&this.run()}get dirty(){return la(this)}}let su=0,sr,or;function ou(n,e=!1){if(n.flags|=8,e){n.next=or,or=n;return}n.next=sr,sr=n}function Ya(){su++}function Ja(){if(--su>0)return;if(or){let e=or;for(or=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;sr;){let e=sr;for(sr=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function au(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cu(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Xa(i),nh(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function la(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lu(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function lu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===hr)||(n.globalVersion=hr,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!la(n))))return;n.flags|=2;const e=n.dep,t=Fe,i=Yt;Fe=n,Yt=!0;try{au(n);const r=n.fn(n._value);(e.version===0||nn(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{Fe=t,Yt=i,cu(n),n.flags&=-3}}function Xa(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Xa(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function nh(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Yt=!0;const uu=[];function Qa(){uu.push(Yt),Yt=!1}function Za(){const n=uu.pop();Yt=n===void 0?!0:n}function ml(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Fe;Fe=void 0;try{e()}finally{Fe=t}}}let hr=0;class ih{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ec{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Fe||!Yt||Fe===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Fe)t=this.activeLink=new ih(Fe,this),Fe.deps?(t.prevDep=Fe.depsTail,Fe.depsTail.nextDep=t,Fe.depsTail=t):Fe.deps=Fe.depsTail=t,fu(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Fe.depsTail,t.nextDep=void 0,Fe.depsTail.nextDep=t,Fe.depsTail=t,Fe.deps===t&&(Fe.deps=i)}return t}trigger(e){this.version++,hr++,this.notify(e)}notify(e){Ya();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Ja()}}}function fu(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)fu(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Is=new WeakMap,ti=Symbol(""),ua=Symbol(""),pr=Symbol("");function Et(n,e,t){if(Yt&&Fe){let i=Is.get(n);i||Is.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new ec),r.map=i,r.key=t),r.track()}}function Pn(n,e,t,i,r,s){const a=Is.get(n);if(!a){hr++;return}const l=d=>{d&&d.trigger()};if(Ya(),e==="clear")a.forEach(l);else{const d=Ut(n),p=d&&Us(t);if(d&&t==="length"){const y=Number(i);a.forEach((m,w)=>{(w==="length"||w===pr||!ni(w)&&w>=y)&&l(m)})}else switch((t!==void 0||a.has(void 0))&&l(a.get(t)),p&&l(a.get(pr)),e){case"add":d?p&&l(a.get("length")):(l(a.get(ti)),rr(n)&&l(a.get(ua)));break;case"delete":d||(l(a.get(ti)),rr(n)&&l(a.get(ua)));break;case"set":rr(n)&&l(a.get(ti));break}}Ja()}function rh(n,e){const t=Is.get(n);return t&&t.get(e)}function yi(n){const e=Me(n);return e===n?e:(Et(e,"iterate",pr),Ft(n)?e:e.map(gn))}function tc(n){return Et(n=Me(n),"iterate",pr),n}function tn(n,e){return Bn(n)?gr(Tn(n)?gn(e):e):gn(e)}const sh={__proto__:null,[Symbol.iterator](){return Bo(this,Symbol.iterator,n=>tn(this,n))},concat(...n){return yi(this).concat(...n.map(e=>Ut(e)?yi(e):e))},entries(){return Bo(this,"entries",n=>(n[1]=tn(this,n[1]),n))},every(n,e){return ln(this,"every",n,e,void 0,arguments)},filter(n,e){return ln(this,"filter",n,e,t=>t.map(i=>tn(this,i)),arguments)},find(n,e){return ln(this,"find",n,e,t=>tn(this,t),arguments)},findIndex(n,e){return ln(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return ln(this,"findLast",n,e,t=>tn(this,t),arguments)},findLastIndex(n,e){return ln(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return ln(this,"forEach",n,e,void 0,arguments)},includes(...n){return Lo(this,"includes",n)},indexOf(...n){return Lo(this,"indexOf",n)},join(n){return yi(this).join(n)},lastIndexOf(...n){return Lo(this,"lastIndexOf",n)},map(n,e){return ln(this,"map",n,e,void 0,arguments)},pop(){return Xi(this,"pop")},push(...n){return Xi(this,"push",n)},reduce(n,...e){return vl(this,"reduce",n,e)},reduceRight(n,...e){return vl(this,"reduceRight",n,e)},shift(){return Xi(this,"shift")},some(n,e){return ln(this,"some",n,e,void 0,arguments)},splice(...n){return Xi(this,"splice",n)},toReversed(){return yi(this).toReversed()},toSorted(n){return yi(this).toSorted(n)},toSpliced(...n){return yi(this).toSpliced(...n)},unshift(...n){return Xi(this,"unshift",n)},values(){return Bo(this,"values",n=>tn(this,n))}};function Bo(n,e,t){const i=tc(n),r=i[e]();return i!==n&&!Ft(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=t(s.value)),s}),r}const oh=Array.prototype;function ln(n,e,t,i,r,s){const a=tc(n),l=a!==n&&!Ft(n),d=a[e];if(d!==oh[e]){const m=d.apply(n,s);return l?gn(m):m}let p=t;a!==n&&(l?p=function(m,w){return t.call(this,tn(n,m),w,n)}:t.length>2&&(p=function(m,w){return t.call(this,m,w,n)}));const y=d.call(a,p,i);return l&&r?r(y):y}function vl(n,e,t,i){const r=tc(n),s=r!==n&&!Ft(n);let a=t,l=!1;r!==n&&(s?(l=i.length===0,a=function(p,y,m){return l&&(l=!1,p=tn(n,p)),t.call(this,p,tn(n,y),m,n)}):t.length>3&&(a=function(p,y,m){return t.call(this,p,y,m,n)}));const d=r[e](a,...i);return l?tn(n,d):d}function Lo(n,e,t){const i=Me(n);Et(i,"iterate",pr);const r=i[e](...t);return(r===-1||r===!1)&&yu(t[0])?(t[0]=Me(t[0]),i[e](...t)):r}function Xi(n,e,t=[]){Qa(),Ya();const i=Me(n)[e].apply(n,t);return Ja(),Za(),i}const ah=qd("__proto__,__v_isRef,__isVue"),du=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(ni));function ch(n){ni(n)||(n=String(n));const e=Me(this);return Et(e,"has",n),e.hasOwnProperty(n)}class hu{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?yh:mu:s?vh:gu).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const a=Ut(e);if(!r){let d;if(a&&(d=sh[t]))return d;if(t==="hasOwnProperty")return ch}const l=Reflect.get(e,t,lt(e)?e:i);if((ni(t)?du.has(t):ah(t))||(r||Et(e,"get",t),s))return l;if(lt(l)){const d=a&&Us(t)?l:l.value;return r&&jn(d)?da(d):d}return jn(l)?r?da(l):nc(l):l}}class lh extends hu{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];const a=Ut(e)&&Us(t);if(!this._isShallow){const p=Bn(s);if(!Ft(i)&&!Bn(i)&&(s=Me(s),i=Me(i)),!a&<(s)&&!lt(i))return p||(s.value=i),!0}const l=a?Number(t)<e.length:Es(e,t),d=Reflect.set(e,t,i,lt(e)?e:r);return e===Me(r)&&(l?nn(i,s)&&Pn(e,"set",t,i):Pn(e,"add",t,i)),d}deleteProperty(e,t){const i=Es(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&Pn(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!ni(t)||!du.has(t))&&Et(e,"has",t),i}ownKeys(e){return Et(e,"iterate",Ut(e)?"length":ti),Reflect.ownKeys(e)}}class uh extends hu{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const fh=new lh,dh=new uh,fa=n=>n,as=n=>Reflect.getPrototypeOf(n);function hh(n,e,t){return function(...i){const r=this.__v_raw,s=Me(r),a=rr(s),l=n==="entries"||n===Symbol.iterator&&a,d=n==="keys"&&a,p=r[n](...i),y=t?fa:e?gr:gn;return!e&&Et(s,"iterate",d?ua:ti),Ha(Object.create(p),{next(){const{value:m,done:w}=p.next();return w?{value:m,done:w}:{value:l?[y(m[0]),y(m[1])]:y(m),done:w}}})}}function cs(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function ph(n,e){const t={get(r){const s=this.__v_raw,a=Me(s),l=Me(r);n||(nn(r,l)&&Et(a,"get",r),Et(a,"get",l));const{has:d}=as(a),p=e?fa:n?gr:gn;if(d.call(a,r))return p(s.get(r));if(d.call(a,l))return p(s.get(l));s!==a&&s.get(r)},get size(){const r=this.__v_raw;return!n&&Et(Me(r),"iterate",ti),r.size},has(r){const s=this.__v_raw,a=Me(s),l=Me(r);return n||(nn(r,l)&&Et(a,"has",r),Et(a,"has",l)),r===l?s.has(r):s.has(r)||s.has(l)},forEach(r,s){const a=this,l=a.__v_raw,d=Me(l),p=e?fa:n?gr:gn;return!n&&Et(d,"iterate",ti),l.forEach((y,m)=>r.call(s,p(y),p(m),a))}};return Ha(t,n?{add:cs("add"),set:cs("set"),delete:cs("delete"),clear:cs("clear")}:{add(r){const s=Me(this),a=as(s),l=Me(r),d=!e&&!Ft(r)&&!Bn(r)?l:r;return a.has.call(s,d)||nn(r,d)&&a.has.call(s,r)||nn(l,d)&&a.has.call(s,l)||(s.add(d),Pn(s,"add",d,d)),this},set(r,s){!e&&!Ft(s)&&!Bn(s)&&(s=Me(s));const a=Me(this),{has:l,get:d}=as(a);let p=l.call(a,r);p||(r=Me(r),p=l.call(a,r));const y=d.call(a,r);return a.set(r,s),p?nn(s,y)&&Pn(a,"set",r,s):Pn(a,"add",r,s),this},delete(r){const s=Me(this),{has:a,get:l}=as(s);let d=a.call(s,r);d||(r=Me(r),d=a.call(s,r)),l&&l.call(s,r);const p=s.delete(r);return d&&Pn(s,"delete",r,void 0),p},clear(){const r=Me(this),s=r.size!==0,a=r.clear();return s&&Pn(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=hh(r,n,e)}),t}function pu(n,e){const t=ph(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(Es(t,r)&&r in i?t:i,r,s)}const gh={get:pu(!1,!1)},mh={get:pu(!0,!1)},gu=new WeakMap,vh=new WeakMap,mu=new WeakMap,yh=new WeakMap;function bh(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nc(n){return Bn(n)?n:vu(n,!1,fh,gh,gu)}function da(n){return vu(n,!0,dh,mh,mu)}function vu(n,e,t,i,r){if(!jn(n)||n.__v_raw&&!(e&&n.__v_isReactive)||n.__v_skip||!Object.isExtensible(n))return n;const s=r.get(n);if(s)return s;const a=bh(Yd(n));if(a===0)return n;const l=new Proxy(n,a===2?i:t);return r.set(n,l),l}function Tn(n){return Bn(n)?Tn(n.__v_raw):!!(n&&n.__v_isReactive)}function Bn(n){return!!(n&&n.__v_isReadonly)}function Ft(n){return!!(n&&n.__v_isShallow)}function yu(n){return n?!!n.__v_raw:!1}function Me(n){const e=n&&n.__v_raw;return e?Me(e):n}function wh(n){return!Es(n,"__v_skip")&&Object.isExtensible(n)&&Xd(n,"__v_skip",!0),n}const gn=n=>jn(n)?nc(n):n,gr=n=>jn(n)?da(n):n;function lt(n){return n?n.__v_isRef===!0:!1}function xh(n){return Sh(n,!1)}function Sh(n,e){return lt(n)?n:new _h(n,e)}class _h{constructor(e,t){this.dep=new ec,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Me(e),this._value=t?e:gn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Ft(e)||Bn(e);e=i?e:Me(e),nn(e,t)&&(this._rawValue=e,this._value=i?e:gn(e),this.dep.trigger())}}function kh(n){return lt(n)?n.value:n}function Ch(n){const e=Ut(n)?new Array(n.length):{};for(const t in n)e[t]=bu(n,t);return e}class Eh{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=ni(t)?t:String(t),this._raw=Me(e);let r=!0,s=e;if(!Ut(e)||ni(this._key)||!Us(this._key))do r=!yu(s)||Ft(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=kh(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&<(this._raw[this._key])){const t=this._object[this._key];if(lt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return rh(this._raw,this._key)}}class Ih{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ah(n,e,t){return lt(n)?n:dn(n)?new Ih(n):jn(n)&&arguments.length>1?bu(n,e,t):xh(n)}function bu(n,e,t){return new Eh(n,e,t)}class Ph{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ec(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=hr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Fe!==this)return ou(this,!0),!0}get value(){const e=this.dep.track();return lu(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Oh(n,e,t=!1){let i,r;return dn(n)?i=n:(i=n.get,r=n.set),new Ph(i,r,t)}const ls={},As=new WeakMap;let Hn;function Th(n,e=!1,t=Hn){if(t){let i=As.get(t);i||As.set(t,i=[]),i.push(n)}}function Nh(n,e,t=Wa){const{immediate:i,deep:r,once:s,scheduler:a,augmentJob:l,call:d}=t,p=G=>r?G:Ft(G)||r===!1||r===0?On(G,1):On(G);let y,m,w,P,K=!1,O=!1;if(lt(n)?(m=()=>n.value,K=Ft(n)):Tn(n)?(m=()=>p(n),K=!0):Ut(n)?(O=!0,K=n.some(G=>Tn(G)||Ft(G)),m=()=>n.map(G=>{if(lt(G))return G.value;if(Tn(G))return p(G);if(dn(G))return d?d(G,2):G()})):dn(n)?e?m=d?()=>d(n,2):n:m=()=>{if(w){Qa();try{w()}finally{Za()}}const G=Hn;Hn=y;try{return d?d(n,3,[P]):n(P)}finally{Hn=G}}:m=ws,e&&r){const G=m,Z=r===!0?1/0:r;m=()=>On(G(),Z)}const D=ru(),ee=()=>{y.stop(),D&&D.active&&Kd(D.effects,y)};if(s&&e){const G=e;e=(...Z)=>{const ae=G(...Z);return ee(),ae}}let J=O?new Array(n.length).fill(ls):ls;const oe=G=>{if(!(!(y.flags&1)||!y.dirty&&!G))if(e){const Z=y.run();if(G||r||K||(O?Z.some((ae,fe)=>nn(ae,J[fe])):nn(Z,J))){w&&w();const ae=Hn;Hn=y;try{const fe=[Z,J===ls?void 0:O&&J[0]===ls?[]:J,P];J=Z,d?d(e,3,fe):e(...fe)}finally{Hn=ae}}}else y.run()};return l&&l(oe),y=new th(m),y.scheduler=a?()=>a(oe,!1):oe,P=G=>Th(G,!1,y),w=y.onStop=()=>{const G=As.get(y);if(G){if(d)d(G,4);else for(const Z of G)Z();As.delete(y)}},e?i?oe(!0):J=y.run():a?a(oe.bind(null,!0),!0):y.run(),ee.pause=y.pause.bind(y),ee.resume=y.resume.bind(y),ee.stop=ee,ee}function On(n,e=1/0,t){if(e<=0||!jn(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,lt(n))On(n.value,e,t);else if(Ut(n))for(let i=0;i<n.length;i++)On(n[i],e,t);else if(zd(n)||rr(n))n.forEach(i=>{On(i,e,t)});else if(Jd(n)){for(const i in n)On(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&On(n[i],e,t)}return n}function ic(n,e,t,i){try{return i?n(...i):n()}catch(r){xu(r,e,t)}}function wu(n,e,t,i){if(dn(n)){const r=ic(n,e,t,i);return r&&Hd(r)&&r.catch(s=>{xu(s,e,t)}),r}if(Ut(n)){const r=[];for(let s=0;s<n.length;s++)r.push(wu(n[s],e,t,i));return r}}function xu(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Wa;if(e){let l=e.parent;const d=e.proxy,p=`https://vuejs.org/error-reference/#runtime-${t}`;for(;l;){const y=l.ec;if(y){for(let m=0;m<y.length;m++)if(y[m](n,d,p)===!1)return}l=l.parent}if(s){Qa(),ic(s,null,10,[n,d,p]),Za();return}}Mh(n,t,r,i,a)}function Mh(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const Lt=[];let un=-1;const Pi=[];let En=null,_i=0;const Su=Promise.resolve();let Ps=null;function Rh(n){const e=Ps||Su;return n?e.then(this?n.bind(this):n):e}function jh(n){let e=un+1,t=Lt.length;for(;e<t;){const i=e+t>>>1,r=Lt[i],s=mr(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function Bh(n){if(!(n.flags&1)){const e=mr(n),t=Lt[Lt.length-1];!t||!(n.flags&2)&&e>=mr(t)?Lt.push(n):Lt.splice(jh(e),0,n),n.flags|=1,_u()}}function _u(){Ps||(Ps=Su.then(ku))}function Lh(n){Ut(n)?Pi.push(...n):En&&n.id===-1?En.splice(_i+1,0,n):n.flags&1||(Pi.push(n),n.flags|=1),_u()}function $h(n){if(Pi.length){const e=[...new Set(Pi)].sort((t,i)=>mr(t)-mr(i));if(Pi.length=0,En){En.push(...e);return}for(En=e,_i=0;_i<En.length;_i++){const t=En[_i];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}En=null,_i=0}}const mr=n=>n.id==null?n.flags&2?-1:1/0:n.id;function ku(n){try{for(un=0;un<Lt.length;un++){const e=Lt[un];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),ic(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;un<Lt.length;un++){const e=Lt[un];e&&(e.flags&=-2)}un=-1,Lt.length=0,$h(),Ps=null,(Lt.length||Pi.length)&&ku()}}let Fh=null;function Cu(n,e,t=!1){const i=Iu();if(i||Eu){let r=i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&dn(e)?e.call(i&&i.proxy):e}}function Dh(){return!!(Iu()||Eu)}const Uh=Symbol.for("v-scx"),qh=()=>Cu(Uh);function Kh(n,e,t){return Vh(n,e,t)}function Vh(n,e,t=Wa){const{immediate:i,deep:r,flush:s,once:a}=t,l=Ha({},t),d=e&&i||!e&&s!=="post";let p;if(Os){if(s==="sync"){const P=qh();p=P.__watcherHandles||(P.__watcherHandles=[])}else if(!d){const P=()=>{};return P.stop=ws,P.resume=ws,P.pause=ws,P}}const y=rc;l.call=(P,K,O)=>wu(P,y,K,O);let m=!1;s==="post"?l.scheduler=P=>{zh(P,y&&y.suspense)}:s!=="sync"&&(m=!0,l.scheduler=(P,K)=>{K?P():Bh(P)}),l.augmentJob=P=>{e&&(P.flags|=4),m&&(P.flags|=2,y&&(P.id=y.uid,P.i=y))};const w=Nh(n,e,l);return Os&&(p?p.push(w):d&&w()),w}Ga().requestIdleCallback;Ga().cancelIdleCallback;let Eu=null;const zh=Wh;function Wh(n,e){e&&e.pendingBranch?Ut(n)?e.effects.push(...n):e.effects.push(n):Lh(n)}let rc=null;const Iu=()=>rc||Fh;{const n=Ga(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(a=>a(s)):r[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>rc=t),e("__VUE_SSR_SETTERS__",t=>Os=t)}let Os=!1;const Au=(n,e)=>Oh(n,e,Os);function Ze(n){return(typeof n=="object"&&n!==null||typeof n=="function")&&typeof n.then=="function"}function ut(n){switch(typeof n){case"string":case"symbol":return n.toString();case"function":return n.name;default:throw new Error(`Unexpected ${typeof n} service id type`)}}const $o=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");class qs{[$o];#e;constructor(e){this.#e=e,this[$o]=!0}static is(e){return typeof e=="object"&&e!==null&&e[$o]===!0}unwrap(){return this.#e()}}var yl={};var bl;function Hh(){if(bl)return yl;bl=1;var n;return(function(e){(function(t){var i=typeof globalThis=="object"?globalThis:typeof dr=="object"?dr:typeof self=="object"?self:typeof this=="object"?this:a(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),t(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(l,d){return function(p,y){Object.defineProperty(l,p,{configurable:!0,writable:!0,value:y}),d&&d(p,y)}}function a(){throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.")}})(function(t,i){var r=typeof Symbol=="function",s=r&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:Qt("Symbol.toPrimitive not found."),a=r&&typeof Symbol.iterator<"u"?Symbol.iterator:Qt("Symbol.iterator not found."),l=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Qt("A valid Map constructor could not be found."),p=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Qt("A valid Set constructor could not be found."),y=typeof WeakMap=="function"?WeakMap:Qt("A valid WeakMap constructor could not be found."),m=r?Symbol.for("@reflect-metadata:registry"):void 0,w=ui(),P=vn(w);function K($,V,z,X){if(pe(z)){if(!Wt($))throw new TypeError;if(!$n(V))throw new TypeError;return Y($,V)}else{if(!Wt($))throw new TypeError;if(!Ue(V))throw new TypeError;if(!Ue(X)&&!pe(X)&&!dt(X))throw new TypeError;return dt(X)&&(X=void 0),z=Ae(z),ge($,V,z,X)}}t("decorate",K);function O($,V){function z(X,he){if(!Ue(X))throw new TypeError;if(!pe(he)&&!de(he))throw new TypeError;mn($,V,X,he)}return z}t("metadata",O);function D($,V,z,X){if(!Ue(z))throw new TypeError;return pe(X)||(X=Ae(X)),mn($,V,z,X)}t("defineMetadata",D);function ee($,V,z){if(!Ue(V))throw new TypeError;return pe(z)||(z=Ae(z)),Re($,V,z)}t("hasMetadata",ee);function J($,V,z){if(!Ue(V))throw new TypeError;return pe(z)||(z=Ae(z)),We($,V,z)}t("hasOwnMetadata",J);function oe($,V,z){if(!Ue(V))throw new TypeError;return pe(z)||(z=Ae(z)),ke($,V,z)}t("getMetadata",oe);function G($,V,z){if(!Ue(V))throw new TypeError;return pe(z)||(z=Ae(z)),rt($,V,z)}t("getOwnMetadata",G);function Z($,V){if(!Ue($))throw new TypeError;return pe(V)||(V=Ae(V)),zt($,V)}t("getMetadataKeys",Z);function ae($,V){if(!Ue($))throw new TypeError;return pe(V)||(V=Ae(V)),ft($,V)}t("getOwnMetadataKeys",ae);function fe($,V,z){if(!Ue(V))throw new TypeError;pe(z)||(z=Ae(z));var X=Rt(V,z,!1);return pe(X)?!1:X.OrdinaryDeleteMetadata($,V,z)}t("deleteMetadata",fe);function Y($,V){for(var z=$.length-1;z>=0;--z){var X=$[z],he=X(V);if(!pe(he)&&!dt(he)){if(!$n(he))throw new TypeError;V=he}}return V}function ge($,V,z,X){for(var he=$.length-1;he>=0;--he){var st=$[he],Ke=st(V,z,X);if(!pe(Ke)&&!dt(Ke)){if(!Ue(Ke))throw new TypeError;X=Ke}}return X}function Re($,V,z){var X=We($,V,z);if(X)return!0;var he=sn(V);return dt(he)?!1:Re($,he,z)}function We($,V,z){var X=Rt(V,z,!1);return pe(X)?!1:ht(X.OrdinaryHasOwnMetadata($,V,z))}function ke($,V,z){var X=We($,V,z);if(X)return rt($,V,z);var he=sn(V);if(!dt(he))return ke($,he,z)}function rt($,V,z){var X=Rt(V,z,!1);if(!pe(X))return X.OrdinaryGetOwnMetadata($,V,z)}function mn($,V,z,X){var he=Rt(z,X,!0);he.OrdinaryDefineOwnMetadata($,V,z,X)}function zt($,V){var z=ft($,V),X=sn($);if(X===null)return z;var he=zt(X,V);if(he.length<=0)return z;if(z.length<=0)return he;for(var st=new p,Ke=[],vt=0,nt=z;vt<nt.length;vt++){var S=nt[vt],T=st.has(S);T||(st.add(S),Ke.push(S))}for(var M=0,U=he;M<U.length;M++){var S=U[M],T=st.has(S);T||(st.add(S),Ke.push(S))}return Ke}function ft($,V){var z=Rt($,V,!1);return z?z.OrdinaryOwnMetadataKeys($,V):[]}function tt($){if($===null)return 1;switch(typeof $){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return $===null?1:6;default:return 6}}function pe($){return $===void 0}function dt($){return $===null}function St($){return typeof $=="symbol"}function Ue($){return typeof $=="object"?$!==null:typeof $=="function"}function _t($,V){switch(tt($)){case 0:return $;case 1:return $;case 2:return $;case 3:return $;case 4:return $;case 5:return $}var z="string",X=pt($,s);if(X!==void 0){var he=X.call($,z);if(Ue(he))throw new TypeError;return he}return ve($)}function ve($,V){var z,X;{var he=$.toString;if(Xt(he)){var X=he.call($);if(!Ue(X))return X}var z=$.valueOf;if(Xt(z)){var X=z.call($);if(!Ue(X))return X}}throw new TypeError}function ht($){return!!$}function ci($){return""+$}function Ae($){var V=_t($);return St(V)?V:ci(V)}function Wt($){return Array.isArray?Array.isArray($):$ instanceof Object?$ instanceof Array:Object.prototype.toString.call($)==="[object Array]"}function Xt($){return typeof $=="function"}function $n($){return typeof $=="function"}function de($){switch(tt($)){case 3:return!0;case 4:return!0;default:return!1}}function pt($,V){var z=$[V];if(z!=null){if(!Xt(z))throw new TypeError;return z}}function Pe($){var V=pt($,a);if(!Xt(V))throw new TypeError;var z=V.call($);if(!Ue(z))throw new TypeError;return z}function At($){return $.value}function Fn($){var V=$.next();return V.done?!1:V}function Mt($){var V=$.return;V&&V.call($)}function sn($){var V=Object.getPrototypeOf($);if(typeof $!="function"||$===l||V!==l)return V;var z=$.prototype,X=z&&Object.getPrototypeOf(z);if(X==null||X===Object.prototype)return V;var he=X.constructor;return typeof he!="function"||he===$?V:he}function Qt($){throw $}function li(){var $;!pe(m)&&typeof i.Reflect<"u"&&!(m in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&($=mt(i.Reflect));var V,z,X,he=new y,st={registerProvider:Ke,getProvider:nt,setProvider:T};return st;function Ke(M){if(!Object.isExtensible(st))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case $===M:break;case pe(V):V=M;break;case V===M:break;case pe(z):z=M;break;case z===M:break;default:X===void 0&&(X=new p),X.add(M);break}}function vt(M,U){if(!pe(V)){if(V.isProviderFor(M,U))return V;if(!pe(z)){if(z.isProviderFor(M,U))return V;if(!pe(X))for(var F=Pe(X);;){var ye=Fn(F);if(!ye)return;var xe=At(ye);if(xe.isProviderFor(M,U))return Mt(F),xe}}}if(!pe($)&&$.isProviderFor(M,U))return $}function nt(M,U){var F=he.get(M),ye;return pe(F)||(ye=F.get(U)),pe(ye)&&(ye=vt(M,U),pe(ye)||(pe(F)&&(F=new d,he.set(M,F)),F.set(U,ye))),ye}function S(M){if(pe(M))throw new TypeError;return V===M||z===M||!pe(X)&&X.has(M)}function T(M,U,F){if(!S(F))throw new Error("Metadata provider not registered.");var ye=nt(M,U);if(ye!==F){if(!pe(ye))return!1;var xe=he.get(M);pe(xe)&&(xe=new d,he.set(M,xe)),xe.set(U,F)}return!0}}function ui(){var $;return!pe(m)&&Ue(i.Reflect)&&Object.isExtensible(i.Reflect)&&($=i.Reflect[m]),pe($)&&($=li()),!pe(m)&&Ue(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:$}),$}function vn($){var V=new y,z={isProviderFor:function(S,T){var M=V.get(S);return pe(M)?!1:M.has(T)},OrdinaryDefineOwnMetadata:Ke,OrdinaryHasOwnMetadata:he,OrdinaryGetOwnMetadata:st,OrdinaryOwnMetadataKeys:vt,OrdinaryDeleteMetadata:nt};return w.registerProvider(z),z;function X(S,T,M){var U=V.get(S),F=!1;if(pe(U)){if(!M)return;U=new d,V.set(S,U),F=!0}var ye=U.get(T);if(pe(ye)){if(!M)return;if(ye=new d,U.set(T,ye),!$.setProvider(S,T,z))throw U.delete(T),F&&V.delete(S),new Error("Wrong provider for target.")}return ye}function he(S,T,M){var U=X(T,M,!1);return pe(U)?!1:ht(U.has(S))}function st(S,T,M){var U=X(T,M,!1);if(!pe(U))return U.get(S)}function Ke(S,T,M,U){var F=X(M,U,!0);F.set(S,T)}function vt(S,T){var M=[],U=X(S,T,!1);if(pe(U))return M;for(var F=U.keys(),ye=Pe(F),xe=0;;){var be=Fn(ye);if(!be)return M.length=xe,M;var L=At(be);try{M[xe]=L}catch(re){try{Mt(ye)}finally{throw re}}xe++}}function nt(S,T,M){var U=X(T,M,!1);if(pe(U)||!U.delete(S))return!1;if(U.size===0){var F=V.get(T);pe(F)||(F.delete(M),F.size===0&&V.delete(F))}return!0}}function mt($){var V=$.defineMetadata,z=$.hasOwnMetadata,X=$.getOwnMetadata,he=$.getOwnMetadataKeys,st=$.deleteMetadata,Ke=new y,vt={isProviderFor:function(nt,S){var T=Ke.get(nt);return!pe(T)&&T.has(S)?!0:he(nt,S).length?(pe(T)&&(T=new p,Ke.set(nt,T)),T.add(S),!0):!1},OrdinaryDefineOwnMetadata:V,OrdinaryHasOwnMetadata:z,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:he,OrdinaryDeleteMetadata:st};return vt}function Rt($,V,z){var X=w.getProvider($,V);if(!pe(X))return X;if(z){if(w.setProvider($,V,P))return P;throw new Error("Illegal state.")}}})})(n||(n={})),yl}Hh();function Bi(n,e,t){return Reflect.getOwnMetadata(e,n,t)}function Pu(n,e,t,i){Reflect.defineMetadata(e,t,n,i)}function si(n,e,t,i,r){const s=Bi(n,e,r)??t(),a=i(s);Reflect.defineMetadata(e,a,n,r)}const Fo="@inversifyjs/container/bindingId";function Gn(){const n=Bi(Object,Fo)??0;return n===Number.MAX_SAFE_INTEGER?Pu(Object,Fo,Number.MIN_SAFE_INTEGER):si(Object,Fo,()=>n,e=>e+1),n}const It={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Le={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*Ou(...n){for(const e of n)yield*e}const Gh=-1;class Cr{#e;#t;#i;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#i=e}add(e,t){this.#o(e).push(t);for(const i of Reflect.ownKeys(t))this.#s(i,t[i]).push(e)}clone(){const e=this.#n(),t=this.#r(),i=Reflect.ownKeys(this.#i),r=this._buildNewInstance(this.#i);this.#h(this.#e,r.#e,e,t);for(const s of i)this.#a(this.#t[s],r.#t[s],e);return r}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const i=this.get(e,t);if(i===void 0)return;const r=new Set(i);for(const s of r){const a=this.#e.get(s);if(a===void 0)throw new Error("Expecting model relation, none found");for(const l of a)l[e]===t&&this.#u(s,l);this.#e.delete(s)}}_buildNewInstance(e){return new Cr(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#n(){const e=new Map;for(const t of this.#e.keys()){const i=this._cloneModel(t);e.set(t,i)}return e}#r(){const e=new Map;for(const t of this.#e.values())for(const i of t){const r=this._cloneRelation(i);e.set(i,r)}return e}#o(e){let t=this.#e.get(e);return t===void 0&&(t=[],this.#e.set(e,t)),t}#s(e,t){let i=this.#t[e].get(t);return i===void 0&&(i=[],this.#t[e].set(t,i)),i}#l(e,t){const i=t.get(e);if(i===void 0)throw new Error("Expecting model to be cloned, none found");return i}#c(e,t){const i=t.get(e);if(i===void 0)throw new Error("Expecting relation to be cloned, none found");return i}#a(e,t,i){for(const[r,s]of e){const a=new Array;for(const l of s)a.push(this.#l(l,i));t.set(r,a)}}#h(e,t,i,r){for(const[s,a]of e){const l=new Array;for(const d of a)l.push(this.#c(d,r));t.set(this.#l(s,i),l)}}#u(e,t){for(const i of Reflect.ownKeys(t))this.#f(e,i,t[i])}#f(e,t,i){const r=this.#t[t].get(i);if(r!==void 0){const s=r.indexOf(e);s!==Gh&&r.splice(s,1),r.length===0&&this.#t[t].delete(i)}}}var ar;(function(n){n.moduleId="moduleId",n.serviceId="serviceId"})(ar||(ar={}));class vr{#e;#t;constructor(e,t){this.#e=t??new Cr({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new vr(e)}add(e,t){this.#e.add(e,t)}clone(){return new vr(this.#t,this.#e.clone())}get(e){const t=[],i=this.#e.get(ar.serviceId,e);i!==void 0&&t.push(i);const r=this.#t()?.get(e);if(r!==void 0&&t.push(r),t.length!==0)return Ou(...t)}removeAllByModuleId(e){this.#e.removeByRelation(ar.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(ar.serviceId,e)}}const Er="@inversifyjs/core/classMetadataReflectKey";function Ir(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}const sc="@inversifyjs/core/pendingClassMetadataCountReflectKey";function Yh(n){const e=Bi(n,sc);return e!==void 0&&e!==0}const Do=Symbol.for("@inversifyjs/core/InversifyCoreError");class Ce extends Error{[Do];kind;constructor(e,t,i){super(t,i),this[Do]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[Do]===!0}static isErrorOfKind(e,t){return Ce.is(e)&&e.kind===t}}var Ee;(function(n){n[n.injectionDecoratorConflict=0]="injectionDecoratorConflict",n[n.missingInjectionDecorator=1]="missingInjectionDecorator",n[n.planning=2]="planning",n[n.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",n[n.resolution=4]="resolution",n[n.unknown=5]="unknown"})(Ee||(Ee={}));var ii;(function(n){n[n.unknown=32]="unknown"})(ii||(ii={}));function Jh(n,e){const t=[];for(let i=0;i<e.constructorArguments.length;++i){const r=e.constructorArguments[i];(r===void 0||r.kind===ii.unknown)&&t.push(` - Missing or incomplete metadata for type "${n.name}" at constructor argument with index ${i.toString()}.
|
|
2
|
-
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,r]of e.properties)r.kind===ii.unknown&&t.push(` - Missing or incomplete metadata for type "${n.name}" at property "${i.toString()}".
|
|
3
|
-
This property must be decorated either with @inject or @multiInject decorator.`);throw t.length===0?new Ce(Ee.unknown,`Unexpected class metadata for type "${n.name}" with uncompletion traces.
|
|
4
|
-
This might be caused by one of the following reasons:
|
|
5
|
-
|
|
6
|
-
1. A third party library is targeting inversify reflection metadata.
|
|
7
|
-
2. A bug is causing the issue. Consider submiting an issue to fix it.`):new Ce(Ee.missingInjectionDecorator,`Invalid class metadata at type ${n.name}:
|
|
8
|
-
|
|
9
|
-
${t.join(`
|
|
10
|
-
|
|
11
|
-
`)}`)}function Xh(n,e){const t=[];if(e.length<n.length)throw new Ce(Ee.missingInjectionDecorator,`Found unexpected missing metadata on type "${n.name}". "${n.name}" constructor requires at least ${n.length.toString()} arguments, found ${e.length.toString()} instead.
|
|
12
|
-
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?
|
|
13
|
-
|
|
14
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let i=0;i<e.length;++i)e[i]===void 0&&t.push(i);if(t.length>0)throw new Ce(Ee.missingInjectionDecorator,`Found unexpected missing metadata on type "${n.name}" at constructor indexes "${t.join('", "')}".
|
|
15
|
-
|
|
16
|
-
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
|
|
17
|
-
|
|
18
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}function Ks(n){const e=Bi(n,Er)??Ir();if(Yh(n))Jh(n,e);else return Xh(n,e.constructorArguments),e}function Tu(n,e){const i=Ks(e).scope??n.scope;return{cache:{isRight:!1,value:void 0},id:Gn(),implementationType:e,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:e,type:Le.Instance}}function Ar(n){return n.isRight?{isRight:!0,value:n.value}:n}function Qh(n){return{cache:Ar(n.cache),id:n.id,isSatisfiedBy:n.isSatisfiedBy,moduleId:n.moduleId,onActivation:n.onActivation,onDeactivation:n.onDeactivation,scope:n.scope,serviceIdentifier:n.serviceIdentifier,type:n.type,value:n.value}}function Zh(n){return{cache:Ar(n.cache),id:n.id,isSatisfiedBy:n.isSatisfiedBy,moduleId:n.moduleId,onActivation:n.onActivation,onDeactivation:n.onDeactivation,scope:n.scope,serviceIdentifier:n.serviceIdentifier,type:n.type,value:n.value}}function ep(n){return{cache:Ar(n.cache),factory:n.factory,id:n.id,isSatisfiedBy:n.isSatisfiedBy,moduleId:n.moduleId,onActivation:n.onActivation,onDeactivation:n.onDeactivation,scope:n.scope,serviceIdentifier:n.serviceIdentifier,type:n.type}}function tp(n){return{cache:Ar(n.cache),id:n.id,implementationType:n.implementationType,isSatisfiedBy:n.isSatisfiedBy,moduleId:n.moduleId,onActivation:n.onActivation,onDeactivation:n.onDeactivation,scope:n.scope,serviceIdentifier:n.serviceIdentifier,type:n.type}}function np(n){return{cache:Ar(n.cache),factory:n.factory,id:n.id,isSatisfiedBy:n.isSatisfiedBy,metadata:n.metadata,moduleId:n.moduleId,onActivation:n.onActivation,onDeactivation:n.onDeactivation,scope:n.scope,serviceIdentifier:n.serviceIdentifier,type:n.type}}function ip(n){return{id:n.id,isSatisfiedBy:n.isSatisfiedBy,moduleId:n.moduleId,serviceIdentifier:n.serviceIdentifier,targetServiceIdentifier:n.targetServiceIdentifier,type:n.type}}function rp(n){switch(n.type){case Le.ConstantValue:return Qh(n);case Le.DynamicValue:return Zh(n);case Le.Factory:return ep(n);case Le.Instance:return tp(n);case Le.ResolvedValue:return np(n);case Le.ServiceRedirection:return ip(n)}}var Tt;(function(n){n.id="id",n.moduleId="moduleId",n.serviceId="serviceId"})(Tt||(Tt={}));class oc extends Cr{_buildNewInstance(e){return new oc(e)}_cloneModel(e){return rp(e)}}class yr{#e;#t;#i;constructor(e,t,i){this.#t=i??new oc({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#i=e,this.#e=t}static build(e,t){return new yr(e,t)}clone(){return new yr(this.#i,this.#e,this.#t.clone())}get(e){const t=this.getNonParentBindings(e)??this.#i()?.get(e);if(t!==void 0)return t;const i=this.#n(e);return i===void 0?i:[i]}*getChained(e){const t=this.getNonParentBindings(e);t!==void 0&&(yield*t);const i=this.#i();if(i===void 0){if(t===void 0){const r=this.#n(e);r!==void 0&&(yield r)}}else yield*i.getChained(e)}getBoundServices(){const e=new Set(this.#t.getAllKeys(Tt.serviceId)),t=this.#i();if(t!==void 0)for(const i of t.getBoundServices())e.add(i);return e}getById(e){return this.#t.get(Tt.id,e)??this.#i()?.getById(e)}getByModuleId(e){return this.#t.get(Tt.moduleId,e)??this.#i()?.getByModuleId(e)}getNonParentBindings(e){return this.#t.get(Tt.serviceId,e)}getNonParentBoundServices(){return this.#t.getAllKeys(Tt.serviceId)}removeById(e){this.#t.removeByRelation(Tt.id,e)}removeAllByModuleId(e){this.#t.removeByRelation(Tt.moduleId,e)}removeAllByServiceId(e){this.#t.removeByRelation(Tt.serviceId,e)}set(e){const t={[Tt.id]:e.id,[Tt.serviceId]:e.serviceIdentifier};e.moduleId!==void 0&&(t[Tt.moduleId]=e.moduleId),this.#t.add(e,t)}#n(e){if(this.#e===void 0||typeof e!="function")return;const t=Tu(this.#e,e);return this.set(t),t}}var cr;(function(n){n.moduleId="moduleId",n.serviceId="serviceId"})(cr||(cr={}));class br{#e;#t;constructor(e,t){this.#e=t??new Cr({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new br(e)}add(e,t){this.#e.add(e,t)}clone(){return new br(this.#t,this.#e.clone())}get(e){const t=[],i=this.#e.get(cr.serviceId,e);i!==void 0&&t.push(i);const r=this.#t()?.get(e);if(r!==void 0&&t.push(r),t.length!==0)return Ou(...t)}removeAllByModuleId(e){this.#e.removeByRelation(cr.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(cr.serviceId,e)}}function Nu(){return 0}function Mu(n){return e=>{e!==void 0&&e.kind===ii.unknown&&si(n,sc,Nu,t=>t-1)}}var xt;(function(n){n[n.multipleInjection=0]="multipleInjection",n[n.singleInjection=1]="singleInjection",n[n.unmanaged=2]="unmanaged"})(xt||(xt={}));function Ru(n,e){return(...t)=>i=>{if(i===void 0)return n(...t);if(i.kind===xt.unmanaged)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return e(i,...t)}}function sp(n,e,t){return n===xt.multipleInjection?{chained:t?.chained??!1,kind:n,name:void 0,optional:!1,tags:new Map,value:e}:{kind:n,name:void 0,optional:!1,tags:new Map,value:e}}function ju(n){if(n.kind!==ii.unknown&&n.isFromTypescriptParamType!==!0)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}function op(n,e,t,i){return ju(n),e===xt.multipleInjection?{...n,chained:i?.chained??!1,kind:e,value:t}:{...n,kind:e,value:t}}const ap=Ru(sp,op);function cp(n,e){return t=>{const i=t.constructorArguments[e];return t.constructorArguments[e]=n(i),t}}function Bu(n,e){return t=>{const i=t.properties.get(e);return t.properties.set(e,n(i)),t}}var Nn;(function(n){n[n.method=0]="method",n[n.parameter=1]="parameter",n[n.property=2]="property"})(Nn||(Nn={}));function lp(n,e,t){if(t===void 0){if(e===void 0)throw new Ce(Ee.unknown,"Unexpected undefined property and index values");return{kind:Nn.property,property:e,targetClass:n.constructor}}return typeof t=="number"?{index:t,kind:Nn.parameter,targetClass:n}:{kind:Nn.method,method:e,targetClass:n}}function up(n){switch(n.kind){case Nn.method:return`[class: "${n.targetClass.name}", method: "${n.method.toString()}"]`;case Nn.parameter:return`[class: "${n.targetClass.name}", index: "${n.index.toString()}"]`;case Nn.property:return`[class: "${n.targetClass.name}", property: "${n.property.toString()}"]`}}function fp(n,e,t,i){if(Ce.isErrorOfKind(i,Ee.injectionDecoratorConflict)){const r=lp(n,e,t);throw new Ce(Ee.injectionDecoratorConflict,`Unexpected injection error.
|
|
19
|
-
|
|
20
|
-
Cause:
|
|
21
|
-
|
|
22
|
-
${i.message}
|
|
23
|
-
|
|
24
|
-
Details
|
|
25
|
-
|
|
26
|
-
${up(r)}`,{cause:i})}throw i}function Vs(n,e){return(i,r,s)=>{try{s===void 0?pp(n,e)(i,r):typeof s=="number"?hp(n,e)(i,r,s):dp(n,e)(i,r,s)}catch(a){fp(i,r,s,a)}}}function ac(n,e){return t=>{const i=e(t);return r=>(i(r),n(r))}}function dp(n,e){const t=ac(n,e);return(i,r,s)=>{if(mp(s))si(i.constructor,Er,Ir,Bu(t(i),r));else throw new Ce(Ee.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
|
|
27
|
-
Found @inject decorator at method "${r.toString()}" at class "${i.constructor.name}"`)}}function hp(n,e){const t=ac(n,e);return(i,r,s)=>{if(gp(i,r))si(i,Er,Ir,cp(t(i),s));else throw new Ce(Ee.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
|
|
28
|
-
Found @inject decorator at method "${r?.toString()??""}" at class "${i.constructor.name}"`)}}function pp(n,e){const t=ac(n,e);return(i,r)=>{si(i.constructor,Er,Ir,Bu(t(i),r))}}function gp(n,e){return typeof n=="function"&&e===void 0}function mp(n){return n.set!==void 0}function Be(n){const e=ap(xt.singleInjection,n);return Vs(e,Mu)}const wl="@inversifyjs/core/classIsInjectableFlagReflectKey";function vp(n){if(Bi(n,wl)!==void 0)throw new Ce(Ee.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${n.name}"`);Pu(n,wl,!0)}const yp="design:paramtypes";function bp(n){return{isFromTypescriptParamType:!0,kind:xt.singleInjection,name:void 0,optional:!1,tags:new Map,value:n}}const wp=[Array,BigInt,Boolean,Function,Number,Object,String];function xp(n){return!wp.includes(n)}function Sp(n){const e=Bi(n,yp);e!==void 0&&si(n,Er,Ir,_p(e))}function _p(n){return e=>(n.forEach((t,i)=>{e.constructorArguments[i]===void 0&&xp(t)&&(e.constructorArguments[i]=bp(t))}),e)}function it(n){return e=>{vp(e),Sp(e)}}function Lu(n){return e=>{e===void 0&&si(n,sc,Nu,t=>t+1)}}function kp(n){return e=>{if(e.name!==void 0)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected duplicated named decorator");return e.name=n,e}}function Cp(){return{kind:ii.unknown,name:void 0,optional:!1,tags:new Map}}function $u(n){return e=>{const t=e??Cp();if(t.kind===xt.unmanaged)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return n(t)}}function cc(n){const e=$u(kp(n));return Vs(e,Lu)}function Ep(n){if(n.optional)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return n.optional=!0,n}function Ip(){const n=$u(Ep);return Vs(n,Lu)}function Fu(){return{kind:xt.unmanaged}}function Ap(n){if(ju(n),Pp(n))throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return Fu()}function Pp(n){return n.name!==void 0||n.optional||n.tags.size>0}const Op=Ru(Fu,Ap);function Tp(){const n=Op();return Vs(n,Mu)}var hn;(function(n){n[n.multipleInjection=0]="multipleInjection",n[n.singleInjection=1]="singleInjection"})(hn||(hn={}));function Np(n){return n.rootConstraints.isMultiple?{chained:n.rootConstraints.chained,isMultiple:!0,name:n.rootConstraints.name,optional:n.rootConstraints.isOptional??!1,serviceIdentifier:n.rootConstraints.serviceIdentifier,tag:n.rootConstraints.tag}:{isMultiple:!1,name:n.rootConstraints.name,optional:n.rootConstraints.isOptional??!1,serviceIdentifier:n.rootConstraints.serviceIdentifier,tag:n.rootConstraints.tag}}const Mp=/stack space|call stack|too much recursion/i,Rp=/too much recursion/;function lc(n){try{return n instanceof Error?n instanceof RangeError&&Mp.test(n.message)||n.name==="InternalError"&&Rp.test(n.message):!1}catch(e){return e instanceof SyntaxError&&e.message.includes("Stack overflow")}}function jp(n){const e=new Set;for(const t of n.servicesBranch){if(e.has(t))return[...e,t];e.add(t)}return[...e]}function Bp(n,e){if(lc(e)||Ce.isErrorOfKind(e,Ee.planningMaxDepthExceeded)){const t=Lp(jp(n));throw new Ce(Ee.planning,`Circular dependency found: ${t}`,{cause:e})}throw e}function Lp(n){const e=[...n];return e.length===0?"(No dependency trace)":e.map(ut).join(" -> ")}const Uo=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class Nt{[Uo];_serviceIdentifier;_serviceNode;constructor(e,t){this[Uo]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return typeof e=="object"&&e!==null&&e[Uo]===!0}invalidate(){this._serviceNode=void 0}isExpanded(){return this._serviceNode!==void 0}_getNode(){return this._serviceNode===void 0&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class Ln{#e;constructor(e){this.#e=e}get name(){return this.#e.elem.name}get serviceIdentifier(){return this.#e.elem.serviceIdentifier}get tags(){return this.#e.elem.tags}getAncestor(){if(this.#e.elem.getAncestorsCalled=!0,this.#e.previous!==void 0)return new Ln(this.#e.previous)}}function zs(n,e,t){const i=t?.customServiceIdentifier??e.serviceIdentifier,s=(t?.chained===!0?[...n.operations.getBindingsChained(i)]:[...n.operations.getBindings(i)??[]]).filter(a=>a.isSatisfiedBy(e));if(s.length===0&&n.autobindOptions!==void 0&&typeof i=="function"){const a=Tu(n.autobindOptions,i);n.operations.setBinding(a),a.isSatisfiedBy(e)&&s.push(a)}return s}class uc{last;length;constructor(e,t){this.last=e,this.length=t}concat(e){return new uc({elem:e,previous:this.last},this.length+1)}[Symbol.iterator](){let e=this.last;return{next:()=>{if(e===void 0)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function fc(n){const e=new Map;return n.rootConstraints.tag!==void 0&&e.set(n.rootConstraints.tag.key,n.rootConstraints.tag.value),new uc({elem:{getAncestorsCalled:!1,name:n.rootConstraints.name,serviceIdentifier:n.rootConstraints.serviceIdentifier,tags:e},previous:void 0},1)}function oi(n){return n.redirections!==void 0}function $p(n){switch(n.type){case Le.Instance:return`[ type: "${n.type}", serviceIdentifier: "${ut(n.serviceIdentifier)}", scope: "${n.scope}", implementationType: "${n.implementationType.name}" ]`;case Le.ServiceRedirection:return`[ type: "${n.type}", serviceIdentifier: "${ut(n.serviceIdentifier)}", redirection: "${ut(n.targetServiceIdentifier)}" ]`;default:return`[ type: "${n.type}", serviceIdentifier: "${ut(n.serviceIdentifier)}", scope: "${n.scope}" ]`}}function Du(n,e,t,i){const r=t.elem.serviceIdentifier,s=t.previous?.elem.serviceIdentifier;Array.isArray(n)?Fp(n,e,r,s,t.elem,i):Dp(n,e,r,s,t.elem,i)}function Uu(n,e,t,i){const r=i[i.length-1]??n,s=`No bindings found for service: "${ut(r)}".
|
|
29
|
-
|
|
30
|
-
Trying to resolve bindings for "${qu(n,e)}".${Vu(i)}${Ku(t)}`;throw new Ce(Ee.planning,s)}function Fp(n,e,t,i,r,s){if(n.length===0)e||Uu(t,i,r,s);else{const a=s[s.length-1]??t,l=`Ambiguous bindings found for service: "${ut(a)}".${Vu(s)}
|
|
31
|
-
|
|
32
|
-
Registered bindings:
|
|
33
|
-
|
|
34
|
-
${n.map(d=>$p(d.binding)).join(`
|
|
35
|
-
`)}
|
|
36
|
-
|
|
37
|
-
Trying to resolve bindings for "${qu(t,i)}".${Ku(r)}`;throw new Ce(Ee.planning,l)}}function Dp(n,e,t,i,r,s){n===void 0&&!e&&Uu(t,i,r,s)}function qu(n,e){return e===void 0?`${ut(n)} (Root service)`:ut(e)}function Ku(n){const e=n.tags.size===0?"":`
|
|
38
|
-
- tags:
|
|
39
|
-
- ${[...n.tags.keys()].map(t=>t.toString()).join(`
|
|
40
|
-
- `)}`;return`
|
|
41
|
-
|
|
42
|
-
Binding constraints:
|
|
43
|
-
- service identifier: ${ut(n.serviceIdentifier)}
|
|
44
|
-
- name: ${n.name?.toString()??"-"}${e}`}function Vu(n){return n.length===0?"":`
|
|
45
|
-
|
|
46
|
-
- service redirections:
|
|
47
|
-
- ${n.map(e=>ut(e)).join(`
|
|
48
|
-
- `)}`}const Up=1;function zu(n,e,t,i){if(n.redirections.length===Up){const[r]=n.redirections;oi(r)&&zu(r,e,t,[...i,r.binding.targetServiceIdentifier]);return}Du(n.redirections,e,t,i)}const qp=1;function dc(n,e,t){if(Array.isArray(n.bindings)&&n.bindings.length===qp){const[i]=n.bindings;oi(i)&&zu(i,e,t,[i.binding.targetServiceIdentifier]);return}Du(n.bindings,e,t,[])}function Kp(n){return e=>{const t=fc(e),i=new Ln(t.last),r=e.rootConstraints.isMultiple&&e.rootConstraints.chained,s=zs(e,i,{chained:r}),a=[],l={bindings:a,isContextFree:!0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(a.push(...n(e,t,s,l,r)),l.isContextFree=!t.last.elem.getAncestorsCalled,!e.rootConstraints.isMultiple){dc(l,e.rootConstraints.isOptional??!1,t.last);const[d]=a;l.bindings=d}return l}}function Ws(n){return qs.is(n)?n.unwrap():n}function Wu(n){return(e,t,i)=>{const r=Ws(i.value),s=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Ln(s.last),l=i.kind===xt.multipleInjection&&i.chained,d=zs(e,a,{chained:l}),p=[],y={bindings:p,isContextFree:!0,serviceIdentifier:r};if(p.push(...n(e,s,d,y,l)),y.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===xt.singleInjection){dc(y,i.optional,s.last);const[m]=p;y.bindings=m}return y}}function Hu(n){return(e,t,i)=>{const r=Ws(i.value),s=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Ln(s.last),l=i.kind===hn.multipleInjection&&i.chained,d=zs(e,a,{chained:l}),p=[],y={bindings:p,isContextFree:!0,serviceIdentifier:r};if(p.push(...n(e,s,d,y,l)),y.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===hn.singleInjection){dc(y,i.optional,s.last);const[m]=p;y.bindings=m}return y}}function Gu(n,e){return Ze(e)?(n.cache={isRight:!0,value:e},e.then(t=>xl(n,t))):xl(n,e)}function xl(n,e){return n.cache={isRight:!0,value:e},e}function hc(n,e,t){const i=n.getActivations(e);return i===void 0?t:Ze(t)?Yu(n,t,i[Symbol.iterator]()):Vp(n,t,i[Symbol.iterator]())}function Vp(n,e,t){let i=e,r=t.next();for(;r.done!==!0;){const s=r.value(n.context,i);if(Ze(s))return Yu(n,s,t);i=s,r=t.next()}return i}async function Yu(n,e,t){let i=await e,r=t.next();for(;r.done!==!0;)i=await r.value(n.context,i),r=t.next();return i}function qo(n,e,t){let i=t;if(e.onActivation!==void 0){const r=e.onActivation;Ze(i)?i=i.then(s=>r(n.context,s)):i=r(n.context,i)}return hc(n,e.serviceIdentifier,i)}function Pr(n,e){const t=n.binding;switch(t.scope){case It.Singleton:return i=>{if(t.cache.isRight)return t.cache.value;const r=qo(i,t,e(i,n));return Gu(t,r)};case It.Request:return i=>{if(i.requestScopeCache.has(t.id))return i.requestScopeCache.get(t.id);const r=qo(i,t,e(i,n));return i.requestScopeCache.set(t.id,r),r};case It.Transient:return i=>qo(i,t,e(i,n))}}class zp{binding;resolve;constructor(e){this.binding=e,this.resolve=Pr(this,(t,i)=>i.binding.value)}}class Wp{binding;resolve;constructor(e){this.binding=e,this.resolve=Pr(this,(t,i)=>i.binding.value(t.context))}}class Hp{binding;resolve;constructor(e){this.binding=e,this.resolve=Pr(this,(t,i)=>i.binding.factory(t.context))}}function Gp(n,e){return e.resolve(n)}function pc(n,e){const t=[];for(const i of e.redirections)oi(i)?t.push(...pc(n,i)):t.push(Gp(n,i));return t}function Yp(n,e){const t=[];for(const i of e)oi(i)?t.push(...pc(n,i)):t.push(i.resolve(n));return t.some(Ze)?Promise.all(t):t}function Jp(n,e){if(oi(e)){const t=pc(n,e);if(t.length===1)return t[0];throw new Ce(Ee.resolution,"Unexpected multiple resolved values on single injection")}else return e.resolve(n)}function Hs(n,e){if(e.bindings!==void 0)return Array.isArray(e.bindings)?Yp(n,e.bindings):Jp(n,e.bindings)}function Ju(n,e){const t=[];for(const i of e.constructorParams)i===void 0?t.push(void 0):t.push(Hs(n,i));return t.some(Ze)?Promise.all(t):t}function Xu(n,e,t){return(i,r)=>{const s=n(i,r);return Ze(s)?e(s,i,r):t(s,i,r)}}function Sl(n,e,t){const i=Xp(n,e,t);return Ze(i)?i.then(()=>n):n}function Xp(n,e,t){if(t in n)if(typeof n[t]=="function"){let i;try{i=n[t]()}catch(r){throw new Ce(Ee.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:r})}if(Ze(i))return Qp(e,t,i)}else throw new Ce(Ee.resolution,`Expecting a "${t.toString()}" method when resolving "${e.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);else throw new Ce(Ee.resolution,`Expecting a "${t.toString()}" property when resolving "${e.implementationType.name}" class @postConstruct decorated method, none found.`)}async function Qp(n,e,t){try{await t}catch(i){throw new Ce(Ee.resolution,`Unexpected error found when calling "${e.toString()}" @postConstruct decorated method on class "${n.implementationType.name}"`,{cause:i})}}function Zp(n,e,t){const i=[];for(const[r,s]of t.propertyParams){const a=t.classMetadata.properties.get(r);if(a===void 0)throw new Ce(Ee.resolution,`Expecting metadata at property "${r.toString()}", none found`);a.kind!==xt.unmanaged&&s.bindings!==void 0&&(e[r]=Hs(n,s),Ze(e[r])&&i.push((async()=>{e[r]=await e[r]})()))}if(i.length>0)return Promise.all(i).then(()=>{})}function _l(n,e,t){if(t.size===0)return n;let i=n;for(const r of t)Ze(i)?i=i.then(s=>Sl(s,e,r)):i=Sl(i,e,r);return i}function eg(n,e,t){return hc(e,t.binding.serviceIdentifier,new t.binding.implementationType(...n))}function Qu(n,e,t){const i=new t.binding.implementationType(...n),r=Zp(e,i,t);return Ze(r)?r.then(()=>_l(i,t.binding,t.classMetadata.lifecycle.postConstructMethodNames)):_l(i,t.binding,t.classMetadata.lifecycle.postConstructMethodNames)}async function tg(n,e,t){return hc(e,t.binding.serviceIdentifier,new t.binding.implementationType(...await n))}async function ng(n,e,t){const i=await n;return Qu(i,e,t)}function ig(n,e){const t=n.binding;switch(t.scope){case It.Singleton:return i=>{if(t.cache.isRight)return t.cache.value;const r=e(i,n);return Gu(t,r)};case It.Request:return i=>{if(i.requestScopeCache.has(t.id))return i.requestScopeCache.get(t.id);const r=e(i,n);return i.requestScopeCache.set(t.id,r),r};case It.Transient:return i=>e(i,n)}}const rg=Xu(Ju,ng,Qu),sg=Xu(Ju,tg,eg),og=n=>Pr(n,rg),ag=n=>ig(n,sg);function cg(n,e,t){return e.lifecycle.postConstructMethodNames.size===0&&n.onActivation===void 0&&e.properties.size===0?ag(t):og(t)}class lg{binding;classMetadata;constructorParams;propertyParams;resolve;constructor(e,t){this.binding=e,this.classMetadata=t,this.constructorParams=[],this.propertyParams=new Map,this.resolve=cg(e,t,this)}}function ug(n,e){const t=[];for(const i of e.params)t.push(Hs(n,i));return t.some(Ze)?Promise.all(t):t}function fg(n,e){const t=ug(n,e);return Ze(t)?t.then(i=>e.binding.factory(...i)):e.binding.factory(...t)}class dg{binding;params;resolve;constructor(e){this.binding=e,this.params=[],this.resolve=Pr(this,fg)}}function Zu(n){const e=hg(n),t=pg(n),i=(s,a,l,d,p)=>{const y=oi(d)?d.binding.targetServiceIdentifier:d.serviceIdentifier;s.servicesBranch.push(y);const m=[];for(const w of l){if(w.type===Le.Factory){m.push(new Hp(w));continue}switch(w.type){case Le.ConstantValue:{m.push(new zp(w));break}case Le.DynamicValue:{m.push(new Wp(w));break}case Le.Instance:{m.push(e(s,w,a));break}case Le.ResolvedValue:{m.push(t(s,w,a));break}case Le.ServiceRedirection:{const P=r(s,a,w,p);m.push(P);break}}}return s.servicesBranch.pop(),m},r=gg(i);return i}function hg(n){return(e,t,i)=>{const r=e.operations.getClassMetadata(t.implementationType),s=new lg(t,r),a={autobindOptions:e.autobindOptions,node:s,operations:e.operations,servicesBranch:e.servicesBranch};return n(a,i)}}function pg(n){return(e,t,i)=>{const r=new dg(t),s={autobindOptions:e.autobindOptions,node:r,operations:e.operations,servicesBranch:e.servicesBranch};return n(s,i)}}function gg(n){return(e,t,i,r)=>{const s={binding:i,redirections:[]},a=new Ln(t.last),l=zs(e,a,{chained:r,customServiceIdentifier:i.targetServiceIdentifier});return s.redirections.push(...n(e,t,l,s,r)),s}}function mg(n){return n.binding.type===Le.Instance}function vg(n){let e;if(n.tags.size===0)e=void 0;else if(n.tags.size===1){const[i,r]=n.tags.entries().next().value;e={key:i,value:r}}else return;const t=qs.is(n.value)?n.value.unwrap():n.value;return n.kind===xt.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:t,tag:e}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:t,tag:e}}function yg(n){let e;if(n.tags.size===0)e=void 0;else if(n.tags.size===1){const[i,r]=n.tags.entries().next().value;e={key:i,value:r}}else return;const t=qs.is(n.value)?n.value.unwrap():n.value;return n.kind===hn.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:t,tag:e}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:t,tag:e}}function ef(n,e,t,i){if(n!==void 0&&(Nt.is(t)&&!t.isExpanded()||t.isContextFree)){const r={tree:{root:t}};e.setPlan(n,r)}else e.setNonCachedServiceNode(t,i)}const bg=500;class wg extends Nt{#e;#t;#i;#n;constructor(e,t,i,r,s){super(s,Ws(r.value)),this.#t=t,this.#e=e,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}class xg extends Nt{#e;#t;#i;#n;constructor(e,t,i,r,s){super(s,Ws(r.value)),this.#e=e,this.#t=t,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}function tf(n,e,t,i){const r=Sg(n,t),s=_g(e,i);return(a,l)=>mg(a.node)?r(a,a.node,l):s(a,a.node,l)}function Sg(n,e){const t=kg(n,e);return(i,r,s)=>{const a=r.classMetadata;for(const[l,d]of a.constructorArguments.entries())r.constructorParams[l]=t(i,s,d);for(const[l,d]of a.properties){const p=t(i,s,d);p!==void 0&&r.propertyParams.set(l,p)}return i.node}}function _g(n,e){const t=Cg(n,e);return(i,r,s)=>{const a=r.binding.metadata;for(const[l,d]of a.arguments.entries())r.params[l]=t(i,s,d);return i.node}}function kg(n,e){return(t,i,r)=>{if(r.kind===xt.unmanaged)return;if(i.length>bg)throw new Ce(Ee.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");const s=vg(r);if(s!==void 0){const d=t.operations.getPlan(s);if(d!==void 0&&d.tree.root.isContextFree)return d.tree.root}const a=e(t,i,r),l=new wg(t,n,i,r,a);return ef(s,t.operations,l,{bindingConstraintsList:i,chainedBindings:r.kind===xt.multipleInjection&&r.chained,optionalBindings:r.optional}),l}}function Cg(n,e){return(t,i,r)=>{const s=yg(r);if(s!==void 0){const d=t.operations.getPlan(s);if(d!==void 0&&d.tree.root.isContextFree)return d.tree.root}const a=e(t,i,r),l=new xg(t,n,i,r,a);return ef(s,t.operations,l,{bindingConstraintsList:i,chainedBindings:r.kind===hn.multipleInjection&&r.chained,optionalBindings:r.optional}),l}}class Eg extends Nt{#e;constructor(e,t){super(t,t.serviceIdentifier),this.#e=e}_buildPlanServiceNode(){return sf(this.#e)}}const ha=Wu(rf),pa=Hu(rf),Ig=tf(ha,pa,ha,pa),nf=Zu(Ig);function rf(n,e,t,i,r){return nf(n,e,t,i,r)}const sf=Kp(nf);function Ag(n){try{const e=Np(n),t=n.operations.getPlan(e);if(t!==void 0)return t;const i=sf(n),r={tree:{root:new Eg(n,i)}};return n.operations.setPlan(e,r),r}catch(e){Bp(n,e)}}var Gt;(function(n){n.bindingAdded="bindingAdded",n.bindingRemoved="bindingRemoved"})(Gt||(Gt={}));const Pg=8,Og=1024,Tg=.5;class Ng{#e;#t;#i;constructor(){this.#e=[],this.#t=Pg,this.#i=Og}*[Symbol.iterator](){let e=0;for(const t of this.#e){const i=t.deref();i===void 0?++e:yield i}this.#e.length>=this.#t&&this.#r(e)&&this.#n(e)}push(e){const t=new WeakRef(e);if(this.#e.push(t),this.#e.length>=this.#t&&this.#e.length%this.#i===0){let i=0;for(const r of this.#e)r.deref()===void 0&&++i;this.#r(i)&&this.#n(i)}}#n(e){const t=new Array(this.#e.length-e);let i=0;for(const r of this.#e)r.deref()&&(t[i++]=r);this.#e=t}#r(e){return e>=this.#e.length*Tg}}function Mg(n){const e=Wu(n);return(t,i,r)=>{try{return e(t,i,r)}catch(s){if(Ce.isErrorOfKind(s,Ee.planning))return;throw s}}}function Rg(n){const e=Hu(n);return(t,i,r)=>{try{return e(t,i,r)}catch(s){if(Ce.isErrorOfKind(s,Ee.planning))return;throw s}}}const jg=tf(ha,pa,$g,Fg),gc=Zu(jg),Bg=Mg(gc),Lg=Rg(gc);function $g(n,e,t){return Bg(n,e,t)}function Fg(n,e,t){return Lg(n,e,t)}function of(n,e,t,i,r){if(Nt.is(e)&&!e.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const s=new Ln(i.last);return!t.isSatisfiedBy(s)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:Dg(n,e,t,i,r)}function Dg(n,e,t,i,r){let s;try{[s]=gc(n,i,[t],e,r)}catch(a){if(lc(a)||Ce.isErrorOfKind(a,Ee.planningMaxDepthExceeded))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw a}return Ug(e,s)}function Ug(n,e){if(Array.isArray(n.bindings))n.bindings.push(e);else if(n.bindings===void 0)n.bindings=e;else{if(!Nt.is(n))throw new Ce(Ee.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}function qg(n,e,t){if(Nt.is(e)&&!e.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const i=fc(n),r=n.rootConstraints.isMultiple&&n.rootConstraints.chained;return of(n,e,t,i,r)}function af(n,e,t,i){if(Nt.is(n)&&!n.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const r=new Ln(t.last);if(!e.isSatisfiedBy(r)||t.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!t.last.elem.getAncestorsCalled};let s;if(Array.isArray(n.bindings))n.bindings=n.bindings.filter(a=>a.binding===e?(s=a,!1):!0);else if(n.bindings?.binding===e)if(s=n.bindings,i)n.bindings=void 0;else{if(!Nt.is(n))throw new Ce(Ee.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");n.invalidate()}return{bindingNodeRemoved:s,isContextFreeBinding:!0}}function Kg(n,e,t){if(Nt.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const i=fc(n);return af(e,t,i,n.rootConstraints.isOptional??!1)}const kl=4,Ko=2,Vo=1,Vg=8;class Cl{#e;#t;#i;#n;#r;#o;constructor(){this.#e=new Map,this.#t=this.#s(),this.#i=this.#s(),this.#n=this.#s(),this.#r=this.#s(),this.#o=new Ng}clearCache(){for(const e of this.#h())e.clear();for(const e of this.#o)e.clearCache()}get(e){return e.name===void 0?e.tag===void 0?this.#a(this.#t,e).get(e.serviceIdentifier):this.#a(this.#r,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):e.tag===void 0?this.#a(this.#i,e).get(e.serviceIdentifier)?.get(e.name):this.#a(this.#n,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#b(e),this.#f(e),this.#d(e),this.#w(e),this.#y(e);for(const t of this.#o)t.invalidateServiceBinding(e)}set(e,t){e.name===void 0?e.tag===void 0?this.#a(this.#t,e).set(e.serviceIdentifier,t):this.#c(this.#c(this.#a(this.#r,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):e.tag===void 0?this.#c(this.#a(this.#i,e),e.serviceIdentifier).set(e.name,t):this.#c(this.#c(this.#c(this.#a(this.#n,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e,t){let i=this.#e.get(e.serviceIdentifier);i===void 0&&(i=new Map,this.#e.set(e.serviceIdentifier,i)),i.set(e,t)}subscribe(e){this.#o.push(e)}#s(){const e=new Array(Vg);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#l(e,t,i,r){const s=(t&Ko)!==0;let a;return s?a={chained:(t&Ko&kl)!==0,isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier}:a={isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier},(t&Vo)!==0&&(a.isOptional=!0),i!==void 0&&(a.name=i),r!==void 0&&(a.tag=r),{autobindOptions:void 0,operations:e.operations,rootConstraints:a,servicesBranch:[]}}#c(e,t){let i=e.get(t);return i===void 0&&(i=new Map,e.set(t,i)),i}#a(e,t){return e[this.#u(t)]}#h(){return[this.#e,...this.#t,...this.#i,...this.#n,...this.#r]}#u(e){return e.isMultiple?(e.chained?kl:0)|(e.optional?Vo:0)|Ko:e.optional?Vo:0}#f(e){for(const[t,i]of this.#i.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())this.#g(e,a,t,s,void 0)}}#d(e){for(const[t,i]of this.#n.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[l,d]of a.entries())for(const[p,y]of d.entries())this.#g(e,y,t,s,{key:l,value:p})}}#p(e){switch(e.binding.type){case Le.ServiceRedirection:for(const t of e.redirections)this.#p(t);break;case Le.Instance:for(const t of e.constructorParams)t!==void 0&&this.#m(t);for(const t of e.propertyParams.values())this.#m(t);break;case Le.ResolvedValue:for(const t of e.params)this.#m(t);break}}#m(e){const t=this.#e.get(e.serviceIdentifier);t===void 0||!t.has(e)||(t.delete(e),this.#v(e))}#v(e){if(!(Nt.is(e)&&!e.isExpanded())&&e.bindings!==void 0)if(Array.isArray(e.bindings))for(const t of e.bindings)this.#p(t);else this.#p(e.bindings)}#y(e){const t=this.#e.get(e.binding.serviceIdentifier);if(t!==void 0)switch(e.kind){case Gt.bindingAdded:for(const[i,r]of t){const s=of({autobindOptions:void 0,operations:e.operations,servicesBranch:[]},i,e.binding,r.bindingConstraintsList,r.chainedBindings);s.isContextFreeBinding?s.shouldInvalidateServiceNode&&Nt.is(i)&&(this.#v(i),i.invalidate()):this.clearCache()}break;case Gt.bindingRemoved:for(const[i,r]of t){const s=af(i,e.binding,r.bindingConstraintsList,r.optionalBindings);s.isContextFreeBinding?s.bindingNodeRemoved!==void 0&&this.#p(s.bindingNodeRemoved):this.clearCache()}break}}#b(e){for(const[t,i]of this.#t.entries()){const r=i.get(e.binding.serviceIdentifier);this.#g(e,r,t,void 0,void 0)}}#w(e){for(const[t,i]of this.#r.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[l,d]of a.entries())this.#g(e,d,t,void 0,{key:s,value:l})}}#g(e,t,i,r,s){if(t!==void 0&&Nt.is(t.tree.root)){const a=this.#l(e,i,r,s);switch(e.kind){case Gt.bindingAdded:{const l=qg(a,t.tree.root,e.binding);l.isContextFreeBinding?l.shouldInvalidateServiceNode&&(this.#v(t.tree.root),t.tree.root.invalidate()):this.clearCache()}break;case Gt.bindingRemoved:{const l=Kg(a,t.tree.root,e.binding);l.isContextFreeBinding?l.bindingNodeRemoved!==void 0&&this.#p(l.bindingNodeRemoved):this.clearCache()}break}}}}const zg=-1;function Wg(n,e){if(lc(e)||Ce.isErrorOfKind(e,Ee.planningMaxDepthExceeded)){const t=Yg(Hg(n));throw new Ce(Ee.planning,`Circular dependency found: ${t}`,{cause:e})}throw e}function Hg(n){const e=n.planResult.tree.root,t=[];function i(s){const a=t.indexOf(s);if(a!==zg)return[...t.slice(a),s].map(d=>d.serviceIdentifier);t.push(s);try{for(const l of Gg(s)){const d=i(l);if(d!==void 0)return d}}finally{t.pop()}}return i(e)??[]}function Gg(n){const e=[],t=n.bindings;if(t===void 0)return e;const i=r=>{if(oi(r)){for(const s of r.redirections)i(s);return}switch(r.binding.type){case Le.Instance:{const s=r;for(const a of s.constructorParams)a!==void 0&&e.push(a);for(const a of s.propertyParams.values())e.push(a);break}case Le.ResolvedValue:{const s=r;for(const a of s.params)e.push(a);break}}};if(Array.isArray(t))for(const r of t)i(r);else i(t);return e}function Yg(n){const e=[...n];return e.length===0?"(No dependency trace)":e.map(ut).join(" -> ")}function Jg(n){try{const e=n.planResult.tree.root;return Hs(n,e)}catch(e){Wg(n,e)}}function Xg(n){return n.scope!==void 0}function Qg(n,e){if(e.type===Le.Instance){const t=n.getClassMetadata(e.implementationType),i=e.cache.value;return Ze(i)?i.then(r=>Il(t,r)):Il(t,i)}}function El(n,e){if(typeof n[e]=="function")return n[e]()}function Il(n,e){const t=n.lifecycle.preDestroyMethodNames;if(t.size===0)return;let i;for(const r of t)i===void 0?i=El(e,r):i=i.then(()=>El(e,r));return i}function Al(n,e,t){const i=n.getDeactivations(e);if(i!==void 0)return Ze(t)?cf(t,i[Symbol.iterator]()):Zg(t,i[Symbol.iterator]())}function Zg(n,e){let t=e.next();for(;t.done!==!0;){const i=t.value(n);if(Ze(i))return cf(n,e);t=e.next()}}async function cf(n,e){const t=await n;let i=e.next();for(;i.done!==!0;)await i.value(t),i=e.next()}function em(n,e){const t=Qg(n,e);return t===void 0?Pl(n,e):t.then(()=>Pl(n,e))}function Pl(n,e){const t=e.cache;return Ze(t.value)?t.value.then(i=>Ol(n,e,i)):Ol(n,e,t.value)}function Ol(n,e,t){let i;if(e.onDeactivation!==void 0){const r=e.onDeactivation;i=r(t)}return i===void 0?Al(n,e.serviceIdentifier,t):i.then(()=>Al(n,e.serviceIdentifier,t))}function Ts(n,e){if(e===void 0)return;const t=tm(e),i=[];for(const r of t){const s=em(n,r);s!==void 0&&i.push(s)}if(i.length>0)return Promise.all(i).then(()=>{})}function tm(n){const e=[];for(const t of n)Xg(t)&&t.scope===It.Singleton&&t.cache.isRight&&e.push(t);return e}function nm(n,e){const t=n.getBindingsFromModule(e);return Ts(n,t)}function im(n,e){const t=n.getBindings(e);return Ts(n,t)}const lf=Symbol.for("@inversifyjs/container/bindingIdentifier");function Tl(n){return typeof n=="object"&&n!==null&&n[lf]===!0}class bi{static always=e=>!0}const zo=Symbol.for("@inversifyjs/container/InversifyContainerError");class qt extends Error{[zo];kind;constructor(e,t,i){super(t,i),this[zo]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[zo]===!0}static isErrorOfKind(e,t){return qt.is(e)&&e.kind===t}}var Kt;(function(n){n[n.invalidOperation=0]="invalidOperation"})(Kt||(Kt={}));function mc(n){return{[lf]:!0,id:n.id}}function Or(n){return e=>{for(let t=e.getAncestor();t!==void 0;t=t.getAncestor())if(n(t))return!0;return!1}}function Tr(n){return e=>e.name===n}function rm(n){return Or(Tr(n))}function Gs(n){return e=>e.serviceIdentifier===n}function sm(n){return Or(Gs(n))}function Nr(n,e){return t=>t.tags.has(n)&&t.tags.get(n)===e}function om(n,e){return Or(Nr(n,e))}function am(n){return n.name===void 0&&n.tags.size===0}function cm(n){return n.isMultiple===!0}function Ys(n){const e=Or(n);return t=>!e(t)}function lm(n){return Ys(Tr(n))}function um(n){return Ys(Gs(n))}function fm(n,e){return Ys(Nr(n,e))}function Js(n){return e=>{const t=e.getAncestor();return t===void 0||!n(t)}}function dm(n){return Js(Tr(n))}function hm(n){return Js(Gs(n))}function pm(n,e){return Js(Nr(n,e))}function Xs(n){return e=>{const t=e.getAncestor();return t!==void 0&&n(t)}}function gm(n){return Xs(Tr(n))}function mm(n){return Xs(Gs(n))}function vm(n,e){return Xs(Nr(n,e))}function ym(n){return typeof n=="object"&&!qs.is(n)}class bm{#e;constructor(e){this.#e=e}getIdentifier(){return mc(this.#e)}inRequestScope(){return this.#e.scope=It.Request,new Oi(this.#e)}inSingletonScope(){return this.#e.scope=It.Singleton,new Oi(this.#e)}inTransientScope(){return this.#e.scope=It.Transient,new Oi(this.#e)}}class uf{#e;#t;#i;#n;constructor(e,t,i,r){this.#e=e,this.#t=t,this.#i=i,this.#n=r}to(e){const t=Ks(e),i={cache:{isRight:!1,value:void 0},id:Gn(),implementationType:e,isSatisfiedBy:bi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:t.scope??this.#i,serviceIdentifier:this.#n,type:Le.Instance};return this.#e(i),new Wo(i)}toSelf(){if(typeof this.#n!="function")throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#n)}toConstantValue(e){const t={cache:{isRight:!1,value:void 0},id:Gn(),isSatisfiedBy:bi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:It.Singleton,serviceIdentifier:this.#n,type:Le.ConstantValue,value:e};return this.#e(t),new Oi(t)}toDynamicValue(e){const t={cache:{isRight:!1,value:void 0},id:Gn(),isSatisfiedBy:bi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Le.DynamicValue,value:e};return this.#e(t),new Wo(t)}toResolvedValue(e,t){const i={cache:{isRight:!1,value:void 0},factory:e,id:Gn(),isSatisfiedBy:bi.always,metadata:this.#r(t),moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Le.ResolvedValue};return this.#e(i),new Wo(i)}toFactory(e){const t={cache:{isRight:!1,value:void 0},factory:e,id:Gn(),isSatisfiedBy:bi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:It.Singleton,serviceIdentifier:this.#n,type:Le.Factory};return this.#e(t),new Oi(t)}toService(e){const t={id:Gn(),isSatisfiedBy:bi.always,moduleId:this.#t,serviceIdentifier:this.#n,targetServiceIdentifier:e,type:Le.ServiceRedirection};this.#e(t)}#r(e){return{arguments:(e??[]).map(i=>ym(i)?cm(i)?{chained:i.chained??!1,kind:hn.multipleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map(r=>[r.key,r.value])),value:i.serviceIdentifier}:{kind:hn.singleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map(r=>[r.key,r.value])),value:i.serviceIdentifier}:{kind:hn.singleInjection,name:void 0,optional:!1,tags:new Map,value:i})}}}class ff{#e;constructor(e){this.#e=e}getIdentifier(){return mc(this.#e)}onActivation(e){return this.#e.onActivation=e,new ga(this.#e)}onDeactivation(e){if(this.#e.onDeactivation=e,this.#e.scope!==It.Singleton)throw new qt(Kt.invalidOperation,`Binding for service "${ut(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new ga(this.#e)}}class ga{#e;constructor(e){this.#e=e}getIdentifier(){return mc(this.#e)}when(e){return this.#e.isSatisfiedBy=e,new ff(this.#e)}whenAnyAncestor(e){return this.when(Or(e))}whenAnyAncestorIs(e){return this.when(sm(e))}whenAnyAncestorNamed(e){return this.when(rm(e))}whenAnyAncestorTagged(e,t){return this.when(om(e,t))}whenDefault(){return this.when(am)}whenNamed(e){return this.when(Tr(e))}whenNoParent(e){return this.when(Js(e))}whenNoParentIs(e){return this.when(hm(e))}whenNoParentNamed(e){return this.when(dm(e))}whenNoParentTagged(e,t){return this.when(pm(e,t))}whenParent(e){return this.when(Xs(e))}whenParentIs(e){return this.when(mm(e))}whenParentNamed(e){return this.when(gm(e))}whenParentTagged(e,t){return this.when(vm(e,t))}whenTagged(e,t){return this.when(Nr(e,t))}whenNoAncestor(e){return this.when(Ys(e))}whenNoAncestorIs(e){return this.when(um(e))}whenNoAncestorNamed(e){return this.when(lm(e))}whenNoAncestorTagged(e,t){return this.when(fm(e,t))}}class Oi extends ga{#e;constructor(e){super(e),this.#e=new ff(e)}onActivation(e){return this.#e.onActivation(e)}onDeactivation(e){return this.#e.onDeactivation(e)}}class Wo extends Oi{#e;constructor(e){super(e),this.#e=new bm(e)}inRequestScope(){return this.#e.inRequestScope()}inSingletonScope(){return this.#e.inSingletonScope()}inTransientScope(){return this.#e.inTransientScope()}}function wm(n){if(n===void 0)return;const e=n.next();if(e.done!==!0)return e.value}function xm(n){return wm(n?.[Symbol.iterator]())}class Sm{#e;#t;#i;#n;constructor(e,t,i,r){this.#e=e,this.#t=t,this.#i=i,this.#n=r}bind(e){return new uf(t=>{this.#r(t)},void 0,this.#t,e)}isBound(e,t){const i=this.#n.bindingService.get(e);return this.#d(e,i,t)}isCurrentBound(e,t){const i=this.#n.bindingService.getNonParentBindings(e);return this.#d(e,i,t)}async rebindAsync(e){return await this.unbindAsync(e),this.bind(e)}rebind(e){return this.unbind(e),this.bind(e)}async unbindAsync(e){await this.#s(e)}async unbindAllAsync(){await this.#a()}unbindAll(){if(this.#a()!==void 0)throw new qt(Kt.invalidOperation,"Unexpected asynchronous deactivation when unbinding all services. Consider using Container.unbindAllAsync() instead.")}unbind(e){this.#s(e)!==void 0&&this.#o(e)}#r(e){this.#n.bindingService.set(e),this.#i.invalidateService({binding:e,kind:Gt.bindingAdded})}#o(e){let t;if(Tl(e)){const i=this.#n.bindingService.getById(e.id),r=xm(i)?.serviceIdentifier;r===void 0?t="Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbindAsync() instead.":t=`Unexpected asynchronous deactivation when unbinding "${ut(r)}" binding. Consider using Container.unbindAsync() instead.`}else t=`Unexpected asynchronous deactivation when unbinding "${ut(e)}" service. Consider using Container.unbindAsync() instead.`;throw new qt(Kt.invalidOperation,t)}#s(e){return Tl(e)?this.#l(e):this.#u(e)}#l(e){const t=this.#n.bindingService.getById(e.id),i=t===void 0?void 0:[...t],r=Ts(this.#e,t);if(r===void 0)this.#c(i,e);else return r.then(()=>{this.#c(i,e)})}#c(e,t){if(this.#n.bindingService.removeById(t.id),e!==void 0)for(const i of e)this.#i.invalidateService({binding:i,kind:Gt.bindingRemoved})}#a(){const e=[...this.#n.bindingService.getNonParentBoundServices()],t=e.map(r=>im(this.#e,r));if(t.some(r=>Ze(r)))return Promise.all(t).then(()=>{this.#h(e)});this.#h(e)}#h(e){for(const t of e)this.#n.activationService.removeAllByServiceId(t),this.#n.bindingService.removeAllByServiceId(t),this.#n.deactivationService.removeAllByServiceId(t);this.#n.planResultCacheService.clearCache()}#u(e){const t=this.#n.bindingService.get(e),i=t===void 0?void 0:[...t],r=Ts(this.#e,t);if(r===void 0)this.#f(e,i);else return r.then(()=>{this.#f(e,i)})}#f(e,t){if(this.#n.activationService.removeAllByServiceId(e),this.#n.bindingService.removeAllByServiceId(e),this.#n.deactivationService.removeAllByServiceId(e),t!==void 0)for(const i of t)this.#i.invalidateService({binding:i,kind:Gt.bindingRemoved})}#d(e,t,i){if(t===void 0)return!1;const r={getAncestor:()=>{},name:i?.name,serviceIdentifier:e,tags:new Map};i?.tag!==void 0&&r.tags.set(i.tag.key,i.tag.value);for(const s of t)if(s.isSatisfiedBy(r))return!0;return!1}}class _m{#e;#t;#i;#n;#r;constructor(e,t,i,r,s){this.#e=e,this.#t=t,this.#i=i,this.#n=r,this.#r=s}async loadAsync(...e){await Promise.all(this.#l(...e))}load(...e){const t=this.#l(...e);for(const i of t)if(i!==void 0)throw new qt(Kt.invalidOperation,"Unexpected asynchronous module load. Consider using container.loadAsync() instead.")}async unloadAsync(...e){await Promise.all(this.#a(...e)),this.#s(e)}unload(...e){const t=this.#a(...e);for(const i of t)if(i!==void 0)throw new qt(Kt.invalidOperation,"Unexpected asynchronous module unload. Consider using container.unloadAsync() instead.");this.#s(e)}#o(e){return{bind:t=>new uf(i=>{this.#c(i)},e,this.#i,t),isBound:this.#e.isBound.bind(this.#e),onActivation:(t,i)=>{this.#r.activationService.add(i,{moduleId:e,serviceId:t})},onDeactivation:(t,i)=>{this.#r.deactivationService.add(i,{moduleId:e,serviceId:t})},rebind:this.#e.rebind.bind(this.#e),rebindAsync:this.#e.rebindAsync.bind(this.#e),unbind:this.#e.unbind.bind(this.#e),unbindAsync:this.#e.unbindAsync.bind(this.#e)}}#s(e){for(const t of e)this.#r.activationService.removeAllByModuleId(t.id),this.#r.bindingService.removeAllByModuleId(t.id),this.#r.deactivationService.removeAllByModuleId(t.id);this.#r.planResultCacheService.clearCache()}#l(...e){return e.map(t=>t.load(this.#o(t.id)))}#c(e){this.#r.bindingService.set(e),this.#n.invalidateService({binding:e,kind:Gt.bindingAdded})}#a(...e){return e.map(t=>nm(this.#t,t.id))}}function km(n,e){e.getBindings=n.bindingService.get.bind(n.bindingService),e.getBindingsFromModule=n.bindingService.getByModuleId.bind(n.bindingService),e.getDeactivations=n.deactivationService.get.bind(n.deactivationService)}function Cm(n){return{getBindings:n.bindingService.get.bind(n.bindingService),getBindingsFromModule:n.bindingService.getByModuleId.bind(n.bindingService),getClassMetadata:Ks,getDeactivations:n.deactivationService.get.bind(n.deactivationService)}}class Em{deactivationParams;constructor(e){this.deactivationParams=Cm(e),e.onReset(()=>{km(e,this.deactivationParams)})}}class Im{planParamsOperations;#e;constructor(e){this.#e=e,this.planParamsOperations={getBindings:this.#e.bindingService.get.bind(this.#e.bindingService),getBindingsChained:this.#e.bindingService.getChained.bind(this.#e.bindingService),getClassMetadata:Ks,getPlan:this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService),setBinding:this.#i.bind(this),setNonCachedServiceNode:this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService),setPlan:this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService)},this.#e.onReset(()=>{this.#t()})}#t(){this.planParamsOperations.getBindings=this.#e.bindingService.get.bind(this.#e.bindingService),this.planParamsOperations.getBindingsChained=this.#e.bindingService.getChained.bind(this.#e.bindingService),this.planParamsOperations.setBinding=this.#i.bind(this)}#i(e){this.#e.bindingService.set(e),this.#e.planResultCacheService.invalidateServiceBinding({binding:e,kind:Gt.bindingAdded,operations:this.planParamsOperations})}}class Am{#e;#t;constructor(e,t){this.#e=e,this.#t=t}invalidateService(e){this.#t.planResultCacheService.invalidateServiceBinding({...e,operations:this.#e.planParamsOperations})}}const Pm=Symbol.for("@inversifyjs/plugin/isPlugin");class Om{#e;#t;#i;#n;constructor(e,t,i){this.#n=t,this.#i=i,this.#e=this.#o(e),this.#t=this.#s()}register(e,t){const i=new t(e,this.#t);this.#r(i),i.load(this.#e)}#r(e){if(e[Pm]!==!0)throw new qt(Kt.invalidOperation,"Invalid plugin. The plugin must extend the Plugin class")}#o(e){return{define:(t,i)=>{if(Object.prototype.hasOwnProperty.call(e,t))throw new qt(Kt.invalidOperation,`Container already has a method named "${String(t)}"`);e[t]=i},onPlan:this.#i.onPlan.bind(this.#i)}}#s(){const e=this.#n;return{get activationService(){return e.activationService},get bindingService(){return e.bindingService},get deactivationService(){return e.deactivationService},get planResultCacheService(){return e.planResultCacheService}}}}class Nl{activationService;bindingService;deactivationService;planResultCacheService;#e;constructor(e,t,i,r){this.activationService=e,this.bindingService=t,this.deactivationService=i,this.planResultCacheService=r,this.#e=[]}reset(e,t,i){this.activationService=e,this.bindingService=t,this.deactivationService=i,this.planResultCacheService.clearCache();for(const r of this.#e)r()}onReset(e){this.#e.push(e)}}class Tm{#e;#t;#i;#n;#r;#o;#s;constructor(e,t,i,r){this.#o=e,this.#s=t,this.#n=this.#f(),this.#e=i,this.#t=r,this.#i=s=>this.#s.activationService.get(s),this.#r=[],this.#s.onReset(()=>{this.#l()})}get(e,t){const i=this.#u(!1,e,t),r=this.#d(i);if(Ze(r))throw new qt(Kt.invalidOperation,`Unexpected asynchronous service when resolving service "${ut(e)}"`);return r}getAll(e,t){const i=this.#u(!0,e,t),r=this.#d(i);if(Ze(r))throw new qt(Kt.invalidOperation,`Unexpected asynchronous service when resolving service "${ut(e)}"`);return r}async getAllAsync(e,t){const i=this.#u(!0,e,t);return this.#d(i)}async getAsync(e,t){const i=this.#u(!1,e,t);return this.#d(i)}onPlan(e){this.#r.push(e)}#l(){this.#n=this.#f()}#c(e,t,i){const r=i?.name,s=i?.optional??!1,a=i?.tag;return e?{chained:i?.chained??!1,isMultiple:e,name:r,optional:s,serviceIdentifier:t,tag:a}:{isMultiple:e,name:r,optional:s,serviceIdentifier:t,tag:a}}#a(e,t,i){const r={autobindOptions:i?.autobind??this.#e?{scope:this.#t}:void 0,operations:this.#o.planParamsOperations,rootConstraints:this.#h(e,t,i),servicesBranch:[]};return this.#p(r,i),r}#h(e,t,i){return t?{chained:i?.chained??!1,isMultiple:t,serviceIdentifier:e}:{isMultiple:t,serviceIdentifier:e}}#u(e,t,i){const r=this.#c(e,t,i),s=this.#s.planResultCacheService.get(r);if(s!==void 0)return s;const a=Ag(this.#a(t,e,i));for(const l of this.#r)l(r,a);return a}#f(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#d(e){return Jg({context:this.#n,getActivations:this.#i,planResult:e,requestScopeCache:new Map})}#p(e,t){t!==void 0&&(t.name!==void 0&&(e.rootConstraints.name=t.name),t.optional===!0&&(e.rootConstraints.isOptional=!0),t.tag!==void 0&&(e.rootConstraints.tag={key:t.tag.key,value:t.tag.value}),e.rootConstraints.isMultiple&&(e.rootConstraints.chained=t?.chained??!1))}}class Nm{#e;#t;constructor(e){this.#e=e,this.#t=[]}restore(){const e=this.#t.pop();if(e===void 0)throw new qt(Kt.invalidOperation,"No snapshot available to restore");this.#e.reset(e.activationService,e.bindingService,e.deactivationService)}snapshot(){this.#t.push({activationService:this.#e.activationService.clone(),bindingService:this.#e.bindingService.clone(),deactivationService:this.#e.deactivationService.clone()})}}const Mm=It.Transient;class Rm{#e;#t;#i;#n;#r;#o;constructor(e){const t=e?.autobind??!1,i=e?.defaultScope??Mm;this.#n=this.#l(e,t,i);const r=new Im(this.#n),s=new Am(r,this.#n),a=new Em(this.#n);this.#e=new Sm(a.deactivationParams,i,s,this.#n),this.#t=new _m(this.#e,a.deactivationParams,i,s,this.#n),this.#r=new Tm(r,this.#n,t,i),this.#i=new Om(this,this.#n,this.#r),this.#o=new Nm(this.#n)}bind(e){return this.#e.bind(e)}get(e,t){return this.#r.get(e,t)}getAll(e,t){return this.#r.getAll(e,t)}async getAllAsync(e,t){return this.#r.getAllAsync(e,t)}async getAsync(e,t){return this.#r.getAsync(e,t)}isBound(e,t){return this.#e.isBound(e,t)}isCurrentBound(e,t){return this.#e.isCurrentBound(e,t)}async loadAsync(...e){return this.#t.loadAsync(...e)}load(...e){this.#t.load(...e)}onActivation(e,t){this.#n.activationService.add(t,{serviceId:e})}onDeactivation(e,t){this.#n.deactivationService.add(t,{serviceId:e})}register(e){this.#i.register(this,e)}restore(){this.#o.restore()}async rebindAsync(e){return this.#e.rebindAsync(e)}rebind(e){return this.#e.rebind(e)}snapshot(){this.#o.snapshot()}async unbindAsync(e){await this.#e.unbindAsync(e)}async unbindAllAsync(){await this.#e.unbindAllAsync()}unbindAll(){this.#e.unbindAll()}unbind(e){this.#e.unbind(e)}async unloadAsync(...e){return this.#t.unloadAsync(...e)}unload(...e){this.#t.unload(...e)}#s(e,t){if(e)return{scope:t}}#l(e,t,i){const r=this.#s(t,i);if(e?.parent===void 0)return new Nl(vr.build(()=>{}),yr.build(()=>{},r),br.build(()=>{}),new Cl);const s=new Cl,a=e.parent;return a.#n.planResultCacheService.subscribe(s),new Nl(vr.build(()=>a.#n.activationService),yr.build(()=>a.#n.bindingService,r),br.build(()=>a.#n.deactivationService),s)}}class ma{jsonld;constructor(e){this.jsonld=e}getIdentifier(){return this.jsonld.identifier}setIdentifier(e){this.jsonld.identifier=e}getName(){return this.jsonld.name}setName(e){this.jsonld.name=e}getText(){return this.jsonld.text}setText(e){this.jsonld.text=e}get(e){return this.jsonld[e]}set(e,t){this.jsonld[e]=t}getSource(){return this.jsonld}}class Mn{id;name;mode="";source;syntax;html;document;css;js;version;headline="";headlineRaw="";lastModificationDate;lastAuthor;canEdit=!0;constructor(e="",t="",i="",r=""){this.document=new ma({}),this.source=i,this.syntax=r,this.html="",this.name=t,this.id=e,this.css=[],this.js=[],this.version=""}toObject(){return{id:this.id,name:this.name,source:this.source,syntax:this.syntax,html:this.html,document:this.document.getSource(),css:this.css,js:this.js,version:this.version}}fromObject(e){this.id=e.id,this.name=e.name,this.source=e.source,this.syntax=e.syntax,this.html=e.html,this.document=new ma(e.document),this.css=e.css,this.js=e.js,this.version=e.version}}var jm=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Ml=(n,e)=>(t,i)=>e(t,i,n);let wr=class{constructor(e){this.loggerConfig=e}module;setModule(e){this.module=e}debug(...e){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&e.unshift(this.module+":"),console.debug.apply(null,e)}info(...e){e.unshift(this.module+":"),console.info.apply(null,e)}warn(...e){e.unshift(this.module+":"),console.warn.apply(null,e)}error(...e){e.unshift(this.module+":"),console.error.apply(null,e)}};wr=jm([it(),Ml(0,Be("LoggerConfig")),Ml(0,Ip())],wr);var Bm=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let va=class{config;computedConfig;defaultLevel;defaultLevelId;levels=new Map;constructor(e="error"){this.config=new Map,this.defaultLevel=e,this.computedConfig=new Map,this.levels.set("error",1),this.levels.set("warn",2),this.levels.set("info",3),this.levels.set("debug",4)}addLevel(e,t){const i=this.levels.get(t);i!=null&&this.config.forEach(r=>{if(r.startsWith(e)){const s=this.computedConfig.get(r);(s==null||i&&i>s)&&i&&this.computedConfig.set(r,i)}})}getLevels(){return this.config}getLevel(e){let t=this.config.get(e);return t||(t=this.defaultLevel),t}getLevelId(e){return this.levels.get(e)||10}setDefaultLevel(e){this.defaultLevel=e,this.defaultLevelId=this.getLevelId(this.defaultLevel)}getDefaultLevel(){return this.defaultLevel}getDefaultLevelId(){return this.defaultLevelId?this.defaultLevelId:(this.defaultLevelId=this.getLevelId(this.defaultLevel),this.defaultLevelId)}hasLevel(e,t){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=this.getLevelId(t);return!!(r&&i>=r)}hasLevelId(e,t){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=t;return!!(r&&i>=r)}};va=Bm([it()],va);var Lm=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},$m=(n,e)=>(t,i)=>e(t,i,n);let xr=class{name;baseURL;baseRestURL;realtimeURL;authenticationBaseURL;authenticationManager;homePage;storage;serverRendering;designSystem;editor;offline;offlineSetup;storageRoot;cristal;logger;constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,t,i,r,s,a,l,d,p){Object.assign(this,{name:e,baseURL:t,baseRestURL:i,homePage:r,serverRendering:s,designSystem:a,offline:l,editor:d,...p})}setConfigFromObject(e){Object.assign(this,e)}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const e=this.cristal.getContainer().get("WrappingStorage");e?(this.logger.debug("Offline local storage is ready"),e.setStorage(this.storage),e.setWikiConfig(this.storage.getWikiConfig()),this.storage=e):this.logger.debug("Failed Looking for wrapping offline storage")}else this.cristal||this.logger.debug("Cristal not initialized"),this.offline||this.logger.debug("Offline mode not activated")}isSupported(e){return e=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}getType(){return"Default"}getNewPageDefaultName(){return"newpage"}};xr=Lm([it(),$m(0,Be("Logger"))],xr);var Fm=Object.getOwnPropertyDescriptor,Dm=(n,e,t,i)=>{for(var r=i>1?void 0:i?Fm(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let ya=class{wikiConfig;container;availableConfigurations;constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(n){this.container=n}getWikiConfig(){return this.wikiConfig}setWikiConfig(n){this.wikiConfig=n}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(n){for(const e in n){const t=n[e],i=t?.configType;if(t){const r=this.container.get("WikiConfig",{name:i});r.setConfigFromObject(t),this.availableConfigurations.set(e,r)}}}getAvailableConfigurations(){return this.availableConfigurations}deleteAvailableConfiguration(n){this.availableConfigurations.delete(n)}run(){throw new Error("Method not implemented.")}getUIXTemplates(){throw new Error("Method not implemented.")}getMenuEntries(){throw new Error("Method not implemented.")}getCurrentPage(){throw new Error("Method not implemented.")}getCurrentContent(){throw new Error("Method not implemented.")}getCurrentSource(){throw new Error("Method not implemented.")}getCurrentSyntax(){throw new Error("Method not implemented.")}setCurrentPage(){throw new Error("Method not implemented.")}setContentRef(){throw new Error("Method not implemented.")}loadPageFromURL(){throw new Error("Method not implemented.")}loadPage(){throw new Error("Method not implemented.")}getPage(){throw new Error("Method not implemented.")}getLogger(){return new wr}getLoggerConfig(){throw new Error("Method not implemented.")}};ya=Dm([it()],ya);var Um=Object.getOwnPropertyDescriptor,qm=(n,e,t,i)=>{for(var r=i>1?void 0:i?Um(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let ba=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};ba=qm([it()],ba);let df;const vc=n=>df=n,Km=Symbol();function wa(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var lr;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(lr||(lr={}));const hf=()=>{};function Rl(n,e,t,i=hf){n.add(e);const r=()=>{n.delete(e)&&i()};return!t&&ru()&&eh(r),r}function wi(n,...e){n.forEach(t=>{t(...e)})}const Vm=n=>n(),jl=Symbol(),Ho=Symbol();function xa(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],r=n[t];wa(r)&&wa(i)&&n.hasOwnProperty(t)&&!lt(i)&&!Tn(i)?n[t]=xa(r,i):n[t]=i}return n}const zm=Symbol();function Wm(n){return!wa(n)||!Object.prototype.hasOwnProperty.call(n,zm)}const{assign:Cn}=Object;function Hm(n){return!!(lt(n)&&n.effect)}function Gm(n,e,t,i){const{state:r,actions:s,getters:a}=e,l=t.state.value[n];let d;function p(){l||(t.state.value[n]=r?r():{});const y=Ch(t.state.value[n]);return Cn(y,s,Object.keys(a||{}).reduce((m,w)=>(m[w]=wh(Au(()=>{vc(t);const P=t._s.get(n);return a[w].call(P,P)})),m),{}))}return d=pf(n,p,e,t,i,!0),d}function pf(n,e,t={},i,r,s){let a;const l=Cn({actions:{}},t),d={deep:!0};let p,y,m=new Set,w=new Set,P;const K=i.state.value[n];!s&&!K&&(i.state.value[n]={});let O;function D(Y){let ge;p=y=!1,typeof Y=="function"?(Y(i.state.value[n]),ge={type:lr.patchFunction,storeId:n,events:P}):(xa(i.state.value[n],Y),ge={type:lr.patchObject,payload:Y,storeId:n,events:P});const Re=O=Symbol();Rh().then(()=>{O===Re&&(p=!0)}),y=!0,wi(m,ge,i.state.value[n])}const ee=s?function(){const{state:ge}=t,Re=ge?ge():{};this.$patch(We=>{Cn(We,Re)})}:hf;function J(){a.stop(),m.clear(),w.clear(),i._s.delete(n)}const oe=(Y,ge="")=>{if(jl in Y)return Y[Ho]=ge,Y;const Re=function(){vc(i);const We=Array.from(arguments),ke=new Set,rt=new Set;function mn(tt){ke.add(tt)}function zt(tt){rt.add(tt)}wi(w,{args:We,name:Re[Ho],store:Z,after:mn,onError:zt});let ft;try{ft=Y.apply(this&&this.$id===n?this:Z,We)}catch(tt){throw wi(rt,tt),tt}return ft instanceof Promise?ft.then(tt=>(wi(ke,tt),tt)).catch(tt=>(wi(rt,tt),Promise.reject(tt))):(wi(ke,ft),ft)};return Re[jl]=!0,Re[Ho]=ge,Re},G={_p:i,$id:n,$onAction:Rl.bind(null,w),$patch:D,$reset:ee,$subscribe(Y,ge={}){const Re=Rl(m,Y,ge.detached,()=>We()),We=a.run(()=>Kh(()=>i.state.value[n],ke=>{(ge.flush==="sync"?y:p)&&Y({storeId:n,type:lr.direct,events:P},ke)},Cn({},d,ge)));return Re},$dispose:J},Z=nc(G);i._s.set(n,Z);const fe=(i._a&&i._a.runWithContext||Vm)(()=>i._e.run(()=>(a=Zd()).run(()=>e({action:oe}))));for(const Y in fe){const ge=fe[Y];if(lt(ge)&&!Hm(ge)||Tn(ge))s||(K&&Wm(ge)&&(lt(ge)?ge.value=K[Y]:xa(ge,K[Y])),i.state.value[n][Y]=ge);else if(typeof ge=="function"){const Re=oe(ge,Y);fe[Y]=Re,l.actions[Y]=ge}}return Cn(Z,fe),Cn(Me(Z),fe),Object.defineProperty(Z,"$state",{get:()=>i.state.value[n],set:Y=>{D(ge=>{Cn(ge,Y)})}}),i._p.forEach(Y=>{Cn(Z,a.run(()=>Y({store:Z,app:i._a,pinia:i,options:l})))}),K&&s&&t.hydrate&&t.hydrate(Z.$state,K),p=!0,y=!0,Z}function Ym(n,e,t){let i;const r=typeof e=="function";i=r?t:e;function s(a,l){const d=Dh();return a=a||(d?Cu(Km,null):null),a&&vc(a),a=df,a._s.has(n)||(r?pf(n,e,i,a):Gm(n,i,a)),a._s.get(n)}return s.$id=n,s}function Jm(n){const e=Me(n),t={};for(const i in e){const r=e[i];r.effect?t[i]=Au({get:()=>n[i],set(s){n[i]=s}}):(lt(r)||Tn(r))&&(t[i]=Ah(n,i))}return t}var Xm=Object.getOwnPropertyDescriptor,Qm=(n,e,t,i)=>{for(var r=i>1?void 0:i?Xm(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};const Zm=Ym("alerts",{state(){return{alerts:[],id:0}},actions:{createAlert(n,e,t){const i=this.alerts.find(r=>r.type==n&&r.message==e&&r.actions==t);i?i.duplicatesCount++:this.alerts.push({id:this.id++,type:n,message:e,actions:t,duplicatesCount:0})},deleteAlert(n){for(const e of this.alerts.keys())if(this.alerts[e].id==n){this.alerts.splice(e,1);break}}}});let Sa=class{refs;store;constructor(){this.store=Zm(),this.refs=Jm(this.store)}list(){return this.refs.alerts}info(n,e){this.store.createAlert("info",n,e)}success(n,e){this.store.createAlert("success",n,e)}warning(n,e){this.store.createAlert("warning",n,e)}error(n,e){this.store.createAlert("error",n,e)}dismiss(n){this.store.deleteAlert(n)}};Sa=Qm([it()],Sa);var ev=Object.getOwnPropertyDescriptor,tv=(n,e,t,i)=>{for(var r=i>1?void 0:i?ev(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},nv=(n,e)=>(t,i)=>e(t,i,n);let _a=class{constructor(n){this.cristal=n}get(){return this.cristal.getContainer().get("AlertsService")}};_a=tv([it(),nv(0,Be("CristalApp"))],_a);let iv=class{constructor(e){e.bind("AlertsService").to(Sa).inSingletonScope(),e.bind("AlertsServiceProvider").to(_a).inSingletonScope()}};var rv=Object.getOwnPropertyDescriptor,sv=(n,e,t,i)=>{for(var r=i>1?void 0:i?rv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ov=(n,e)=>(t,i)=>e(t,i,n);let ka=class{constructor(n){this.cristalApp=n}get(n){const e=n??this.cristalApp.getWikiConfig().authenticationManager??this.cristalApp.getWikiConfig().getType();try{return this.cristalApp.getContainer().get("AuthenticationManager",{name:e})}catch(t){this.cristalApp.getLogger("authentication.api").warn(`Couldn't resolve AuthenticationManager for type=[${e}]`,t);return}}};ka=sv([it(),ov(0,Be("CristalApp"))],ka);let av=class{constructor(e){e.bind("AuthenticationManagerProvider").to(ka).inSingletonScope()}};var xs={exports:{}},cv=xs.exports,Bl;function lv(){return Bl||(Bl=1,(function(n,e){((t,i)=>{n.exports=i()})(cv,function(){var t=function(o,c){return(t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,f){u.__proto__=f}:function(u,f){for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(u[h]=f[h])}))(o,c)},i=function(){return(i=Object.assign||function(o){for(var c,u=1,f=arguments.length;u<f;u++)for(var h in c=arguments[u])Object.prototype.hasOwnProperty.call(c,h)&&(o[h]=c[h]);return o}).apply(this,arguments)};function r(o,c,u){for(var f,h=0,g=c.length;h<g;h++)!f&&h in c||((f=f||Array.prototype.slice.call(c,0,h))[h]=c[h]);return o.concat(f||Array.prototype.slice.call(c))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:dr,a=Object.keys,l=Array.isArray;function d(o,c){return typeof c=="object"&&a(c).forEach(function(u){o[u]=c[u]}),o}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var p=Object.getPrototypeOf,y={}.hasOwnProperty;function m(o,c){return y.call(o,c)}function w(o,c){typeof c=="function"&&(c=c(p(o))),(typeof Reflect>"u"?a:Reflect.ownKeys)(c).forEach(function(u){K(o,u,c[u])})}var P=Object.defineProperty;function K(o,c,u,f){P(o,c,d(u&&m(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},f))}function O(o){return{from:function(c){return o.prototype=Object.create(c.prototype),K(o.prototype,"constructor",o),{extend:w.bind(null,o.prototype)}}}}var D=Object.getOwnPropertyDescriptor,ee=[].slice;function J(o,c,u){return ee.call(o,c,u)}function oe(o,c){return c(o)}function G(o){if(!o)throw new Error("Assertion Failed")}function Z(o){s.setImmediate?setImmediate(o):setTimeout(o,0)}function ae(o,c){if(typeof c=="string"&&m(o,c))return o[c];if(!c)return o;if(typeof c!="string"){for(var u=[],f=0,h=c.length;f<h;++f){var g=ae(o,c[f]);u.push(g)}return u}var v,b=c.indexOf(".");return b===-1||(v=o[c.substr(0,b)])==null?void 0:ae(v,c.substr(b+1))}function fe(o,c,u){if(o&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(o)))if(typeof c!="string"&&"length"in c){G(typeof u!="string"&&"length"in u);for(var f=0,h=c.length;f<h;++f)fe(o,c[f],u[f])}else{var g,v,b=c.indexOf(".");b!==-1?(g=c.substr(0,b),(b=c.substr(b+1))===""?u===void 0?l(o)&&!isNaN(parseInt(g))?o.splice(g,1):delete o[g]:o[g]=u:fe(v=(v=o[g])&&m(o,g)?v:o[g]={},b,u)):u===void 0?l(o)&&!isNaN(parseInt(c))?o.splice(c,1):delete o[c]:o[c]=u}}function Y(o){var c,u={};for(c in o)m(o,c)&&(u[c]=o[c]);return u}var ge=[].concat;function Re(o){return ge.apply([],o)}var _t="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Re([8,16,32,64].map(function(o){return["Int","Uint","Float"].map(function(c){return c+o+"Array"})}))).filter(function(o){return s[o]}),We=new Set(_t.map(function(o){return s[o]})),ke=null;function rt(o){return ke=new WeakMap,o=(function c(u){if(!u||typeof u!="object")return u;var f=ke.get(u);if(f)return f;if(l(u)){f=[],ke.set(u,f);for(var h=0,g=u.length;h<g;++h)f.push(c(u[h]))}else if(We.has(u.constructor))f=u;else{var v,b=p(u);for(v in f=b===Object.prototype?{}:Object.create(b),ke.set(u,f),u)m(u,v)&&(f[v]=c(u[v]))}return f})(o),ke=null,o}var mn={}.toString;function zt(o){return mn.call(o).slice(8,-1)}var ft=typeof Symbol<"u"?Symbol.iterator:"@@iterator",tt=typeof ft=="symbol"?function(o){var c;return o!=null&&(c=o[ft])&&c.apply(o)}:function(){return null};function pe(o,c){c=o.indexOf(c),0<=c&&o.splice(c,1)}var dt={};function St(o){var c,u,f,h;if(arguments.length===1){if(l(o))return o.slice();if(this===dt&&typeof o=="string")return[o];if(h=tt(o))for(u=[];!(f=h.next()).done;)u.push(f.value);else{if(o==null)return[o];if(typeof(c=o.length)!="number")return[o];for(u=new Array(c);c--;)u[c]=o[c]}}else for(c=arguments.length,u=new Array(c);c--;)u[c]=arguments[c];return u}var Ue=typeof Symbol<"u"?function(o){return o[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},_t=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],X=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(_t),ve={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ht(o,c){this.name=o,this.message=c}function ci(o,c){return o+". Errors: "+Object.keys(c).map(function(u){return c[u].toString()}).filter(function(u,f,h){return h.indexOf(u)===f}).join(`
|
|
49
|
-
`)}function Ae(o,c,u,f){this.failures=c,this.failedKeys=f,this.successCount=u,this.message=ci(o,c)}function Wt(o,c){this.name="BulkError",this.failures=Object.keys(c).map(function(u){return c[u]}),this.failuresByPos=c,this.message=ci(o,this.failures)}O(ht).from(Error).extend({toString:function(){return this.name+": "+this.message}}),O(Ae).from(ht),O(Wt).from(ht);var Xt=X.reduce(function(o,c){return o[c]=c+"Error",o},{}),$n=ht,de=X.reduce(function(o,c){var u=c+"Error";function f(h,g){this.name=u,h?typeof h=="string"?(this.message="".concat(h).concat(g?`
|
|
50
|
-
`+g:""),this.inner=g||null):typeof h=="object"&&(this.message="".concat(h.name," ").concat(h.message),this.inner=h):(this.message=ve[c]||u,this.inner=null)}return O(f).from($n),o[c]=f,o},{}),pt=(de.Syntax=SyntaxError,de.Type=TypeError,de.Range=RangeError,_t.reduce(function(o,c){return o[c+"Error"]=de[c],o},{}));_t=X.reduce(function(o,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(o[c+"Error"]=de[c]),o},{});function Pe(){}function At(o){return o}function Fn(o,c){return o==null||o===At?c:function(u){return c(o(u))}}function Mt(o,c){return function(){o.apply(this,arguments),c.apply(this,arguments)}}function sn(o,c){return o===Pe?c:function(){var u=o.apply(this,arguments),f=(u!==void 0&&(arguments[0]=u),this.onsuccess),h=this.onerror,g=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?Mt(f,this.onsuccess):f),h&&(this.onerror=this.onerror?Mt(h,this.onerror):h),g!==void 0?g:u}}function Qt(o,c){return o===Pe?c:function(){o.apply(this,arguments);var u=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?Mt(u,this.onsuccess):u),f&&(this.onerror=this.onerror?Mt(f,this.onerror):f)}}function li(o,c){return o===Pe?c:function(h){var f=o.apply(this,arguments),h=(d(h,f),this.onsuccess),g=this.onerror,v=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return h&&(this.onsuccess=this.onsuccess?Mt(h,this.onsuccess):h),g&&(this.onerror=this.onerror?Mt(g,this.onerror):g),f===void 0?v===void 0?void 0:v:d(f,v)}}function ui(o,c){return o===Pe?c:function(){return c.apply(this,arguments)!==!1&&o.apply(this,arguments)}}function vn(o,c){return o===Pe?c:function(){var u=o.apply(this,arguments);if(u&&typeof u.then=="function"){for(var f=this,h=arguments.length,g=new Array(h);h--;)g[h]=arguments[h];return u.then(function(){return c.apply(f,g)})}return c.apply(this,arguments)}}_t.ModifyError=Ae,_t.DexieError=ht,_t.BulkError=Wt;var mt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Rt(o){mt=o}var $={},V=100,z=typeof Promise>"u"?[]:(X=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[z=crypto.subtle.digest("SHA-512",new Uint8Array([0])),p(z),X]:[X,p(X),X]),X=z[0],mi=z[1],mi=mi&&mi.then,he=X&&X.constructor,st=!!z[2],Ke=function(o,c){ye.push([o,c]),nt&&(queueMicrotask(Pt),nt=!1)},vt=!0,nt=!0,S=[],T=[],M=At,U={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pe,pgp:!1,env:{},finalize:Pe},F=U,ye=[],xe=0,be=[];function L(o){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=F;if(typeof o!="function"){if(o!==$)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&ue(this,this._value)}else this._state=null,this._value=null,++c.ref,(function u(f,h){try{h(function(g){if(f._state===null){if(g===f)throw new TypeError("A promise cannot be resolved with itself.");var v=f._lib&&on();g&&typeof g.then=="function"?u(f,function(b,k){g instanceof L?g._then(b,k):g.then(b,k)}):(f._state=!0,f._value=g,Se(f)),v&&yn()}},ue.bind(null,f))}catch(g){ue(f,g)}})(this,o)}var re={get:function(){var o=F,c=qr;function u(f,h){var g=this,v=!o.global&&(o!==F||c!==qr),b=v&&!wn(),k=new L(function(R,C){je(g,new ce(Lc(f,o,v,b),Lc(h,o,v,b),R,C,o))});return this._consoleTask&&(k._consoleTask=this._consoleTask),k}return u.prototype=$,u},set:function(o){K(this,"then",o&&o.prototype===$?re:{get:function(){return o},set:re.set})}};function ce(o,c,u,f,h){this.onFulfilled=typeof o=="function"?o:null,this.onRejected=typeof c=="function"?c:null,this.resolve=u,this.reject=f,this.psd=h}function ue(o,c){var u,f;T.push(c),o._state===null&&(u=o._lib&&on(),c=M(c),o._state=!1,o._value=c,f=o,S.some(function(h){return h._value===f._value})||S.push(f),Se(o),u)&&yn()}function Se(o){var c=o._listeners;o._listeners=[];for(var u=0,f=c.length;u<f;++u)je(o,c[u]);var h=o._PSD;--h.ref||h.finalize(),xe===0&&(++xe,Ke(function(){--xe==0&&Ui()},[]))}function je(o,c){if(o._state===null)o._listeners.push(c);else{var u=o._state?c.onFulfilled:c.onRejected;if(u===null)return(o._state?c.resolve:c.reject)(o._value);++c.psd.ref,++xe,Ke(Ve,[u,o,c])}}function Ve(o,c,u){try{var f,h=c._value;!c._state&&T.length&&(T=[]),f=mt&&c._consoleTask?c._consoleTask.run(function(){return o(h)}):o(h),c._state||T.indexOf(h)!==-1||(g=>{for(var v=S.length;v;)if(S[--v]._value===g._value)return S.splice(v,1)})(c),u.resolve(f)}catch(g){u.reject(g)}finally{--xe==0&&Ui(),--u.psd.ref||u.psd.finalize()}}function Pt(){Dn(U,function(){on()&&yn()})}function on(){var o=vt;return nt=vt=!1,o}function yn(){var o,c,u;do for(;0<ye.length;)for(o=ye,ye=[],u=o.length,c=0;c<u;++c){var f=o[c];f[0].apply(null,f[1])}while(0<ye.length);nt=vt=!0}function Ui(){for(var o=S,c=(S=[],o.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),be.slice(0)),u=c.length;u;)c[--u]()}function Fr(o){return new L($,!1,o)}function qe(o,c){var u=F;return function(){var f=on(),h=F;try{return xn(u,!0),o.apply(this,arguments)}catch(g){c&&c(g)}finally{xn(h,!1),f&&yn()}}}w(L.prototype,{then:re,_then:function(o,c){je(this,new ce(null,null,o,c,F))},catch:function(o){var c,u;return arguments.length===1?this.then(null,o):(c=o,u=arguments[1],typeof c=="function"?this.then(null,function(f){return(f instanceof c?u:Fr)(f)}):this.then(null,function(f){return(f&&f.name===c?u:Fr)(f)}))},finally:function(o){return this.then(function(c){return L.resolve(o()).then(function(){return c})},function(c){return L.resolve(o()).then(function(){return Fr(c)})})},timeout:function(o,c){var u=this;return o<1/0?new L(function(f,h){var g=setTimeout(function(){return h(new de.Timeout(c))},o);u.then(f,h).finally(clearTimeout.bind(null,g))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&K(L.prototype,Symbol.toStringTag,"Dexie.Promise"),U.env=Bc(),w(L,{all:function(){var o=St.apply(null,arguments).map(Kr);return new L(function(c,u){o.length===0&&c([]);var f=o.length;o.forEach(function(h,g){return L.resolve(h).then(function(v){o[g]=v,--f||c(o)},u)})})},resolve:function(o){return o instanceof L?o:o&&typeof o.then=="function"?new L(function(c,u){o.then(c,u)}):new L($,!0,o)},reject:Fr,race:function(){var o=St.apply(null,arguments).map(Kr);return new L(function(c,u){o.map(function(f){return L.resolve(f).then(c,u)})})},PSD:{get:function(){return F},set:function(o){return F=o}},totalEchoes:{get:function(){return qr}},newPSD:bn,usePSD:Dn,scheduler:{get:function(){return Ke},set:function(o){Ke=o}},rejectionMapper:{get:function(){return M},set:function(o){M=o}},follow:function(o,c){return new L(function(u,f){return bn(function(h,g){var v=F;v.unhandleds=[],v.onunhandled=g,v.finalize=Mt(function(){var b,k=this;b=function(){k.unhandleds.length===0?h():g(k.unhandleds[0])},be.push(function R(){b(),be.splice(be.indexOf(R),1)}),++xe,Ke(function(){--xe==0&&Ui()},[])},v.finalize),o()},c,u,f)})}}),he&&(he.allSettled&&K(L,"allSettled",function(){var o=St.apply(null,arguments).map(Kr);return new L(function(c){o.length===0&&c([]);var u=o.length,f=new Array(u);o.forEach(function(h,g){return L.resolve(h).then(function(v){return f[g]={status:"fulfilled",value:v}},function(v){return f[g]={status:"rejected",reason:v}}).then(function(){return--u||c(f)})})})}),he.any&&typeof AggregateError<"u"&&K(L,"any",function(){var o=St.apply(null,arguments).map(Kr);return new L(function(c,u){o.length===0&&u(new AggregateError([]));var f=o.length,h=new Array(f);o.forEach(function(g,v){return L.resolve(g).then(function(b){return c(b)},function(b){h[v]=b,--f||u(new AggregateError(h))})})})}),he.withResolvers)&&(L.withResolvers=he.withResolvers);var at={awaits:0,echoes:0,id:0},vd=0,Dr=[],Ur=0,qr=0,yd=0;function bn(o,v,u,f){var h=F,g=Object.create(h),v=(g.parent=h,g.ref=0,g.global=!1,g.id=++yd,U.env,g.env=st?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject}:{},v&&d(g,v),++h.ref,g.finalize=function(){--this.parent.ref||this.parent.finalize()},Dn(g,o,u,f));return g.ref===0&&g.finalize(),v}function fi(){return at.id||(at.id=++vd),++at.awaits,at.echoes+=V,at.id}function wn(){return!!at.awaits&&(--at.awaits==0&&(at.id=0),at.echoes=at.awaits*V,!0)}function Kr(o){return at.echoes&&o&&o.constructor===he?(fi(),o.then(function(c){return wn(),c},function(c){return wn(),Ge(c)})):o}function bd(){var o=Dr[Dr.length-1];Dr.pop(),xn(o,!1)}function xn(o,c){var u,f,h=F;(c?!at.echoes||Ur++&&o===F:!Ur||--Ur&&o===F)||queueMicrotask(c?function(g){++qr,at.echoes&&--at.echoes!=0||(at.echoes=at.awaits=at.id=0),Dr.push(F),xn(g,!0)}.bind(null,o):bd),o!==F&&(F=o,h===U&&(U.env=Bc()),st)&&(u=U.env.Promise,f=o.env,h.global||o.global)&&(Object.defineProperty(s,"Promise",f.PromiseProp),u.all=f.all,u.race=f.race,u.resolve=f.resolve,u.reject=f.reject,f.allSettled&&(u.allSettled=f.allSettled),f.any)&&(u.any=f.any)}function Bc(){var o=s.Promise;return st?{Promise:o,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:o.all,race:o.race,allSettled:o.allSettled,any:o.any,resolve:o.resolve,reject:o.reject}:{}}function Dn(o,c,u,f,h){var g=F;try{return xn(o,!0),c(u,f,h)}finally{xn(g,!1)}}function Lc(o,c,u,f){return typeof o!="function"?o:function(){var h=F;u&&fi(),xn(c,!0);try{return o.apply(this,arguments)}finally{xn(h,!1),f&&queueMicrotask(wn)}}}function ao(o){Promise===he&&at.echoes===0?Ur===0?o():enqueueNativeMicroTask(o):setTimeout(o,0)}(""+mi).indexOf("[native code]")===-1&&(fi=wn=Pe);var Ge=L.reject,Un="",an="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$c="String expected.",di=[],Vr="__dbnames",co="readonly",lo="readwrite";function qn(o,c){return o?c?function(){return o.apply(this,arguments)&&c.apply(this,arguments)}:o:c}var Fc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function zr(o){return typeof o!="string"||/\./.test(o)?function(c){return c}:function(c){return c[o]===void 0&&o in c&&delete(c=rt(c))[o],c}}function Dc(){throw de.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Ie(o,c){try{var u=Uc(o),f=Uc(c);if(u!==f)return u==="Array"?1:f==="Array"?-1:u==="binary"?1:f==="binary"?-1:u==="string"?1:f==="string"?-1:u==="Date"?1:f!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return c<o?1:o<c?-1:0;case"binary":for(var h=qc(o),g=qc(c),v=h.length,b=g.length,k=v<b?v:b,R=0;R<k;++R)if(h[R]!==g[R])return h[R]<g[R]?-1:1;return v===b?0:v<b?-1:1;case"Array":for(var C=o,x=c,I=C.length,A=x.length,E=I<A?I:A,_=0;_<E;++_){var j=Ie(C[_],x[_]);if(j!==0)return j}return I===A?0:I<A?-1:1}}catch{}return NaN}function Uc(o){var c=typeof o;return c=="object"&&(ArrayBuffer.isView(o)||(c=zt(o))==="ArrayBuffer")?"binary":c}function qc(o){return o instanceof Uint8Array?o:ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o)}function Wr(o,c,u){var f=o.schema.yProps;return f?(c&&0<u.numFailures&&(c=c.filter(function(h,g){return!u.failures[g]})),Promise.all(f.map(function(h){return h=h.updatesTable,c?o.db.table(h).where("k").anyOf(c).delete():o.db.table(h).clear()})).then(function(){return u})):u}Kc.prototype.execute=function(o){var c=this["@@propmod"];if(c.add!==void 0){var u=c.add;if(l(u))return r(r([],l(o)?o:[],!0),u).sort();if(typeof u=="number")return(Number(o)||0)+u;if(typeof u=="bigint")try{return BigInt(o)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(c.remove!==void 0){var f=c.remove;if(l(f))return l(o)?o.filter(function(h){return!f.includes(h)}).sort():[];if(typeof f=="number")return Number(o)-f;if(typeof f=="bigint")try{return BigInt(o)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return u=(u=c.replacePrefix)==null?void 0:u[0],u&&typeof o=="string"&&o.startsWith(u)?c.replacePrefix[1]+o.substring(u.length):o};var qi=Kc;function Kc(o){this["@@propmod"]=o}function Vc(o,c){for(var u=a(c),f=u.length,h=!1,g=0;g<f;++g){var v=u[g],b=c[v],k=ae(o,v);b instanceof qi?(fe(o,v,b.execute(k)),h=!0):k!==b&&(fe(o,v,b),h=!0)}return h}$e.prototype._trans=function(o,c,u){var f=this._tx||F.trans,h=this.name,g=mt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(o==="readonly"?"read":"write"," ").concat(this.name));function v(R,C,x){if(x.schema[h])return c(x.idbtrans,x);throw new de.NotFound("Table "+h+" not part of transaction")}var b=on();try{var k=f&&f.db._novip===this.db._novip?f===F.trans?f._promise(o,v,u):bn(function(){return f._promise(o,v,u)},{trans:f,transless:F.transless||F}):(function R(C,x,I,A){if(C.idbdb&&(C._state.openComplete||F.letThrough||C._vip)){var E=C._createTransaction(x,I,C._dbSchema);try{E.create(),C._state.PR1398_maxLoop=3}catch(_){return _.name===Xt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return R(C,x,I,A)})):Ge(_)}return E._promise(x,function(_,j){return bn(function(){return F.trans=E,A(_,j,E)})}).then(function(_){if(x==="readwrite")try{E.idbtrans.commit()}catch{}return x==="readonly"?_:E._completion.then(function(){return _})})}if(C._state.openComplete)return Ge(new de.DatabaseClosed(C._state.dbOpenError));if(!C._state.isBeingOpened){if(!C._state.autoOpen)return Ge(new de.DatabaseClosed);C.open().catch(Pe)}return C._state.dbReadyPromise.then(function(){return R(C,x,I,A)})})(this.db,o,[this.name],v);return g&&(k._consoleTask=g,k=k.catch(function(R){return console.trace(R),Ge(R)})),k}finally{b&&yn()}},$e.prototype.get=function(o,c){var u=this;return o&&o.constructor===Object?this.where(o).first(c):o==null?Ge(new de.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return u.core.get({trans:f,key:o}).then(function(h){return u.hook.reading.fire(h)})}).then(c)},$e.prototype.where=function(o){if(typeof o=="string")return new this.db.WhereClause(this,o);if(l(o))return new this.db.WhereClause(this,"[".concat(o.join("+"),"]"));var c=a(o);if(c.length===1)return this.where(c[0]).equals(o[c[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(b){if(b.compound&&c.every(function(R){return 0<=b.keyPath.indexOf(R)})){for(var k=0;k<c.length;++k)if(c.indexOf(b.keyPath[k])===-1)return!1;return!0}return!1}).sort(function(b,k){return b.keyPath.length-k.keyPath.length})[0];if(u&&this.db._maxKey!==Un)return v=u.keyPath.slice(0,c.length),this.where(v).equals(v.map(function(b){return o[b]}));!u&&mt&&console.warn("The query ".concat(JSON.stringify(o)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var f=this.schema.idxByName;function h(b,k){return Ie(b,k)===0}var v=c.reduce(function(C,k){var R=C[0],C=C[1],x=f[k],I=o[k];return[R||x,R||!x?qn(C,x&&x.multi?function(A){return A=ae(A,k),l(A)&&A.some(function(E){return h(I,E)})}:function(A){return h(I,ae(A,k))}):C]},[null,null]),g=v[0],v=v[1];return g?this.where(g.name).equals(o[g.keyPath]).filter(v):u?this.filter(v):this.where(c).equals("")},$e.prototype.filter=function(o){return this.toCollection().and(o)},$e.prototype.count=function(o){return this.toCollection().count(o)},$e.prototype.offset=function(o){return this.toCollection().offset(o)},$e.prototype.limit=function(o){return this.toCollection().limit(o)},$e.prototype.each=function(o){return this.toCollection().each(o)},$e.prototype.toArray=function(o){return this.toCollection().toArray(o)},$e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$e.prototype.orderBy=function(o){return new this.db.Collection(new this.db.WhereClause(this,l(o)?"[".concat(o.join("+"),"]"):o))},$e.prototype.reverse=function(){return this.toCollection().reverse()},$e.prototype.mapToClass=function(o){for(var c=this.db,u=this.name,f=((this.schema.mappedClass=o).prototype instanceof Dc&&(o=(v=>{var b=C,k=v;if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function R(){this.constructor=b}function C(){return v!==null&&v.apply(this,arguments)||this}return t(b,k),b.prototype=k===null?Object.create(k):(R.prototype=k.prototype,new R),Object.defineProperty(C.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),C.prototype.table=function(){return u},C})(o)),new Set),h=o.prototype;h;h=p(h))Object.getOwnPropertyNames(h).forEach(function(v){return f.add(v)});function g(v){if(!v)return v;var b,k=Object.create(o.prototype);for(b in v)if(!f.has(b))try{k[b]=v[b]}catch{}return k}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=g,this.hook("reading",g),o},$e.prototype.defineClass=function(){return this.mapToClass(function(o){d(this,o)})},$e.prototype.add=function(o,c){var u=this,f=this.schema.primKey,h=f.auto,g=f.keyPath,v=o;return g&&h&&(v=zr(g)(o)),this._trans("readwrite",function(b){return u.core.mutate({trans:b,type:"add",keys:c!=null?[c]:null,values:[v]})}).then(function(b){return b.numFailures?L.reject(b.failures[0]):b.lastResult}).then(function(b){if(g)try{fe(o,g,b)}catch{}return b})},$e.prototype.upsert=function(o,c){var u=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(h){return u.core.get({trans:h,key:o}).then(function(g){var v=g??{};return Vc(v,c),f&&fe(v,f,o),u.core.mutate({trans:h,type:"put",values:[v],keys:[o],upsert:!0,updates:{keys:[o],changeSpecs:[c]}}).then(function(b){return b.numFailures?L.reject(b.failures[0]):!!g})})})},$e.prototype.update=function(o,c){return typeof o!="object"||l(o)?this.where(":id").equals(o).modify(c):(o=ae(o,this.schema.primKey.keyPath))===void 0?Ge(new de.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(c)},$e.prototype.put=function(o,c){var u=this,f=this.schema.primKey,h=f.auto,g=f.keyPath,v=o;return g&&h&&(v=zr(g)(o)),this._trans("readwrite",function(b){return u.core.mutate({trans:b,type:"put",values:[v],keys:c!=null?[c]:null})}).then(function(b){return b.numFailures?L.reject(b.failures[0]):b.lastResult}).then(function(b){if(g)try{fe(o,g,b)}catch{}return b})},$e.prototype.delete=function(o){var c=this;return this._trans("readwrite",function(u){return c.core.mutate({trans:u,type:"delete",keys:[o]}).then(function(f){return Wr(c,[o],f)}).then(function(f){return f.numFailures?L.reject(f.failures[0]):void 0})})},$e.prototype.clear=function(){var o=this;return this._trans("readwrite",function(c){return o.core.mutate({trans:c,type:"deleteRange",range:Fc}).then(function(u){return Wr(o,null,u)})}).then(function(c){return c.numFailures?L.reject(c.failures[0]):void 0})},$e.prototype.bulkGet=function(o){var c=this;return this._trans("readonly",function(u){return c.core.getMany({keys:o,trans:u}).then(function(f){return f.map(function(h){return c.hook.reading.fire(h)})})})},$e.prototype.bulkAdd=function(o,c,u){var f=this,h=Array.isArray(c)?c:void 0,g=(u=u||(h?void 0:c))?u.allKeys:void 0;return this._trans("readwrite",function(v){var b=f.schema.primKey,R=b.auto,b=b.keyPath;if(b&&h)throw new de.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(h&&h.length!==o.length)throw new de.InvalidArgument("Arguments objects and keys must have the same length");var k=o.length,R=b&&R?o.map(zr(b)):o;return f.core.mutate({trans:v,type:"add",keys:h,values:R,wantResults:g}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return g?C.results:C.lastResult;throw new Wt("".concat(f.name,".bulkAdd(): ").concat(x," of ").concat(k," operations failed"),I)})})},$e.prototype.bulkPut=function(o,c,u){var f=this,h=Array.isArray(c)?c:void 0,g=(u=u||(h?void 0:c))?u.allKeys:void 0;return this._trans("readwrite",function(v){var b=f.schema.primKey,R=b.auto,b=b.keyPath;if(b&&h)throw new de.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(h&&h.length!==o.length)throw new de.InvalidArgument("Arguments objects and keys must have the same length");var k=o.length,R=b&&R?o.map(zr(b)):o;return f.core.mutate({trans:v,type:"put",keys:h,values:R,wantResults:g}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return g?C.results:C.lastResult;throw new Wt("".concat(f.name,".bulkPut(): ").concat(x," of ").concat(k," operations failed"),I)})})},$e.prototype.bulkUpdate=function(o){var c=this,u=this.core,f=o.map(function(v){return v.key}),h=o.map(function(v){return v.changes}),g=[];return this._trans("readwrite",function(v){return u.getMany({trans:v,keys:f,cache:"clone"}).then(function(b){var k=[],R=[],C=(o.forEach(function(x,I){var A=x.key,E=x.changes,_=b[I];if(_){for(var j=0,B=Object.keys(E);j<B.length;j++){var N=B[j],q=E[N];if(N===c.schema.primKey.keyPath){if(Ie(q,A)!==0)throw new de.Constraint("Cannot update primary key in bulkUpdate()")}else fe(_,N,q)}g.push(I),k.push(A),R.push(_)}}),k.length);return u.mutate({trans:v,type:"put",keys:k,values:R,updates:{keys:f,changeSpecs:h}}).then(function(x){var I=x.numFailures,A=x.failures;if(I===0)return C;for(var E=0,_=Object.keys(A);E<_.length;E++){var j,B=_[E],N=g[Number(B)];N!=null&&(j=A[B],delete A[B],A[N]=j)}throw new Wt("".concat(c.name,".bulkUpdate(): ").concat(I," of ").concat(C," operations failed"),A)})})})},$e.prototype.bulkDelete=function(o){var c=this,u=o.length;return this._trans("readwrite",function(f){return c.core.mutate({trans:f,type:"delete",keys:o}).then(function(h){return Wr(c,o,h)})}).then(function(f){var h=f.numFailures,g=f.failures;if(h===0)return f.lastResult;throw new Wt("".concat(c.name,".bulkDelete(): ").concat(h," of ").concat(u," operations failed"),g)})};var zc=$e;function $e(){}function Ki(o){function c(v,b){if(b){for(var k=arguments.length,R=new Array(k-1);--k;)R[k-1]=arguments[k];return u[v].subscribe.apply(null,R),o}if(typeof v=="string")return u[v]}var u={};c.addEventType=g;for(var f=1,h=arguments.length;f<h;++f)g(arguments[f]);return c;function g(v,b,k){var R,C;if(typeof v!="object")return b=b||ui,C={subscribers:[],fire:k=k||Pe,subscribe:function(x){C.subscribers.indexOf(x)===-1&&(C.subscribers.push(x),C.fire=b(C.fire,x))},unsubscribe:function(x){C.subscribers=C.subscribers.filter(function(I){return I!==x}),C.fire=C.subscribers.reduce(b,k)}},u[v]=c[v]=C;a(R=v).forEach(function(x){var I=R[x];if(l(I))g(x,R[x][0],R[x][1]);else{if(I!=="asap")throw new de.InvalidArgument("Invalid event config");var A=g(x,At,function(){for(var E=arguments.length,_=new Array(E);E--;)_[E]=arguments[E];A.subscribers.forEach(function(j){Z(function(){j.apply(null,_)})})})}})}}function Vi(o,c){return O(c).from({prototype:o}),c}function hi(o,c){return!(o.filter||o.algorithm||o.or)&&(c?o.justLimit:!o.replayFilter)}function uo(o,c){o.filter=qn(o.filter,c)}function fo(o,c,u){var f=o.replayFilter;o.replayFilter=f?function(){return qn(f(),c())}:c,o.justLimit=u&&!f}function Hr(o,c){if(o.isPrimKey)return c.primaryKey;var u=c.getIndexByKeyPath(o.index);if(u)return u;throw new de.Schema("KeyPath "+o.index+" on object store "+c.name+" is not indexed")}function Wc(o,c,u){var f=Hr(o,c.schema);return c.openCursor({trans:u,values:!o.keysOnly,reverse:o.dir==="prev",unique:!!o.unique,query:{index:f,range:o.range}})}function Gr(o,c,u,f){var h,g,v=o.replayFilter?qn(o.filter,o.replayFilter()):o.filter;return o.or?(h={},g=function(b,k,R){var C,x;v&&!v(k,R,function(I){return k.stop(I)},function(I){return k.fail(I)})||((x=""+(C=k.primaryKey))=="[object ArrayBuffer]"&&(x=""+new Uint8Array(C)),m(h,x))||(h[x]=!0,c(b,k,R))},Promise.all([o.or._iterate(g,u),Hc(Wc(o,f,u),o.algorithm,g,!o.keysOnly&&o.valueMapper)])):Hc(Wc(o,f,u),qn(o.algorithm,v),c,!o.keysOnly&&o.valueMapper)}function Hc(o,c,u,f){var h=qe(f?function(g,v,b){return u(f(g),v,b)}:u);return o.then(function(g){if(g)return g.start(function(){var v=function(){return g.continue()};c&&!c(g,function(b){return v=b},function(b){g.stop(b),v=Pe},function(b){g.fail(b),v=Pe})||h(g.value,g,function(b){return v=b}),v()})})}Te.prototype._read=function(o,c){var u=this._ctx;return u.error?u.table._trans(null,Ge.bind(null,u.error)):u.table._trans("readonly",o).then(c)},Te.prototype._write=function(o){var c=this._ctx;return c.error?c.table._trans(null,Ge.bind(null,c.error)):c.table._trans("readwrite",o,"locked")},Te.prototype._addAlgorithm=function(o){var c=this._ctx;c.algorithm=qn(c.algorithm,o)},Te.prototype._iterate=function(o,c){return Gr(this._ctx,o,c,this._ctx.table.core)},Te.prototype.clone=function(o){var c=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return o&&d(u,o),c._ctx=u,c},Te.prototype.raw=function(){return this._ctx.valueMapper=null,this},Te.prototype.each=function(o){var c=this._ctx;return this._read(function(u){return Gr(c,o,u,c.table.core)})},Te.prototype.count=function(o){var c=this;return this._read(function(u){var f,h=c._ctx,g=h.table.core;return hi(h,!0)?g.count({trans:u,query:{index:Hr(h,g.schema),range:h.range}}).then(function(v){return Math.min(v,h.limit)}):(f=0,Gr(h,function(){return++f,!1},u,g).then(function(){return f}))}).then(o)},Te.prototype.sortBy=function(o,c){var u=o.split(".").reverse(),f=u[0],h=u.length-1;function g(k,R){return R?g(k[u[R]],R-1):k[f]}var v=this._ctx.dir==="next"?1:-1;function b(k,R){return Ie(g(k,h),g(R,h))*v}return this.toArray(function(k){return k.sort(b)}).then(c)},Te.prototype.toArray=function(o){var c=this;return this._read(function(u){var f,h,g,v=c._ctx;return v.dir==="next"&&hi(v,!0)&&0<v.limit?(f=v.valueMapper,h=Hr(v,v.table.core.schema),v.table.core.query({trans:u,limit:v.limit,values:!0,query:{index:h,range:v.range}}).then(function(b){return b=b.result,f?b.map(f):b})):(g=[],Gr(v,function(b){return g.push(b)},u,v.table.core).then(function(){return g}))},o)},Te.prototype.offset=function(o){var c=this._ctx;return o<=0||(c.offset+=o,hi(c)?fo(c,function(){var u=o;return function(f,h){return u===0||(u===1?--u:h(function(){f.advance(u),u=0}),!1)}}):fo(c,function(){var u=o;return function(){return--u<0}})),this},Te.prototype.limit=function(o){return this._ctx.limit=Math.min(this._ctx.limit,o),fo(this._ctx,function(){var c=o;return function(u,f,h){return--c<=0&&f(h),0<=c}},!0),this},Te.prototype.until=function(o,c){return uo(this._ctx,function(u,f,h){return!o(u.value)||(f(h),c)}),this},Te.prototype.first=function(o){return this.limit(1).toArray(function(c){return c[0]}).then(o)},Te.prototype.last=function(o){return this.reverse().first(o)},Te.prototype.filter=function(o){var c;return uo(this._ctx,function(u){return o(u.value)}),(c=this._ctx).isMatch=qn(c.isMatch,o),this},Te.prototype.and=function(o){return this.filter(o)},Te.prototype.or=function(o){return new this.db.WhereClause(this._ctx.table,o,this)},Te.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Te.prototype.desc=function(){return this.reverse()},Te.prototype.eachKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(u,f){o(f.key,f)})},Te.prototype.eachUniqueKey=function(o){return this._ctx.unique="unique",this.eachKey(o)},Te.prototype.eachPrimaryKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(u,f){o(f.primaryKey,f)})},Te.prototype.keys=function(o){var c=this._ctx,u=(c.keysOnly=!c.isMatch,[]);return this.each(function(f,h){u.push(h.key)}).then(function(){return u}).then(o)},Te.prototype.primaryKeys=function(o){var c=this._ctx;if(c.dir==="next"&&hi(c,!0)&&0<c.limit)return this._read(function(f){var h=Hr(c,c.table.core.schema);return c.table.core.query({trans:f,values:!1,limit:c.limit,query:{index:h,range:c.range}})}).then(function(f){return f.result}).then(o);c.keysOnly=!c.isMatch;var u=[];return this.each(function(f,h){u.push(h.primaryKey)}).then(function(){return u}).then(o)},Te.prototype.uniqueKeys=function(o){return this._ctx.unique="unique",this.keys(o)},Te.prototype.firstKey=function(o){return this.limit(1).keys(function(c){return c[0]}).then(o)},Te.prototype.lastKey=function(o){return this.reverse().firstKey(o)},Te.prototype.distinct=function(){var o,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(o={},uo(this._ctx,function(f){var f=f.primaryKey.toString(),h=m(o,f);return o[f]=!0,!h})),this},Te.prototype.modify=function(o){var c=this,u=this._ctx;return this._write(function(f){function h(_,j){var B=j.failures;I+=_-j.numFailures;for(var N=0,q=a(B);N<q.length;N++){var W=q[N];x.push(B[W])}}var g=typeof o=="function"?o:function(_){return Vc(_,o)},v=u.table.core,C=v.schema.primaryKey,b=C.outbound,k=C.extractKey,R=200,C=c.db._options.modifyChunkSize,x=(C&&(R=typeof C=="object"?C[v.name]||C["*"]||200:C),[]),I=0,A=[],E=o===Gc;return c.clone().primaryKeys().then(function(_){function j(N){var q=Math.min(R,_.length-N),W=_.slice(N,N+q);return(E?Promise.resolve([]):v.getMany({trans:f,keys:W,cache:"immutable"})).then(function(te){var ne=[],H=[],se=b?[]:null,ie=E?W:[];if(!E)for(var Q=0;Q<q;++Q){var le=te[Q],Oe={value:rt(le),primKey:_[N+Q]};g.call(Oe,Oe.value,Oe)!==!1&&(Oe.value==null?ie.push(_[N+Q]):b||Ie(k(le),k(Oe.value))===0?(H.push(Oe.value),b&&se.push(_[N+Q])):(ie.push(_[N+Q]),ne.push(Oe.value)))}return Promise.resolve(0<ne.length&&v.mutate({trans:f,type:"add",values:ne}).then(function(Ne){for(var me in Ne.failures)ie.splice(parseInt(me),1);h(ne.length,Ne)})).then(function(){return(0<H.length||B&&typeof o=="object")&&v.mutate({trans:f,type:"put",keys:se,values:H,criteria:B,changeSpec:typeof o!="function"&&o,isAdditionalChunk:0<N}).then(function(Ne){return h(H.length,Ne)})}).then(function(){return(0<ie.length||B&&E)&&v.mutate({trans:f,type:"delete",keys:ie,criteria:B,isAdditionalChunk:0<N}).then(function(Ne){return Wr(u.table,ie,Ne)}).then(function(Ne){return h(ie.length,Ne)})}).then(function(){return _.length>N+q&&j(N+R)})})}var B=hi(u)&&u.limit===1/0&&(typeof o!="function"||E)&&{index:u.index,range:u.range};return j(0).then(function(){if(0<x.length)throw new Ae("Error modifying one or more objects",x,I,A);return _.length})})})},Te.prototype.delete=function(){var o=this._ctx,c=o.range;return!hi(o)||o.table.schema.yProps||!o.isPrimKey&&c.type!==3?this.modify(Gc):this._write(function(u){var f=o.table.core.schema.primaryKey,h=c;return o.table.core.count({trans:u,query:{index:f,range:h}}).then(function(g){return o.table.core.mutate({trans:u,type:"deleteRange",range:h}).then(function(k){var b=k.failures,k=k.numFailures;if(k)throw new Ae("Could not delete some values",Object.keys(b).map(function(R){return b[R]}),g-k);return g-k})})})};var wd=Te;function Te(){}var Gc=function(o,c){return c.value=null};function xd(o,c){return o<c?-1:o===c?0:1}function Sd(o,c){return c<o?-1:o===c?0:1}function Ot(o,c,u){return o=o instanceof Jc?new o.Collection(o):o,o._ctx.error=new(u||TypeError)(c),o}function pi(o){return new o.Collection(o,function(){return Yc("")}).limit(0)}function Yr(A,c,u,f){var h,g,v,b,k,R,C,x=u.length;if(!u.every(function(_){return typeof _=="string"}))return Ot(A,$c);function I(_){h=_==="next"?function(B){return B.toUpperCase()}:function(B){return B.toLowerCase()},g=_==="next"?function(B){return B.toLowerCase()}:function(B){return B.toUpperCase()},v=_==="next"?xd:Sd;var j=u.map(function(B){return{lower:g(B),upper:h(B)}}).sort(function(B,N){return v(B.lower,N.lower)});b=j.map(function(B){return B.upper}),k=j.map(function(B){return B.lower}),C=(R=_)==="next"?"":f}I("next");var A=new A.Collection(A,function(){return Sn(b[0],k[x-1]+f)}),E=(A._ondirectionchange=function(_){I(_)},0);return A._addAlgorithm(function(_,j,B){var N=_.key;if(typeof N=="string"){var q=g(N);if(c(q,k,E))return!0;for(var W=null,te=E;te<x;++te){var ne=((H,se,ie,Q,le,Oe)=>{for(var Ne=Math.min(H.length,Q.length),me=-1,_e=0;_e<Ne;++_e){var ze=se[_e];if(ze!==Q[_e])return le(H[_e],ie[_e])<0?H.substr(0,_e)+ie[_e]+ie.substr(_e+1):le(H[_e],Q[_e])<0?H.substr(0,_e)+Q[_e]+ie.substr(_e+1):0<=me?H.substr(0,me)+se[me]+ie.substr(me+1):null;le(H[_e],ze)<0&&(me=_e)}return Ne<Q.length&&Oe==="next"?H+ie.substr(H.length):Ne<H.length&&Oe==="prev"?H.substr(0,ie.length):me<0?null:H.substr(0,me)+Q[me]+ie.substr(me+1)})(N,q,b[te],k[te],v,R);ne===null&&W===null?E=te+1:(W===null||0<v(W,ne))&&(W=ne)}j(W!==null?function(){_.continue(W+C)}:B)}return!1}),A}function Sn(o,c,u,f){return{type:2,lower:o,upper:c,lowerOpen:u,upperOpen:f}}function Yc(o){return{type:1,lower:o,upper:o}}Object.defineProperty(ct.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),ct.prototype.between=function(o,c,u,f){u=u!==!1,f=f===!0;try{return 0<this._cmp(o,c)||this._cmp(o,c)===0&&(u||f)&&(!u||!f)?pi(this):new this.Collection(this,function(){return Sn(o,c,!u,!f)})}catch{return Ot(this,an)}},ct.prototype.equals=function(o){return o==null?Ot(this,an):new this.Collection(this,function(){return Yc(o)})},ct.prototype.above=function(o){return o==null?Ot(this,an):new this.Collection(this,function(){return Sn(o,void 0,!0)})},ct.prototype.aboveOrEqual=function(o){return o==null?Ot(this,an):new this.Collection(this,function(){return Sn(o,void 0,!1)})},ct.prototype.below=function(o){return o==null?Ot(this,an):new this.Collection(this,function(){return Sn(void 0,o,!1,!0)})},ct.prototype.belowOrEqual=function(o){return o==null?Ot(this,an):new this.Collection(this,function(){return Sn(void 0,o)})},ct.prototype.startsWith=function(o){return typeof o!="string"?Ot(this,$c):this.between(o,o+Un,!0,!0)},ct.prototype.startsWithIgnoreCase=function(o){return o===""?this.startsWith(o):Yr(this,function(c,u){return c.indexOf(u[0])===0},[o],Un)},ct.prototype.equalsIgnoreCase=function(o){return Yr(this,function(c,u){return c===u[0]},[o],"")},ct.prototype.anyOfIgnoreCase=function(){var o=St.apply(dt,arguments);return o.length===0?pi(this):Yr(this,function(c,u){return u.indexOf(c)!==-1},o,"")},ct.prototype.startsWithAnyOfIgnoreCase=function(){var o=St.apply(dt,arguments);return o.length===0?pi(this):Yr(this,function(c,u){return u.some(function(f){return c.indexOf(f)===0})},o,Un)},ct.prototype.anyOf=function(){var o,c,u=this,f=St.apply(dt,arguments),h=this._cmp;try{f.sort(h)}catch{return Ot(this,an)}return f.length===0?pi(this):((o=new this.Collection(this,function(){return Sn(f[0],f[f.length-1])}))._ondirectionchange=function(g){h=g==="next"?u._ascending:u._descending,f.sort(h)},c=0,o._addAlgorithm(function(g,v,b){for(var k=g.key;0<h(k,f[c]);)if(++c===f.length)return v(b),!1;return h(k,f[c])===0||(v(function(){g.continue(f[c])}),!1)}),o)},ct.prototype.notEqual=function(o){return this.inAnyRange([[-1/0,o],[o,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},ct.prototype.noneOf=function(){var o=St.apply(dt,arguments);if(o.length===0)return new this.Collection(this);try{o.sort(this._ascending)}catch{return Ot(this,an)}var c=o.reduce(function(u,f){return u?u.concat([[u[u.length-1][1],f]]):[[-1/0,f]]},null);return c.push([o[o.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},ct.prototype.inAnyRange=function(o,B){var u=this,f=this._cmp,h=this._ascending,g=this._descending,v=this._min,b=this._max;if(o.length===0)return pi(this);if(!o.every(function(N){return N[0]!==void 0&&N[1]!==void 0&&h(N[0],N[1])<=0}))return Ot(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",de.InvalidArgument);var k=!B||B.includeLowers!==!1,R=B&&B.includeUppers===!0,C,x=h;function I(N,q){return x(N[0],q[0])}try{(C=o.reduce(function(N,q){for(var W=0,te=N.length;W<te;++W){var ne=N[W];if(f(q[0],ne[1])<0&&0<f(q[1],ne[0])){ne[0]=v(ne[0],q[0]),ne[1]=b(ne[1],q[1]);break}}return W===te&&N.push(q),N},[])).sort(I)}catch{return Ot(this,an)}var A=0,E=R?function(N){return 0<h(N,C[A][1])}:function(N){return 0<=h(N,C[A][1])},_=k?function(N){return 0<g(N,C[A][0])}:function(N){return 0<=g(N,C[A][0])},j=E,B=new this.Collection(this,function(){return Sn(C[0][0],C[C.length-1][1],!k,!R)});return B._ondirectionchange=function(N){x=N==="next"?(j=E,h):(j=_,g),C.sort(I)},B._addAlgorithm(function(N,q,W){for(var te,ne=N.key;j(ne);)if(++A===C.length)return q(W),!1;return!E(te=ne)&&!_(te)||(u._cmp(ne,C[A][1])===0||u._cmp(ne,C[A][0])===0||q(function(){x===h?N.continue(C[A][0]):N.continue(C[A][1])}),!1)}),B},ct.prototype.startsWithAnyOf=function(){var o=St.apply(dt,arguments);return o.every(function(c){return typeof c=="string"})?o.length===0?pi(this):this.inAnyRange(o.map(function(c){return[c,c+Un]})):Ot(this,"startsWithAnyOf() only works with strings")};var Jc=ct;function ct(){}function Zt(o){return qe(function(c){return zi(c),o(c.target.error),!1})}function zi(o){o.stopPropagation&&o.stopPropagation(),o.preventDefault&&o.preventDefault()}var Wi="storagemutated",ho="x-storagemutated-1",_n=Ki(null,Wi),_d=(en.prototype._lock=function(){return G(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},en.prototype._unlock=function(){if(G(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var o=this._blockedFuncs.shift();try{Dn(o[1],o[0])}catch{}}return this},en.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},en.prototype.create=function(o){var c=this;if(this.mode){var u=this.db.idbdb,f=this.db._state.dbOpenError;if(G(!this.idbtrans),!o&&!u)switch(f&&f.name){case"DatabaseClosedError":throw new de.DatabaseClosed(f);case"MissingAPIError":throw new de.MissingAPI(f.message,f);default:throw new de.OpenFailed(f)}if(!this.active)throw new de.TransactionInactive;G(this._completion._state===null),(o=this.idbtrans=o||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=qe(function(h){zi(h),c._reject(o.error)}),o.onabort=qe(function(h){zi(h),c.active&&c._reject(new de.Abort(o.error)),c.active=!1,c.on("abort").fire(h)}),o.oncomplete=qe(function(){c.active=!1,c._resolve(),"mutatedParts"in o&&_n.storagemutated.fire(o.mutatedParts)})}return this},en.prototype._promise=function(o,c,u){var f,h=this;return o==="readwrite"&&this.mode!=="readwrite"?Ge(new de.ReadOnly("Transaction is readonly")):this.active?this._locked()?new L(function(g,v){h._blockedFuncs.push([function(){h._promise(o,c,u).then(g,v)},F])}):u?bn(function(){var g=new L(function(v,b){h._lock();var k=c(v,b,h);k&&k.then&&k.then(v,b)});return g.finally(function(){return h._unlock()}),g._lib=!0,g}):((f=new L(function(g,v){var b=c(g,v,h);b&&b.then&&b.then(g,v)}))._lib=!0,f):Ge(new de.TransactionInactive)},en.prototype._root=function(){return this.parent?this.parent._root():this},en.prototype.waitFor=function(o){var c,u=this._root(),f=L.resolve(o),h=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return f}):(u._waitingFor=f,u._waitingQueue=[],c=u.idbtrans.objectStore(u.storeNames[0]),(function g(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(c.get(-1/0).onsuccess=g)})()),u._waitingFor);return new L(function(g,v){f.then(function(b){return u._waitingQueue.push(qe(g.bind(null,b)))},function(b){return u._waitingQueue.push(qe(v.bind(null,b)))}).finally(function(){u._waitingFor===h&&(u._waitingFor=null)})})},en.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new de.Abort))},en.prototype.table=function(o){var c=this._memoizedTables||(this._memoizedTables={});if(m(c,o))return c[o];var u=this.schema[o];if(u)return(u=new this.db.Table(o,u,this)).core=this.db.core.table(o),c[o]=u;throw new de.NotFound("Table "+o+" not part of transaction")},en);function en(){}function po(o,c,u,f,h,g,v,b){return{name:o,keyPath:c,unique:u,multi:f,auto:h,compound:g,src:(u&&!v?"&":"")+(f?"*":"")+(h?"++":"")+Xc(c),type:b}}function Xc(o){return typeof o=="string"?o:o?"["+[].join.call(o,"+")+"]":""}function go(o,c,u){return{name:o,primKey:c,indexes:u,mappedClass:null,idxByName:(f=function(h){return[h.name,h]},u.reduce(function(h,g,v){return g=f(g,v),g&&(h[g[0]]=g[1]),h},{}))};var f}var Hi=function(o){try{return o.only([[]]),Hi=function(){return[[]]},[[]]}catch{return Hi=function(){return Un},Un}};function mo(o){return o==null?function(){}:typeof o=="string"?(c=o).split(".").length===1?function(u){return u[c]}:function(u){return ae(u,c)}:function(u){return ae(u,o)};var c}function Qc(o){return[].slice.call(o)}var kd=0;function Gi(o){return o==null?":id":typeof o=="string"?o:"[".concat(o.join("+"),"]")}function Cd(o,c,k){function f(E){if(E.type===3)return null;if(E.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var x=E.lower,I=E.upper,A=E.lowerOpen,E=E.upperOpen;return x===void 0?I===void 0?null:c.upperBound(I,!!E):I===void 0?c.lowerBound(x,!!A):c.bound(x,I,!!A,!!E)}function h(C){var x,I=C.name;return{name:I,schema:C,mutate:function(A){var E=A.trans,_=A.type,j=A.keys,B=A.values,N=A.range;return new Promise(function(q,W){q=qe(q);var te=E.objectStore(I),ne=te.keyPath==null,H=_==="put"||_==="add";if(!H&&_!=="delete"&&_!=="deleteRange")throw new Error("Invalid operation type: "+_);var se,ie=(j||B||{length:1}).length;if(j&&B&&j.length!==B.length)throw new Error("Given keys array must have same length as given values array.");if(ie===0)return q({numFailures:0,failures:{},results:[],lastResult:void 0});function Q(He){++Ne,zi(He)}var le=[],Oe=[],Ne=0;if(_==="deleteRange"){if(N.type===4)return q({numFailures:Ne,failures:Oe,results:[],lastResult:void 0});N.type===3?le.push(se=te.clear()):le.push(se=te.delete(f(N)))}else{var ne=H?ne?[B,j]:[B,null]:[j,null],me=ne[0],_e=ne[1];if(H)for(var ze=0;ze<ie;++ze)le.push(se=_e&&_e[ze]!==void 0?te[_](me[ze],_e[ze]):te[_](me[ze])),se.onerror=Q;else for(ze=0;ze<ie;++ze)le.push(se=te[_](me[ze])),se.onerror=Q}function jt(He){He=He.target.result,le.forEach(function(zn,Ro){return zn.error!=null&&(Oe[Ro]=zn.error)}),q({numFailures:Ne,failures:Oe,results:_==="delete"?j:le.map(function(zn){return zn.result}),lastResult:He})}se.onerror=function(He){Q(He),jt(He)},se.onsuccess=jt})},getMany:function(A){var E=A.trans,_=A.keys;return new Promise(function(j,B){j=qe(j);for(var N,q=E.objectStore(I),W=_.length,te=new Array(W),ne=0,H=0,se=function(le){le=le.target,te[le._pos]=le.result,++H===ne&&j(te)},ie=Zt(B),Q=0;Q<W;++Q)_[Q]!=null&&((N=q.get(_[Q]))._pos=Q,N.onsuccess=se,N.onerror=ie,++ne);ne===0&&j(te)})},get:function(A){var E=A.trans,_=A.key;return new Promise(function(j,B){j=qe(j);var N=E.objectStore(I).get(_);N.onsuccess=function(q){return j(q.target.result)},N.onerror=Zt(B)})},query:(x=b,function(A){return new Promise(function(E,_){E=qe(E);var j,B,N,H=A.trans,q=A.values,W=A.limit,ne=A.query,te=W===1/0?void 0:W,se=ne.index,ne=ne.range,H=H.objectStore(I),H=se.isPrimaryKey?H:H.index(se.name),se=f(ne);if(W===0)return E({result:[]});x?((ne=q?H.getAll(se,te):H.getAllKeys(se,te)).onsuccess=function(ie){return E({result:ie.target.result})},ne.onerror=Zt(_)):(j=0,B=!q&&"openKeyCursor"in H?H.openKeyCursor(se):H.openCursor(se),N=[],B.onsuccess=function(ie){var Q=B.result;return!Q||(N.push(q?Q.value:Q.primaryKey),++j===W)?E({result:N}):void Q.continue()},B.onerror=Zt(_))})}),openCursor:function(A){var E=A.trans,_=A.values,j=A.query,B=A.reverse,N=A.unique;return new Promise(function(q,W){q=qe(q);var H=j.index,te=j.range,ne=E.objectStore(I),ne=H.isPrimaryKey?ne:ne.index(H.name),H=B?N?"prevunique":"prev":N?"nextunique":"next",se=!_&&"openKeyCursor"in ne?ne.openKeyCursor(f(te),H):ne.openCursor(f(te),H);se.onerror=Zt(W),se.onsuccess=qe(function(ie){var Q,le,Oe,Ne,me=se.result;me?(me.___id=++kd,me.done=!1,Q=me.continue.bind(me),le=(le=me.continuePrimaryKey)&&le.bind(me),Oe=me.advance.bind(me),Ne=function(){throw new Error("Cursor not stopped")},me.trans=E,me.stop=me.continue=me.continuePrimaryKey=me.advance=function(){throw new Error("Cursor not started")},me.fail=qe(W),me.next=function(){var _e=this,ze=1;return this.start(function(){return ze--?_e.continue():_e.stop()}).then(function(){return _e})},me.start=function(_e){function ze(){if(se.result)try{_e()}catch(He){me.fail(He)}else me.done=!0,me.start=function(){throw new Error("Cursor behind last entry")},me.stop()}var jt=new Promise(function(He,zn){He=qe(He),se.onerror=Zt(zn),me.fail=zn,me.stop=function(Ro){me.stop=me.continue=me.continuePrimaryKey=me.advance=Ne,He(Ro)}});return se.onsuccess=qe(function(He){se.onsuccess=ze,ze()}),me.continue=Q,me.continuePrimaryKey=le,me.advance=Oe,ze(),jt},q(me)):q(null)},W)})},count:function(A){var E=A.query,_=A.trans,j=E.index,B=E.range;return new Promise(function(N,q){var W=_.objectStore(I),W=j.isPrimaryKey?W:W.index(j.name),te=f(B),te=te?W.count(te):W.count();te.onsuccess=qe(function(ne){return N(ne.target.result)}),te.onerror=Zt(q)})}}}g=k,v=Qc((k=o).objectStoreNames);var g,k={schema:{name:k.name,tables:v.map(function(C){return g.objectStore(C)}).map(function(C){var x=C.keyPath,I=C.autoIncrement,E=l(x),A={},E={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:x==null,compound:E,keyPath:x,autoIncrement:I,unique:!0,extractKey:mo(x)},indexes:Qc(C.indexNames).map(function(_){return C.index(_)}).map(function(N){var q=N.name,j=N.unique,B=N.multiEntry,N=N.keyPath,q={name:q,compound:l(N),keyPath:N,unique:j,multiEntry:B,extractKey:mo(N)};return A[Gi(N)]=q}),getIndexByKeyPath:function(_){return A[Gi(_)]}};return A[":id"]=E.primaryKey,x!=null&&(A[Gi(x)]=E.primaryKey),E})},hasGetAll:0<v.length&&"getAll"in g.objectStore(v[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},v=k.schema,b=k.hasGetAll,k=v.tables.map(h),R={};return k.forEach(function(C){return R[C.name]=C}),{stack:"dbcore",transaction:o.transaction.bind(o),table:function(C){if(R[C])return R[C];throw new Error("Table '".concat(C,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Hi(c),schema:v}}function Ed(o,c,u,f){return u=u.IDBKeyRange,c=Cd(c,u,f),{dbcore:o.dbcore.reduce(function(h,g){return g=g.create,i(i({},h),g(h))},c)}}function Jr(o,c){var u=c.db,u=Ed(o._middlewares,u,o._deps,c);o.core=u.dbcore,o.tables.forEach(function(f){var h=f.name;o.core.schema.tables.some(function(g){return g.name===h})&&(f.core=o.core.table(h),o[h]instanceof o.Table)&&(o[h].core=f.core)})}function Xr(o,c,u,f){u.forEach(function(h){var g=f[h];c.forEach(function(v){var b=(function k(R,C){return D(R,C)||(R=p(R))&&k(R,C)})(v,h);(!b||"value"in b&&b.value===void 0)&&(v===o.Transaction.prototype||v instanceof o.Transaction?K(v,h,{get:function(){return this.table(h)},set:function(k){P(this,h,{value:k,writable:!0,configurable:!0,enumerable:!0})}}):v[h]=new o.Table(h,g))})})}function vo(o,c){c.forEach(function(u){for(var f in u)u[f]instanceof o.Table&&delete u[f]})}function Id(o,c){return o._cfg.version-c._cfg.version}function Ad(o,c,u,f){var h=o._dbSchema,g=(u.objectStoreNames.contains("$meta")&&!h.$meta&&(h.$meta=go("$meta",el("")[0],[]),o._storeNames.push("$meta")),o._createTransaction("readwrite",o._storeNames,h)),v=(g.create(u),g._completion.catch(f),g._reject.bind(g)),b=F.transless||F;bn(function(){if(F.trans=g,F.transless=b,c!==0)return Jr(o,u),R=c,((k=g).storeNames.includes("$meta")?k.table("$meta").get("version").then(function(C){return C??R}):L.resolve(R)).then(function(j){var x=o,I=j,A=g,E=u,_=[],j=x._versions,B=x._dbSchema=Zr(0,x.idbdb,E);return(j=j.filter(function(N){return N._cfg.version>=I})).length===0?L.resolve():(j.forEach(function(N){_.push(function(){var q,W,te,ne=B,H=N._cfg.dbschema,se=(es(x,ne,E),es(x,H,E),B=x._dbSchema=H,yo(ne,H)),ie=(se.add.forEach(function(Q){bo(E,Q[0],Q[1].primKey,Q[1].indexes)}),se.change.forEach(function(Q){if(Q.recreate)throw new de.Upgrade("Not yet support for changing primary key");var le=E.objectStore(Q.name);Q.add.forEach(function(Oe){return Qr(le,Oe)}),Q.change.forEach(function(Oe){le.deleteIndex(Oe.name),Qr(le,Oe)}),Q.del.forEach(function(Oe){return le.deleteIndex(Oe)})}),N._cfg.contentUpgrade);if(ie&&N._cfg.version>I)return Jr(x,E),A._memoizedTables={},q=Y(H),se.del.forEach(function(Q){q[Q]=ne[Q]}),vo(x,[x.Transaction.prototype]),Xr(x,[x.Transaction.prototype],a(q),q),A.schema=q,(W=Ue(ie))&&fi(),H=L.follow(function(){var Q;(te=ie(A))&&W&&(Q=wn.bind(null,null),te.then(Q,Q))}),te&&typeof te.then=="function"?L.resolve(te):H.then(function(){return te})}),_.push(function(q){var W,te,ne=N._cfg.dbschema;W=ne,te=q,[].slice.call(te.db.objectStoreNames).forEach(function(H){return W[H]==null&&te.db.deleteObjectStore(H)}),vo(x,[x.Transaction.prototype]),Xr(x,[x.Transaction.prototype],x._storeNames,x._dbSchema),A.schema=x._dbSchema}),_.push(function(q){x.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(x.idbdb.version/10)===N._cfg.version?(x.idbdb.deleteObjectStore("$meta"),delete x._dbSchema.$meta,x._storeNames=x._storeNames.filter(function(W){return W!=="$meta"})):q.objectStore("$meta").put(N._cfg.version,"version"))})}),(function N(){return _.length?L.resolve(_.shift()(A.idbtrans)).then(N):L.resolve()})().then(function(){Zc(B,E)}))}).catch(v);var k,R;a(h).forEach(function(C){bo(u,C,h[C].primKey,h[C].indexes)}),Jr(o,u),L.follow(function(){return o.on.populate.fire(g)}).catch(v)})}function Pd(o,c){Zc(o._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var u=Zr(0,o.idbdb,c);es(o,o._dbSchema,c);for(var f=0,h=yo(u,o._dbSchema).change;f<h.length;f++){var g=(v=>{if(v.change.length||v.recreate)return console.warn("Unable to patch indexes of table ".concat(v.name," because it has changes on the type of index or primary key.")),{value:void 0};var b=c.objectStore(v.name);v.add.forEach(function(k){mt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(v.name,".").concat(k.src)),Qr(b,k)})})(h[f]);if(typeof g=="object")return g.value}}function yo(o,c){var u,f={del:[],add:[],change:[]};for(u in o)c[u]||f.del.push(u);for(u in c){var h=o[u],g=c[u];if(h){var v={name:u,def:g,recreate:!1,del:[],add:[],change:[]};if(""+(h.primKey.keyPath||"")!=""+(g.primKey.keyPath||"")||h.primKey.auto!==g.primKey.auto)v.recreate=!0,f.change.push(v);else{var b=h.idxByName,k=g.idxByName,R=void 0;for(R in b)k[R]||v.del.push(R);for(R in k){var C=b[R],x=k[R];C?C.src!==x.src&&v.change.push(x):v.add.push(x)}(0<v.del.length||0<v.add.length||0<v.change.length)&&f.change.push(v)}}else f.add.push([u,g])}return f}function bo(o,c,u,f){var h=o.db.createObjectStore(c,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});f.forEach(function(g){return Qr(h,g)})}function Zc(o,c){a(o).forEach(function(u){c.db.objectStoreNames.contains(u)||(mt&&console.debug("Dexie: Creating missing table",u),bo(c,u,o[u].primKey,o[u].indexes))})}function Qr(o,c){o.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Zr(o,c,u){var f={};return J(c.objectStoreNames,0).forEach(function(h){for(var g=u.objectStore(h),v=po(Xc(R=g.keyPath),R||"",!0,!1,!!g.autoIncrement,R&&typeof R!="string",!0),b=[],k=0;k<g.indexNames.length;++k){var C=g.index(g.indexNames[k]),R=C.keyPath,C=po(C.name,R,!!C.unique,!!C.multiEntry,!1,R&&typeof R!="string",!1);b.push(C)}f[h]=go(h,v,b)}),f}function es(o,c,u){for(var f=u.db.objectStoreNames,h=0;h<f.length;++h){var g=f[h],v=u.objectStore(g);o._hasGetAll="getAll"in v;for(var b=0;b<v.indexNames.length;++b){var k,R=v.indexNames[b],C=v.index(R).keyPath,C=typeof C=="string"?C:"["+J(C).join("+")+"]";c[g]&&(k=c[g].idxByName[C])&&(k.name=R,delete c[g].idxByName[C],c[g].idxByName[R]=k)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(o._hasGetAll=!1)}function el(o){return o.split(",").map(function(c,u){var h=c.split(":"),f=(f=h[1])==null?void 0:f.trim(),h=(c=h[0].trim()).replace(/([&*]|\+\+)/g,""),g=/^\[/.test(h)?h.match(/^\[(.*)\]$/)[1].split("+"):h;return po(h,g||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),l(g),u===0,f)})}gi.prototype._createTableSchema=go,gi.prototype._parseIndexSyntax=el,gi.prototype._parseStoresSpec=function(o,c){var u=this;a(o).forEach(function(f){if(o[f]!==null){var h=u._parseIndexSyntax(o[f]),g=h.shift();if(!g)throw new de.Schema("Invalid schema for table "+f+": "+o[f]);if(g.unique=!0,g.multi)throw new de.Schema("Primary key cannot be multiEntry*");h.forEach(function(v){if(v.auto)throw new de.Schema("Only primary key can be marked as autoIncrement (++)");if(!v.keyPath)throw new de.Schema("Index must have a name and cannot be an empty string")}),g=u._createTableSchema(f,g,h),c[f]=g}})},gi.prototype.stores=function(u){var c=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?d(this._cfg.storesSource,u):u,c._versions),f={},h={};return u.forEach(function(g){d(f,g._cfg.storesSource),h=g._cfg.dbschema={},g._parseStoresSpec(f,h)}),c._dbSchema=h,vo(c,[c._allTables,c,c.Transaction.prototype]),Xr(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],a(h),h),c._storeNames=a(h),this},gi.prototype.upgrade=function(o){return this._cfg.contentUpgrade=vn(this._cfg.contentUpgrade||Pe,o),this};var Od=gi;function gi(){}function wo(o,c){var u=o._dbNamesDB;return u||(u=o._dbNamesDB=new cn(Vr,{addons:[],indexedDB:o,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function xo(o){return o&&typeof o.databases=="function"}function So(o){return bn(function(){return F.letThrough=!0,o()})}function _o(o){return!("from"in o)}var gt=function(o,c){var u;if(!this)return u=new gt,o&&"d"in o&&d(u,o),u;d(this,arguments.length?{d:1,from:o,to:1<arguments.length?c:o}:{d:0})};function Yi(o,c,u){var f=Ie(c,u);if(!isNaN(f)){if(0<f)throw RangeError();if(_o(o))return d(o,{from:c,to:u,d:1});var f=o.l,h=o.r;if(Ie(u,o.from)<0)return f?Yi(f,c,u):o.l={from:c,to:u,d:1,l:null,r:null},nl(o);if(0<Ie(c,o.to))return h?Yi(h,c,u):o.r={from:c,to:u,d:1,l:null,r:null},nl(o);Ie(c,o.from)<0&&(o.from=c,o.l=null,o.d=h?h.d+1:1),0<Ie(u,o.to)&&(o.to=u,o.r=null,o.d=o.l?o.l.d+1:1),c=!o.r,f&&!o.l&&Ji(o,f),h&&c&&Ji(o,h)}}function Ji(o,c){_o(c)||(function u(f,h){var g=h.from,v=h.l,b=h.r;Yi(f,g,h.to),v&&u(f,v),b&&u(f,b)})(o,c)}function tl(o,c){var u=ts(c),f=u.next();if(!f.done)for(var h=f.value,g=ts(o),v=g.next(h.from),b=v.value;!f.done&&!v.done;){if(Ie(b.from,h.to)<=0&&0<=Ie(b.to,h.from))return!0;Ie(h.from,b.from)<0?h=(f=u.next(b.from)).value:b=(v=g.next(h.from)).value}return!1}function ts(o){var c=_o(o)?null:{s:0,n:o};return{next:function(u){for(var f=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,f)for(;c.n.l&&Ie(u,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!f||Ie(u,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function nl(o){var c,u,f,h=(((h=o.r)==null?void 0:h.d)||0)-(((h=o.l)==null?void 0:h.d)||0),h=1<h?"r":h<-1?"l":"";h&&(c=h=="r"?"l":"r",u=i({},o),f=o[h],o.from=f.from,o.to=f.to,o[h]=f[h],u[h]=f[c],(o[c]=u).d=il(u)),o.d=il(o)}function il(u){var c=u.r,u=u.l;return(c?u?Math.max(c.d,u.d):c.d:u?u.d:0)+1}function ns(o,c){return a(c).forEach(function(u){o[u]?Ji(o[u],c[u]):o[u]=(function f(h){var g,v,b={};for(g in h)m(h,g)&&(v=h[g],b[g]=!v||typeof v!="object"||We.has(v.constructor)?v:f(v));return b})(c[u])}),o}function ko(o,c){return o.all||c.all||Object.keys(o).some(function(u){return c[u]&&tl(c[u],o[u])})}w(gt.prototype,((X={add:function(o){return Ji(this,o),this},addKey:function(o){return Yi(this,o,o),this},addKeys:function(o){var c=this;return o.forEach(function(u){return Yi(c,u,u)}),this},hasKey:function(o){var c=ts(this).next(o).value;return c&&Ie(c.from,o)<=0&&0<=Ie(c.to,o)}})[ft]=function(){return ts(this)},X));var Kn={},Co={},Eo=!1;function is(o){ns(Co,o),Eo||(Eo=!0,setTimeout(function(){Eo=!1,Io(Co,!(Co={}))},0))}function Io(o,c){c===void 0&&(c=!1);var u=new Set;if(o.all)for(var f=0,h=Object.values(Kn);f<h.length;f++)rl(b=h[f],o,u,c);else for(var g in o){var v,b,g=/^idb\:\/\/(.*)\/(.*)\//.exec(g);g&&(v=g[1],g=g[2],b=Kn["idb://".concat(v,"/").concat(g)])&&rl(b,o,u,c)}u.forEach(function(k){return k()})}function rl(o,c,u,f){for(var h=[],g=0,v=Object.entries(o.queries.query);g<v.length;g++){for(var b=v[g],k=b[0],R=[],C=0,x=b[1];C<x.length;C++){var I=x[C];ko(c,I.obsSet)?I.subscribers.forEach(function(j){return u.add(j)}):f&&R.push(I)}f&&h.push([k,R])}if(f)for(var A=0,E=h;A<E.length;A++){var _=E[A],k=_[0],R=_[1];o.queries.query[k]=R}}function Td(o){var c=o._state,u=o._deps.indexedDB;if(c.isBeingOpened||o.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Ge(c.dbOpenError):o});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var f=c.openCanceller,h=Math.round(10*o.verno),g=!1;function v(){if(c.openCanceller!==f)throw new de.DatabaseClosed("db.open() was cancelled")}function b(){return new L(function(I,A){if(v(),!u)throw new de.MissingAPI;var E=o.name,_=c.autoSchema||!h?u.open(E):u.open(E,h);if(!_)throw new de.MissingAPI;_.onerror=Zt(A),_.onblocked=qe(o._fireOnBlocked),_.onupgradeneeded=qe(function(j){var B;C=_.transaction,c.autoSchema&&!o._options.allowEmptyDB?(_.onerror=zi,C.abort(),_.result.close(),(B=u.deleteDatabase(E)).onsuccess=B.onerror=qe(function(){A(new de.NoSuchDatabase("Database ".concat(E," doesnt exist")))})):(C.onerror=Zt(A),B=j.oldVersion>Math.pow(2,62)?0:j.oldVersion,x=B<1,o.idbdb=_.result,g&&Pd(o,C),Ad(o,B/10,C,A))},A),_.onsuccess=qe(function(){C=null;var j,B,N,q,W,te,ne=o.idbdb=_.result,H=J(ne.objectStoreNames);if(0<H.length)try{var se=ne.transaction((W=H).length===1?W[0]:W,"readonly");if(c.autoSchema)te=ne,q=se,(N=o).verno=te.version/10,q=N._dbSchema=Zr(0,te,q),N._storeNames=J(te.objectStoreNames,0),Xr(N,[N._allTables],a(q),q);else if(es(o,o._dbSchema,se),B=se,((B=yo(Zr(0,(j=o).idbdb,B),j._dbSchema)).add.length||B.change.some(function(ie){return ie.add.length||ie.change.length}))&&!g)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ne.close(),h=ne.version+1,g=!0,I(b());Jr(o,se)}catch{}di.push(o),ne.onversionchange=qe(function(ie){c.vcFired=!0,o.on("versionchange").fire(ie)}),ne.onclose=qe(function(){o.close({disableAutoOpen:!1})}),x&&(H=o._deps,W=E,xo(te=H.indexedDB)||W===Vr||wo(te,H.IDBKeyRange).put({name:W}).catch(Pe)),I()},A)}).catch(function(I){switch(I?.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),b();break;case"VersionError":if(0<h)return h=0,b()}return L.reject(I)})}var k,R=c.dbReadyResolve,C=null,x=!1;return L.race([f,(typeof navigator>"u"?L.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(I){function A(){return indexedDB.databases().finally(I)}k=setInterval(A,100),A()}).finally(function(){return clearInterval(k)}):Promise.resolve()).then(b)]).then(function(){return v(),c.onReadyBeingFired=[],L.resolve(So(function(){return o.on.ready.fire(o.vip)})).then(function I(){var A;if(0<c.onReadyBeingFired.length)return A=c.onReadyBeingFired.reduce(vn,Pe),c.onReadyBeingFired=[],L.resolve(So(function(){return A(o.vip)})).then(I)})}).finally(function(){c.openCanceller===f&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(I){c.dbOpenError=I;try{C&&C.abort()}catch{}return f===c.openCanceller&&o._close(),Ge(I)}).finally(function(){c.openComplete=!0,R()}).then(function(){var I;return x&&(I={},o.tables.forEach(function(A){A.schema.indexes.forEach(function(E){E.name&&(I["idb://".concat(o.name,"/").concat(A.name,"/").concat(E.name)]=new gt(-1/0,[[[]]]))}),I["idb://".concat(o.name,"/").concat(A.name,"/")]=I["idb://".concat(o.name,"/").concat(A.name,"/:dels")]=new gt(-1/0,[[[]]])}),_n(Wi).fire(I),Io(I,!0)),o})}function Ao(o){function c(g){return o.next(g)}var u=h(c),f=h(function(g){return o.throw(g)});function h(g){return function(b){var b=g(b),k=b.value;return b.done?k:k&&typeof k.then=="function"?k.then(u,f):l(k)?Promise.all(k).then(u,f):u(k)}}return h(c)()}function rs(o,c,u){for(var f=l(o)?o.slice():[o],h=0;h<u;++h)f.push(c);return f}var Nd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(o){return i(i({},o),{table:function(f){var u=o.table(f),f=u.schema,h={},g=[];function v(I,A,E){var N=Gi(I),_=h[N]=h[N]||[],j=I==null?0:typeof I=="string"?1:I.length,B=0<A,N=i(i({},E),{name:B?"".concat(N,"(virtual-from:").concat(E.name,")"):E.name,lowLevelIndex:E,isVirtual:B,keyTail:A,keyLength:j,extractKey:mo(I),unique:!B&&E.unique});return _.push(N),N.isPrimaryKey||g.push(N),1<j&&v(j===2?I[0]:I.slice(0,j-1),A+1,E),_.sort(function(q,W){return q.keyTail-W.keyTail}),N}var b=v(f.primaryKey.keyPath,0,f.primaryKey);h[":id"]=[b];for(var k=0,R=f.indexes;k<R.length;k++){var C=R[k];v(C.keyPath,0,C)}function x(I){var A,E=I.query.index;return E.isVirtual?i(i({},I),{query:{index:E.lowLevelIndex,range:(A=I.query.range,E=E.keyTail,{type:A.type===1?2:A.type,lower:rs(A.lower,A.lowerOpen?o.MAX_KEY:o.MIN_KEY,E),lowerOpen:!0,upper:rs(A.upper,A.upperOpen?o.MIN_KEY:o.MAX_KEY,E),upperOpen:!0})}}):I}return i(i({},u),{schema:i(i({},f),{primaryKey:b,indexes:g,getIndexByKeyPath:function(I){return(I=h[Gi(I)])&&I[0]}}),count:function(I){return u.count(x(I))},query:function(I){return u.query(x(I))},openCursor:function(I){var A=I.query.index,E=A.keyTail,_=A.keyLength;return A.isVirtual?u.openCursor(x(I)).then(function(B){return B&&j(B)}):u.openCursor(I);function j(B){return Object.create(B,{continue:{value:function(N){N!=null?B.continue(rs(N,I.reverse?o.MAX_KEY:o.MIN_KEY,E)):I.unique?B.continue(B.key.slice(0,_).concat(I.reverse?o.MIN_KEY:o.MAX_KEY,E)):B.continue()}},continuePrimaryKey:{value:function(N,q){B.continuePrimaryKey(rs(N,o.MAX_KEY,E),q)}},primaryKey:{get:function(){return B.primaryKey}},key:{get:function(){var N=B.key;return _===1?N[0]:N.slice(0,_)}},value:{get:function(){return B.value}}})}}})}})}};function Po(o,c,u,f){return u=u||{},f=f||"",a(o).forEach(function(h){var g,v,b;m(c,h)?(g=o[h],v=c[h],typeof g=="object"&&typeof v=="object"&&g&&v?(b=zt(g))!==zt(v)?u[f+h]=c[h]:b==="Object"?Po(g,v,u,f+h+"."):g!==v&&(u[f+h]=c[h]):g!==v&&(u[f+h]=c[h])):u[f+h]=void 0}),a(c).forEach(function(h){m(o,h)||(u[f+h]=c[h])}),u}function Oo(o,c){return c.type==="delete"?c.keys:c.keys||c.values.map(o.extractKey)}var Md={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(o){return i(i({},o),{table:function(c){var u=o.table(c),f=u.schema.primaryKey;return i(i({},u),{mutate:function(h){var g=F.trans,v=g.table(c).hook,b=v.deleting,k=v.creating,R=v.updating;switch(h.type){case"add":if(k.fire===Pe)break;return g._promise("readwrite",function(){return C(h)},!0);case"put":if(k.fire===Pe&&R.fire===Pe)break;return g._promise("readwrite",function(){return C(h)},!0);case"delete":if(b.fire===Pe)break;return g._promise("readwrite",function(){return C(h)},!0);case"deleteRange":if(b.fire===Pe)break;return g._promise("readwrite",function(){return(function x(I,A,E){return u.query({trans:I,values:!1,query:{index:f,range:A},limit:E}).then(function(_){var j=_.result;return C({type:"delete",keys:j,trans:I}).then(function(B){return 0<B.numFailures?Promise.reject(B.failures[0]):j.length<E?{failures:[],numFailures:0,lastResult:void 0}:x(I,i(i({},A),{lower:j[j.length-1],lowerOpen:!0}),E)})})})(h.trans,h.range,1e4)},!0)}return u.mutate(h);function C(x){var I,A,E,_=F.trans,j=x.keys||Oo(f,x);if(j)return(x=x.type==="add"||x.type==="put"?i(i({},x),{keys:j}):i({},x)).type!=="delete"&&(x.values=r([],x.values)),x.keys&&(x.keys=r([],x.keys)),I=u,E=j,((A=x).type==="add"?Promise.resolve([]):I.getMany({trans:A.trans,keys:E,cache:"immutable"})).then(function(B){var N=j.map(function(q,W){var te,ne,H,se=B[W],ie={onerror:null,onsuccess:null};return x.type==="delete"?b.fire.call(ie,q,se,_):x.type==="add"||se===void 0?(te=k.fire.call(ie,q,x.values[W],_),q==null&&te!=null&&(x.keys[W]=q=te,f.outbound||fe(x.values[W],f.keyPath,q))):(te=Po(se,x.values[W]),(ne=R.fire.call(ie,te,q,se,_))&&(H=x.values[W],Object.keys(ne).forEach(function(Q){m(H,Q)?H[Q]=ne[Q]:fe(H,Q,ne[Q])}))),ie});return u.mutate(x).then(function(q){for(var W=q.failures,te=q.results,ne=q.numFailures,q=q.lastResult,H=0;H<j.length;++H){var se=(te||j)[H],ie=N[H];se==null?ie.onerror&&ie.onerror(W[H]):ie.onsuccess&&ie.onsuccess(x.type==="put"&&B[H]?x.values[H]:se)}return{failures:W,results:te,numFailures:ne,lastResult:q}}).catch(function(q){return N.forEach(function(W){return W.onerror&&W.onerror(q)}),Promise.reject(q)})});throw new Error("Keys missing")}}})}})}};function sl(o,c,u){try{if(!c||c.keys.length<o.length)return null;for(var f=[],h=0,g=0;h<c.keys.length&&g<o.length;++h)Ie(c.keys[h],o[g])===0&&(f.push(u?rt(c.values[h]):c.values[h]),++g);return f.length===o.length?f:null}catch{return null}}var Rd={stack:"dbcore",level:-1,create:function(o){return{table:function(c){var u=o.table(c);return i(i({},u),{getMany:function(f){var h;return f.cache?(h=sl(f.keys,f.trans._cache,f.cache==="clone"))?L.resolve(h):u.getMany(f).then(function(g){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?rt(g):g},g}):u.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),u.mutate(f)}})}}}};function ol(o,c){return o.trans.mode==="readonly"&&!!o.subscr&&!o.trans.explicit&&o.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function al(o,c){switch(o){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var jd={stack:"dbcore",level:0,name:"Observability",create:function(o){var c=o.schema.name,u=new gt(o.MIN_KEY,o.MAX_KEY);return i(i({},o),{transaction:function(f,h,g){if(F.subscr&&h!=="readonly")throw new de.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return o.transaction(f,h,g)},table:function(f){function h(j){var _,j=j.query;return[_=j.index,new gt((_=(j=j.range).lower)!=null?_:o.MIN_KEY,(_=j.upper)!=null?_:o.MAX_KEY)]}var g=o.table(f),v=g.schema,b=v.primaryKey,k=v.indexes,R=b.extractKey,C=b.outbound,x=b.autoIncrement&&k.filter(function(E){return E.compound&&E.keyPath.includes(b.keyPath)}),I=i(i({},g),{mutate:function(E){function _(le){return le="idb://".concat(c,"/").concat(f,"/").concat(le),W[le]||(W[le]=new gt)}var j,B,N,q=E.trans,W=E.mutatedParts||(E.mutatedParts={}),te=_(""),ne=_(":dels"),H=E.type,ie=E.type==="deleteRange"?[E.range]:E.type==="delete"?[E.keys]:E.values.length<50?[Oo(b,E).filter(function(le){return le}),E.values]:[],se=ie[0],ie=ie[1],Q=E.trans._cache;return l(se)?(te.addKeys(se),(H=H==="delete"||se.length===ie.length?sl(se,Q):null)||ne.addKeys(se),(H||ie)&&(j=_,B=H,N=ie,v.indexes.forEach(function(le){var Oe=j(le.name||"");function Ne(_e){return _e!=null?le.extractKey(_e):null}function me(_e){le.multiEntry&&l(_e)?_e.forEach(function(ze){return Oe.addKey(ze)}):Oe.addKey(_e)}(B||N).forEach(function(_e,He){var jt=B&&Ne(B[He]),He=N&&Ne(N[He]);Ie(jt,He)!==0&&(jt!=null&&me(jt),He!=null)&&me(He)})}))):se?(ie={from:(Q=se.lower)!=null?Q:o.MIN_KEY,to:(H=se.upper)!=null?H:o.MAX_KEY},ne.add(ie),te.add(ie)):(te.add(u),ne.add(u),v.indexes.forEach(function(le){return _(le.name).add(u)})),g.mutate(E).then(function(le){return!se||E.type!=="add"&&E.type!=="put"||(te.addKeys(le.results),x&&x.forEach(function(Oe){for(var Ne=E.values.map(function(jt){return Oe.extractKey(jt)}),me=Oe.keyPath.findIndex(function(jt){return jt===b.keyPath}),_e=0,ze=le.results.length;_e<ze;++_e)Ne[_e][me]=le.results[_e];_(Oe.name).addKeys(Ne)})),q.mutatedParts=ns(q.mutatedParts||{},W),le})}}),A={get:function(E){return[b,new gt(E.key)]},getMany:function(E){return[b,new gt().addKeys(E.keys)]},count:h,query:h,openCursor:h};return a(A).forEach(function(E){I[E]=function(_){var j=F.subscr,B=!!j,N=ol(F,g)&&al(E,_)?_.obsSet={}:j;if(B){var q,j=function(ie){return ie="idb://".concat(c,"/").concat(f,"/").concat(ie),N[ie]||(N[ie]=new gt)},W=j(""),te=j(":dels"),B=A[E](_),ne=B[0],B=B[1];if((E==="query"&&ne.isPrimaryKey&&!_.values?te:j(ne.name||"")).add(B),!ne.isPrimaryKey){if(E!=="count")return q=E==="query"&&C&&_.values&&g.query(i(i({},_),{values:!1})),g[E].apply(this,arguments).then(function(ie){if(E==="query"){if(C&&_.values)return q.then(function(Ne){return Ne=Ne.result,W.addKeys(Ne),ie});var Q=_.values?ie.result.map(R):ie.result;(_.values?W:te).addKeys(Q)}else{var le,Oe;if(E==="openCursor")return Oe=_.values,(le=ie)&&Object.create(le,{key:{get:function(){return te.addKey(le.primaryKey),le.key}},primaryKey:{get:function(){var Ne=le.primaryKey;return te.addKey(Ne),Ne}},value:{get:function(){return Oe&&W.addKey(le.primaryKey),le.value}}})}return ie});te.add(u)}}return g[E].apply(this,arguments)}}),I}})}};function cl(o,c,u){var f;return u.numFailures===0?c:c.type==="deleteRange"||(f=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,u.numFailures===f)?null:(f=i({},c),l(f.keys)&&(f.keys=f.keys.filter(function(h,g){return!(g in u.failures)})),"values"in f&&l(f.values)&&(f.values=f.values.filter(function(h,g){return!(g in u.failures)})),f)}function To(o,c){return u=o,((f=c).lower===void 0||(f.lowerOpen?0<Ie(u,f.lower):0<=Ie(u,f.lower)))&&(u=o,(f=c).upper===void 0||(f.upperOpen?Ie(u,f.upper)<0:Ie(u,f.upper)<=0));var u,f}function ll(o,c,u,f,h,g){var v,b,k,R,C,x;return!u||u.length===0||(v=c.query.index,b=v.multiEntry,k=c.query.range,R=f.schema.primaryKey.extractKey,C=v.extractKey,x=(v.lowLevelIndex||v).extractKey,(f=u.reduce(function(I,A){var E=I,_=[];if(A.type==="add"||A.type==="put")for(var j=new gt,B=A.values.length-1;0<=B;--B){var N,q=A.values[B],W=R(q);!j.hasKey(W)&&(N=C(q),b&&l(N)?N.some(function(ie){return To(ie,k)}):To(N,k))&&(j.addKey(W),_.push(q))}switch(A.type){case"add":var te=new gt().addKeys(c.values?I.map(function(Q){return R(Q)}):I),E=I.concat(c.values?_.filter(function(Q){return Q=R(Q),!te.hasKey(Q)&&(te.addKey(Q),!0)}):_.map(function(Q){return R(Q)}).filter(function(Q){return!te.hasKey(Q)&&(te.addKey(Q),!0)}));break;case"put":var ne=new gt().addKeys(A.values.map(function(Q){return R(Q)}));E=I.filter(function(Q){return!ne.hasKey(c.values?R(Q):Q)}).concat(c.values?_:_.map(function(Q){return R(Q)}));break;case"delete":var H=new gt().addKeys(A.keys);E=I.filter(function(Q){return!H.hasKey(c.values?R(Q):Q)});break;case"deleteRange":var se=A.range;E=I.filter(function(Q){return!To(R(Q),se)})}return E},o))===o)?o:(f.sort(function(I,A){return Ie(x(I),x(A))||Ie(R(I),R(A))}),c.limit&&c.limit<1/0&&(f.length>c.limit?f.length=c.limit:o.length===c.limit&&f.length<c.limit&&(h.dirty=!0)),g?Object.freeze(f):f)}function ul(o,c){return Ie(o.lower,c.lower)===0&&Ie(o.upper,c.upper)===0&&!!o.lowerOpen==!!c.lowerOpen&&!!o.upperOpen==!!c.upperOpen}function Bd(o,c){return((u,f,h,g)=>{if(u===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((u=Ie(u,f))===0){if(h&&g)return 0;if(h)return 1;if(g)return-1}return u})(o.lower,c.lower,o.lowerOpen,c.lowerOpen)<=0&&0<=((u,f,h,g)=>{if(u===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((u=Ie(u,f))===0){if(h&&g)return 0;if(h)return-1;if(g)return 1}return u})(o.upper,c.upper,o.upperOpen,c.upperOpen)}function Ld(o,c,u,f){o.subscribers.add(u),f.addEventListener("abort",function(){var h,g;o.subscribers.delete(u),o.subscribers.size===0&&(h=o,g=c,setTimeout(function(){h.subscribers.size===0&&pe(g,h)},3e3))})}var $d={stack:"dbcore",level:0,name:"Cache",create:function(o){var c=o.schema.name;return i(i({},o),{transaction:function(u,f,h){var g,v,b=o.transaction(u,f,h);return f==="readwrite"&&(h=(g=new AbortController).signal,b.addEventListener("abort",(v=function(k){return function(){if(g.abort(),f==="readwrite"){for(var R=new Set,C=0,x=u;C<x.length;C++){var I=x[C],A=Kn["idb://".concat(c,"/").concat(I)];if(A){var E=o.table(I),_=A.optimisticOps.filter(function(le){return le.trans===b});if(b._explicit&&k&&b.mutatedParts)for(var j=0,B=Object.values(A.queries.query);j<B.length;j++)for(var N=0,q=(ne=B[j]).slice();N<q.length;N++)ko((H=q[N]).obsSet,b.mutatedParts)&&(pe(ne,H),H.subscribers.forEach(function(le){return R.add(le)}));else if(0<_.length){A.optimisticOps=A.optimisticOps.filter(function(le){return le.trans!==b});for(var W=0,te=Object.values(A.queries.query);W<te.length;W++)for(var ne,H,se,ie=0,Q=(ne=te[W]).slice();ie<Q.length;ie++)(H=Q[ie]).res!=null&&b.mutatedParts&&(k&&!H.dirty?(se=Object.isFrozen(H.res),se=ll(H.res,H.req,_,E,H,se),H.dirty?(pe(ne,H),H.subscribers.forEach(function(le){return R.add(le)})):se!==H.res&&(H.res=se,H.promise=L.resolve({result:se}))):(H.dirty&&pe(ne,H),H.subscribers.forEach(function(le){return R.add(le)})))}}}R.forEach(function(le){return le()})}}})(!1),{signal:h}),b.addEventListener("error",v(!1),{signal:h}),b.addEventListener("complete",v(!0),{signal:h})),b},table:function(u){var f=o.table(u),h=f.schema.primaryKey;return i(i({},f),{mutate:function(g){var v,b=F.trans;return!h.outbound&&b.db._options.cache!=="disabled"&&!b.explicit&&b.idbtrans.mode==="readwrite"&&(v=Kn["idb://".concat(c,"/").concat(u)])?(b=f.mutate(g),g.type!=="add"&&g.type!=="put"||!(50<=g.values.length||Oo(h,g).some(function(k){return k==null}))?(v.optimisticOps.push(g),g.mutatedParts&&is(g.mutatedParts),b.then(function(k){0<k.numFailures&&(pe(v.optimisticOps,g),(k=cl(0,g,k))&&v.optimisticOps.push(k),g.mutatedParts)&&is(g.mutatedParts)}),b.catch(function(){pe(v.optimisticOps,g),g.mutatedParts&&is(g.mutatedParts)})):b.then(function(k){var R=cl(0,i(i({},g),{values:g.values.map(function(C,x){var I;return k.failures[x]?C:(fe(I=(I=h.keyPath)!=null&&I.includes(".")?rt(C):i({},C),h.keyPath,k.results[x]),I)})}),k);v.optimisticOps.push(R),queueMicrotask(function(){return g.mutatedParts&&is(g.mutatedParts)})}),b):f.mutate(g)},query:function(g){var v,b,k,R,C,x,I;return ol(F,f)&&al("query",g)?(v=((k=F.trans)==null?void 0:k.db._options.cache)==="immutable",b=(k=F).requery,k=k.signal,x=((A,E,_,j)=>{var B=Kn["idb://".concat(A,"/").concat(E)];if(!B)return[];if(!(A=B.queries[_]))return[null,!1,B,null];var N=A[(j.query?j.query.index.name:null)||""];if(!N)return[null,!1,B,null];switch(_){case"query":var q=N.find(function(W){return W.req.limit===j.limit&&W.req.values===j.values&&ul(W.req.query.range,j.query.range)});return q?[q,!0,B,N]:[N.find(function(W){return("limit"in W.req?W.req.limit:1/0)>=j.limit&&(!j.values||W.req.values)&&Bd(W.req.query.range,j.query.range)}),!1,B,N];case"count":return q=N.find(function(W){return ul(W.req.query.range,j.query.range)}),[q,!!q,B,N]}})(c,u,"query",g),I=x[0],R=x[2],C=x[3],I&&x[1]?I.obsSet=g.obsSet:(x=f.query(g).then(function(A){var E=A.result;if(I&&(I.res=E),v){for(var _=0,j=E.length;_<j;++_)Object.freeze(E[_]);Object.freeze(E)}else A.result=rt(E);return A}).catch(function(A){return C&&I&&pe(C,I),Promise.reject(A)}),I={obsSet:g.obsSet,promise:x,subscribers:new Set,type:"query",req:g,dirty:!1},C?C.push(I):(C=[I],(R=R||(Kn["idb://".concat(c,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[g.query.index.name||""]=C)),Ld(I,C,b,k),I.promise.then(function(A){return{result:ll(A.result,g,R?.optimisticOps,f,I,v)}})):f.query(g)}})}})}};function ss(o,c){return new Proxy(o,{get:function(u,f,h){return f==="db"?c:Reflect.get(u,f,h)}})}Ye.prototype.version=function(o){if(isNaN(o)||o<.1)throw new de.Type("Given version is not a positive number");if(o=Math.round(10*o)/10,this.idbdb||this._state.isBeingOpened)throw new de.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,o);var c=this._versions,u=c.filter(function(f){return f._cfg.version===o})[0];return u||(u=new this.Version(o),c.push(u),c.sort(Id),u.stores({}),this._state.autoSchema=!1),u},Ye.prototype._whenReady=function(o){var c=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?o():new L(function(u,f){if(c._state.openComplete)return f(new de.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void f(new de.DatabaseClosed);c.open().catch(Pe)}c._state.dbReadyPromise.then(u,f)}).then(o)},Ye.prototype.use=function(h){var c=h.stack,u=h.create,f=h.level,h=h.name,g=(h&&this.unuse({stack:c,name:h}),this._middlewares[c]||(this._middlewares[c]=[]));return g.push({stack:c,create:u,level:f??10,name:h}),g.sort(function(v,b){return v.level-b.level}),this},Ye.prototype.unuse=function(o){var c=o.stack,u=o.name,f=o.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(h){return f?h.create!==f:!!u&&h.name!==u})),this},Ye.prototype.open=function(){var o=this;return Dn(U,function(){return Td(o)})},Ye.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var o=this._state,c=di.indexOf(this);if(0<=c&&di.splice(c,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}o.isBeingOpened||(o.dbReadyPromise=new L(function(u){o.dbReadyResolve=u}),o.openCanceller=new L(function(u,f){o.cancelOpen=f}))},Ye.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,u=this._state;c?(u.isBeingOpened&&u.cancelOpen(new de.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new de.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},Ye.prototype.delete=function(o){var c=this,u=(o===void 0&&(o={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),f=this._state;return new L(function(h,g){function v(){c.close(o);var b=c._deps.indexedDB.deleteDatabase(c.name);b.onsuccess=qe(function(){var k,R,C;k=c._deps,R=c.name,xo(C=k.indexedDB)||R===Vr||wo(C,k.IDBKeyRange).delete(R).catch(Pe),h()}),b.onerror=Zt(g),b.onblocked=c._fireOnBlocked}if(u)throw new de.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(v):v()})},Ye.prototype.backendDB=function(){return this.idbdb},Ye.prototype.isOpen=function(){return this.idbdb!==null},Ye.prototype.hasBeenClosed=function(){var o=this._state.dbOpenError;return o&&o.name==="DatabaseClosed"},Ye.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ye.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ye.prototype,"tables",{get:function(){var o=this;return a(this._allTables).map(function(c){return o._allTables[c]})},enumerable:!1,configurable:!0}),Ye.prototype.transaction=function(){var o=function(c,u,f){var h=arguments.length;if(h<2)throw new de.InvalidArgument("Too few arguments");for(var g=new Array(h-1);--h;)g[h-1]=arguments[h];return f=g.pop(),[c,Re(g),f]}.apply(this,arguments);return this._transaction.apply(this,o)},Ye.prototype._transaction=function(o,c,u){var f,h,g=this,v=F.trans,b=(v&&v.db===this&&o.indexOf("!")===-1||(v=null),o.indexOf("?")!==-1);o=o.replace("!","").replace("?","");try{if(h=c.map(function(R){if(R=R instanceof g.Table?R.name:R,typeof R!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return R}),o=="r"||o===co)f=co;else{if(o!="rw"&&o!=lo)throw new de.InvalidArgument("Invalid transaction mode: "+o);f=lo}if(v){if(v.mode===co&&f===lo){if(!b)throw new de.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");v=null}v&&h.forEach(function(R){if(v&&v.storeNames.indexOf(R)===-1){if(!b)throw new de.SubTransaction("Table "+R+" not included in parent transaction.");v=null}}),b&&v&&!v.active&&(v=null)}}catch(R){return v?v._promise(null,function(C,x){x(R)}):Ge(R)}var k=function R(C,x,I,A,E){return L.resolve().then(function(){var N=F.transless||F,_=C._createTransaction(x,I,C._dbSchema,A),N=(_.explicit=!0,{trans:_,transless:N});if(A)_.idbtrans=A.idbtrans;else try{_.create(),_.idbtrans._explicit=!0,C._state.PR1398_maxLoop=3}catch(q){return q.name===Xt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return R(C,x,I,null,E)})):Ge(q)}var j,B=Ue(E),N=(B&&fi(),L.follow(function(){var q;(j=E.call(_,_))&&(B?(q=wn.bind(null,null),j.then(q,q)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=Ao(j)))},N));return(j&&typeof j.then=="function"?L.resolve(j).then(function(q){return _.active?q:Ge(new de.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):N.then(function(){return j})).then(function(q){return A&&_._resolve(),_._completion.then(function(){return q})}).catch(function(q){return _._reject(q),Ge(q)})})}.bind(null,this,f,h,v,u);return v?v._promise(f,k,"lock"):F.trans?Dn(F.transless,function(){return g._whenReady(k)}):this._whenReady(k)},Ye.prototype.table=function(o){if(m(this._allTables,o))return this._allTables[o];throw new de.InvalidTable("Table ".concat(o," does not exist"))};var cn=Ye;function Ye(o,c){var u,f,h,g,v,b=this,k=(this._middlewares={},this.verno=0,Ye.dependencies),k=(this._options=c=i({addons:Ye.addons,autoOpen:!0,indexedDB:k.indexedDB,IDBKeyRange:k.IDBKeyRange,cache:"cloned"},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),R=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Pe,dbReadyPromise:null,cancelOpen:Pe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),C=(R.dbReadyPromise=new L(function(x){R.dbReadyResolve=x}),R.openCanceller=new L(function(x,I){R.cancelOpen=I}),this._state=R,this.name=o,this.on=Ki(this,"populate","blocked","versionchange","close",{ready:[vn,Pe]}),this.once=function(x,I){var A=function(){for(var E=[],_=0;_<arguments.length;_++)E[_]=arguments[_];b.on(x).unsubscribe(A),I.apply(b,E)};return b.on(x,A)},this.on.ready.subscribe=oe(this.on.ready.subscribe,function(x){return function(I,A){Ye.vip(function(){var E,_=b._state;_.openComplete?(_.dbOpenError||L.resolve().then(I),A&&x(I)):_.onReadyBeingFired?(_.onReadyBeingFired.push(I),A&&x(I)):(x(I),E=b,A||x(function j(){E.on.ready.unsubscribe(I),E.on.ready.unsubscribe(j)}))})}}),this.Collection=(u=this,Vi(wd.prototype,function(j,_){this.db=u;var A=Fc,E=null;if(_)try{A=_()}catch(N){E=N}var _=j._ctx,j=_.table,B=j.hook.reading.fire;this._ctx={table:j,index:_.index,isPrimKey:!_.index||j.schema.primKey.keyPath&&_.index===j.schema.primKey.name,range:A,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:E,or:_.or,valueMapper:B!==At?B:null}})),this.Table=(f=this,Vi(zc.prototype,function(x,I,A){this.db=f,this._tx=A,this.name=x,this.schema=I,this.hook=f._allTables[x]?f._allTables[x].hook:Ki(null,{creating:[sn,Pe],reading:[Fn,At],updating:[li,Pe],deleting:[Qt,Pe]})})),this.Transaction=(h=this,Vi(_d.prototype,function(x,I,A,E,_){var j=this;x!=="readonly"&&I.forEach(function(B){B=(B=A[B])==null?void 0:B.yProps,B&&(I=I.concat(B.map(function(N){return N.updatesTable})))}),this.db=h,this.mode=x,this.storeNames=I,this.schema=A,this.chromeTransactionDurability=E,this.idbtrans=null,this.on=Ki(this,"complete","error","abort"),this.parent=_||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L(function(B,N){j._resolve=B,j._reject=N}),this._completion.then(function(){j.active=!1,j.on.complete.fire()},function(B){var N=j.active;return j.active=!1,j.on.error.fire(B),j.parent?j.parent._reject(B):N&&j.idbtrans&&j.idbtrans.abort(),Ge(B)})})),this.Version=(g=this,Vi(Od.prototype,function(x){this.db=g,this._cfg={version:x,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(v=this,Vi(Jc.prototype,function(x,I,A){if(this.db=v,this._ctx={table:x,index:I===":id"?null:I,or:A},this._cmp=this._ascending=Ie,this._descending=function(E,_){return Ie(_,E)},this._max=function(E,_){return 0<Ie(E,_)?E:_},this._min=function(E,_){return Ie(E,_)<0?E:_},this._IDBKeyRange=v._deps.IDBKeyRange,!this._IDBKeyRange)throw new de.MissingAPI})),this.on("versionchange",function(x){0<x.newVersion?console.warn("Another connection wants to upgrade database '".concat(b.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(b.name,"'. Closing db now to resume the delete request.")),b.close({disableAutoOpen:!1})}),this.on("blocked",function(x){!x.newVersion||x.newVersion<x.oldVersion?console.warn("Dexie.delete('".concat(b.name,"') was blocked")):console.warn("Upgrade '".concat(b.name,"' blocked by other connection holding version ").concat(x.oldVersion/10))}),this._maxKey=Hi(c.IDBKeyRange),this._createTransaction=function(x,I,A,E){return new b.Transaction(x,I,A,b._options.chromeTransactionDurability,E)},this._fireOnBlocked=function(x){b.on("blocked").fire(x),di.filter(function(I){return I.name===b.name&&I!==b&&!I._state.vcFired}).map(function(I){return I.on("versionchange").fire(x)})},this.use(Rd),this.use($d),this.use(jd),this.use(Nd),this.use(Md),new Proxy(this,{get:function(x,I,A){var E;return I==="_vip"||(I==="table"?function(_){return ss(b.table(_),C)}:(E=Reflect.get(x,I,A))instanceof zc?ss(E,C):I==="tables"?E.map(function(_){return ss(_,C)}):I==="_createTransaction"?function(){return ss(E.apply(this,arguments),C)}:E)}}));this.vip=C,k.forEach(function(x){return x(b)})}var os,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Fd=(No.prototype.subscribe=function(o,c,u){return this._subscribe(o&&typeof o!="function"?o:{next:o,error:c,complete:u})},No.prototype[mi]=function(){return this},No);function No(o){this._subscribe=o}try{os={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{os={indexedDB:null,IDBKeyRange:null}}function fl(o){var c,u=!1,f=new Fd(function(h){var g=Ue(o),v,b=!1,k={},R={},C={get closed(){return b},unsubscribe:function(){b||(b=!0,v&&v.abort(),x&&_n.storagemutated.unsubscribe(A))}},x=(h.start&&h.start(C),!1),I=function(){return ao(E)},A=function(_){ns(k,_),ko(R,k)&&I()},E=function(){var _,j,B;!b&&os.indexedDB&&(k={},_={},v&&v.abort(),v=new AbortController,B=(N=>{var q=on();try{g&&fi();var W=bn(o,N);return W=g?W.finally(wn):W}finally{q&&yn()}})(j={subscr:_,signal:v.signal,requery:I,querier:o,trans:null}),Promise.resolve(B).then(function(N){u=!0,c=N,b||j.signal.aborted||(k={},(q=>{for(var W in q)if(m(q,W))return;return 1})(R=_)||x||(_n(Wi,A),x=!0),ao(function(){return!b&&h.next&&h.next(N)}))},function(N){u=!1,["DatabaseClosedError","AbortError"].includes(N?.name)||b||ao(function(){b||h.error&&h.error(N)})}))};return setTimeout(I,0),C});return f.hasValue=function(){return u},f.getValue=function(){return c},f}var Vn=cn;function Mo(o){var c=kn;try{kn=!0,_n.storagemutated.fire(o),Io(o,!0)}finally{kn=c}}w(Vn,i(i({},_t),{delete:function(o){return new Vn(o,{addons:[]}).delete()},exists:function(o){return new Vn(o,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(o){try{return c=Vn.dependencies,u=c.indexedDB,c=c.IDBKeyRange,(xo(u)?Promise.resolve(u.databases()).then(function(f){return f.map(function(h){return h.name}).filter(function(h){return h!==Vr})}):wo(u,c).toCollection().primaryKeys()).then(o)}catch{return Ge(new de.MissingAPI)}var c,u},defineClass:function(){return function(o){d(this,o)}},ignoreTransaction:function(o){return F.trans?Dn(F.transless,o):o()},vip:So,async:function(o){return function(){try{var c=Ao(o.apply(this,arguments));return c&&typeof c.then=="function"?c:L.resolve(c)}catch(u){return Ge(u)}}},spawn:function(o,c,u){try{var f=Ao(o.apply(u,c||[]));return f&&typeof f.then=="function"?f:L.resolve(f)}catch(h){return Ge(h)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(o,c){return o=L.resolve(typeof o=="function"?Vn.ignoreTransaction(o):o).timeout(c||6e4),F.trans?F.trans.waitFor(o):o},Promise:L,debug:{get:function(){return mt},set:function(o){Rt(o)}},derive:O,extend:d,props:w,override:oe,Events:Ki,on:_n,liveQuery:fl,extendObservabilitySet:ns,getByKeyPath:ae,setByKeyPath:fe,delByKeyPath:function(o,c){typeof c=="string"?fe(o,c,void 0):"length"in c&&[].map.call(c,function(u){fe(o,u,void 0)})},shallowClone:Y,deepClone:rt,getObjectDiff:Po,cmp:Ie,asap:Z,minKey:-1/0,addons:[],connections:di,errnames:Xt,dependencies:os,cache:Kn,semVer:"4.3.0",version:"4.3.0".split(".").map(function(o){return parseInt(o)}).reduce(function(o,c,u){return o+c/Math.pow(10,2*u)})})),Vn.maxKey=Hi(Vn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(_n(Wi,function(o){kn||(o=new CustomEvent(ho,{detail:o}),kn=!0,dispatchEvent(o),kn=!1)}),addEventListener(ho,function(o){o=o.detail,kn||Mo(o)}));var vi,kn=!1,dl=function(){};return typeof BroadcastChannel<"u"&&((dl=function(){(vi=new BroadcastChannel(ho)).onmessage=function(o){return o.data&&Mo(o.data)}})(),typeof vi.unref=="function"&&vi.unref(),_n(Wi,function(o){kn||vi.postMessage(o)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(o){if(!cn.disableBfCache&&o.persisted){mt&&console.debug("Dexie: handling persisted pagehide"),vi?.close();for(var c=0,u=di;c<u.length;c++)u[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(o){!cn.disableBfCache&&o.persisted&&(mt&&console.debug("Dexie: handling persisted pageshow"),dl(),Mo({all:new gt(-1/0,[[]])}))})),L.rejectionMapper=function(o,c){return!o||o instanceof ht||o instanceof TypeError||o instanceof SyntaxError||!o.name||!pt[o.name]?o:(c=new pt[o.name](c||o.message,o),"stack"in o&&K(c,"stack",{get:function(){return this.inner.stack}}),c)},Rt(mt),i(cn,Object.freeze({__proto__:null,Dexie:cn,Entity:Dc,PropModification:qi,RangeSet:gt,add:function(o){return new qi({add:o})},cmp:Ie,default:cn,liveQuery:fl,mergeRanges:Ji,rangesOverlap:tl,remove:function(o){return new qi({remove:o})},replacePrefix:function(o,c){return new qi({replacePrefix:[o,c]})}}),{default:cn}),cn})})(xs)),xs.exports}var uv=lv(),Ca=Dd(uv);const Ll=Symbol.for("Dexie"),Ns=globalThis[Ll]||(globalThis[Ll]=Ca);if(Ca.semVer!==Ns.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ca.semVer} and ${Ns.semVer}`);const{liveQuery:Nw,mergeRanges:Mw,rangesOverlap:Rw,RangeSet:jw,cmp:Bw,Entity:Lw,PropModification:$w,replacePrefix:Fw,add:Dw,remove:Uw,DexieYProvider:qw}=Ns;class fv extends Ns{pages;constructor(e){super("pages_"+e),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var dv=Object.getOwnPropertyDescriptor,hv=(n,e,t,i)=>{for(var r=i>1?void 0:i?dv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},pv=(n,e)=>(t,i)=>e(t,i,n);let Ea=class{pageStorageMap=new Map;logger;constructor(n){this.logger=n,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(n){let e=this.pageStorageMap.get(n);return e==null&&(e=new fv(n),this.pageStorageMap.set(n,e)),e}async getPage(n,e){try{this.logger.debug("Ready to load page from local storage",e);const t=this.getPageStorage(n);this.logger.debug("pageStorage is ready, asking for page");const i=await t.pages.get(e),r=new Mn;return r.fromObject(i),r}catch(t){this.logger.debug("Exception while trying to read from local storage",t);return}}async savePage(n,e,t){try{await this.getPageStorage(n).pages.put(t.toObject(),e)}catch(i){this.logger.debug("Exception while trying to store in local storage",n,e,t,i)}}async updatePage(n,e,t){try{const i=this.getPageStorage(n);this.logger.debug("Ready to store",t),await i.pages.update(e,t.toObject())}catch(i){this.logger.debug("Exception while trying to store in local storage",n,e,t,i)}}};Ea=hv([it(),pv(0,Be("Logger"))],Ea);var gv=Object.getOwnPropertyDescriptor,mv=(n,e,t,i)=>{for(var r=i>1?void 0:i?gv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Go=(n,e)=>(t,i)=>e(t,i,n);let Ia=class{logger;storage;offlineStorage;queueWorker;constructor(n,e,t){this.logger=n,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=e,this.queueWorker=t}setStorage(n){this.storage=n}getStorage(){return this.storage}setWikiConfig(n){return this.storage.setWikiConfig(n)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(n,e){return this.storage.getPageRestURL(n,e)}getPageFromViewURL(n){return this.storage.getPageFromViewURL(n)}getImageURL(n,e){return this.storage.getImageURL(n,e)}async getPageContent(n,e,t,i){if(this.logger.debug("Trying to get data for page ",n),this.offlineStorage){this.logger.debug("Asking offline storage for ",n);const r=await this.offlineStorage.getPage(this.getWikiConfig().name,n+"_"+e);return r!=null&&r!=null?(this.logger.debug("Loading data from local storage for page",n),(i==null||i)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+n+"_"+e),r):(this.logger.debug("Could not find data in local storage for page",n),this.savePageContent(n,e))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(n,e)}getAttachments(n){return this.storage.getAttachments(n)}getAttachment(n,e){return this.storage.getAttachment(n,e)}async savePageContent(n,e){const t=await this.storage.getPageContent(n,e);if(t)return t.id=n+"_"+e,this.logger.debug("Saving page to offline storage",n),this.offlineStorage.savePage(this.getWikiConfig().name,n+"_"+e,t),t;throw new Error("Can't save missing page.")}async updatePageContent(n,e){const t=await this.offlineStorage.getPage(this.getWikiConfig().name,n+"_"+e),i=await this.storage.getPageContent(n,e);return t&&i?(i.id=n+"_"+e,this.logger.debug("Saving page to offline storage",n),this.offlineStorage.savePage(this.getWikiConfig().name,n+"_"+e,i),!0):t?.version!=i?.version&&i?(i.id=n+"_"+e,this.logger.debug("Updating page to offline storage",n),this.offlineStorage.updatePage(this.getWikiConfig().name,n+"_"+e,i),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(n,e,t){return this.storage.getPanelContent(n,e,t)}async getEditField(n,e){return await this.storage.getEditField(n,e)}save(n,e,t,i){return this.storage.save(n,e,t,i)}async saveAttachments(n,e){return this.storage.saveAttachments(n,e)}async delete(n){return this.storage.delete(n)}async move(n,e,t){return this.storage.move(n,e,t)}};Ia=mv([it(),Go(0,Be("Logger")),Go(1,Be("OfflineStorage")),Go(2,Be("QueueWorker"))],Ia);let vv=class{constructor(e){e.bind("WrappingStorage").to(Ia).inSingletonScope(),e.bind("OfflineStorage").to(Ea).inSingletonScope()}};var yv=Object.getOwnPropertyDescriptor,bv=(n,e,t,i)=>{for(var r=i>1?void 0:i?yv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},us=(n,e)=>(t,i)=>e(t,i,n);let Aa=class extends xr{storage;cristal;constructor(n,e,t){super(n),this.storage=e,this.cristal=t,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}getType(){return"GitHub"}};Aa=bv([it(),us(0,Be("Logger")),us(1,Be("Storage")),us(1,cc("GitHub")),us(2,Be("CristalApp"))],Aa);const yc=Symbol.for("yaml.alias"),Pa=Symbol.for("yaml.document"),Rn=Symbol.for("yaml.map"),gf=Symbol.for("yaml.pair"),rn=Symbol.for("yaml.scalar"),Li=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),ai=n=>!!n&&typeof n=="object"&&n[Vt]===yc,Mr=n=>!!n&&typeof n=="object"&&n[Vt]===Pa,Rr=n=>!!n&&typeof n=="object"&&n[Vt]===Rn,et=n=>!!n&&typeof n=="object"&&n[Vt]===gf,De=n=>!!n&&typeof n=="object"&&n[Vt]===rn,jr=n=>!!n&&typeof n=="object"&&n[Vt]===Li;function Xe(n){if(n&&typeof n=="object")switch(n[Vt]){case Rn:case Li:return!0}return!1}function Qe(n){if(n&&typeof n=="object")switch(n[Vt]){case yc:case Rn:case rn:case Li:return!0}return!1}const mf=n=>(De(n)||Xe(n))&&!!n.anchor,Yn=Symbol("break visit"),wv=Symbol("skip children"),ur=Symbol("remove node");function $i(n,e){const t=xv(e);Mr(n)?Ei(null,n.contents,t,Object.freeze([n]))===ur&&(n.contents=null):Ei(null,n,t,Object.freeze([]))}$i.BREAK=Yn;$i.SKIP=wv;$i.REMOVE=ur;function Ei(n,e,t,i){const r=Sv(n,e,t,i);if(Qe(r)||et(r))return _v(n,i,r),Ei(n,r,t,i);if(typeof r!="symbol"){if(Xe(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){const a=Ei(s,e.items[s],t,i);if(typeof a=="number")s=a-1;else{if(a===Yn)return Yn;a===ur&&(e.items.splice(s,1),s-=1)}}}else if(et(e)){i=Object.freeze(i.concat(e));const s=Ei("key",e.key,t,i);if(s===Yn)return Yn;s===ur&&(e.key=null);const a=Ei("value",e.value,t,i);if(a===Yn)return Yn;a===ur&&(e.value=null)}}return r}function xv(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Sv(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(Rr(e))return t.Map?.(n,e,i);if(jr(e))return t.Seq?.(n,e,i);if(et(e))return t.Pair?.(n,e,i);if(De(e))return t.Scalar?.(n,e,i);if(ai(e))return t.Alias?.(n,e,i)}function _v(n,e,t){const i=e[e.length-1];if(Xe(i))i.items[n]=t;else if(et(i))n==="key"?i.key=t:i.value=t;else if(Mr(i))i.contents=t;else{const r=ai(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const kv={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Cv=n=>n.replace(/[!,[\]{}]/g,e=>kv[e]);class bt{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},bt.defaultYaml,e),this.tags=Object.assign({},bt.defaultTags,t)}clone(){const e=new bt(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new bt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:bt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},bt.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:bt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},bt.defaultTags),this.atNextDocument=!1);const i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}const[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Cv(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(e&&i.length>0&&Qe(e.contents)){const s={};$i(e.contents,(a,l)=>{Qe(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(a)))&&t.push(`%TAG ${s} ${a}`);return t.join(`
|
|
51
|
-
`)}}bt.defaultYaml={explicit:!1,version:"1.2"};bt.defaultTags={"!!":"tag:yaml.org,2002:"};function vf(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function yf(n){const e=new Set;return $i(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function bf(n,e){for(let t=1;;++t){const i=`${n}${t}`;if(!e.has(i))return i}}function Ev(n,e){const t=[],i=new Map;let r=null;return{onAnchor:s=>{t.push(s),r??(r=yf(n));const a=bf(e,r);return r.add(a),a},setAnchors:()=>{for(const s of t){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(De(a.node)||Xe(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Ii(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){const a=i[r],l=Ii(n,i,String(r),a);l===void 0?delete i[r]:l!==a&&(i[r]=l)}else if(i instanceof Map)for(const r of Array.from(i.keys())){const s=i.get(r),a=Ii(n,i,r,s);a===void 0?i.delete(r):a!==s&&i.set(r,a)}else if(i instanceof Set)for(const r of Array.from(i)){const s=Ii(n,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(const[r,s]of Object.entries(i)){const a=Ii(n,i,r,s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}return n.call(e,t,i)}function Dt(n,e,t){if(Array.isArray(n))return n.map((i,r)=>Dt(i,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!mf(n))return n.toJSON(e,t);const i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=s=>{i.res=s,delete t.onCreate};const r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}class bc{constructor(e){Object.defineProperty(this,Vt,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Mr(e))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Dt(this,"",a);if(typeof r=="function")for(const{count:d,res:p}of a.anchors.values())r(p,d);return typeof s=="function"?Ii(s,{"":l},"",l):l}}class wc extends bc{constructor(e){super(yc),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],$i(e,{Node:(s,a)=>{(ai(a)||mf(a))&&i.push(a)}}),t&&(t.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=t,a=this.resolve(r,t);if(!a){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let l=i.get(a);if(l||(Dt(a,null,t),l=i.get(a)),l?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Ss(r,a,i)),l.count*l.aliasCount>s)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return l.res}toString(e,t,i){const r=`*${this.source}`;if(e){if(vf(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}}function Ss(n,e,t){if(ai(e)){const i=e.resolve(n),r=t&&i&&t.get(i);return r?r.count*r.aliasCount:0}else if(Xe(e)){let i=0;for(const r of e.items){const s=Ss(n,r,t);s>i&&(i=s)}return i}else if(et(e)){const i=Ss(n,e.key,t),r=Ss(n,e.value,t);return Math.max(i,r)}return 1}const wf=n=>!n||typeof n!="function"&&typeof n!="object";class we extends bc{constructor(e){super(rn),this.value=e}toJSON(e,t){return t?.keep?this.value:Dt(this.value,e,t)}toString(){return String(this.value)}}we.BLOCK_FOLDED="BLOCK_FOLDED";we.BLOCK_LITERAL="BLOCK_LITERAL";we.PLAIN="PLAIN";we.QUOTE_DOUBLE="QUOTE_DOUBLE";we.QUOTE_SINGLE="QUOTE_SINGLE";const Iv="tag:yaml.org,2002:";function Av(n,e,t){if(e){const i=t.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>i.identify?.(n)&&!i.format)}function Sr(n,e,t){if(Mr(n)&&(n=n.contents),Qe(n))return n;if(et(n)){const m=t.schema[Rn].createNode?.(t.schema,null,t);return m.items.push(n),m}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:l}=t;let d;if(i&&n&&typeof n=="object"){if(d=l.get(n),d)return d.anchor??(d.anchor=r(n)),new wc(d.anchor);d={anchor:null,node:null},l.set(n,d)}e?.startsWith("!!")&&(e=Iv+e.slice(2));let p=Av(n,e,a.tags);if(!p){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const m=new we(n);return d&&(d.node=m),m}p=n instanceof Map?a[Rn]:Symbol.iterator in Object(n)?a[Li]:a[Rn]}s&&(s(p),delete t.onTagObj);const y=p?.createNode?p.createNode(t.schema,n,t):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(t.schema,n,t):new we(n);return e?y.tag=e:p.default||(y.tag=p.tag),d&&(d.node=y),y}function Ms(n,e,t){let i=t;for(let r=e.length-1;r>=0;--r){const s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return Sr(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const tr=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class xf extends bc{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>Qe(i)||et(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(tr(e))this.add(t);else{const[i,...r]=e,s=this.get(i,!0);if(Xe(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(i,Ms(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){const[t,...i]=e;if(i.length===0)return this.delete(t);const r=this.get(t,!0);if(Xe(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){const[i,...r]=e,s=this.get(i,!0);return r.length===0?!t&&De(s)?s.value:s:Xe(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!et(t))return!1;const i=t.value;return i==null||e&&De(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){const[t,...i]=e;if(i.length===0)return this.has(t);const r=this.get(t,!0);return Xe(r)?r.hasIn(i):!1}setIn(e,t){const[i,...r]=e;if(r.length===0)this.set(i,t);else{const s=this.get(i,!0);if(Xe(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(i,Ms(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const Pv=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function fn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const Qn=(n,e,t)=>n.endsWith(`
|
|
52
|
-
`)?fn(t,e):t.includes(`
|
|
53
|
-
`)?`
|
|
54
|
-
`+fn(t,e):(n.endsWith(" ")?"":" ")+t,Sf="flow",Oa="block",_s="quoted";function Qs(n,e,t="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return n;r<s&&(s=0);const d=Math.max(1+s,1+r-e.length);if(n.length<=d)return n;const p=[],y={};let m=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?p.push(0):m=r-i);let w,P,K=!1,O=-1,D=-1,ee=-1;t===Oa&&(O=$l(n,O,e.length),O!==-1&&(m=O+d));for(let oe;oe=n[O+=1];){if(t===_s&&oe==="\\"){switch(D=O,n[O+1]){case"x":O+=3;break;case"u":O+=5;break;case"U":O+=9;break;default:O+=1}ee=O}if(oe===`
|
|
55
|
-
`)t===Oa&&(O=$l(n,O,e.length)),m=O+e.length+d,w=void 0;else{if(oe===" "&&P&&P!==" "&&P!==`
|
|
56
|
-
`&&P!==" "){const G=n[O+1];G&&G!==" "&&G!==`
|
|
57
|
-
`&&G!==" "&&(w=O)}if(O>=m)if(w)p.push(w),m=w+d,w=void 0;else if(t===_s){for(;P===" "||P===" ";)P=oe,oe=n[O+=1],K=!0;const G=O>ee+1?O-2:D-1;if(y[G])return n;p.push(G),y[G]=!0,m=G+d,w=void 0}else K=!0}P=oe}if(K&&l&&l(),p.length===0)return n;a&&a();let J=n.slice(0,p[0]);for(let oe=0;oe<p.length;++oe){const G=p[oe],Z=p[oe+1]||n.length;G===0?J=`
|
|
58
|
-
${e}${n.slice(0,Z)}`:(t===_s&&y[G]&&(J+=`${n[G]}\\`),J+=`
|
|
59
|
-
${e}${n.slice(G+1,Z)}`)}return J}function $l(n,e,t){let i=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
|
|
60
|
-
`);i=e,r=e+1,s=n[r]}return i}const Zs=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),eo=n=>/^(%|---|\.\.\.)/m.test(n);function Ov(n,e,t){if(!e||e<0)return!1;const i=e-t,r=n.length;if(r<=i)return!1;for(let s=0,a=0;s<r;++s)if(n[s]===`
|
|
61
|
-
`){if(s-a>i)return!0;if(a=s+1,r-a<=i)return!1}return!0}function fr(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(eo(n)?" ":"");let a="",l=0;for(let d=0,p=t[d];p;p=t[++d])if(p===" "&&t[d+1]==="\\"&&t[d+2]==="n"&&(a+=t.slice(l,d)+"\\ ",d+=1,l=d,p="\\"),p==="\\")switch(t[d+1]){case"u":{a+=t.slice(l,d);const y=t.substr(d+2,4);switch(y){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:y.substr(0,2)==="00"?a+="\\x"+y.substr(2):a+=t.substr(d,6)}d+=5,l=d+1}break;case"n":if(i||t[d+2]==='"'||t.length<r)d+=1;else{for(a+=t.slice(l,d)+`
|
|
62
|
-
|
|
63
|
-
`;t[d+2]==="\\"&&t[d+3]==="n"&&t[d+4]!=='"';)a+=`
|
|
64
|
-
`,d+=2;a+=s,t[d+2]===" "&&(a+="\\"),d+=1,l=d+1}break;default:d+=1}return a=l?a+t.slice(l):t,i?a:Qs(a,s,_s,Zs(e,!1))}function Ta(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
65
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return fr(n,e);const t=e.indent||(eo(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
66
|
-
${t}`)+"'";return e.implicitKey?i:Qs(i,t,Sf,Zs(e,!1))}function Ai(n,e){const{singleQuote:t}=e.options;let i;if(t===!1)i=fr;else{const r=n.includes('"'),s=n.includes("'");r&&!s?i=Ta:s&&!r?i=fr:i=t?Ta:fr}return i(n,e)}let Na;try{Na=new RegExp(`(^|(?<!
|
|
67
|
-
))
|
|
68
|
-
+(?!
|
|
69
|
-
|$)`,"g")}catch{Na=/\n+(?!\n|$)/g}function ks({comment:n,type:e,value:t},i,r,s){const{blockQuote:a,commentString:l,lineWidth:d}=i.options;if(!a||/\n[\t ]+$/.test(t))return Ai(t,i);const p=i.indent||(i.forceBlockIndent||eo(t)?" ":""),y=a==="literal"?!0:a==="folded"||e===we.BLOCK_FOLDED?!1:e===we.BLOCK_LITERAL?!0:!Ov(t,d,p.length);if(!t)return y?`|
|
|
70
|
-
`:`>
|
|
71
|
-
`;let m,w;for(w=t.length;w>0;--w){const Z=t[w-1];if(Z!==`
|
|
72
|
-
`&&Z!==" "&&Z!==" ")break}let P=t.substring(w);const K=P.indexOf(`
|
|
73
|
-
`);K===-1?m="-":t===P||K!==P.length-1?(m="+",s&&s()):m="",P&&(t=t.slice(0,-P.length),P[P.length-1]===`
|
|
74
|
-
`&&(P=P.slice(0,-1)),P=P.replace(Na,`$&${p}`));let O=!1,D,ee=-1;for(D=0;D<t.length;++D){const Z=t[D];if(Z===" ")O=!0;else if(Z===`
|
|
75
|
-
`)ee=D;else break}let J=t.substring(0,ee<D?ee+1:D);J&&(t=t.substring(J.length),J=J.replace(/\n+/g,`$&${p}`));let G=(O?p?"2":"1":"")+m;if(n&&(G+=" "+l(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!y){const Z=t.replace(/\n+/g,`
|
|
76
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let ae=!1;const fe=Zs(i,!0);a!=="folded"&&e!==we.BLOCK_FOLDED&&(fe.onOverflow=()=>{ae=!0});const Y=Qs(`${J}${Z}${P}`,p,Oa,fe);if(!ae)return`>${G}
|
|
77
|
-
${p}${Y}`}return t=t.replace(/\n+/g,`$&${p}`),`|${G}
|
|
78
|
-
${p}${J}${t}${P}`}function Tv(n,e,t,i){const{type:r,value:s}=n,{actualString:a,implicitKey:l,indent:d,indentStep:p,inFlow:y}=e;if(l&&s.includes(`
|
|
79
|
-
`)||y&&/[[\]{},]/.test(s))return Ai(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||y||!s.includes(`
|
|
80
|
-
`)?Ai(s,e):ks(n,e,t,i);if(!l&&!y&&r!==we.PLAIN&&s.includes(`
|
|
81
|
-
`))return ks(n,e,t,i);if(eo(s)){if(d==="")return e.forceBlockIndent=!0,ks(n,e,t,i);if(l&&d===p)return Ai(s,e)}const m=s.replace(/\n+/g,`$&
|
|
82
|
-
${d}`);if(a){const w=O=>O.default&&O.tag!=="tag:yaml.org,2002:str"&&O.test?.test(m),{compat:P,tags:K}=e.doc.schema;if(K.some(w)||P?.some(w))return Ai(s,e)}return l?m:Qs(m,d,Sf,Zs(e,!1))}function xc(n,e,t,i){const{implicitKey:r,inFlow:s}=e,a=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:l}=n;l!==we.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=we.QUOTE_DOUBLE);const d=y=>{switch(y){case we.BLOCK_FOLDED:case we.BLOCK_LITERAL:return r||s?Ai(a.value,e):ks(a,e,t,i);case we.QUOTE_DOUBLE:return fr(a.value,e);case we.QUOTE_SINGLE:return Ta(a.value,e);case we.PLAIN:return Tv(a,e,t,i);default:return null}};let p=d(l);if(p===null){const{defaultKeyType:y,defaultStringType:m}=e.options,w=r&&y||m;if(p=d(w),p===null)throw new Error(`Unsupported default string type ${w}`)}return p}function _f(n,e){const t=Object.assign({blockQuote:!0,commentString:Pv,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function Nv(n,e){if(e.tag){const r=n.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let t,i;if(De(e)){i=e.value;let r=n.filter(s=>s.identify?.(i));if(r.length>1){const s=r.filter(a=>a.test);s.length>0&&(r=s)}t=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,t=n.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!t){const r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return t}function Mv(n,e,{anchors:t,doc:i}){if(!i.directives)return"";const r=[],s=(De(n)||Xe(n))&&n.anchor;s&&vf(s)&&(t.add(s),r.push(`&${s}`));const a=n.tag??(e.default?null:e.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function Ri(n,e,t,i){if(et(n))return n.toString(e,t,i);if(ai(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r;const s=Qe(n)?n:e.doc.createNode(n,{onTagObj:d=>r=d});r??(r=Nv(e.doc.schema.tags,s));const a=Mv(s,r,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,e,t,i):De(s)?xc(s,e,t,i):s.toString(e,t,i);return a?De(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
83
|
-
${e.indent}${l}`:l}function Rv({key:n,value:e},t,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:d,options:{commentString:p,indentSeq:y,simpleKeys:m}}=t;let w=Qe(n)&&n.comment||null;if(m){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(Xe(n)||!Qe(n)&&typeof n=="object"){const fe="With simple keys, collection cannot be used as a key value";throw new Error(fe)}}let P=!m&&(!n||w&&e==null&&!t.inFlow||Xe(n)||(De(n)?n.type===we.BLOCK_FOLDED||n.type===we.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!P&&(m||!s),indent:l+d});let K=!1,O=!1,D=Ri(n,t,()=>K=!0,()=>O=!0);if(!P&&!t.inFlow&&D.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");P=!0}if(t.inFlow){if(s||e==null)return K&&i&&i(),D===""?"?":P?`? ${D}`:D}else if(s&&!m||e==null&&P)return D=`? ${D}`,w&&!K?D+=Qn(D,t.indent,p(w)):O&&r&&r(),D;K&&(w=null),P?(w&&(D+=Qn(D,t.indent,p(w))),D=`? ${D}
|
|
84
|
-
${l}:`):(D=`${D}:`,w&&(D+=Qn(D,t.indent,p(w))));let ee,J,oe;Qe(e)?(ee=!!e.spaceBefore,J=e.commentBefore,oe=e.comment):(ee=!1,J=null,oe=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!P&&!w&&De(e)&&(t.indentAtStart=D.length+1),O=!1,!y&&d.length>=2&&!t.inFlow&&!P&&jr(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let G=!1;const Z=Ri(e,t,()=>G=!0,()=>O=!0);let ae=" ";if(w||ee||J){if(ae=ee?`
|
|
85
|
-
`:"",J){const fe=p(J);ae+=`
|
|
86
|
-
${fn(fe,t.indent)}`}Z===""&&!t.inFlow?ae===`
|
|
87
|
-
`&&oe&&(ae=`
|
|
88
|
-
|
|
89
|
-
`):ae+=`
|
|
90
|
-
${t.indent}`}else if(!P&&Xe(e)){const fe=Z[0],Y=Z.indexOf(`
|
|
91
|
-
`),ge=Y!==-1,Re=t.inFlow??e.flow??e.items.length===0;if(ge||!Re){let We=!1;if(ge&&(fe==="&"||fe==="!")){let ke=Z.indexOf(" ");fe==="&"&&ke!==-1&&ke<Y&&Z[ke+1]==="!"&&(ke=Z.indexOf(" ",ke+1)),(ke===-1||Y<ke)&&(We=!0)}We||(ae=`
|
|
92
|
-
${t.indent}`)}}else(Z===""||Z[0]===`
|
|
93
|
-
`)&&(ae="");return D+=ae+Z,t.inFlow?G&&i&&i():oe&&!G?D+=Qn(D,t.indent,p(oe)):O&&r&&r(),D}function kf(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const fs="<<",pn={identify:n=>n===fs||typeof n=="symbol"&&n.description===fs,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new we(Symbol(fs)),{addToJSMap:Cf}),stringify:()=>fs},jv=(n,e)=>(pn.identify(e)||De(e)&&(!e.type||e.type===we.PLAIN)&&pn.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===pn.tag&&t.default);function Cf(n,e,t){if(t=n&&ai(t)?t.resolve(n.doc):t,jr(t))for(const i of t.items)Yo(n,e,i);else if(Array.isArray(t))for(const i of t)Yo(n,e,i);else Yo(n,e,t)}function Yo(n,e,t){const i=n&&ai(t)?t.resolve(n.doc):t;if(!Rr(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,n,Map);for(const[s,a]of r)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function Ef(n,e,{key:t,value:i}){if(Qe(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(jv(n,t))Cf(n,e,i);else{const r=Dt(t,"",n);if(e instanceof Map)e.set(r,Dt(i,r,n));else if(e instanceof Set)e.add(r);else{const s=Bv(t,r,n),a=Dt(i,s,n);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function Bv(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Qe(n)&&t?.doc){const i=_f(t.doc,{});i.anchors=new Set;for(const s of t.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=n.toString(i);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),kf(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}function Sc(n,e,t){const i=Sr(n,void 0,t),r=Sr(e,void 0,t);return new wt(i,r)}class wt{constructor(e,t=null){Object.defineProperty(this,Vt,{value:gf}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return Qe(t)&&(t=t.clone(e)),Qe(i)&&(i=i.clone(e)),new wt(t,i)}toJSON(e,t){const i=t?.mapAsMap?new Map:{};return Ef(t,i,this)}toString(e,t,i){return e?.doc?Rv(this,e,t,i):JSON.stringify(this)}}function If(n,e,t){return(e.inFlow??n.flow?$v:Lv)(n,e,t)}function Lv({comment:n,items:e},t,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:d,options:{commentString:p}}=t,y=Object.assign({},t,{indent:s,type:null});let m=!1;const w=[];for(let K=0;K<e.length;++K){const O=e[K];let D=null;if(Qe(O))!m&&O.spaceBefore&&w.push(""),Rs(t,w,O.commentBefore,m),O.comment&&(D=O.comment);else if(et(O)){const J=Qe(O.key)?O.key:null;J&&(!m&&J.spaceBefore&&w.push(""),Rs(t,w,J.commentBefore,m))}m=!1;let ee=Ri(O,y,()=>D=null,()=>m=!0);D&&(ee+=Qn(ee,s,p(D))),m&&D&&(m=!1),w.push(i+ee)}let P;if(w.length===0)P=r.start+r.end;else{P=w[0];for(let K=1;K<w.length;++K){const O=w[K];P+=O?`
|
|
94
|
-
${d}${O}`:`
|
|
95
|
-
`}}return n?(P+=`
|
|
96
|
-
`+fn(p(n),d),l&&l()):m&&a&&a(),P}function $v({items:n},e,{flowChars:t,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;i+=s;const d=Object.assign({},e,{indent:i,inFlow:!0,type:null});let p=!1,y=0;const m=[];for(let K=0;K<n.length;++K){const O=n[K];let D=null;if(Qe(O))O.spaceBefore&&m.push(""),Rs(e,m,O.commentBefore,!1),O.comment&&(D=O.comment);else if(et(O)){const J=Qe(O.key)?O.key:null;J&&(J.spaceBefore&&m.push(""),Rs(e,m,J.commentBefore,!1),J.comment&&(p=!0));const oe=Qe(O.value)?O.value:null;oe?(oe.comment&&(D=oe.comment),oe.commentBefore&&(p=!0)):O.value==null&&J?.comment&&(D=J.comment)}D&&(p=!0);let ee=Ri(O,d,()=>D=null);p||(p=m.length>y||ee.includes(`
|
|
97
|
-
`)),K<n.length-1?ee+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(p||(p=m.reduce((J,oe)=>J+oe.length+2,2)+(ee.length+2)>e.options.lineWidth)),p&&(ee+=",")),D&&(ee+=Qn(ee,i,l(D))),m.push(ee),y=m.length}const{start:w,end:P}=t;if(m.length===0)return w+P;if(!p){const K=m.reduce((O,D)=>O+D.length+2,2);p=e.options.lineWidth>0&&K>e.options.lineWidth}if(p){let K=w;for(const O of m)K+=O?`
|
|
98
|
-
${s}${r}${O}`:`
|
|
99
|
-
`;return`${K}
|
|
100
|
-
${r}${P}`}else return`${w}${a}${m.join(" ")}${a}${P}`}function Rs({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=fn(e(i),n);t.push(s.trimStart())}}function Zn(n,e){const t=De(e)?e.value:e;for(const i of n)if(et(i)&&(i.key===e||i.key===t||De(i.key)&&i.key.value===t))return i}class $t extends xf{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Rn,e),this.items=[]}static from(e,t,i){const{keepUndefined:r,replacer:s}=i,a=new this(e),l=(d,p)=>{if(typeof s=="function")p=s.call(t,d,p);else if(Array.isArray(s)&&!s.includes(d))return;(p!==void 0||r)&&a.items.push(Sc(d,p,i))};if(t instanceof Map)for(const[d,p]of t)l(d,p);else if(t&&typeof t=="object")for(const d of Object.keys(t))l(d,t[d]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let i;et(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new wt(e,e?.value):i=new wt(e.key,e.value);const r=Zn(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${i.key} already set`);De(r.value)&&wf(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const a=this.items.findIndex(l=>s(i,l)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(e){const t=Zn(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const r=Zn(this.items,e)?.value;return(!t&&De(r)?r.value:r)??void 0}has(e){return!!Zn(this.items,e)}set(e,t){this.add(new wt(e,t),!0)}toJSON(e,t,i){const r=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const s of this.items)Ef(t,r,s);return r}toString(e,t,i){if(!e)return JSON.stringify(this);for(const r of this.items)if(!et(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),If(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}}const Fi={collection:"map",default:!0,nodeClass:$t,tag:"tag:yaml.org,2002:map",resolve(n,e){return Rr(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>$t.from(n,e,t)};class ri extends xf{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Li,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=ds(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const i=ds(e);if(typeof i!="number")return;const r=this.items[i];return!t&&De(r)?r.value:r}has(e){const t=ds(e);return typeof t=="number"&&t<this.items.length}set(e,t){const i=ds(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[i];De(r)&&wf(t)?r.value=t:this.items[i]=t}toJSON(e,t){const i=[];t?.onCreate&&t.onCreate(i);let r=0;for(const s of this.items)i.push(Dt(s,String(r++),t));return i}toString(e,t,i){return e?If(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){const{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof r=="function"){const d=t instanceof Set?l:String(a++);l=r.call(t,d,l)}s.items.push(Sr(l,void 0,i))}}return s}}function ds(n){let e=De(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Di={collection:"seq",default:!0,nodeClass:ri,tag:"tag:yaml.org,2002:seq",resolve(n,e){return jr(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>ri.from(n,e,t)},to={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),xc(n,e,t,i)}},no={identify:n=>n==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new we(null),stringify:({source:n},e)=>typeof n=="string"&&no.test.test(n)?n:e.options.nullStr},_c={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new we(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&_c.test.test(n)){const i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};function Jt({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const Af={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Jt},Pf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Jt(n)}},Of={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new we(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Jt},io=n=>typeof n=="bigint"||Number.isInteger(n),kc=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function Tf(n,e,t){const{value:i}=n;return io(i)&&i>=0?t+i.toString(e):Jt(n)}const Nf={identify:n=>io(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>kc(n,2,8,t),stringify:n=>Tf(n,8,"0o")},Mf={identify:io,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>kc(n,0,10,t),stringify:Jt},Rf={identify:n=>io(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>kc(n,2,16,t),stringify:n=>Tf(n,16,"0x")},Fv=[Fi,Di,to,no,_c,Nf,Mf,Rf,Af,Pf,Of];function Fl(n){return typeof n=="bigint"||Number.isInteger(n)}const hs=({value:n})=>JSON.stringify(n),Dv=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:hs},{identify:n=>n==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:hs},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:hs},{identify:Fl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Fl(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:hs}],Uv={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},qv=[Fi,Di].concat(Dv,Uv),Cc={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,r,s){if(!t)return"";const a=t;let l;if(typeof btoa=="function"){let d="";for(let p=0;p<a.length;++p)d+=String.fromCharCode(a[p]);l=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=we.BLOCK_LITERAL),e!==we.QUOTE_DOUBLE){const d=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),p=Math.ceil(l.length/d),y=new Array(p);for(let m=0,w=0;m<p;++m,w+=d)y[m]=l.substr(w,d);l=y.join(e===we.BLOCK_LITERAL?`
|
|
101
|
-
`:" ")}return xc({comment:n,type:e,value:l},i,r,s)}};function jf(n,e){if(jr(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!et(i)){if(Rr(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new wt(new we(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
102
|
-
${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
103
|
-
${s.comment}`:i.comment}i=r}n.items[t]=et(i)?i:new wt(i)}}else e("Expected a sequence for this tag");return n}function Bf(n,e,t){const{replacer:i}=t,r=new ri(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof i=="function"&&(a=i.call(e,String(s++),a));let l,d;if(Array.isArray(a))if(a.length===2)l=a[0],d=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const p=Object.keys(a);if(p.length===1)l=p[0],d=a[l];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else l=a;r.items.push(Sc(l,d,t))}return r}const Ec={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jf,createNode:Bf};class Ti extends ri{constructor(){super(),this.add=$t.prototype.add.bind(this),this.delete=$t.prototype.delete.bind(this),this.get=$t.prototype.get.bind(this),this.has=$t.prototype.has.bind(this),this.set=$t.prototype.set.bind(this),this.tag=Ti.tag}toJSON(e,t){if(!t)return super.toJSON(e);const i=new Map;t?.onCreate&&t.onCreate(i);for(const r of this.items){let s,a;if(et(r)?(s=Dt(r.key,"",t),a=Dt(r.value,s,t)):s=Dt(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(e,t,i){const r=Bf(e,t,i),s=new this;return s.items=r.items,s}}Ti.tag="tag:yaml.org,2002:omap";const Ic={collection:"seq",identify:n=>n instanceof Map,nodeClass:Ti,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=jf(n,e),i=[];for(const{key:r}of t.items)De(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Ti,t)},createNode:(n,e,t)=>Ti.from(n,e,t)};function Lf({value:n,source:e},t){return e&&(n?$f:Ff).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const $f={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new we(!0),stringify:Lf},Ff={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new we(!1),stringify:Lf},Kv={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Jt},Vv={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Jt(n)}},zv={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new we(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Jt},Br=n=>typeof n=="bigint"||Number.isInteger(n);function ro(n,e,t,{intAsBigInt:i}){const r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const a=BigInt(n);return r==="-"?BigInt(-1)*a:a}const s=parseInt(n,t);return r==="-"?-1*s:s}function Ac(n,e,t){const{value:i}=n;if(Br(i)){const r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return Jt(n)}const Wv={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>ro(n,2,2,t),stringify:n=>Ac(n,2,"0b")},Hv={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>ro(n,1,8,t),stringify:n=>Ac(n,8,"0")},Gv={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>ro(n,0,10,t),stringify:Jt},Yv={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>ro(n,2,16,t),stringify:n=>Ac(n,16,"0x")};class Ni extends $t{constructor(e){super(e),this.tag=Ni.tag}add(e){let t;et(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new wt(e.key,null):t=new wt(e,null),Zn(this.items,t.key)||this.items.push(t)}get(e,t){const i=Zn(this.items,e);return!t&&et(i)?De(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const i=Zn(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new wt(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){const{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),s.items.push(Sc(a,null,i));return s}}Ni.tag="tag:yaml.org,2002:set";const Pc={collection:"map",identify:n=>n instanceof Set,nodeClass:Ni,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Ni.from(n,e,t),resolve(n,e){if(Rr(n)){if(n.hasAllNullValues(!0))return Object.assign(new Ni,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function Oc(n,e){const t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=a=>e?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return t==="-"?r(-1)*s:s}function Df(n){let{value:e}=n,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Jt(n);let i="";e<0&&(i="-",e*=t(-1));const r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Uf={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Oc(n,t),stringify:Df},qf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Oc(n,!1),stringify:Df},so={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(so.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,i,r,s,a,l]=e.map(Number),d=e[7]?Number((e[7]+"00").substr(1,3)):0;let p=Date.UTC(t,i-1,r,s||0,a||0,l||0,d);const y=e[8];if(y&&y!=="Z"){let m=Oc(y,!1);Math.abs(m)<30&&(m*=60),p-=6e4*m}return new Date(p)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Dl=[Fi,Di,to,no,$f,Ff,Wv,Hv,Gv,Yv,Kv,Vv,zv,Cc,pn,Ic,Ec,Pc,Uf,qf,so],Ul=new Map([["core",Fv],["failsafe",[Fi,Di,to]],["json",qv],["yaml11",Dl],["yaml-1.1",Dl]]),ql={binary:Cc,bool:_c,float:Of,floatExp:Pf,floatNaN:Af,floatTime:qf,int:Mf,intHex:Rf,intOct:Nf,intTime:Uf,map:Fi,merge:pn,null:no,omap:Ic,pairs:Ec,seq:Di,set:Pc,timestamp:so},Jv={"tag:yaml.org,2002:binary":Cc,"tag:yaml.org,2002:merge":pn,"tag:yaml.org,2002:omap":Ic,"tag:yaml.org,2002:pairs":Ec,"tag:yaml.org,2002:set":Pc,"tag:yaml.org,2002:timestamp":so};function Jo(n,e,t){const i=Ul.get(e);if(i&&!n)return t&&!i.includes(pn)?i.concat(pn):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{const s=Array.from(Ul.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(const s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(pn)),r.reduce((s,a)=>{const l=typeof a=="string"?ql[a]:a;if(!l){const d=JSON.stringify(a),p=Object.keys(ql).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${p}`)}return s.includes(l)||s.push(l),s},[])}const Xv=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class Tc{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Jo(e,"compat"):e?Jo(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Jv:{},this.tags=Jo(t,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Rn,{value:Fi}),Object.defineProperty(this,rn,{value:to}),Object.defineProperty(this,Li,{value:Di}),this.sortMapEntries=typeof a=="function"?a:a===!0?Xv:null}clone(){const e=Object.create(Tc.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Qv(n,e){const t=[];let i=e.directives===!0;if(e.directives!==!1&&n.directives){const d=n.directives.toString(n);d?(t.push(d),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");const r=_f(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");const d=s(n.commentBefore);t.unshift(fn(d,""))}let a=!1,l=null;if(n.contents){if(Qe(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){const y=s(n.contents.commentBefore);t.push(fn(y,""))}r.forceBlockIndent=!!n.comment,l=n.contents.comment}const d=l?void 0:()=>a=!0;let p=Ri(n.contents,r,()=>l=null,d);l&&(p+=Qn(p,"",s(l))),(p[0]==="|"||p[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${p}`:t.push(p)}else t.push(Ri(n.contents,r));if(n.directives?.docEnd)if(n.comment){const d=s(n.comment);d.includes(`
|
|
104
|
-
`)?(t.push("..."),t.push(fn(d,""))):t.push(`... ${d}`)}else t.push("...");else{let d=n.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||l)&&t[t.length-1]!==""&&t.push(""),t.push(fn(s(d),"")))}return t.join(`
|
|
105
|
-
`)+`
|
|
106
|
-
`}class Lr{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vt,{value:Pa});let r=null;typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new bt({version:a}),this.setSchema(a,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){const e=Object.create(Lr.prototype,{[Vt]:{value:Pa}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Qe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){xi(this.contents)&&this.contents.add(e)}addIn(e,t){xi(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const i=yf(this);e.anchor=!t||i.has(t)?bf(t||"a",i):t}return new wc(e.anchor)}createNode(e,t,i){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const D=J=>typeof J=="number"||J instanceof String||J instanceof Number,ee=t.filter(D).map(String);ee.length>0&&(t=t.concat(ee)),r=t}else i===void 0&&t&&(i=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:d,onTagObj:p,tag:y}=i??{},{onAnchor:m,setAnchors:w,sourceObjects:P}=Ev(this,a||"a"),K={aliasDuplicateObjects:s??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:p,replacer:r,schema:this.schema,sourceObjects:P},O=Sr(e,y,K);return l&&Xe(O)&&(O.flow=!0),w(),O}createPair(e,t,i={}){const r=this.createNode(e,null,i),s=this.createNode(t,null,i);return new wt(r,s)}delete(e){return xi(this.contents)?this.contents.delete(e):!1}deleteIn(e){return tr(e)?this.contents==null?!1:(this.contents=null,!0):xi(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Xe(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return tr(e)?!t&&De(this.contents)?this.contents.value:this.contents:Xe(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Xe(this.contents)?this.contents.has(e):!1}hasIn(e){return tr(e)?this.contents!==void 0:Xe(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ms(this.schema,[e],t):xi(this.contents)&&this.contents.set(e,t)}setIn(e,t){tr(e)?this.contents=t:this.contents==null?this.contents=Ms(this.schema,Array.from(e),t):xi(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new bt({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new bt({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new Tc(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},d=Dt(this.contents,t??"",l);if(typeof s=="function")for(const{count:p,res:y}of l.anchors.values())s(y,p);return typeof a=="function"?Ii(a,{"":d},"",d):d}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Qv(this,e)}}function xi(n){if(Xe(n))return!0;throw new Error("Expected a YAML collection as document contents")}class Kf extends Error{constructor(e,t,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=t}}class nr extends Kf{constructor(e,t,i){super("YAMLParseError",e,t,i)}}class Zv extends Kf{constructor(e,t,i){super("YAMLWarning",e,t,i)}}const Kl=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:i,col:r}=t.linePos[0];t.message+=` at line ${i}, column ${r}`;let s=r-1,a=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`…
|
|
107
|
-
`),a=l+a}if(/[^ ]/.test(a)){let l=1;const d=t.linePos[1];d?.line===i&&d.col>r&&(l=Math.max(1,Math.min(d.col-r,80-s)));const p=" ".repeat(s)+"^".repeat(l);t.message+=`:
|
|
108
|
-
|
|
109
|
-
${a}
|
|
110
|
-
${p}
|
|
111
|
-
`}};function ji(n,{flow:e,indicator:t,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:l}){let d=!1,p=l,y=l,m="",w="",P=!1,K=!1,O=null,D=null,ee=null,J=null,oe=null,G=null,Z=null;for(const Y of n)switch(K&&(Y.type!=="space"&&Y.type!=="newline"&&Y.type!=="comma"&&s(Y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),K=!1),O&&(p&&Y.type!=="comment"&&Y.type!=="newline"&&s(O,"TAB_AS_INDENT","Tabs are not allowed as indentation"),O=null),Y.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&Y.source.includes(" ")&&(O=Y),y=!0;break;case"comment":{y||s(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const ge=Y.source.substring(1)||" ";m?m+=w+ge:m=ge,w="",p=!1;break}case"newline":p?m?m+=Y.source:(!G||t!=="seq-item-ind")&&(d=!0):w+=Y.source,p=!0,P=!0,(D||ee)&&(J=Y),y=!0;break;case"anchor":D&&s(Y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),Y.source.endsWith(":")&&s(Y.offset+Y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),D=Y,Z??(Z=Y.offset),p=!1,y=!1,K=!0;break;case"tag":{ee&&s(Y,"MULTIPLE_TAGS","A node can have at most one tag"),ee=Y,Z??(Z=Y.offset),p=!1,y=!1,K=!0;break}case t:(D||ee)&&s(Y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${Y.source} indicator`),G&&s(Y,"UNEXPECTED_TOKEN",`Unexpected ${Y.source} in ${e??"collection"}`),G=Y,p=t==="seq-item-ind"||t==="explicit-key-ind",y=!1;break;case"comma":if(e){oe&&s(Y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),oe=Y,p=!1,y=!1;break}default:s(Y,"UNEXPECTED_TOKEN",`Unexpected ${Y.type} token`),p=!1,y=!1}const ae=n[n.length-1],fe=ae?ae.offset+ae.source.length:r;return K&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),O&&(p&&O.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&s(O,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:oe,found:G,spaceBefore:d,comment:m,hasNewline:P,anchor:D,tag:ee,newlineAfterProp:J,end:fe,start:Z??fe}}function _r(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
112
|
-
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(_r(e.key)||_r(e.value))return!0}return!1;default:return!0}}function Ma(n,e,t){if(e?.type==="flow-collection"){const i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&_r(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Vf(n,e,t){const{uniqueKeys:i}=n.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||De(s)&&De(a)&&s.value===a.value;return e.some(s=>r(s.key,t))}const Vl="All mapping items must start at the same column";function ey({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=s?.nodeClass??$t,l=new a(t.schema);t.atRoot&&(t.atRoot=!1);let d=i.offset,p=null;for(const y of i.items){const{start:m,key:w,sep:P,value:K}=y,O=ji(m,{indicator:"explicit-key-ind",next:w??P?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0}),D=!O.found;if(D){if(w&&(w.type==="block-seq"?r(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==i.indent&&r(d,"BAD_INDENT",Vl)),!O.anchor&&!O.tag&&!P){p=O.end,O.comment&&(l.comment?l.comment+=`
|
|
113
|
-
`+O.comment:l.comment=O.comment);continue}(O.newlineAfterProp||_r(w))&&r(w??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else O.found?.indent!==i.indent&&r(d,"BAD_INDENT",Vl);t.atKey=!0;const ee=O.end,J=w?n(t,w,O,r):e(t,ee,m,null,O,r);t.schema.compat&&Ma(i.indent,w,r),t.atKey=!1,Vf(t,l.items,J)&&r(ee,"DUPLICATE_KEY","Map keys must be unique");const oe=ji(P??[],{indicator:"map-value-ind",next:K,offset:J.range[2],onError:r,parentIndent:i.indent,startOnNewline:!w||w.type==="block-scalar"});if(d=oe.end,oe.found){D&&(K?.type==="block-map"&&!oe.hasNewline&&r(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&O.start<oe.found.offset-1024&&r(J.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const G=K?n(t,K,oe,r):e(t,d,P,null,oe,r);t.schema.compat&&Ma(i.indent,K,r),d=G.range[2];const Z=new wt(J,G);t.options.keepSourceTokens&&(Z.srcToken=y),l.items.push(Z)}else{D&&r(J.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),oe.comment&&(J.comment?J.comment+=`
|
|
114
|
-
`+oe.comment:J.comment=oe.comment);const G=new wt(J);t.options.keepSourceTokens&&(G.srcToken=y),l.items.push(G)}}return p&&p<d&&r(p,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,d,p??d],l}function ty({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=s?.nodeClass??ri,l=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=i.offset,p=null;for(const{start:y,value:m}of i.items){const w=ji(y,{indicator:"seq-item-ind",next:m,offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!w.found)if(w.anchor||w.tag||m)m?.type==="block-seq"?r(w.end,"BAD_INDENT","All sequence items must start at the same column"):r(d,"MISSING_CHAR","Sequence item without - indicator");else{p=w.end,w.comment&&(l.comment=w.comment);continue}const P=m?n(t,m,w,r):e(t,w.end,y,null,w,r);t.schema.compat&&Ma(i.indent,m,r),d=P.range[2],l.items.push(P)}return l.range=[i.offset,d,p??d],l}function $r(n,e,t,i){let r="";if(n){let s=!1,a="";for(const l of n){const{source:d,type:p}=l;switch(p){case"space":s=!0;break;case"comment":{t&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const y=d.substring(1)||" ";r?r+=a+y:r=y,a="";break}case"newline":r&&(a+=d),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}e+=d.length}}return{comment:r,offset:e}}const Xo="Block collections are not allowed within flow collections",Qo=n=>n&&(n.type==="block-map"||n.type==="block-seq");function ny({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=i.start.source==="{",l=a?"flow map":"flow sequence",d=s?.nodeClass??(a?$t:ri),p=new d(t.schema);p.flow=!0;const y=t.atRoot;y&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let m=i.offset+i.start.source.length;for(let D=0;D<i.items.length;++D){const ee=i.items[D],{start:J,key:oe,sep:G,value:Z}=ee,ae=ji(J,{flow:l,indicator:"explicit-key-ind",next:oe??G?.[0],offset:m,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!ae.found){if(!ae.anchor&&!ae.tag&&!G&&!Z){D===0&&ae.comma?r(ae.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):D<i.items.length-1&&r(ae.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),ae.comment&&(p.comment?p.comment+=`
|
|
115
|
-
`+ae.comment:p.comment=ae.comment),m=ae.end;continue}!a&&t.options.strict&&_r(oe)&&r(oe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0)ae.comma&&r(ae.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(ae.comma||r(ae.start,"MISSING_CHAR",`Missing , between ${l} items`),ae.comment){let fe="";e:for(const Y of J)switch(Y.type){case"comma":case"space":break;case"comment":fe=Y.source.substring(1);break e;default:break e}if(fe){let Y=p.items[p.items.length-1];et(Y)&&(Y=Y.value??Y.key),Y.comment?Y.comment+=`
|
|
116
|
-
`+fe:Y.comment=fe,ae.comment=ae.comment.substring(fe.length+1)}}if(!a&&!G&&!ae.found){const fe=Z?n(t,Z,ae,r):e(t,ae.end,G,null,ae,r);p.items.push(fe),m=fe.range[2],Qo(Z)&&r(fe.range,"BLOCK_IN_FLOW",Xo)}else{t.atKey=!0;const fe=ae.end,Y=oe?n(t,oe,ae,r):e(t,fe,J,null,ae,r);Qo(oe)&&r(Y.range,"BLOCK_IN_FLOW",Xo),t.atKey=!1;const ge=ji(G??[],{flow:l,indicator:"map-value-ind",next:Z,offset:Y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(ge.found){if(!a&&!ae.found&&t.options.strict){if(G)for(const ke of G){if(ke===ge.found)break;if(ke.type==="newline"){r(ke,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}ae.start<ge.found.offset-1024&&r(ge.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else Z&&("source"in Z&&Z.source?.[0]===":"?r(Z,"MISSING_CHAR",`Missing space after : in ${l}`):r(ge.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const Re=Z?n(t,Z,ge,r):ge.found?e(t,ge.end,G,null,ge,r):null;Re?Qo(Z)&&r(Re.range,"BLOCK_IN_FLOW",Xo):ge.comment&&(Y.comment?Y.comment+=`
|
|
117
|
-
`+ge.comment:Y.comment=ge.comment);const We=new wt(Y,Re);if(t.options.keepSourceTokens&&(We.srcToken=ee),a){const ke=p;Vf(t,ke.items,Y)&&r(fe,"DUPLICATE_KEY","Map keys must be unique"),ke.items.push(We)}else{const ke=new $t(t.schema);ke.flow=!0,ke.items.push(We);const rt=(Re??Y).range;ke.range=[Y.range[0],rt[1],rt[2]],p.items.push(ke)}m=Re?Re.range[2]:ge.end}}const w=a?"}":"]",[P,...K]=i.end;let O=m;if(P?.source===w)O=P.offset+P.source.length;else{const D=l[0].toUpperCase()+l.substring(1),ee=y?`${D} must end with a ${w}`:`${D} in block collection must be sufficiently indented and end with a ${w}`;r(m,y?"MISSING_CHAR":"BAD_INDENT",ee),P&&P.source.length!==1&&K.unshift(P)}if(K.length>0){const D=$r(K,O,t.options.strict,r);D.comment&&(p.comment?p.comment+=`
|
|
118
|
-
`+D.comment:p.comment=D.comment),p.range=[i.offset,O,D.offset]}else p.range=[i.offset,O,O];return p}function Zo(n,e,t,i,r,s){const a=t.type==="block-map"?ey(n,e,t,i,s):t.type==="block-seq"?ty(n,e,t,i,s):ny(n,e,t,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function iy(n,e,t,i,r){const s=i.tag,a=s?e.directives.tagName(s.source,w=>r(s,"TAG_RESOLVE_FAILED",w)):null;if(t.type==="block-seq"){const{anchor:w,newlineAfterProp:P}=i,K=w&&s?w.offset>s.offset?w:s:w??s;K&&(!P||P.offset<K.offset)&&r(K,"MISSING_CHAR","Missing newline after block sequence props")}const l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===$t.tagName&&l==="map"||a===ri.tagName&&l==="seq")return Zo(n,e,t,r,a);let d=e.schema.tags.find(w=>w.tag===a&&w.collection===l);if(!d){const w=e.schema.knownTags[a];if(w?.collection===l)e.schema.tags.push(Object.assign({},w,{default:!1})),d=w;else return w?r(s,"BAD_COLLECTION_TYPE",`${w.tag} used for ${l} collection, but expects ${w.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Zo(n,e,t,r,a)}const p=Zo(n,e,t,r,a,d),y=d.resolve?.(p,w=>r(s,"TAG_RESOLVE_FAILED",w),e.options)??p,m=Qe(y)?y:new we(y);return m.range=p.range,m.tag=a,d?.format&&(m.format=d.format),m}function ry(n,e,t){const i=e.offset,r=sy(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?we.BLOCK_FOLDED:we.BLOCK_LITERAL,a=e.source?oy(e.source):[];let l=a.length;for(let O=a.length-1;O>=0;--O){const D=a[O][1];if(D===""||D==="\r")l=O;else break}if(l===0){const O=r.chomp==="+"&&a.length>0?`
|
|
119
|
-
`.repeat(Math.max(1,a.length-1)):"";let D=i+r.length;return e.source&&(D+=e.source.length),{value:O,type:s,comment:r.comment,range:[i,D,D]}}let d=e.indent+r.indent,p=e.offset+r.length,y=0;for(let O=0;O<l;++O){const[D,ee]=a[O];if(ee===""||ee==="\r")r.indent===0&&D.length>d&&(d=D.length);else{D.length<d&&t(p+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(d=D.length),y=O,d===0&&!n.atRoot&&t(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=D.length+ee.length+1}for(let O=a.length-1;O>=l;--O)a[O][0].length>d&&(l=O+1);let m="",w="",P=!1;for(let O=0;O<y;++O)m+=a[O][0].slice(d)+`
|
|
120
|
-
`;for(let O=y;O<l;++O){let[D,ee]=a[O];p+=D.length+ee.length+1;const J=ee[ee.length-1]==="\r";if(J&&(ee=ee.slice(0,-1)),ee&&D.length<d){const G=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(p-ee.length-(J?2:1),"BAD_INDENT",G),D=""}s===we.BLOCK_LITERAL?(m+=w+D.slice(d)+ee,w=`
|
|
121
|
-
`):D.length>d||ee[0]===" "?(w===" "?w=`
|
|
122
|
-
`:!P&&w===`
|
|
123
|
-
`&&(w=`
|
|
124
|
-
|
|
125
|
-
`),m+=w+D.slice(d)+ee,w=`
|
|
126
|
-
`,P=!0):ee===""?w===`
|
|
127
|
-
`?m+=`
|
|
128
|
-
`:w=`
|
|
129
|
-
`:(m+=w+ee,w=" ",P=!1)}switch(r.chomp){case"-":break;case"+":for(let O=l;O<a.length;++O)m+=`
|
|
130
|
-
`+a[O][0].slice(d);m[m.length-1]!==`
|
|
131
|
-
`&&(m+=`
|
|
132
|
-
`);break;default:m+=`
|
|
133
|
-
`}const K=i+r.length+e.source.length;return{value:m,type:s,comment:r.comment,range:[i,K,K]}}function sy({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],s=r[0];let a=0,l="",d=-1;for(let w=1;w<r.length;++w){const P=r[w];if(!l&&(P==="-"||P==="+"))l=P;else{const K=Number(P);!a&&K?a=K:d===-1&&(d=n+w)}}d!==-1&&i(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let p=!1,y="",m=r.length;for(let w=1;w<e.length;++w){const P=e[w];switch(P.type){case"space":p=!0;case"newline":m+=P.source.length;break;case"comment":t&&!p&&i(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=P.source.length,y=P.source.substring(1);break;case"error":i(P,"UNEXPECTED_TOKEN",P.message),m+=P.source.length;break;default:{const K=`Unexpected token in block scalar header: ${P.type}`;i(P,"UNEXPECTED_TOKEN",K);const O=P.source;O&&typeof O=="string"&&(m+=O.length)}}}return{mode:s,indent:a,chomp:l,comment:y,length:m}}function oy(n){const e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),s=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}function ay(n,e,t){const{offset:i,type:r,source:s,end:a}=n;let l,d;const p=(w,P,K)=>t(i+w,P,K);switch(r){case"scalar":l=we.PLAIN,d=cy(s,p);break;case"single-quoted-scalar":l=we.QUOTE_SINGLE,d=ly(s,p);break;case"double-quoted-scalar":l=we.QUOTE_DOUBLE,d=uy(s,p);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const y=i+s.length,m=$r(a,y,e,t);return{value:d,type:l,comment:m.comment,range:[i,y,m.offset]}}function cy(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),zf(n)}function ly(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),zf(n.slice(1,-1)).replace(/''/g,"'")}function zf(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
134
|
-
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
135
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(n);if(!i)return n;let r=i[1],s=" ",a=e.lastIndex;for(t.lastIndex=a;i=t.exec(n);)i[1]===""?s===`
|
|
136
|
-
`?r+=s:s=`
|
|
137
|
-
`:(r+=s+i[1],s=" "),a=t.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=a,i=l.exec(n),r+s+(i?.[1]??"")}function uy(n,e){let t="";for(let i=1;i<n.length-1;++i){const r=n[i];if(!(r==="\r"&&n[i+1]===`
|
|
138
|
-
`))if(r===`
|
|
139
|
-
`){const{fold:s,offset:a}=fy(n,i);t+=s,i=a}else if(r==="\\"){let s=n[++i];const a=dy[s];if(a)t+=a;else if(s===`
|
|
140
|
-
`)for(s=n[i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="\r"&&n[i+1]===`
|
|
141
|
-
`)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){const l={x:2,u:4,U:8}[s];t+=hy(n,i+1,l,e),i+=l}else{const l=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(r===" "||r===" "){const s=i;let a=n[i+1];for(;a===" "||a===" ";)a=n[++i+1];a!==`
|
|
142
|
-
`&&!(a==="\r"&&n[i+2]===`
|
|
143
|
-
`)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function fy(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
|
|
144
|
-
`||i==="\r")&&!(i==="\r"&&n[e+2]!==`
|
|
145
|
-
`);)i===`
|
|
146
|
-
`&&(t+=`
|
|
147
|
-
`),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}const dy={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
148
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hy(n,e,t,i){const r=n.substr(e,t),a=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(a)){const l=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(a)}function Wf(n,e,t,i){const{value:r,type:s,comment:a,range:l}=e.type==="block-scalar"?ry(n,e,i):ay(e,n.options.strict,i),d=t?n.directives.tagName(t.source,m=>i(t,"TAG_RESOLVE_FAILED",m)):null;let p;n.options.stringKeys&&n.atKey?p=n.schema[rn]:d?p=py(n.schema,r,d,t,i):e.type==="scalar"?p=gy(n,r,e,i):p=n.schema[rn];let y;try{const m=p.resolve(r,w=>i(t??e,"TAG_RESOLVE_FAILED",w),n.options);y=De(m)?m:new we(m)}catch(m){const w=m instanceof Error?m.message:String(m);i(t??e,"TAG_RESOLVE_FAILED",w),y=new we(r)}return y.range=l,y.source=r,s&&(y.type=s),d&&(y.tag=d),p.format&&(y.format=p.format),a&&(y.comment=a),y}function py(n,e,t,i,r){if(t==="!")return n[rn];const s=[];for(const l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if(l.test?.test(e))return l;const a=n.knownTags[t];return a&&!a.collection?(n.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[rn])}function gy({atKey:n,directives:e,schema:t},i,r,s){const a=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(i))||t[rn];if(t.compat){const l=t.compat.find(d=>d.default&&d.test?.test(i))??t[rn];if(a.tag!==l.tag){const d=e.tagString(a.tag),p=e.tagString(l.tag),y=`Value may be parsed as either ${d} or ${p}`;s(r,"TAG_RESOLVE_FAILED",y,!0)}}return a}function my(n,e,t){if(e){t??(t=e.length);for(let i=t-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++i];r?.type==="space";)n+=r.source.length,r=e[++i];break}}return n}const vy={composeNode:Hf,composeEmptyNode:Nc};function Hf(n,e,t,i){const r=n.atKey,{spaceBefore:s,comment:a,anchor:l,tag:d}=t;let p,y=!0;switch(e.type){case"alias":p=yy(n,e,i),(l||d)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=Wf(n,e,d,i),l&&(p.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=iy(vy,n,e,t,i),l&&(p.anchor=l.source.substring(1))}catch(m){const w=m instanceof Error?m.message:String(m);i(e,"RESOURCE_EXHAUSTION",w)}break;default:{const m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",m),y=!1}}return p??(p=Nc(n,e.offset,void 0,null,t,i)),l&&p.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!De(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&i(d??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(p.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?p.comment=a:p.commentBefore=a),n.options.keepSourceTokens&&y&&(p.srcToken=e),p}function Nc(n,e,t,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:d},p){const y={type:"scalar",offset:my(e,t,i),indent:-1,source:""},m=Wf(n,y,l,p);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&p(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(m.spaceBefore=!0),s&&(m.comment=s,m.range[2]=d),m}function yy({options:n},{offset:e,source:t,end:i},r){const s=new wc(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+t.length,l=$r(i,a,n.strict,r);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}function by(n,e,{offset:t,start:i,value:r,end:s},a){const l=Object.assign({_directives:e},n),d=new Lr(void 0,l),p={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},y=ji(i,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});y.found&&(d.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!y.hasNewline&&a(y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=r?Hf(p,r,y,a):Nc(p,y.end,i,null,y,a);const m=d.contents.range[2],w=$r(s,m,!1,a);return w.comment&&(d.comment=w.comment),d.range=[t,m,w.offset],d}function Qi(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function zl(n){let e="",t=!1,i=!1;for(let r=0;r<n.length;++r){const s=n[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
149
|
-
|
|
150
|
-
`:`
|
|
151
|
-
`)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}class wy{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{const a=Qi(t);s?this.warnings.push(new Zv(a,i,r)):this.errors.push(new nr(a,i,r))},this.directives=new bt({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:i,afterEmptyLine:r}=zl(this.prelude);if(i){const s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
152
|
-
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Xe(s)&&!s.flow&&s.items.length>0){let a=s.items[0];et(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${i}
|
|
153
|
-
${l}`:i}else{const a=s.commentBefore;s.commentBefore=a?`${i}
|
|
154
|
-
${a}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(const r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{const s=Qi(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=by(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new nr(Qi(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new nr(Qi(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const t=$r(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
155
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new nr(Qi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const i=Object.assign({_directives:this.directives},this.options),r=new Lr(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}}const Gf="\uFEFF",Yf="",Jf="",Ra="";function xy(n){switch(n){case Gf:return"byte-order-mark";case Yf:return"doc-mode";case Jf:return"flow-error-end";case Ra:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
156
|
-
`:case`\r
|
|
157
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Ht(n){switch(n){case void 0:case" ":case`
|
|
158
|
-
`:case"\r":case" ":return!0;default:return!1}}const Wl=new Set("0123456789ABCDEFabcdef"),Sy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ps=new Set(",[]{}"),_y=new Set(` ,[]{}
|
|
159
|
-
\r `),ea=n=>!n||_y.has(n);class ky{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
160
|
-
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
161
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let i=0;for(;t===" ";)t=this.buffer[++i+e];if(t==="\r"){const r=this.buffer[i+e+1];if(r===`
|
|
162
|
-
`||!r&&!this.atEnd)return e+i+1}return t===`
|
|
163
|
-
`||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){const i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&Ht(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
164
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Gf&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){const s=e[i-1];if(s===" "||s===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){const s=e[t-1];if(s===" "||s===" ")t-=1;else break}const r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Yf,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Ht(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ht(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ht(t)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ea),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&Ht(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Jf,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ea),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Ht(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}const i=this.buffer.substring(0,t);let r=i.indexOf(`
|
|
165
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){const s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
166
|
-
`,s)}r!==-1&&(t=r-(i[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Ht(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":t+=1;break;case`
|
|
167
|
-
`:e=s,t=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
168
|
-
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
169
|
-
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
170
|
-
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);const l=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
171
|
-
`&&s>=this.pos&&s+1+t>l)e=s;else break}while(!0);return yield Ra,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Ht(s)||e&&ps.has(s))break;t=i}else if(Ht(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
172
|
-
`?(i+=1,r=`
|
|
173
|
-
`,s=this.buffer[i+1]):t=i),s==="#"||e&&ps.has(s))break;if(r===`
|
|
174
|
-
`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(e&&ps.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Ra,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ea))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Ht(t)||e&&ps.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Ht(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Sy.has(t))t=this.buffer[++e];else if(t==="%"&&Wl.has(this.buffer[e+1])&&Wl.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
175
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
176
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");const r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Cy{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){const s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function In(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Hl(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Xf(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function gs(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Si(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Gl(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!In(e.start,"explicit-key-ind")&&!In(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Xf(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Ey{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ky,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(e,t))yield*this.next(i);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=xy(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Gl(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Hl(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Hl(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=gs(this.peek(2)),i=Si(t);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
177
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
178
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(r&&t.sep&&!t.value){const a=[];for(let l=0;l<t.sep.length;++l){const d=t.sep[l];switch(d.type){case"newline":a.push(l);break;case"space":break;case"comment":d.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(In(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Xf(t.key)&&!In(t.sep,"newline")){const a=Si(t.start),l=t.key,d=t.sep;d.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:d}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(In(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=Si(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):In(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||t.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!In(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||In(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=gs(i),s=Si(r);Gl(e);const a=e.end.splice(1,e.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
179
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
180
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=gs(e),i=Si(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=gs(e),i=Si(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Iy(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Cy||null,prettyErrors:e}}function Ay(n,e={}){const{lineCounter:t,prettyErrors:i}=Iy(e),r=new Ey(t?.addNewLine),s=new wy(e);let a=null;for(const l of s.compose(r.parse(n),!0,n.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new nr(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(a.errors.forEach(Kl(n,t)),a.warnings.forEach(Kl(n,t))),a}function Py(n,e,t){let i;const r=Ay(n,t);if(!r)return null;if(r.warnings.forEach(s=>kf(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function Oy(n,e,t){let i=null;if(Array.isArray(e)&&(i=e),n===void 0){const{keepUndefined:r}={};if(!r)return}return Mr(n)&&!i?n.toString(t):new Lr(n,i,t).toString(t)}class Qf{readPage(e){const t=e.split(`
|
|
181
|
-
`);if(t[0]=="---"){t.shift();const i=t.findIndex(r=>r=="---");if(i>=0){const r=t.slice(0,i).join(`
|
|
182
|
-
`);return{...Py(r),content:t.slice(i+1).join(`
|
|
183
|
-
`)}}else return{content:e}}else return{content:e}}}class Zf{writePage(e){const{content:t,...i}=e;return i&&Object.keys(i).length>0?`---
|
|
184
|
-
${Oy(i)}---
|
|
185
|
-
${t??""}`:t??""}}var Ty=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Ny=(n,e)=>(t,i)=>e(t,i,n);let kr=class{logger;wikiConfig;constructor(e,t){this.logger=e,this.logger.setModule(t)}setWikiConfig(e){this.logger.debug("Setting wiki Config: ",e),this.wikiConfig=e}getWikiConfig(){return this.wikiConfig}};kr=Ty([it(),Ny(0,Tp())],kr);var My=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Ry=(n,e)=>(t,i)=>e(t,i,n);let Yl=class{constructor(n){this.cristalApp=n}get(){return this.cristalApp.getWikiConfig().storage}};Yl=My([it(),Ry(0,Be("CristalApp"))],Yl);const ed={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(ed);const td={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(td);var Bt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},ki,ir,Jn;class jy{constructor(...e){ki.set(this,new Map),ir.set(this,new Map),Jn.set(this,new Map);for(const t of e)this.define(t)}define(e,t=!1){for(let[i,r]of Object.entries(e)){i=i.toLowerCase(),r=r.map(l=>l.toLowerCase()),Bt(this,Jn,"f").has(i)||Bt(this,Jn,"f").set(i,new Set);const s=Bt(this,Jn,"f").get(i);let a=!0;for(let l of r){const d=l.startsWith("*");if(l=d?l.slice(1):l,s?.add(l),a&&Bt(this,ir,"f").set(i,l),a=!1,d)continue;const p=Bt(this,ki,"f").get(l);if(p&&p!=i&&!t)throw new Error(`"${i} -> ${l}" conflicts with "${p} -> ${l}". Pass \`force=true\` to override this definition.`);Bt(this,ki,"f").set(l,i)}}return this}getType(e){if(typeof e!="string")return null;const t=e.replace(/^.*[/\\]/s,"").toLowerCase(),i=t.replace(/^.*\./s,"").toLowerCase(),r=t.length<e.length;return!(i.length<t.length-1)&&r?null:Bt(this,ki,"f").get(i)??null}getExtension(e){return typeof e!="string"?null:(e=e?.split?.(";")[0],(e&&Bt(this,ir,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:Bt(this,Jn,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of Bt(this,Jn,"f").values())Object.freeze(e);return this}_getTestState(){return{types:Bt(this,ki,"f"),extensions:Bt(this,ir,"f")}}}ki=new WeakMap,ir=new WeakMap,Jn=new WeakMap;var By=new jy(td,ed)._freeze(),Ly=Object.getOwnPropertyDescriptor,$y=(n,e,t,i)=>{for(var r=i>1?void 0:i?Ly(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ta=(n,e)=>(t,i)=>e(t,i,n);let ja=class extends kr{constructor(n,e,t){super(n,"storage.components.githubStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t}ATTACHMENTS="attachments";async isStorageReady(){return!0}getPageRestURL(n,e,t){this.logger?.debug("GitHub Loading page",n);let i=`${this.wikiConfig.baseRestURL}/contents/${n}`;return t&&(i=`${i}?ref=${t}`),i}getPageRestMetaURL(n,e,t){const i=n.split("/");i[i.length-1]=`.${i[i.length-1]}`;let r=`${this.wikiConfig.baseRestURL}/contents/${i.join("/")}`;return t&&(r=`${r}?ref=${t}`),r}getPageFromViewURL(n){let e=null;return n.startsWith(this.wikiConfig.baseURL)&&(e=n.replace(this.wikiConfig.baseURL,"")),e}getImageURL(n,e){const t=n.replace(/[^/]*$/,"");return`${this.wikiConfig.baseURL}/${t}${e}`}hashCode=function(n){let e=0,t,i;if(n.length===0)return""+e;for(t=0;t<n.length;t++)i=n.charCodeAt(t),e=(e<<5)-e+i,e|=0;return""+e};async getPageContent(n,e,t){this.logger?.debug("GitHub Loading page",n);const i=this.getPageRestURL(`${n}.md`,e,t),r=await fetch(i,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(r.status>=200&&r.status<300){const{content:s,...a}=new Qf().readPage(await r.text()),{date:l,name:d,username:p}=await this.getLastEditDetails(n,t);return Object.assign(new Mn,{source:s,syntax:"markdown/1.2",...a,id:n,headline:a.name,headlineRaw:a.name,canEdit:await this.authenticationManagerProvider.get()?.isAuthenticated()??!1,lastModificationDate:l,lastAuthor:{name:d,username:p}})}else return}async getAttachments(n){const e=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}`,t=await fetch(e,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(t.status>=200&&t.status<300){const i=await t.json();return{attachments:await Promise.all(i.map(async r=>await this.getAttachment(n,r.name))),count:i.length}}else return{attachments:[],count:0}}async getAttachment(n,e){const t=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}/${e}`,i=await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});if(i.status>=200&&i.status<300){const r=await i.json(),s=new URL(`${this.wikiConfig.baseRestURL}/commits`);s.search=new URLSearchParams([["path",r.path],["per_page","1"]]).toString();const l=await(await fetch(s,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{reference:r.name,id:r.path,size:r.size,href:r.download_url,mimetype:By.getType(r.name)??"",date:new Date(l[0].commit.author.date),author:l[0].commit.author.name}}else return}async getPanelContent(){return new Mn}async getEditField(){return""}async save(n,e,t){const i=this.getPageRestURL(`${n}.md`,""),r=await fetch(i,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}}),s=r.status>=200&&r.status<300?r.headers.get("ETag").slice(3,-1):void 0,a=new Zf().writePage({content:t,name:e,syntax:"markdown/1.2"}),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:btoa(a),message:`Update ${n}`,sha:s})});if(!l.ok){const d=await l.text();throw this.alertsServiceProvider.get().error(`Could not save page ${n}. Reason: ${d}`),new Error(d)}}async saveAttachments(n,e){const t=[];for(const i of e){const r=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}/${i.name}`,s=await this.computeAttachmentSHA(r);t.push(this.uploadAttachment(r,i,s,n))}return Promise.all(t)}async computeAttachmentSHA(n){const e=await fetch(n,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});return e.status>=200&&e.status<300?e.headers.get("ETag").slice(3,-1):void 0}uploadAttachment(n,e,t,i){return new Promise(r=>{const s=new FileReader;s.onload=async()=>{const a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:s.result.split(",")[1],message:`Upload ${e.name}`,sha:t})});if(a.ok)r((await a.json()).content.download_url);else{const l=await a.text();this.alertsServiceProvider.get().error(`Could not upload attachment ${e.name} for page ${i}. Reason: ${l}`),r(void 0)}},s.readAsDataURL(e)})}async delete(n){const e=this.wikiConfig.baseURL.split("/").pop(),t=(await(await fetch(`${this.wikiConfig.baseRestURL}/git/ref/heads/${e}`,{method:"GET",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()}})).json()).object.sha,i=await fetch(`${this.wikiConfig.baseRestURL}/git/trees`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({base_tree:e,tree:[{path:`${n}.md`,mode:"040000",type:"tree",sha:null}]})});if(!i.ok)return{success:!1,error:await i.text()};const r=await fetch(`${this.wikiConfig.baseRestURL}/git/commits`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({tree:(await i.json()).sha,message:`Delete ${n}`,parents:[t]})});return r.ok?await fetch(`${this.wikiConfig.baseRestURL}/git/refs/heads/${e}`,{method:"PATCH",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({sha:(await r.json()).sha})}).then(async s=>s.ok?{success:!0}:{success:!1,error:await s.text()}):{success:!1,error:await r.text()}}async move(){throw new Error("Move not supported")}async getCredentials(){const n=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return n&&(e.Authorization=n),e}async getLastEditDetails(n,e){if(e){const t=new URL(`${this.wikiConfig.baseRestURL}/commits/${e}`),r=await(await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r.commit.author.date),username:r.commit.author.login,name:r.commit.author.name}}else{const t=new URL(`${this.wikiConfig.baseRestURL}/commits`);t.search=new URLSearchParams([["path",`${n}.md`],["per_page","1"]]).toString();const r=await(await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r[0].commit.author.date),username:r[0].commit.author.login,name:r[0].commit.author.name}}}};ja=$y([it(),ta(0,Be("Logger")),ta(1,Be("AuthenticationManagerProvider")),ta(2,Be("AlertsServiceProvider"))],ja);function Mc(n){return e=>e.name==n||e.name==null}let Fy=class{constructor(e){e.bind("WikiConfig").to(Aa).when(Mc("GitHub")),e.bind("Storage").to(ja).whenNamed("GitHub")}};var Dy=Object.getOwnPropertyDescriptor,Uy=(n,e,t,i)=>{for(var r=i>1?void 0:i?Dy(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ms=(n,e)=>(t,i)=>e(t,i,n);let Ba=class extends xr{storage;cristal;constructor(n,e,t){super(n),this.cristal=t,this.storage=e,this.storage.setWikiConfig(this)}isSupported(n){return n=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};Ba=Uy([it(),ms(0,Be("Logger")),ms(1,Be("Storage")),ms(1,cc("Nextcloud")),ms(2,Be("CristalApp"))],Ba);class qy{type=1;wiki;names;constructor(e,...t){this.wiki=e,this.names=t}}let Ky=class{type=2;space;name;terminal;locale;constructor(e,t,i){this.space=t,this.name=e,this.terminal=i??!1}};const nd=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Vy=nd+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",zy="["+nd+"]["+Vy+"]*",Wy=new RegExp("^"+zy+"$");function id(n,e){const t=[];let i=e.exec(n);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let a=0;a<s;a++)r.push(i[a]);t.push(r),i=e.exec(n)}return t}const oo=function(n){const e=Wy.exec(n);return!(e===null||typeof e>"u")};function Hy(n){return typeof n<"u"}const Rc=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],rd=["__proto__","constructor","prototype"],Gy={allowBooleanAttributes:!1,unpairedTags:[]};function Yy(n,e){e=Object.assign({},Gy,e);const t=[];let i=!1,r=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let s=0;s<n.length;s++)if(n[s]==="<"&&n[s+1]==="?"){if(s+=2,s=Xl(n,s),s.err)return s}else if(n[s]==="<"){let a=s;if(s++,n[s]==="!"){s=Ql(n,s);continue}else{let l=!1;n[s]==="/"&&(l=!0,s++);let d="";for(;s<n.length&&n[s]!==">"&&n[s]!==" "&&n[s]!==" "&&n[s]!==`
|
|
186
|
-
`&&n[s]!=="\r";s++)d+=n[s];if(d=d.trim(),d[d.length-1]==="/"&&(d=d.substring(0,d.length-1),s--),!ib(d)){let m;return d.trim().length===0?m="Invalid space after '<'.":m="Tag '"+d+"' is an invalid name.",Je("InvalidTag",m,yt(n,s))}const p=Qy(n,s);if(p===!1)return Je("InvalidAttr","Attributes for '"+d+"' have open quote.",yt(n,s));let y=p.value;if(s=p.index,y[y.length-1]==="/"){const m=s-y.length;y=y.substring(0,y.length-1);const w=Zl(y,e);if(w===!0)i=!0;else return Je(w.err.code,w.err.msg,yt(n,m+w.err.line))}else if(l)if(p.tagClosed){if(y.trim().length>0)return Je("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",yt(n,a));if(t.length===0)return Je("InvalidTag","Closing tag '"+d+"' has not been opened.",yt(n,a));{const m=t.pop();if(d!==m.tagName){let w=yt(n,m.tagStartPos);return Je("InvalidTag","Expected closing tag '"+m.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+d+"'.",yt(n,a))}t.length==0&&(r=!0)}}else return Je("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",yt(n,s));else{const m=Zl(y,e);if(m!==!0)return Je(m.err.code,m.err.msg,yt(n,s-y.length+m.err.line));if(r===!0)return Je("InvalidXml","Multiple possible root nodes found.",yt(n,s));e.unpairedTags.indexOf(d)!==-1||t.push({tagName:d,tagStartPos:a}),i=!0}for(s++;s<n.length;s++)if(n[s]==="<")if(n[s+1]==="!"){s++,s=Ql(n,s);continue}else if(n[s+1]==="?"){if(s=Xl(n,++s),s.err)return s}else break;else if(n[s]==="&"){const m=tb(n,s);if(m==-1)return Je("InvalidChar","char '&' is not expected.",yt(n,s));s=m}else if(r===!0&&!Jl(n[s]))return Je("InvalidXml","Extra text at the end",yt(n,s));n[s]==="<"&&s--}}else{if(Jl(n[s]))continue;return Je("InvalidChar","char '"+n[s]+"' is not expected.",yt(n,s))}if(i){if(t.length==1)return Je("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",yt(n,t[0].tagStartPos));if(t.length>0)return Je("InvalidXml","Invalid '"+JSON.stringify(t.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Je("InvalidXml","Start tag expected.",1);return!0}function Jl(n){return n===" "||n===" "||n===`
|
|
187
|
-
`||n==="\r"}function Xl(n,e){const t=e;for(;e<n.length;e++)if(n[e]=="?"||n[e]==" "){const i=n.substr(t,e-t);if(e>5&&i==="xml")return Je("InvalidXml","XML declaration allowed only at the start of the document.",yt(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Ql(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e<n.length;e++)if(n[e]==="-"&&n[e+1]==="-"&&n[e+2]===">"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e<n.length;e++)if(n[e]==="<")t++;else if(n[e]===">"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e<n.length;e++)if(n[e]==="]"&&n[e+1]==="]"&&n[e+2]===">"){e+=2;break}}return e}const Jy='"',Xy="'";function Qy(n,e){let t="",i="",r=!1;for(;e<n.length;e++){if(n[e]===Jy||n[e]===Xy)i===""?i=n[e]:i!==n[e]||(i="");else if(n[e]===">"&&i===""){r=!0;break}t+=n[e]}return i!==""?!1:{value:t,index:e,tagClosed:r}}const Zy=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Zl(n,e){const t=id(n,Zy),i={};for(let r=0;r<t.length;r++){if(t[r][1].length===0)return Je("InvalidAttr","Attribute '"+t[r][2]+"' has no space in starting.",Zi(t[r]));if(t[r][3]!==void 0&&t[r][4]===void 0)return Je("InvalidAttr","Attribute '"+t[r][2]+"' is without value.",Zi(t[r]));if(t[r][3]===void 0&&!e.allowBooleanAttributes)return Je("InvalidAttr","boolean attribute '"+t[r][2]+"' is not allowed.",Zi(t[r]));const s=t[r][2];if(!nb(s))return Je("InvalidAttr","Attribute '"+s+"' is an invalid name.",Zi(t[r]));if(!Object.prototype.hasOwnProperty.call(i,s))i[s]=1;else return Je("InvalidAttr","Attribute '"+s+"' is repeated.",Zi(t[r]))}return!0}function eb(n,e){let t=/\d/;for(n[e]==="x"&&(e++,t=/[\da-fA-F]/);e<n.length;e++){if(n[e]===";")return e;if(!n[e].match(t))break}return-1}function tb(n,e){if(e++,n[e]===";")return-1;if(n[e]==="#")return e++,eb(n,e);let t=0;for(;e<n.length;e++,t++)if(!(n[e].match(/\w/)&&t<20)){if(n[e]===";")break;return-1}return e}function Je(n,e,t){return{err:{code:n,msg:e,line:t.line||t,col:t.col}}}function nb(n){return oo(n)}function ib(n){return oo(n)}function yt(n,e){const t=n.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function Zi(n){return n.startIndex+n[1].length}const rb={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},sd={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},sb={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},ob=new Set("!?\\\\/[]$%{}^&*()<>|+");function eu(n){if(n[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${n}"`);for(const e of n)if(ob.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${n}"`);return n}function na(...n){const e=Object.create(null);for(const t of n)if(t)for(const i of Object.keys(t)){const r=t[i];if(typeof r=="string")e[i]=r;else if(r&&typeof r=="object"&&r.val!==void 0){const s=r.val;typeof s=="string"&&(e[i]=s)}}return e}const ei="external",js="base",La="all";function ab(n){return!n||n===ei?new Set([ei]):n===La?new Set([La]):n===js?new Set([js]):Array.isArray(n)?new Set(n):new Set([ei])}const Ct=Object.freeze({allow:0,leave:1,remove:2,throw:3}),cb=new Set([9,10,13]);function lb(n){if(!n)return{xmlVersion:1,onLevel:Ct.allow,nullLevel:Ct.remove};const e=n.xmlVersion===1.1?1.1:1,t=Ct[n.onNCR]??Ct.allow,i=Ct[n.nullNCR]??Ct.remove,r=Math.max(i,Ct.remove);return{xmlVersion:e,onLevel:t,nullLevel:r}}class ub{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:i=>i,this._limitTiers=ab(this._limit.applyLimitsTo??ei),this._numericAllowed=e.numericAllowed??!0,this._baseMap=na(sd,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);const t=lb(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel}setExternalEntities(e){if(e)for(const t of Object.keys(e))eu(t);this._externalMap=na(e)}addExternalEntity(e,t){eu(e),typeof t=="string"&&t.indexOf("&")===-1&&(this._externalMap[e]=t)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=na(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!="string"||e.length===0)return e;const t=e,i=[],r=e.length;let s=0,a=0;const l=this._maxTotalExpansions>0,d=this._maxExpandedLength>0,p=l||d;for(;a<r;){if(e.charCodeAt(a)!==38){a++;continue}let m=a+1;for(;m<r&&e.charCodeAt(m)!==59&&m-a<=32;)m++;if(m>=r||e.charCodeAt(m)!==59){a++;continue}const w=e.slice(a+1,m);if(w.length===0){a++;continue}let P,K;if(this._removeSet.has(w))P="",K===void 0&&(K=ei);else if(this._leaveSet.has(w)){a++;continue}else if(w.charCodeAt(0)===35){const O=this._resolveNCR(w);if(O===void 0){a++;continue}P=O,K=js}else{const O=this._resolveName(w);P=O?.value,K=O?.tier}if(P===void 0){a++;continue}if(a>s&&i.push(e.slice(s,a)),i.push(P),s=m+1,a=s,p&&this._tierCounts(K)){if(l&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(d){const O=P.length-(w.length+2);if(O>0&&(this._expandedLength+=O,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}s<r&&i.push(e.slice(s));const y=i.length===0?e:i.join("");return this._postCheck(y,t)}_tierCounts(e){return this._limitTiers.has(La)?!0:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return{value:this._inputMap[e],tier:ei};if(e in this._externalMap)return{value:this._externalMap[e],tier:ei};if(e in this._baseMap)return{value:this._baseMap[e],tier:js}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!cb.has(e)?Ct.remove:-1}_applyNCRAction(e,t,i){switch(e){case Ct.allow:return String.fromCodePoint(i);case Ct.remove:return"";case Ct.leave:return;case Ct.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${i.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(i)}}_resolveNCR(e){const t=e.charCodeAt(1);let i;if(t===120||t===88?i=parseInt(e.slice(2),16):i=parseInt(e.slice(1),10),Number.isNaN(i)||i<0||i>1114111)return;const r=this._classifyNCR(i);if(!this._numericAllowed&&r<Ct.remove)return;const s=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(s,e,i)}}const od=n=>Rc.includes(n)?"__"+n:n,fb={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:od};function db(n,e){if(typeof n!="string")return;const t=n.toLowerCase();if(Rc.some(i=>t===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);if(rd.some(i=>t===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ad(n,e){return typeof n=="boolean"?{enabled:n,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof n=="object"&&n!==null?{enabled:n.enabled!==!1,maxEntitySize:Math.max(1,n.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,n.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,n.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,n.maxExpandedLength??1e5),maxEntityCount:Math.max(1,n.maxEntityCount??1e3),allowedTags:n.allowedTags??null,tagFilter:n.tagFilter??null,appliesTo:n.appliesTo??"all"}:ad(!0)}const hb=function(n){const e=Object.assign({},fb,n),t=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:i,name:r}of t)i&&db(i,r);return e.onDangerousProperty===null&&(e.onDangerousProperty=od),e.processEntities=ad(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(i=>typeof i=="string"&&i.startsWith("*.")?".."+i.substring(2):i)),e};let Bs;typeof Symbol!="function"?Bs="@@xmlMetadata":Bs=Symbol("XML Node Metadata");class An{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Bs]={startIndex:t})}static getMetaDataSymbol(){return Bs}}class pb{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){const i=Object.create(null);let r=0;if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,a=!1,l=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!l){if(a&&Wn(e,"!ENTITY",t)){t+=7;let p,y;if([p,y,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),y.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);i[p]=y,r++}}else if(a&&Wn(e,"!ELEMENT",t)){t+=8;const{index:p}=this.readElementExp(e,t+1);t=p}else if(a&&Wn(e,"!ATTLIST",t))t+=8;else if(a&&Wn(e,"!NOTATION",t)){t+=9;const{index:p}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=p}else if(Wn(e,"!--",t))l=!0;else throw new Error("Invalid DOCTYPE");s++,d=""}else if(e[t]===">"){if(l?e[t-1]==="-"&&e[t-2]==="-"&&(l=!1,s--):s--,s===0)break}else e[t]==="["?a=!0:d+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:t}}readEntityExp(e,t){t=kt(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)t++;let r=e.substring(i,t);if(er(r),t=kt(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let s="";if([t,s]=this.readIdentifierVal(e,t,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,s,t]}readNotationExp(e,t){t=kt(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);!this.suppressValidationErr&&er(r),t=kt(e,t);const s=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);t+=s.length,t=kt(e,t);let a=null,l=null;if(s==="PUBLIC")[t,a]=this.readIdentifierVal(e,t,"publicIdentifier"),t=kt(e,t),(e[t]==='"'||e[t]==="'")&&([t,l]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(s==="SYSTEM"&&([t,l]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!l))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:a,systemIdentifier:l,index:--t}}readIdentifierVal(e,t,i){let r="";const s=e[t];if(s!=='"'&&s!=="'")throw new Error(`Expected quoted string, found "${s}"`);t++;const a=t;for(;t<e.length&&e[t]!==s;)t++;if(r=e.substring(a,t),e[t]!==s)throw new Error(`Unterminated ${i} value`);return t++,[t,r]}readElementExp(e,t){t=kt(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);if(!this.suppressValidationErr&&!oo(r))throw new Error(`Invalid element name: "${r}"`);t=kt(e,t);let s="";if(e[t]==="E"&&Wn(e,"MPTY",t))t+=4;else if(e[t]==="A"&&Wn(e,"NY",t))t+=2;else if(e[t]==="("){t++;const a=t;for(;t<e.length&&e[t]!==")";)t++;if(s=e.substring(a,t),e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:s.trim(),index:t}}readAttlistExp(e,t){t=kt(e,t);let i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);for(er(r),t=kt(e,t),i=t;t<e.length&&!/\s/.test(e[t]);)t++;let s=e.substring(i,t);if(!er(s))throw new Error(`Invalid attribute name: "${s}"`);t=kt(e,t);let a="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(a="NOTATION",t+=8,t=kt(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){const p=t;for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)t++;let y=e.substring(p,t);if(y=y.trim(),!er(y))throw new Error(`Invalid notation name: "${y}"`);d.push(y),e[t]==="|"&&(t++,t=kt(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,a+=" ("+d.join("|")+")"}else{const d=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;a+=e.substring(d,t);const p=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!p.includes(a.toUpperCase()))throw new Error(`Invalid attribute type: "${a}"`)}t=kt(e,t);let l="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(l="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(l="#IMPLIED",t+=7):[t,l]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:r,attributeName:s,attributeType:a,defaultValue:l,index:t}}}const kt=(n,e)=>{for(;e<n.length&&/\s/.test(n[e]);)e++;return e};function Wn(n,e,t){for(let i=0;i<e.length;i++)if(e[i]!==n[t+i+1])return!1;return!0}function er(n){if(oo(n))return n;throw new Error(`Invalid entity name ${n}`)}const gb=/^[-+]?0x[a-fA-F0-9]+$/,mb=/^0b[01]+$/,vb=/^0o[0-7]+$/,yb=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,bb={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function wb(n,e={}){if(e=Object.assign({},bb,e),!n||typeof n!="string")return n;let t=n.trim();if(t.length===0)return n;if(e.skipLike!==void 0&&e.skipLike.test(t))return n;if(t==="0")return 0;if(e.hex&&gb.test(t))return ia(t,16);if(e.binary&&mb.test(t))return ia(t,2);if(e.octal&&vb.test(t))return ia(t,8);if(isFinite(t)){if(t.includes("e")||t.includes("E"))return Sb(n,t,e);{const i=yb.exec(t);if(i){const r=i[1]||"",s=i[2];let a=_b(i[3]);const l=r?n[s.length+1]===".":n[s.length]===".";if(!e.leadingZeros&&(s.length>1||s.length===1&&!l))return n;{const d=Number(t),p=String(d);if(d===0)return d;if(p.search(/[eE]/)!==-1)return e.eNotation?d:n;if(t.indexOf(".")!==-1)return p==="0"||p===a||p===`${r}${a}`?d:n;let y=s?a:t;return s?y===p||r+y===p?d:n:y===p||y===r+p?d:n}}else return n}}else return kb(n,Number(t),e)}const xb=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Sb(n,e,t){if(!t.eNotation)return n;const i=e.match(xb);if(i){let r=i[1]||"";const s=i[3].indexOf("e")===-1?"E":"e",a=i[2],l=r?n[a.length+1]===s:n[a.length]===s;return a.length>1&&l?n:a.length===1&&(i[3].startsWith(`.${s}`)||i[3][0]===s)?Number(e):a.length>0?t.leadingZeros&&!l?(e=(i[1]||"")+i[3],Number(e)):n:Number(e)}else return n}function _b(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function ia(n,e){const t=n.trim();if((e===2||e===8)&&(n=t.substring(2)),parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function kb(n,e,t){const i=e===1/0;switch(t.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return n}}function Cb(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class tu{constructor(e,t={},i){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this.data=i,this._hasDeepWildcard=this.segments.some(r=>r.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(r=>r.attrName!==void 0),this._hasPositionSelector=this.segments.some(r=>r.position!==void 0)}_parse(e){const t=[];let i=0,r="";for(;i<e.length;)e[i]===this.separator?i+1<e.length&&e[i+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=""),t.push({type:"deep-wildcard"}),i+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r="",i++):(r+=e[i],i++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){const t={type:"tag"};let i=null,r=e;const s=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(r=s[1]+s[3],s[2])){const y=s[2].slice(1,-1);y&&(i=y)}let a,l=r;if(r.includes("::")){const y=r.indexOf("::");if(a=r.substring(0,y).trim(),l=r.substring(y+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${e}`)}let d,p=null;if(l.includes(":")){const y=l.lastIndexOf(":"),m=l.substring(0,y).trim(),w=l.substring(y+1).trim();["first","last","odd","even"].includes(w)||/^nth\(\d+\)$/.test(w)?(d=m,p=w):d=l}else d=l;if(!d)throw new Error(`Invalid segment pattern: ${e}`);if(t.tag=d,a&&(t.namespace=a),i)if(i.includes("=")){const y=i.indexOf("=");t.attrName=i.substring(0,y).trim(),t.attrValue=i.substring(y+1).trim()}else t.attrName=i.trim();if(p){const y=p.match(/^nth\((\d+)\)$/);y?(t.position="nth",t.positionValue=parseInt(y[1],10)):t.position=p}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class Eb{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard())return this._deepWildcards.push(e),this;const t=e.length,r=e.segments[e.segments.length-1]?.tag;if(!r||r==="*")this._wildcardByDepth.has(t)||this._wildcardByDepth.set(t,[]),this._wildcardByDepth.get(t).push(e);else{const s=`${t}:${r}`;this._byDepthAndTag.has(s)||this._byDepthAndTag.set(s,[]),this._byDepthAndTag.get(s).push(e)}return this}addAll(e){for(const t of e)this.add(t);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){const t=e.getDepth(),i=e.getCurrentTag(),r=`${t}:${i}`,s=this._byDepthAndTag.get(r);if(s){for(let l=0;l<s.length;l++)if(e.matches(s[l]))return s[l]}const a=this._wildcardByDepth.get(t);if(a){for(let l=0;l<a.length;l++)if(e.matches(a[l]))return a[l]}for(let l=0;l<this._deepWildcards.length;l++)if(e.matches(this._deepWildcards[l]))return this._deepWildcards[l];return null}}class Ib{constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){const e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){const e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){const t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){const t=this._matcher.path;if(t.length===0)return!1;const i=t[t.length-1];return i.values!==void 0&&e in i.values}getPosition(){const e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){const e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}}class Ab{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Ib(this)}push(e,t=null,i=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);const s=this.siblingStacks[r],a=i?`${i}:${e}`:e,l=s.get(a)||0;let d=0;for(const y of s.values())d+=y;s.set(a,l+1);const p={tag:e,position:d,counter:l};i!=null&&(p.namespace=i),t!=null&&(p.values=t),this.path.push(p)}pop(){if(this.path.length===0)return;this._pathStringCache=null;const e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){const t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;const t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){const i=e||this.separator;if(i===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;const s=this.path.map(a=>a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(i);return this._pathStringCache=s,s}return this.path.map(s=>t&&s.namespace?`${s.namespace}:${s.tag}`:s.tag).join(i)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){const t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(!this._matchSegment(e[t],this.path[t],t===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,i=e.length-1;for(;i>=0&&t>=0;){const r=e[i];if(r.type==="deep-wildcard"){if(i--,i<0)return!0;const s=e[i];let a=!1;for(let l=t;l>=0;l--)if(this._matchSegment(s,this.path[l],l===this.path.length-1)){t=l-1,i--,a=!0;break}if(!a)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,i--}}return i<0}_matchSegment(e,t,i){if(e.tag!=="*"&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==t.namespace||e.attrName!==void 0&&(!i||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!i)return!1;const r=t.counter??0;if(e.position==="first"&&r!==0)return!1;if(e.position==="odd"&&r%2!==1)return!1;if(e.position==="even"&&r%2!==0)return!1;if(e.position==="nth"&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map(t=>({...t})),this.siblingStacks=e.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}function Pb(n,e){if(!n)return{};const t=e.attributesGroupName?n[e.attributesGroupName]:n;if(!t)return{};const i={};for(const r in t)if(r.startsWith(e.attributeNamePrefix)){const s=r.substring(e.attributeNamePrefix.length);i[s]=t[r]}else i[r]=t[r];return i}function Ob(n){if(!n||typeof n!="string")return;const e=n.indexOf(":");if(e!==-1&&e>0){const t=n.substring(0,e);if(t!=="xmlns")return t}}class Tb{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Bb,this.parseTextData=Nb,this.resolveNameSpace=Mb,this.buildAttributesMap=jb,this.isItStopNode=Db,this.replaceEntitiesValue=$b,this.readStopNodeData=Kb,this.saveTextToParentTag=Fb,this.addChild=Lb,this.ignoreAttributesFn=Cb(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let t={...sd};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?t=this.options.htmlEntities:this.options.htmlEntities===!0&&(t={...sb,...rb}),this.entityDecoder=new ub({namedEntities:t,numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new Ab,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Eb;const i=this.options.stopNodes;if(i&&i.length>0){for(let r=0;r<i.length;r++){const s=i[r];typeof s=="string"?this.stopNodeExpressionsSet.add(new tu(s)):s instanceof tu&&this.stopNodeExpressionsSet.add(s)}this.stopNodeExpressionsSet.seal()}}}function Nb(n,e,t,i,r,s,a){const l=this.options;if(n!==void 0&&(l.trimValues&&!i&&(n=n.trim()),n.length>0)){a||(n=this.replaceEntitiesValue(n,e,t));const d=l.jPath?t.toString():t,p=l.tagValueProcessor(e,n,d,r,s);return p==null?n:typeof p!=typeof n||p!==n?p:l.trimValues||n.trim()===n?Fa(n,l.parseTagValue,l.numberParseOptions):n}}function Mb(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Rb=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function jb(n,e,t,i=!1){const r=this.options;if(i===!0||r.ignoreAttributes!==!0&&typeof n=="string"){const s=id(n,Rb),a=s.length,l={},d=new Array(a);let p=!1;const y={};for(let P=0;P<a;P++){const K=this.resolveNameSpace(s[P][1]),O=s[P][4];if(K.length&&O!==void 0){let D=O;r.trimValues&&(D=D.trim()),D=this.replaceEntitiesValue(D,t,this.readonlyMatcher),d[P]=D,y[K]=D,p=!0}}p&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(y);const m=r.jPath?e.toString():this.readonlyMatcher;let w=!1;for(let P=0;P<a;P++){const K=this.resolveNameSpace(s[P][1]);if(this.ignoreAttributesFn(K,m))continue;let O=r.attributeNamePrefix+K;if(K.length)if(r.transformAttributeName&&(O=r.transformAttributeName(O)),O=cd(O,r),s[P][4]!==void 0){const D=d[P],ee=r.attributeValueProcessor(K,D,m);ee==null?l[O]=D:typeof ee!=typeof D||ee!==D?l[O]=ee:l[O]=Fa(D,r.parseAttributeValue,r.numberParseOptions),w=!0}else r.allowBooleanAttributes&&(l[O]=!0,w=!0)}if(!w)return;if(r.attributesGroupName){const P={};return P[r.attributesGroupName]=l,P}return l}}const Bb=function(n){n=n.replace(/\r\n?/g,`
|
|
188
|
-
`);const e=new An("!xml");let t=e,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const r=this.options,s=new pb(r.processEntities),a=n.length;for(let l=0;l<a;l++)if(n[l]==="<"){const p=n.charCodeAt(l+1);if(p===47){const y=Mi(n,">",l,"Closing Tag is not closed.");let m=n.substring(l+2,y).trim();if(r.removeNSPrefix){const P=m.indexOf(":");P!==-1&&(m=m.substr(P+1))}m=ra(r.transformTagName,m,"",r).tagName,t&&(i=this.saveTextToParentTag(i,t,this.readonlyMatcher));const w=this.matcher.getCurrentTag();if(m&&r.unpairedTagsSet.has(m))throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);w&&r.unpairedTagsSet.has(w)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,t=this.tagsNodeStack.pop(),i="",l=y}else if(p===63){let y=$a(n,l,!1,"?>");if(!y)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,t,this.readonlyMatcher);const m=this.buildAttributesMap(y.tagExp,this.matcher,y.tagName,!0);if(m){const w=m[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(w)||1)}if(!(r.ignoreDeclaration&&y.tagName==="?xml"||r.ignorePiTags)){const w=new An(y.tagName);w.add(r.textNodeName,""),y.tagName!==y.tagExp&&y.attrExpPresent&&r.ignoreAttributes!==!0&&(w[":@"]=m),this.addChild(t,w,this.readonlyMatcher,l)}l=y.closeIndex+1}else if(p===33&&n.charCodeAt(l+2)===45&&n.charCodeAt(l+3)===45){const y=Mi(n,"-->",l+4,"Comment is not closed.");if(r.commentPropName){const m=n.substring(l+4,y-2);i=this.saveTextToParentTag(i,t,this.readonlyMatcher),t.add(r.commentPropName,[{[r.textNodeName]:m}])}l=y}else if(p===33&&n.charCodeAt(l+2)===68){const y=s.readDocType(n,l);this.entityDecoder.addInputEntities(y.entities),l=y.i}else if(p===33&&n.charCodeAt(l+2)===91){const y=Mi(n,"]]>",l,"CDATA is not closed.")-2,m=n.substring(l+9,y);i=this.saveTextToParentTag(i,t,this.readonlyMatcher);let w=this.parseTextData(m,t.tagname,this.readonlyMatcher,!0,!1,!0,!0);w==null&&(w=""),r.cdataPropName?t.add(r.cdataPropName,[{[r.textNodeName]:m}]):t.add(r.textNodeName,w),l=y+2}else{let y=$a(n,l,r.removeNSPrefix);if(!y){const Z=n.substring(Math.max(0,l-50),Math.min(a,l+50));throw new Error(`readTagExp returned undefined at position ${l}. Context: "${Z}"`)}let m=y.tagName;const w=y.rawTagName;let P=y.tagExp,K=y.attrExpPresent,O=y.closeIndex;if({tagName:m,tagExp:P}=ra(r.transformTagName,m,P,r),r.strictReservedNames&&(m===r.commentPropName||m===r.cdataPropName||m===r.textNodeName||m===r.attributesGroupName))throw new Error(`Invalid tag name: ${m}`);t&&i&&t.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,t,this.readonlyMatcher,!1));const D=t;D&&r.unpairedTagsSet.has(D.tagname)&&(t=this.tagsNodeStack.pop(),this.matcher.pop());let ee=!1;P.length>0&&P.lastIndexOf("/")===P.length-1&&(ee=!0,m[m.length-1]==="/"?(m=m.substr(0,m.length-1),P=m):P=P.substr(0,P.length-1),K=m!==P);let J=null,oe;oe=Ob(w),m!==e.tagname&&this.matcher.push(m,{},oe),m!==P&&K&&(J=this.buildAttributesMap(P,this.matcher,m),J&&Pb(J,r)),m!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const G=l;if(this.isCurrentNodeStopNode){let Z="";if(ee)l=y.closeIndex;else if(r.unpairedTagsSet.has(m))l=y.closeIndex;else{const fe=this.readStopNodeData(n,w,O+1);if(!fe)throw new Error(`Unexpected end of ${w}`);l=fe.i,Z=fe.tagContent}const ae=new An(m);J&&(ae[":@"]=J),ae.add(r.textNodeName,Z),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(t,ae,this.readonlyMatcher,G)}else{if(ee){({tagName:m,tagExp:P}=ra(r.transformTagName,m,P,r));const Z=new An(m);J&&(Z[":@"]=J),this.addChild(t,Z,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(r.unpairedTagsSet.has(m)){const Z=new An(m);J&&(Z[":@"]=J),this.addChild(t,Z,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1,l=y.closeIndex;continue}else{const Z=new An(m);if(this.tagsNodeStack.length>r.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(t),J&&(Z[":@"]=J),this.addChild(t,Z,this.readonlyMatcher,G),t=Z}i="",l=O}}}else i+=n[l];return e.child};function Lb(n,e,t,i){this.options.captureMetaData||(i=void 0);const r=this.options.jPath?t.toString():t,s=this.options.updateTag(e.tagname,r,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e,i))}function $b(n,e,t){const i=this.options.processEntities;if(!i||!i.enabled)return n;if(i.allowedTags){const r=this.options.jPath?t.toString():t;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return n}if(i.tagFilter){const r=this.options.jPath?t.toString():t;if(!i.tagFilter(e,r))return n}return this.entityDecoder.decode(n)}function Fb(n,e,t,i){return n&&(i===void 0&&(i=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,i),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Db(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Ub(n,e,t=">"){let i=0;const r=[],s=n.length,a=t.charCodeAt(0),l=t.length>1?t.charCodeAt(1):-1;for(let d=e;d<s;d++){const p=n.charCodeAt(d);if(i)p===i&&(i=0);else if(p===34||p===39)i=p;else if(p===a)if(l!==-1){if(n.charCodeAt(d+1)===l)return{data:String.fromCharCode(...r),index:d}}else return{data:String.fromCharCode(...r),index:d};else if(p===9){r.push(32);continue}r.push(p)}}function Mi(n,e,t,i){const r=n.indexOf(e,t);if(r===-1)throw new Error(i);return r+e.length-1}function qb(n,e,t,i){const r=n.indexOf(e,t);if(r===-1)throw new Error(i);return r}function $a(n,e,t,i=">"){const r=Ub(n,e+1,i);if(!r)return;let s=r.data;const a=r.index,l=s.search(/\s/);let d=s,p=!0;l!==-1&&(d=s.substring(0,l),s=s.substring(l+1).trimStart());const y=d;if(t){const m=d.indexOf(":");m!==-1&&(d=d.substr(m+1),p=d!==r.data.substr(m+1))}return{tagName:d,tagExp:s,closeIndex:a,attrExpPresent:p,rawTagName:y}}function Kb(n,e,t){const i=t;let r=1;const s=n.length;for(;t<s;t++)if(n[t]==="<"){const a=n.charCodeAt(t+1);if(a===47){const l=qb(n,">",t,`${e} is not closed`);if(n.substring(t+2,l).trim()===e&&(r--,r===0))return{tagContent:n.substring(i,t),i:l};t=l}else if(a===63)t=Mi(n,"?>",t+1,"StopNode is not closed.");else if(a===33&&n.charCodeAt(t+2)===45&&n.charCodeAt(t+3)===45)t=Mi(n,"-->",t+3,"StopNode is not closed.");else if(a===33&&n.charCodeAt(t+2)===91)t=Mi(n,"]]>",t,"StopNode is not closed.")-2;else{const l=$a(n,t,">");l&&((l&&l.tagName)===e&&l.tagExp[l.tagExp.length-1]!=="/"&&r++,t=l.closeIndex)}}}function Fa(n,e,t){if(e&&typeof n=="string"){const i=n.trim();return i==="true"?!0:i==="false"?!1:wb(n,t)}else return Hy(n)?n:""}function ra(n,e,t,i){if(n){const r=n(e);t===e&&(t=r),e=r}return e=cd(e,i),{tagName:e,tagExp:t}}function cd(n,e){if(rd.includes(n))throw new Error(`[SECURITY] Invalid name: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);return Rc.includes(n)?e.onDangerousProperty(n):n}const sa=An.getMetaDataSymbol();function Vb(n,e){if(!n||typeof n!="object")return{};if(!e)return n;const t={};for(const i in n)if(i.startsWith(e)){const r=i.substring(e.length);t[r]=n[i]}else t[i]=n[i];return t}function zb(n,e,t,i){return ld(n,e,t,i)}function ld(n,e,t,i){let r;const s={};for(let a=0;a<n.length;a++){const l=n[a],d=Wb(l);if(d!==void 0&&d!==e.textNodeName){const p=Vb(l[":@"]||{},e.attributeNamePrefix);t.push(d,p)}if(d===e.textNodeName)r===void 0?r=l[d]:r+=""+l[d];else{if(d===void 0)continue;if(l[d]){let p=ld(l[d],e,t,i);const y=Gb(p,e);if(l[":@"]?Hb(p,l[":@"],i,e):Object.keys(p).length===1&&p[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?p=p[e.textNodeName]:Object.keys(p).length===0&&(e.alwaysCreateTextNode?p[e.textNodeName]="":p=""),l[sa]!==void 0&&typeof p=="object"&&p!==null&&(p[sa]=l[sa]),s[d]!==void 0&&Object.prototype.hasOwnProperty.call(s,d))Array.isArray(s[d])||(s[d]=[s[d]]),s[d].push(p);else{const m=e.jPath?i.toString():i;e.isArray(d,m,y)?s[d]=[p]:s[d]=p}d!==void 0&&d!==e.textNodeName&&t.pop()}}}return typeof r=="string"?r.length>0&&(s[e.textNodeName]=r):r!==void 0&&(s[e.textNodeName]=r),s}function Wb(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const i=e[t];if(i!==":@")return i}}function Hb(n,e,t,i){if(e){const r=Object.keys(e),s=r.length;for(let a=0;a<s;a++){const l=r[a],d=l.startsWith(i.attributeNamePrefix)?l.substring(i.attributeNamePrefix.length):l,p=i.jPath?t.toString()+"."+d:t;i.isArray(l,p,!0,!0)?n[l]=[e[l]]:n[l]=e[l]}}}function Gb(n,e){const{textNodeName:t}=e,i=Object.keys(n).length;return!!(i===0||i===1&&(n[t]||typeof n[t]=="boolean"||n[t]===0))}class Yb{constructor(e){this.externalEntities={},this.options=hb(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const s=Yy(e,t);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const i=new Tb(this.options);i.entityDecoder.setExternalEntities(this.externalEntities);const r=i.parseXml(e);return this.options.preserveOrder||r===void 0?r:zb(r,this.options,i.matcher,i.readonlyMatcher)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return An.getMetaDataSymbol()}}var Jb=Object.getOwnPropertyDescriptor,Xb=(n,e,t,i)=>{for(var r=i>1?void 0:i?Jb(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},vs=(n,e)=>(t,i)=>e(t,i,n);let Da=class extends kr{constructor(n,e,t,i){super(n,"storage.components.nextcloudStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t,this.cristalApp=i}ATTACHMENTS="attachments";initBaseContentCalled=!1;authenticatedHTTPHeadersProvider;documentService;async getEditField(){return""}getImageURL(){return""}async getAuthenticatedHTTPHeaders(){return this.authenticatedHTTPHeadersProvider||(this.authenticatedHTTPHeadersProvider=this.cristalApp.getContainer().get("HTTPHeadersProvider",{name:"Nextcloud/Authenticated"})),await this.authenticatedHTTPHeadersProvider.getHeaders()}getDocumentService(){return this.documentService||(this.documentService=this.cristalApp.getContainer().get("DocumentService")),this.documentService}getRootUrl(n){const e=this.getWikiConfig();return`${e.baseRestURL}${e.storageRoot??`/files/${n}/.cristal`}`.replace("${username}",n)}async getPageContent(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e){const t=new Mn;return t.html="Not logged-in.",t.canEdit=!1,t}await this.initBaseContent(e);try{const t=await fetch(`${this.getRootUrl(e)}/${n}.md`,{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()});if(t.status>=200&&t.status<300){const{lastModificationDate:i,lastAuthor:r}=await this.getLastEditDetails(n,e),s=new Qf().readPage(await t.text()),a=new Mn;return a.source=s.content,a.name=s.name,a.headline=s.name,a.headlineRaw=s.name,a.syntax=s.syntax,a.lastAuthor=r,a.lastModificationDate=i,a.canEdit=!0,a}else return}catch(t){console.error("Unable to get page content",t);return}}async getLastEditDetails(n,e){let t,i;const r=await fetch(`${this.getRootUrl(e)}/${n}.md`,{body:`<?xml version="1.0" encoding="UTF-8"?>
|
|
189
|
-
<d:propfind xmlns:d="DAV:">
|
|
190
|
-
<d:prop xmlns:oc="http://owncloud.org/ns">
|
|
191
|
-
<d:getlastmodified />
|
|
192
|
-
<oc:owner-id />
|
|
193
|
-
<oc:owner-display-name />
|
|
194
|
-
</d:prop>
|
|
195
|
-
</d:propfind>`,method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(r.status>=200&&r.status<300){const s=new Yb().parse(await r.text())["d:multistatus"]["d:response"]["d:propstat"]["d:prop"],a=s["d:getlastmodified"];a&&(t=new Date(Date.parse(a))),i={username:s["oc:owner-id"],name:s["oc:owner-display-name"]}}return{lastModificationDate:t,lastAuthor:i}}async getAttachments(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return;const t=await fetch(this.getAttachmentsBasePath(n,e),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(t.status>=200&&t.status<300){const i=await t.text(),s=new window.DOMParser().parseFromString(i,"text/xml").getElementsByTagName("d:response"),a=[];for(let l=0;l<s.length;l++){const d=s[l];d.getElementsByTagName("d:getcontenttype").length>0&&a.push(this.parseAttachment(d))}return{attachments:a}}else return}async getAttachment(n,e){const t=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!t)return;const i=await fetch(this.getAttachmentBasePath(e,n,t),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(i.status>=200&&i.status<300){const r=await i.text(),a=new window.DOMParser().parseFromString(r,"text/xml").getElementsByTagName("d:response")[0];return this.parseAttachment(a)}else return}getAttachmentsBasePath(n,e){const t=this.convertToMetaSegments(n).join("/");return`${this.getRootUrl(e)}/${t}/${this.ATTACHMENTS}`}getAttachmentBasePath(n,e,t){return`${this.getAttachmentsBasePath(e,t)}/${n}`}async save(n,e,t){const i=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!i)return;const r=n.split("/"),s=this.getRootUrl(i);await this.createIntermediateDirectories(s,r.slice(0,r.length-1));const a=new Zf().writePage({content:t,name:e,syntax:"markdown/1.2"});await fetch(`${s}/${r.join("/")}.md`,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:a})}convertToMetaSegments(n){const e=n.split("/");return[...e.slice(0,e.length-1),`.${e[e.length-1]}`]}async createIntermediateDirectories(n,e){await this.createDirectory(n);for(let t=0;t<e.length;t++)await this.createDirectory(`${n}/${e.slice(0,t+1).join("/")}`)}async saveAttachments(n,e){const t=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!t){this.alertsServiceProvider.get().error(`Could not save attachments for page ${n}, the user is not properly logged-in.`);return}return Promise.all(e.map(i=>this.saveAttachment(n,i,t)))}async saveAttachment(n,e,t){const i=this.convertToMetaSegments(n),r=this.getRootUrl(t);await this.createIntermediateDirectories(r,[...i,this.ATTACHMENTS]);const s=this.getAttachmentsBasePath(n,t)+"/"+e.name;await fetch(s,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:e})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new Mn}async delete(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return{success:!1,error:"Not logged-in."};const t=this.getRootUrl(e),r=(await Promise.all([await this.deletePageFile(t,n),await this.deletePageFolder(t,n)])).filter(s=>!s.success).map(s=>s.error).filter(s=>s!==void 0);return r.length>0?{success:!1,error:r.join(", ")}:{success:!0}}async deletePageFile(n,e){return await fetch(`${n}/${e}.md`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async t=>t.ok?{success:!0}:{success:!1,error:await t.text()})}async deletePageFolder(n,e){return await fetch(`${n}/${this.convertToMetaSegments(e).join("/")}`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async t=>t.ok||t.status==404?{success:!0}:{success:!1,error:await t.text()})}async move(){throw new Error("Move not supported")}async isStorageReady(){return!0}async createDirectory(n){await fetch(n,{method:"MKCOL",headers:await this.getAuthenticatedHTTPHeaders()})}parseAttachment(n){const e=n.getElementsByTagName("d:href")[0].textContent,t=n.getElementsByTagName("d:getcontenttype")[0].textContent,i=parseInt(n.getElementsByTagName("d:getcontentlength")[0].textContent),r=Date.parse(n.getElementsByTagName("d:getlastmodified")[0].textContent),s=e.split("/"),a=`${this.getWikiConfig().baseURL}${e}`,l=s[s.length-1];return{mimetype:t,reference:l,id:e,href:a,size:i,date:new Date(r),author:void 0}}async initBaseContent(n){if(!this.initBaseContentCalled){this.initBaseContentCalled=!0;try{(await fetch(this.getRootUrl(n),{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()})).status===404&&(await this.save("home","",`# Welcome
|
|
196
|
-
|
|
197
|
-
This is a new **Cristal** wiki.
|
|
198
|
-
|
|
199
|
-
You can use it to take your *own* notes.
|
|
200
|
-
|
|
201
|
-
Enjoy!`),await this.getDocumentService().notifyDocumentChange("update",new Ky("home",new qy)))}catch(e){console.error("Failed to initialize Cristal default content",e)}}}};Da=Xb([it(),vs(0,Be("Logger")),vs(1,Be("AuthenticationManagerProvider")),vs(2,Be("AlertsServiceProvider")),vs(3,Be("CristalApp"))],Da);let Qb=class{constructor(e){e.bind("WikiConfig").to(Ba).when(Mc("Nextcloud")),e.bind("Storage").to(Da).whenNamed("Nextcloud")}};var Zb=Object.getOwnPropertyDescriptor,ew=(n,e,t,i)=>{for(var r=i>1?void 0:i?Zb(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ys=(n,e)=>(t,i)=>e(t,i,n);let Ua=class extends xr{storage;cristal;constructor(n,e,t){super(n),this.cristal=t,this.storage=e,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(n){return n=="html"||n=="jsonld"}defaultPageName(){return"Main.WebHome"}getType(){return"XWiki"}getNewPageDefaultName(){return"NewPage"}};Ua=ew([it(),ys(0,Be("Logger")),ys(1,Be("Storage")),ys(1,cc("XWiki")),ys(2,Be("CristalApp"))],Ua);function oa(n,e){const t=e.split(":"),i=t.length>1?t[0]:"xwiki",r=t.length>1?t[1]:t[0];return`${n.baseURL}/rest/wikis/${i}/spaces/${encodeURIComponent(r).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}var tw=Object.getOwnPropertyDescriptor,nw=(n,e,t,i)=>{for(var r=i>1?void 0:i?tw(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},aa=(n,e)=>(t,i)=>e(t,i,n);let qa=class extends kr{constructor(n,e,t){super(n,"storage.components.xwikiStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t}async isStorageReady(){return!0}getPageRestURL(n,e,t){this.logger?.debug("XWiki Loading page",n);const i=new URL(this.buildPageRestBaseURL(n,["rest","cristal","wikis","xwiki"])),r=new URLSearchParams([["format",e]]);return t&&r.append("revision",t),i.search=r.toString(),i.toString()}getPageFromViewURL(n){let e;return n.startsWith(this.wikiConfig.baseURL)?(e=n.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),e.endsWith(".")&&(e+="WebHome"),e=decodeURIComponent(e)):e=null,e}getImageURL(n,e){n==""&&(n="Main.WebHome");const t=this.wikiConfig.baseURL+"/bin/download/"+n.replace(".","/")+"/"+e;return this.logger?.debug("final image url ",t),t}async getPageContent(n,e,t){this.logger?.debug("XWiki Loading page",n),n==""&&(n="Main.WebHome");let i;t?i=new URL(`${oa(this.wikiConfig,n)}/history/${t}`):(i=new URL(oa(this.wikiConfig,n)),i.search=new URLSearchParams([["checkRight","edit"],["supportedSyntax","markdown/1.2"]]).toString()),this.logger?.debug("XWiki Loading url",i);const r=await fetch(i,{cache:"no-store",headers:{Accept:"application/json",...await this.getCredentials()}}),s=await r.json();if(r.status==404)return;if(!r.ok){this.alertsServiceProvider.get().error(`Could not load page ${n}. Reason: ${s.message}`);return}const a=new Mn;a.syntax=s.syntax,a.source=s.content,a.html=s.renderedContent,a.version=`${s.majorVersion}.${s.minorVersion}`,a.headlineRaw=s.rawTitle,a.headline=s.title;const l=s.hierarchy.items.pop().name;return a.name=l!="WebHome"?l:s.hierarchy.items.pop().name,a.lastModificationDate=new Date(s.modified),a.lastAuthor={name:s.author},a.canEdit=s.rights?.find(d=>d.name=="edit")?.value??!1,a.document=new ma({encodingFormat:a.syntax,name:a.name,identifier:s.fullName,headline:a.headline,headlineRaw:a.headlineRaw,text:a.source,html:a.html}),a}async getAttachments(n){return{attachments:(await(await fetch(this.buildAttachmentsURL(n),{headers:{Accept:"application/json",...await this.getCredentials()}})).json()).attachments.map(({id:r,name:s,mimeType:a,xwikiAbsoluteUrl:l,size:d,date:p,author:y})=>({id:r,reference:s,mimetype:a,href:l,size:d,date:new Date(p),author:y}))}}async getAttachment(n,e){const t=await this.getAttachments(n);if(t)return t.attachments.filter(i=>i.reference==e)[0]}async getPanelContent(n,e){const t=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+e+"&panel="+n;this.logger?.debug("XWiki Loading url",t);const r=await(await fetch(t,{cache:"no-store"})).json(),s=new Mn;return s.source=r.source,s.syntax="xwiki",s.html=r.content,s.css=r.css,s.js=r.js,s}async getEditField(n,e){try{const t=n.get("xwikiMapping")[e];let i=t.type,r=t.fieldName;i==null&&(i="document"),r==null&&(r=e);const s=this.wikiConfig.baseURL+"/bin/get/"+n.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+i+"&property="+n.get("className")+"."+r;return this.logger?.debug("XWiki Loading Field url",s),await(await fetch(s,{cache:"no-store"})).text()}catch(t){return this.logger?.error("Exception looking for edit field for field",e,t),""}}async save(n,e,t){const i=this.buildPageRestBaseURL(n,["rest","wikis","xwiki"]),r=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",...await this.getCredentials()},body:JSON.stringify({content:t,title:e,syntax:"markdown/1.2"})});if(!r.ok){const s=await r.text();throw this.alertsServiceProvider.get().error(`Could not save page ${n}. Reason: ${s}`),new Error(s)}}async saveAttachments(n,e){await Promise.all(e.map(t=>this.saveAttachment(n,t)))}async saveAttachment(n,e){const t=await fetch(`${this.buildAttachmentsURL(n)}/${e.name}`,{method:"PUT",body:e,headers:{...await this.getCredentials(),"Content-Type":e.type}});if(!t.ok)throw new Error(`Failed to upload the attachment. Reason: [${t.statusText}]`)}async delete(n){const e=this.buildPageRestBaseURL(n,["rest","wikis","xwiki"]);return await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...await this.getCredentials()}}).then(async i=>i.ok?{success:!0}:{success:!1,error:await i.text()})}async move(){throw new Error("Move not supported")}async getCredentials(){const n=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return n&&(e.Authorization=n),e}buildPageRestBaseURL(n,e){const t=this.wikiConfig.baseURL,i=n.split(/(?<=(?<!\\)(?:\\\\)*)\./);for(let r=0;r<i.length;r++){const s=r<i.length-1?"spaces":"pages";e.push(s),e.push(i[r].replace(/\\\./g,"."))}return`${t}/${e.join("/")}`}buildAttachmentsURL(n){return`${oa(this.wikiConfig,n)}/attachments`}};qa=nw([it(),aa(0,Be("Logger")),aa(1,Be("AuthenticationManagerProvider")),aa(2,Be("AlertsServiceProvider"))],qa);let iw=class{constructor(e){e.bind("WikiConfig").to(Ua).when(Mc("XWiki")),e.bind("Storage").to(qa).whenNamed("XWiki")}};var rw=Object.getOwnPropertyDescriptor,sw=(n,e,t,i)=>{for(var r=i>1?void 0:i?rw(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let Ka=class{name;hint;priority;singleton;constructor(){this.name="component.name",this.hint="default",this.priority=1e3,this.singleton=!1}getName(){return this.name}getHint(){return this.hint}getPriority(){return this.priority}isSingleton(){return this.singleton}};Ka=sw([it()],Ka);class ow{name;entryFile;staticModule;constructor(e,t,i){this.name=e,this.entryFile=t,this.staticModule=i}}var aw=Object.getOwnPropertyDescriptor,cw=(n,e,t,i)=>{for(var r=i>1?void 0:i?aw(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},lw=(n,e)=>(t,i)=>e(t,i,n);let Va=class extends Ka{remoteExtensions=new Map;remoteExtensionDefaultURL="/apps/";remoteExtensionDefaultEntryFile="main.bundle.js";logger;constructor(n){super(),this.logger=n,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(n,e,t){this.remoteExtensions.set(n,new ow(n,e,t))}setRemoteExtensionsConfig(n,e){this.remoteExtensionDefaultURL=n,this.remoteExtensionDefaultEntryFile=e}async loadExtension(n,e){try{const t=this.remoteExtensions.get(n),i=t&&t.entryFile?t.entryFile:this.remoteExtensionDefaultEntryFile,r=this.remoteExtensionDefaultURL+n+"/"+i,s=this.remoteExtensionDefaultURL+n+"/style.css";this.logger?.debug("Ready to import ",r);try{const l=await import(s,{assert:{type:"text/css"}});document.adoptedStyleSheets=[l.default]}catch{}const a=await import(r);if(a!=null){this.logger?.debug("Found components Init for ",n,a);const l=a.ComponentInit;new l(e),this.logger?.debug("Succesfull components Init for ",n)}else this.logger?.debug("No components to load for ",n);return}catch(t){this.logger?.error("Exception while loading components from ",n,t)}}async loadExtensions(n){for(const e of this.remoteExtensions.keys())await this.loadExtension(e,n)}};Va=cw([it(),lw(0,Be("Logger"))],Va);class uw{logger;constructor(e){this.logger=e.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),this.logger?.debug("Init Extension Manager components begin"),e.bind("ExtensionManager").to(Va),this.logger?.debug("Init Extension Manager components end")}}class fw{logger;container;extensionList;constructor(e){this.extensionList=e}getLogger(e){let t=this.container.get("Logger");return t||(t=new wr),t.setModule(e),t}async loadExtensionManager(e){const t="extension-manager",i="/apps/"+t+"/main.bundle.dev.js";try{if(e)this.logger?.debug("Loading static extension Manager"),new uw(this.container);else{this.logger?.debug("Dynamic extension Manager. Ready to import ",i);const r=await import(i);if(r!=null){this.logger?.debug("Found components Init for ",t,r);const s=r.ComponentInit;new s(this.container),this.logger?.debug("Succesfull components Init for ",t)}else this.logger?.debug("No components to load for ",t)}}catch(r){this.logger?.error("Exception while loading extension Manager from ",i,r)}}async loadExtensions(e,t){this.logger?.debug("Start app"),await this.loadExtensionManager(e);const i=this.container.get("ExtensionManager");if(this.logger?.debug("Extension Manager is ",i),i!=null){if(!t){i.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const r in this.extensionList)i.addRemoteExtension(r,"",!0);await i.loadExtensions(this.container)}this.logger?.debug("After extensions loading")}else this.logger?.debug("Could not start extension Manager");return i}initializeContainer(){this.container=new Rm,this.container.bind("LoggerConfig").to(va).inSingletonScope(),this.container.bind("Logger").to(wr);const e=this.container.get("LoggerConfig");e&&e.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),this.logger?.debug("Logging initialized")}getConfigFromPathName(e){let t="";if(e.startsWith("/")){const i=e.indexOf("/",1);i!=-1&&(t=e.substring(1,i))}return(t==null||t=="")&&(t="XWiki"),t}}const ud=Symbol("Comlink.proxy"),dw=Symbol("Comlink.endpoint"),hw=Symbol("Comlink.releaseProxy"),ca=Symbol("Comlink.finalizer"),Cs=Symbol("Comlink.thrown"),fd=n=>typeof n=="object"&&n!==null||typeof n=="function",pw={canHandle:n=>fd(n)&&n[ud],serialize(n){const{port1:e,port2:t}=new MessageChannel;return jc(n,e),[t,[t]]},deserialize(n){return n.start(),yw(n)}},gw={canHandle:n=>fd(n)&&Cs in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},dd=new Map([["proxy",pw],["throw",gw]]);function mw(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function jc(n,e=globalThis,t=["*"]){e.addEventListener("message",function i(r){if(!r||!r.data)return;if(!mw(t,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:s,type:a,path:l}=Object.assign({path:[]},r.data),d=(r.data.argumentList||[]).map(Xn);let p;try{const y=l.slice(0,-1).reduce((w,P)=>w[P],n),m=l.reduce((w,P)=>w[P],n);switch(a){case"GET":p=m;break;case"SET":y[l.slice(-1)[0]]=Xn(r.data.value),p=!0;break;case"APPLY":p=m.apply(y,d);break;case"CONSTRUCT":{const w=new m(...d);p=_w(w)}break;case"ENDPOINT":{const{port1:w,port2:P}=new MessageChannel;jc(n,P),p=Sw(w,[w])}break;case"RELEASE":p=void 0;break;default:return}}catch(y){p={value:y,[Cs]:0}}Promise.resolve(p).catch(y=>({value:y,[Cs]:0})).then(y=>{const[m,w]=Fs(y);e.postMessage(Object.assign(Object.assign({},m),{id:s}),w),a==="RELEASE"&&(e.removeEventListener("message",i),hd(e),ca in n&&typeof n[ca]=="function"&&n[ca]())}).catch(y=>{const[m,w]=Fs({value:new TypeError("Unserializable return value"),[Cs]:0});e.postMessage(Object.assign(Object.assign({},m),{id:s}),w)})}),e.start&&e.start()}function vw(n){return n.constructor.name==="MessagePort"}function hd(n){vw(n)&&n.close()}function yw(n,e){const t=new Map;return n.addEventListener("message",function(r){const{data:s}=r;if(!s||!s.id)return;const a=t.get(s.id);if(a)try{a(s)}finally{t.delete(s.id)}}),za(n,t,[],e)}function bs(n){if(n)throw new Error("Proxy has been released and is not useable")}function pd(n){return Ci(n,new Map,{type:"RELEASE"}).then(()=>{hd(n)})}const Ls=new WeakMap,$s="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(Ls.get(n)||0)-1;Ls.set(n,e),e===0&&pd(n)});function bw(n,e){const t=(Ls.get(e)||0)+1;Ls.set(e,t),$s&&$s.register(n,e,n)}function ww(n){$s&&$s.unregister(n)}function za(n,e,t=[],i=function(){}){let r=!1;const s=new Proxy(i,{get(a,l){if(bs(r),l===hw)return()=>{ww(s),pd(n),e.clear(),r=!0};if(l==="then"){if(t.length===0)return{then:()=>s};const d=Ci(n,e,{type:"GET",path:t.map(p=>p.toString())}).then(Xn);return d.then.bind(d)}return za(n,e,[...t,l])},set(a,l,d){bs(r);const[p,y]=Fs(d);return Ci(n,e,{type:"SET",path:[...t,l].map(m=>m.toString()),value:p},y).then(Xn)},apply(a,l,d){bs(r);const p=t[t.length-1];if(p===dw)return Ci(n,e,{type:"ENDPOINT"}).then(Xn);if(p==="bind")return za(n,e,t.slice(0,-1));const[y,m]=nu(d);return Ci(n,e,{type:"APPLY",path:t.map(w=>w.toString()),argumentList:y},m).then(Xn)},construct(a,l){bs(r);const[d,p]=nu(l);return Ci(n,e,{type:"CONSTRUCT",path:t.map(y=>y.toString()),argumentList:d},p).then(Xn)}});return bw(s,n),s}function xw(n){return Array.prototype.concat.apply([],n)}function nu(n){const e=n.map(Fs);return[e.map(t=>t[0]),xw(e.map(t=>t[1]))]}const gd=new WeakMap;function Sw(n,e){return gd.set(n,e),n}function _w(n){return Object.assign(n,{[ud]:!0})}function Fs(n){for(const[e,t]of dd)if(t.canHandle(n)){const[i,r]=t.serialize(n);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:n},gd.get(n)||[]]}function Xn(n){switch(n.type){case"HANDLER":return dd.get(n.name).deserialize(n.value);case"RAW":return n.value}}function Ci(n,e,t,i){return new Promise(r=>{const s=kw();e.set(s,r),n.start&&n.start(),n.postMessage(Object.assign({id:s},t),i)})}function kw(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}async function iu(){return await(await import("./index-DWPjg9z3.js")).loadConfig("/config.json")()}async function Cw(){try{return!process||!process.versions||!process.versions.electron?{}:await iu()}catch{return await iu()}}class Ew{currentNumber=0;queue=[];container;cristal;configMap;initialized=!1;fct;async start(){for(console.log("Starting worker thread"),await this.initialize();;)await this.sleep(1e3),await this.checkQueue()}setPageLoadedCallback(e){this.fct=e}sleep(e){return new Promise(t=>setTimeout(t,e))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const t=this.queue.pop();t&&await this.handleQueueItem(t),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(e){console.log("Handling queue item code ready to process",e);try{let t=null,i=null,r=null;const s=e.indexOf(":"),a=e.lastIndexOf("_");if(s!=-1&&a!=-1){t=e.substring(0,s),i=e.substring(s+1,a),r=e.substring(a+1);const l=this.getWikiConfig(t);l==null?console.log("Could not find config for page",e):(console.log("Updating page ",i,r),await l.storage.updatePageContent(i,r)&&(console.log("Page updated. Calling back to main thread"),this.fct(e)))}else console.log("Could not process page",e)}catch(t){console.log("Exception while trying to load",e,t)}}add(e){return console.log("Worker in add"),this.currentNumber+=e,this.currentNumber}addToQueue(e){console.log("Worker in addToQueue",e),this.queue.includes(e)||this.queue.push(e)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(e){const t=this.configMap.get(e);if(t==null){console.error("Failed to find wikiConfig for configName",e);return}const r=new Map(Object.entries(t)).get("configType");console.log("Looking for wikiConfig for name",e,"and type",r);let s;try{return s=this.container.get("WikiConfig",{name:r}),this.cristal.setWikiConfig(s),s.setConfigFromObject(t),s.initialize(),console.debug("Found wikiConfig for",e,"and type",r,":",s),s}catch(a){console.error("Failed to find wikiConfig for name",e,"and type",r,a);return}}async initialize(){console.log("Starting initialize");const e=["storage"],t=await Cw();this.configMap=new Map(Object.entries(t)),console.log("Loaded json config",this.configMap);const i=new fw(e);i.initializeContainer(),this.container=i.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(ya).inSingletonScope(),this.container.bind("QueueWorker").to(ba).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new vv(i.container),new Fy(i.container),new Qb(i.container),new iw(i.container),new av(i.container),new iv(i.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const md=new Ew;md.start();onconnect=n=>{jc(md,n.ports[0])};console.log("Worker code loaded");
|
|
202
|
-
//# sourceMappingURL=worker-8k1RWHy1.js.map
|