@xwiki/cristal-electron-renderer 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/chunk.2FB5TK5H-DmNP_ew6.js +2 -0
- package/dist/chunk.2FB5TK5H-DmNP_ew6.js.map +1 -0
- package/dist/{chunk.2Y62WHSU-C8i5cHiy.js → chunk.2Y62WHSU-CtjxXyaN.js} +2 -2
- package/dist/chunk.2Y62WHSU-CtjxXyaN.js.map +1 -0
- package/dist/{chunk.6DH62NIS-CVBVc-bX.js → chunk.6DH62NIS-Dm8zuX7H.js} +2 -2
- package/dist/chunk.6DH62NIS-Dm8zuX7H.js.map +1 -0
- package/dist/chunk.CFNN54QE-CwH9z8le.js +22 -0
- package/dist/chunk.CFNN54QE-CwH9z8le.js.map +1 -0
- package/dist/chunk.DBG7W4GS-C1gixj8b.js +75 -0
- package/dist/chunk.DBG7W4GS-C1gixj8b.js.map +1 -0
- package/dist/chunk.F5JVBNK3-BFrgaGDl.js +2 -0
- package/dist/chunk.F5JVBNK3-BFrgaGDl.js.map +1 -0
- package/dist/{chunk.XX4STEEY-COEpspdZ.js → chunk.FX2KPKHF-DRH3dcmv.js} +9 -9
- package/dist/chunk.FX2KPKHF-DRH3dcmv.js.map +1 -0
- package/dist/{chunk.GAND2OKP-lICOl7JF.js → chunk.GAND2OKP-ByJceoyz.js} +3 -3
- package/dist/chunk.GAND2OKP-ByJceoyz.js.map +1 -0
- package/dist/chunk.GQSSKPMO-XeEX4TdL.js +273 -0
- package/dist/chunk.GQSSKPMO-XeEX4TdL.js.map +1 -0
- package/dist/{chunk.I6OQK3N3-BBclK2fM.js → chunk.I6OQK3N3-XuvDDN4C.js} +7 -7
- package/dist/chunk.I6OQK3N3-XuvDDN4C.js.map +1 -0
- package/dist/chunk.KWPBDQ6I-Bf3dc1GJ.js.map +1 -1
- package/dist/chunk.LHI6QEL2-DjjW-g1e.js +2 -0
- package/dist/chunk.LHI6QEL2-DjjW-g1e.js.map +1 -0
- package/dist/chunk.MGEAXYVX-o-WC3ZVc.js.map +1 -1
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js.map +1 -1
- package/dist/chunk.TUZSOS6C-DxyWSdpL.js.map +1 -1
- package/dist/chunk.WJBFYL4X-Cbeo_gEa.js.map +1 -1
- package/dist/chunk.WYDJ5QAQ-BaRtgVmq.js +163 -0
- package/dist/chunk.WYDJ5QAQ-BaRtgVmq.js.map +1 -0
- package/dist/chunk.XX4STEEY-CnZz31HY.js +2 -0
- package/dist/chunk.XX4STEEY-CnZz31HY.js.map +1 -0
- package/dist/chunk.Z2C7OFLH-DXpTuERC.js +90 -0
- package/dist/chunk.Z2C7OFLH-DXpTuERC.js.map +1 -0
- package/dist/{chunk.Z6CYCANS-DF0ctyRp.js → chunk.Z6CYCANS-3ZX6gaKw.js} +2 -2
- package/dist/chunk.Z6CYCANS-3ZX6gaKw.js.map +1 -0
- package/dist/class-map-C3Xk0adH.js.map +1 -1
- package/dist/if-defined-DAvNwoU5.js.map +1 -1
- package/dist/index-BwWdPCLg.js +109 -0
- package/dist/index-BwWdPCLg.js.map +1 -0
- package/dist/{index-ScDkqPqn.css → index-Cqiv3gUG.css} +2 -25
- package/dist/index.html +2 -2
- package/dist/query-D1pSaKds.js.map +1 -1
- package/dist/static-CdL8EPVS.js.map +1 -1
- package/dist/staticBuild-DaVk8OhA.js +443 -0
- package/dist/staticBuild-DaVk8OhA.js.map +1 -0
- package/dist/staticBuild-ttxynnc3.css +1 -0
- package/dist/translations-LzwkxwEW.js +2 -0
- package/dist/translations-LzwkxwEW.js.map +1 -0
- package/dist/worker-CeXgpy1V.js +27 -0
- package/dist/worker-CeXgpy1V.js.map +1 -0
- package/dist/x-alert-BXrMLl_z.js +2 -0
- package/dist/x-alert-BXrMLl_z.js.map +1 -0
- package/dist/x-alert-BoZBHJTw.js +2 -0
- package/dist/x-alert-BoZBHJTw.js.map +1 -0
- package/dist/x-alert-DMLsu2fN.js +2 -0
- package/dist/x-alert-DMLsu2fN.js.map +1 -0
- package/dist/x-avatar-5PJmmbmb.js +2 -0
- package/dist/x-avatar-5PJmmbmb.js.map +1 -0
- package/dist/x-avatar-DMZRLeU4.css +1 -0
- package/dist/x-avatar-DXrOfuv4.js +2 -0
- package/dist/x-avatar-DXrOfuv4.js.map +1 -0
- package/dist/{x-avatar-rzw6K8Wc.js → x-avatar-bHnylPsU.js} +2 -2
- package/dist/x-avatar-bHnylPsU.js.map +1 -0
- package/dist/x-breadcrumb-ByeHAMZ3.js +2 -0
- package/dist/x-breadcrumb-ByeHAMZ3.js.map +1 -0
- package/dist/x-breadcrumb-UzKzkWEm.js +2 -0
- package/dist/x-breadcrumb-UzKzkWEm.js.map +1 -0
- package/dist/x-btn-BIQ8eFJy.js +2 -0
- package/dist/x-btn-BIQ8eFJy.js.map +1 -0
- package/dist/x-btn-Ek7j5MQJ.js +2 -0
- package/dist/x-btn-Ek7j5MQJ.js.map +1 -0
- package/dist/x-btn-Jy05lUMC.css +1 -0
- package/dist/x-btn-XPAPreXz.js +2 -0
- package/dist/x-btn-XPAPreXz.js.map +1 -0
- package/dist/x-card-CqrrEOda.js +2 -0
- package/dist/x-card-CqrrEOda.js.map +1 -0
- package/dist/x-card-DkMCK51C.js +2 -0
- package/dist/x-card-DkMCK51C.js.map +1 -0
- package/dist/x-card-mVVPCuVs.js +2 -0
- package/dist/x-card-mVVPCuVs.js.map +1 -0
- package/dist/x-col-BKCtabUF.js +2 -0
- package/dist/x-col-BKCtabUF.js.map +1 -0
- package/dist/x-col-CPix5n9C.js +2 -0
- package/dist/x-col-CPix5n9C.js.map +1 -0
- package/dist/x-container-B8usqdAt.js +2 -0
- package/dist/x-container-B8usqdAt.js.map +1 -0
- package/dist/x-container-C3VJF8Cs.js +2 -0
- package/dist/x-container-C3VJF8Cs.js.map +1 -0
- package/dist/x-dialog-DTbBEomU.js +2 -0
- package/dist/x-dialog-DTbBEomU.js.map +1 -0
- package/dist/x-dialog-Dmk1mNNm.js +2 -0
- package/dist/x-dialog-Dmk1mNNm.js.map +1 -0
- package/dist/x-dialog-Y6y28F7b.js +2 -0
- package/dist/x-dialog-Y6y28F7b.js.map +1 -0
- package/dist/x-divider-1De0d0_h.js +2 -0
- package/dist/x-divider-1De0d0_h.js.map +1 -0
- package/dist/x-divider-BOo7N7TG.js +2 -0
- package/dist/x-divider-BOo7N7TG.js.map +1 -0
- package/dist/{x-divider-BCwuNKpo.js → x-divider-DAdnWMFB.js} +2 -2
- package/dist/x-divider-DAdnWMFB.js.map +1 -0
- package/dist/x-file-input-CQcXcoHB.css +1 -0
- package/dist/x-file-input-D5fZFrts.js +2 -0
- package/dist/x-file-input-D5fZFrts.js.map +1 -0
- package/dist/x-file-input-Vq6SbhIt.js +2 -0
- package/dist/x-file-input-Vq6SbhIt.js.map +1 -0
- package/dist/x-form-2etnPUmf.js +2 -0
- package/dist/x-form-2etnPUmf.js.map +1 -0
- package/dist/x-form-6WjFitVZ.js +2 -0
- package/dist/x-form-6WjFitVZ.js.map +1 -0
- package/dist/x-img-C0VJnfz2.js +2 -0
- package/dist/x-img-C0VJnfz2.js.map +1 -0
- package/dist/x-img-CI94figY.js +2 -0
- package/dist/x-img-CI94figY.js.map +1 -0
- package/dist/x-img-ep-9amoQ.js +2 -0
- package/dist/x-img-ep-9amoQ.js.map +1 -0
- package/dist/x-load-5_-B9I0p.js +2 -0
- package/dist/x-load-5_-B9I0p.js.map +1 -0
- package/dist/x-load-BRJNFFsQ.js +2 -0
- package/dist/x-load-BRJNFFsQ.js.map +1 -0
- package/dist/x-load-CXyz5AZH.js +2 -0
- package/dist/x-load-CXyz5AZH.js.map +1 -0
- package/dist/x-load-CwU5Pjl2.css +5 -0
- package/dist/{x-load-DYuGRQQC.css → x-load-DLCnwiCB.css} +1 -1
- package/dist/{x-menu-BKquCdsX.js → x-menu-BPTY2_Pm.js} +164 -543
- package/dist/x-menu-BPTY2_Pm.js.map +1 -0
- package/dist/x-menu-CinyzodZ.js +2 -0
- package/dist/x-menu-CinyzodZ.js.map +1 -0
- package/dist/x-menu-MDCUArVg.js +2 -0
- package/dist/x-menu-MDCUArVg.js.map +1 -0
- package/dist/x-menu-item-DlEPAuVr.js +2 -0
- package/dist/x-menu-item-DlEPAuVr.js.map +1 -0
- package/dist/{x-menuitem-CVO0asxe.js → x-menuitem-C7L7TT_M.js} +2 -2
- package/dist/x-menuitem-C7L7TT_M.js.map +1 -0
- package/dist/x-menuitem-ChQ-MEzP.js +2 -0
- package/dist/x-menuitem-ChQ-MEzP.js.map +1 -0
- package/dist/x-row-BKCtabUF.js +2 -0
- package/dist/x-row-BKCtabUF.js.map +1 -0
- package/dist/x-row-CPix5n9C.js +2 -0
- package/dist/x-row-CPix5n9C.js.map +1 -0
- package/dist/x-search-BwzR-lic.js +2 -0
- package/dist/x-search-BwzR-lic.js.map +1 -0
- package/dist/{x-search-D_rjUBBL.js → x-search-DgB3g9qY.js} +2 -2
- package/dist/x-search-DgB3g9qY.js.map +1 -0
- package/dist/x-tab-D0Vw_ond.js +2 -0
- package/dist/x-tab-D0Vw_ond.js.map +1 -0
- package/dist/x-tab-DbIZPX0N.js +2 -0
- package/dist/x-tab-DbIZPX0N.js.map +1 -0
- package/dist/x-tab-group-C9tgQAMN.js +2 -0
- package/dist/x-tab-group-C9tgQAMN.js.map +1 -0
- package/dist/x-tab-group-D1vbKY6D.js +2 -0
- package/dist/x-tab-group-D1vbKY6D.js.map +1 -0
- package/dist/x-tab-panel--v10F4gh.js +2 -0
- package/dist/x-tab-panel--v10F4gh.js.map +1 -0
- package/dist/x-tab-panel-CbJsU5r0.js +2 -0
- package/dist/x-tab-panel-CbJsU5r0.js.map +1 -0
- package/dist/x-text-field-DcPqej4l.js +2 -0
- package/dist/x-text-field-DcPqej4l.js.map +1 -0
- package/dist/x-text-field-DpPHmzsd.js +2 -0
- package/dist/x-text-field-DpPHmzsd.js.map +1 -0
- package/dist/x-textfield-DM2JTrO7.js +2 -0
- package/dist/x-textfield-DM2JTrO7.js.map +1 -0
- package/dist/x-textfield-lI6PveRP.js +2 -0
- package/dist/x-textfield-lI6PveRP.js.map +1 -0
- package/package.json +13 -10
- package/src/index.ts +12 -9
- package/src/vite-env.d.ts +5 -10
- package/src/vue.d.ts +4 -9
- package/vite.config.js +4 -9
- package/dist/chunk.2Y62WHSU-C8i5cHiy.js.map +0 -1
- package/dist/chunk.6DH62NIS-CVBVc-bX.js.map +0 -1
- package/dist/chunk.GAND2OKP-lICOl7JF.js.map +0 -1
- package/dist/chunk.I6OQK3N3-BBclK2fM.js.map +0 -1
- package/dist/chunk.LHI6QEL2-DbpPiPxS.js +0 -75
- package/dist/chunk.LHI6QEL2-DbpPiPxS.js.map +0 -1
- package/dist/chunk.WYDJ5QAQ-C81Elw3D.js +0 -163
- package/dist/chunk.WYDJ5QAQ-C81Elw3D.js.map +0 -1
- package/dist/chunk.XX4STEEY-COEpspdZ.js.map +0 -1
- package/dist/chunk.Z6CYCANS-DF0ctyRp.js.map +0 -1
- package/dist/index-DK0YwuAW.js +0 -411
- package/dist/index-DK0YwuAW.js.map +0 -1
- package/dist/staticBuild-BlyaXHUF.css +0 -1
- package/dist/staticBuild-BoKVadnu.js +0 -1063
- package/dist/staticBuild-BoKVadnu.js.map +0 -1
- package/dist/worker-CybHddrE.js +0 -211
- package/dist/worker-CybHddrE.js.map +0 -1
- package/dist/x-alert-7r5rx0d7.js +0 -2
- package/dist/x-alert-7r5rx0d7.js.map +0 -1
- package/dist/x-alert-l0oP9PUN.js +0 -2
- package/dist/x-alert-l0oP9PUN.js.map +0 -1
- package/dist/x-alert-uqeGd1IW.js +0 -2
- package/dist/x-alert-uqeGd1IW.js.map +0 -1
- package/dist/x-avatar-BARZZcgr.js +0 -2
- package/dist/x-avatar-BARZZcgr.js.map +0 -1
- package/dist/x-avatar-CfnVd4CE.css +0 -1
- package/dist/x-avatar-DnbaVGNC.js +0 -2
- package/dist/x-avatar-DnbaVGNC.js.map +0 -1
- package/dist/x-avatar-rzw6K8Wc.js.map +0 -1
- package/dist/x-breadcrumb-CzKs24Jh.js +0 -2
- package/dist/x-breadcrumb-CzKs24Jh.js.map +0 -1
- package/dist/x-breadcrumb-VokcqVrB.js +0 -2
- package/dist/x-breadcrumb-VokcqVrB.js.map +0 -1
- package/dist/x-btn-BNO2Vh9q.js +0 -2
- package/dist/x-btn-BNO2Vh9q.js.map +0 -1
- package/dist/x-btn-BeE4ChBm.js +0 -2
- package/dist/x-btn-BeE4ChBm.js.map +0 -1
- package/dist/x-btn-D2HJcK1C.css +0 -1
- package/dist/x-btn-DOkDF37q.js +0 -2
- package/dist/x-btn-DOkDF37q.js.map +0 -1
- package/dist/x-card-BzquGj3n.js +0 -2
- package/dist/x-card-BzquGj3n.js.map +0 -1
- package/dist/x-card-D6loY5Bx.js +0 -2
- package/dist/x-card-D6loY5Bx.js.map +0 -1
- package/dist/x-card-D_W5kTzv.js +0 -2
- package/dist/x-card-D_W5kTzv.js.map +0 -1
- package/dist/x-col-B5OPXPr8.js +0 -2
- package/dist/x-col-B5OPXPr8.js.map +0 -1
- package/dist/x-col-KJDQojCc.js +0 -2
- package/dist/x-col-KJDQojCc.js.map +0 -1
- package/dist/x-container-e-eRQnv6.js +0 -2
- package/dist/x-container-e-eRQnv6.js.map +0 -1
- package/dist/x-container-e4wjA5VY.js +0 -2
- package/dist/x-container-e4wjA5VY.js.map +0 -1
- package/dist/x-dialog-D6r8mi6-.js +0 -2
- package/dist/x-dialog-D6r8mi6-.js.map +0 -1
- package/dist/x-dialog-DYWxApRD.js +0 -2
- package/dist/x-dialog-DYWxApRD.js.map +0 -1
- package/dist/x-dialog-oAn88o9T.js +0 -2
- package/dist/x-dialog-oAn88o9T.js.map +0 -1
- package/dist/x-divider-BCwuNKpo.js.map +0 -1
- package/dist/x-divider-BnEfygqi.js +0 -2
- package/dist/x-divider-BnEfygqi.js.map +0 -1
- package/dist/x-divider-rvXgbWfE.js +0 -2
- package/dist/x-divider-rvXgbWfE.js.map +0 -1
- package/dist/x-img-B2B5glWY.js +0 -2
- package/dist/x-img-B2B5glWY.js.map +0 -1
- package/dist/x-img-Bj_1ZxwL.js +0 -2
- package/dist/x-img-Bj_1ZxwL.js.map +0 -1
- package/dist/x-img-iz7nX54V.js +0 -2
- package/dist/x-img-iz7nX54V.js.map +0 -1
- package/dist/x-load-B-IMf3jW.js +0 -2
- package/dist/x-load-B-IMf3jW.js.map +0 -1
- package/dist/x-load-DKS8UJZy.js +0 -2
- package/dist/x-load-DKS8UJZy.js.map +0 -1
- package/dist/x-load-Diex9fJK.js +0 -2
- package/dist/x-load-Diex9fJK.js.map +0 -1
- package/dist/x-load-DyIF2nXd.css +0 -5
- package/dist/x-menu-BBb2QzOu.js +0 -2
- package/dist/x-menu-BBb2QzOu.js.map +0 -1
- package/dist/x-menu-BKquCdsX.js.map +0 -1
- package/dist/x-menu-Ce37WOnf.js +0 -2
- package/dist/x-menu-Ce37WOnf.js.map +0 -1
- package/dist/x-menu-item-JuTN7QVh.js +0 -2
- package/dist/x-menu-item-JuTN7QVh.js.map +0 -1
- package/dist/x-menuitem-CNKTVGiE.js +0 -2
- package/dist/x-menuitem-CNKTVGiE.js.map +0 -1
- package/dist/x-menuitem-CVO0asxe.js.map +0 -1
- package/dist/x-row-B5OPXPr8.js +0 -2
- package/dist/x-row-B5OPXPr8.js.map +0 -1
- package/dist/x-row-KJDQojCc.js +0 -2
- package/dist/x-row-KJDQojCc.js.map +0 -1
- package/dist/x-search-B0oJfSre.js +0 -2
- package/dist/x-search-B0oJfSre.js.map +0 -1
- package/dist/x-search-D_rjUBBL.js.map +0 -1
- package/dist/x-textfield-CRySrmrj.js +0 -2
- package/dist/x-textfield-CRySrmrj.js.map +0 -1
- package/dist/x-textfield-GtnNDOX1.js +0 -2
- package/dist/x-textfield-GtnNDOX1.js.map +0 -1
package/dist/worker-CybHddrE.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/const vi=Symbol("Comlink.proxy"),Bo=Symbol("Comlink.endpoint"),Fo=Symbol("Comlink.releaseProxy"),gr=Symbol("Comlink.finalizer"),fn=Symbol("Comlink.thrown"),mi=r=>typeof r=="object"&&r!==null||typeof r=="function",Ko={canHandle:r=>mi(r)&&r[vi],serialize(r){const{port1:t,port2:i}=new MessageChannel;return yr(r,t),[i,[i]]},deserialize(r){return r.start(),Vo(r)}},Wo={canHandle:r=>mi(r)&&fn in r,serialize({value:r}){let t;return r instanceof Error?t={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:t={isError:!1,value:r},[t,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},bi=new Map([["proxy",Ko],["throw",Wo]]);function qo(r,t){for(const i of r)if(t===i||i==="*"||i instanceof RegExp&&i.test(t))return!0;return!1}function yr(r,t=globalThis,i=["*"]){t.addEventListener("message",function a(u){if(!u||!u.data)return;if(!qo(i,u.origin)){console.warn(`Invalid origin '${u.origin}' for comlink proxy`);return}const{id:l,type:d,path:E}=Object.assign({path:[]},u.data),M=(u.data.argumentList||[]).map(gt);let y;try{const j=E.slice(0,-1).reduce((Y,pe)=>Y[pe],r),V=E.reduce((Y,pe)=>Y[pe],r);switch(d){case"GET":y=V;break;case"SET":j[E.slice(-1)[0]]=gt(u.data.value),y=!0;break;case"APPLY":y=V.apply(j,M);break;case"CONSTRUCT":{const Y=new V(...M);y=Yo(Y)}break;case"ENDPOINT":{const{port1:Y,port2:pe}=new MessageChannel;yr(r,pe),y=Ho(Y,[Y])}break;case"RELEASE":y=void 0;break;default:return}}catch(j){y={value:j,[fn]:0}}Promise.resolve(y).catch(j=>({value:j,[fn]:0})).then(j=>{const[V,Y]=gn(j);t.postMessage(Object.assign(Object.assign({},V),{id:l}),Y),d==="RELEASE"&&(t.removeEventListener("message",a),wi(t),gr in r&&typeof r[gr]=="function"&&r[gr]())}).catch(j=>{const[V,Y]=gn({value:new TypeError("Unserializable return value"),[fn]:0});t.postMessage(Object.assign(Object.assign({},V),{id:l}),Y)})}),t.start&&t.start()}function Uo(r){return r.constructor.name==="MessagePort"}function wi(r){Uo(r)&&r.close()}function Vo(r,t){return vr(r,[],t)}function hn(r){if(r)throw new Error("Proxy has been released and is not useable")}function _i(r){return Tt(r,{type:"RELEASE"}).then(()=>{wi(r)})}const dn=new WeakMap,pn="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const t=(dn.get(r)||0)-1;dn.set(r,t),t===0&&_i(r)});function $o(r,t){const i=(dn.get(t)||0)+1;dn.set(t,i),pn&&pn.register(r,t,r)}function Go(r){pn&&pn.unregister(r)}function vr(r,t=[],i=function(){}){let a=!1;const u=new Proxy(i,{get(l,d){if(hn(a),d===Fo)return()=>{Go(u),_i(r),a=!0};if(d==="then"){if(t.length===0)return{then:()=>u};const E=Tt(r,{type:"GET",path:t.map(M=>M.toString())}).then(gt);return E.then.bind(E)}return vr(r,[...t,d])},set(l,d,E){hn(a);const[M,y]=gn(E);return Tt(r,{type:"SET",path:[...t,d].map(j=>j.toString()),value:M},y).then(gt)},apply(l,d,E){hn(a);const M=t[t.length-1];if(M===Bo)return Tt(r,{type:"ENDPOINT"}).then(gt);if(M==="bind")return vr(r,t.slice(0,-1));const[y,j]=Ai(E);return Tt(r,{type:"APPLY",path:t.map(V=>V.toString()),argumentList:y},j).then(gt)},construct(l,d){hn(a);const[E,M]=Ai(d);return Tt(r,{type:"CONSTRUCT",path:t.map(y=>y.toString()),argumentList:E},M).then(gt)}});return $o(u,r),u}function zo(r){return Array.prototype.concat.apply([],r)}function Ai(r){const t=r.map(gn);return[t.map(i=>i[0]),zo(t.map(i=>i[1]))]}const Si=new WeakMap;function Ho(r,t){return Si.set(r,t),r}function Yo(r){return Object.assign(r,{[vi]:!0})}function gn(r){for(const[t,i]of bi)if(i.canHandle(r)){const[a,u]=i.serialize(r);return[{type:"HANDLER",name:t,value:a},u]}return[{type:"RAW",value:r},Si.get(r)||[]]}function gt(r){switch(r.type){case"HANDLER":return bi.get(r.name).deserialize(r.value);case"RAW":return r.value}}function Tt(r,t,i){return new Promise(a=>{const u=Qo();r.addEventListener("message",function l(d){!d.data||!d.data.id||d.data.id!==u||(r.removeEventListener("message",l),a(d.data))}),r.start&&r.start(),r.postMessage(Object.assign({id:u},t),i)})}function Qo(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Me="named",Ci="name",yn="unmanaged",xi="optional",vn="inject",qt="multi_inject",Oi="inversify:tagged",Ei="inversify:tagged_props",mr="inversify:paramtypes",Xo="design:paramtypes",Pi="post_construct",br="pre_destroy";function Jo(){return[vn,qt,Ci,yn,Me,xi]}var ki=Jo(),ye={Request:"Request",Singleton:"Singleton",Transient:"Transient"},ce={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},Ut={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},Zo=0;function Vt(){return Zo++}var ea=function(){function r(t,i){this.id=Vt(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=ce.Invalid,this.constraint=function(a){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var t=new r(this.serviceIdentifier,this.scope);return t.activated=t.scope===ye.Singleton?this.activated:!1,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t},r}(),ta="Cannot apply @injectable decorator multiple times.",Ti="Metadata key was used more than once in a parameter:",$t="NULL argument",Ii="Key Not Found",na="Ambiguous match found for serviceIdentifier:",ra="Could not unbind serviceIdentifier:",ia="No matching bindings found for serviceIdentifier:",Di="Missing required @injectable annotation in:",oa="Missing required @inject or @multiInject annotation in:",aa=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifier to overcome this limitation."},sa="Circular dependency found:",ua="Invalid binding type:",ca="No snapshot available to restore.",la="Invalid return type in middleware. Middleware must return!",fa="Value provided to function binding must be a function!",ha=function(r){return"You are attempting to construct '"+r+`' in a synchronous way
|
|
6
|
-
but it has asynchronous dependencies.`},da="The toSelf function can only be applied when a constructor is used as service identifier",Mi="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",pa=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")},ga="Invalid Container constructor argument. Container options must be an object.",ya='Invalid Container option. Default scope must be a string ("singleton" or "transient").',va="Invalid Container option. Auto bind injectable must be a boolean",ma="Invalid Container option. Skip base check must be a boolean",ba="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)",wa=function(r,t){return"@postConstruct error in class "+r+": "+t},_a=function(r,t){return"@preDestroy error in class "+r+": "+t},wr=function(r,t){return"onDeactivation() error in class "+r+": "+t},Aa=function(r,t){return"It looks like there is a circular dependency in one of the '"+r+"' bindings. Please investigate bindings with "+("service identifier '"+t+"'.")},Sa="Maximum call stack size exceeded",Ca=function(){function r(){}return r.prototype.getConstructorMetadata=function(t){var i=Reflect.getMetadata(mr,t),a=Reflect.getMetadata(Oi,t);return{compilerGeneratedMetadata:i,userGeneratedMetadata:a||{}}},r.prototype.getPropertiesMetadata=function(t){var i=Reflect.getMetadata(Ei,t)||[];return i},r}(),mn={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Ri(r){return r instanceof RangeError||r.message===Sa}var xa=function(r,t){try{return r()}catch(i){throw Ri(i)&&(i=t()),i}};function Gt(r){if(typeof r=="function"){var t=r;return t.name}else{if(typeof r=="symbol")return r.toString();var t=r;return t}}function ji(r,t,i){var a="",u=i(r,t);return u.length!==0&&(a=`
|
|
7
|
-
Registered bindings:`,u.forEach(function(l){var d="Object";l.implementationType!==null&&(d=bn(l.implementationType)),a=a+`
|
|
8
|
-
`+d,l.constraint.metaData&&(a=a+" - "+l.constraint.metaData)})),a}function Ni(r,t){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===t?!0:Ni(r.parentRequest,t)}function Oa(r){function t(a,u){u===void 0&&(u=[]);var l=Gt(a.serviceIdentifier);return u.push(l),a.parentRequest!==null?t(a.parentRequest,u):u}var i=t(r);return i.reverse().join(" --> ")}function Li(r){r.childRequests.forEach(function(t){if(Ni(t,t.serviceIdentifier)){var i=Oa(t);throw new Error(sa+" "+i)}else Li(t)})}function Ea(r,t){if(t.isTagged()||t.isNamed()){var i="",a=t.getNamedTag(),u=t.getCustomTags();return a!==null&&(i+=a.toString()+`
|
|
9
|
-
`),u!==null&&u.forEach(function(l){i+=l.toString()+`
|
|
10
|
-
`})," "+r+`
|
|
11
|
-
`+r+" - "+i}else return" "+r}function bn(r){if(r.name)return r.name;var t=r.toString(),i=t.match(/^function\s*([^\s(]+)/);return i?i[1]:"Anonymous function: "+t}function Pa(r){return r.toString().slice(7,-1)}var Bi=function(){function r(t){this.id=Vt(),this.container=t}return r.prototype.addPlan=function(t){this.plan=t},r.prototype.setCurrentRequest=function(t){this.currentRequest=t},r}(),Qe=function(){function r(t,i){this.key=t,this.value=i}return r.prototype.toString=function(){return this.key===Me?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},r}(),ka=function(){function r(t,i){this.parentContext=t,this.rootRequest=i}return r}(),Ta=function(){function r(t){this._cb=t}return r.prototype.unwrap=function(){return this._cb()},r}(),Ia=function(){function r(t){this.str=t}return r.prototype.startsWith=function(t){return this.str.indexOf(t)===0},r.prototype.endsWith=function(t){var i="",a=t.split("").reverse().join("");return i=this.str.split("").reverse().join(""),this.startsWith.call({str:i},a)},r.prototype.contains=function(t){return this.str.indexOf(t)!==-1},r.prototype.equals=function(t){return this.str===t},r.prototype.value=function(){return this.str},r}(),wn=function(){function r(t,i,a,u){this.id=Vt(),this.type=t,this.serviceIdentifier=a;var l=typeof i=="symbol"?Pa(i):i;this.name=new Ia(l||""),this.identifier=i,this.metadata=new Array;var d=null;typeof u=="string"?d=new Qe(Me,u):u instanceof Qe&&(d=u),d!==null&&this.metadata.push(d)}return r.prototype.hasTag=function(t){for(var i=0,a=this.metadata;i<a.length;i++){var u=a[i];if(u.key===t)return!0}return!1},r.prototype.isArray=function(){return this.hasTag(qt)},r.prototype.matchesArray=function(t){return this.matchesTag(qt)(t)},r.prototype.isNamed=function(){return this.hasTag(Me)},r.prototype.isTagged=function(){return this.metadata.some(function(t){return ki.every(function(i){return t.key!==i})})},r.prototype.isOptional=function(){return this.matchesTag(xi)(!0)},r.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(t){return t.key===Me})[0]:null},r.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(t){return ki.every(function(i){return t.key!==i})}):null},r.prototype.matchesNamedTag=function(t){return this.matchesTag(Me)(t)},r.prototype.matchesTag=function(t){var i=this;return function(a){for(var u=0,l=i.metadata;u<l.length;u++){var d=l[u];if(d.key===t&&d.value===a)return!0}return!1}},r}(),_n=function(r,t,i){if(i||arguments.length===2)for(var a=0,u=t.length,l;a<u;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return r.concat(l||Array.prototype.slice.call(t))};function Da(r,t){var i=bn(t);return Fi(r,i,t,!1)}function Fi(r,t,i,a){var u=r.getConstructorMetadata(i),l=u.compilerGeneratedMetadata;if(l===void 0){var d=Di+" "+t+".";throw new Error(d)}var E=u.userGeneratedMetadata,M=Object.keys(E),y=i.length===0&&M.length>0,j=M.length>i.length,V=y||j?M.length:i.length,Y=Ra(a,t,l,E,V),pe=Ki(r,i,t),ve=_n(_n([],Y,!0),pe,!0);return ve}function Ma(r,t,i,a,u){var l=u[r.toString()]||[],d=qi(l),E=d.unmanaged!==!0,M=a[r],y=d.inject||d.multiInject;if(M=y||M,M instanceof Ta&&(M=M.unwrap()),E){var j=M===Object,V=M===Function,Y=M===void 0,pe=j||V||Y;if(!t&&pe){var ve=oa+" argument "+r+" in class "+i+".";throw new Error(ve)}var we=new wn(Ut.ConstructorArgument,d.targetName,M);return we.metadata=l,we}return null}function Ra(r,t,i,a,u){for(var l=[],d=0;d<u;d++){var E=d,M=Ma(E,r,t,i,a);M!==null&&l.push(M)}return l}function ja(r,t,i,a){var u=r||t;if(u===void 0){var l=Di+" for property "+String(i)+" in class "+a+".";throw new Error(l)}return u}function Ki(r,t,i){for(var a=r.getPropertiesMetadata(t),u=[],l=Object.getOwnPropertySymbols(a),d=Object.keys(a),E=d.concat(l),M=0,y=E;M<y.length;M++){var j=y[M],V=a[j],Y=qi(V),pe=Y.targetName||j,ve=ja(Y.inject,Y.multiInject,j,i),we=new wn(Ut.ClassProperty,pe,ve);we.metadata=V,u.push(we)}var Ze=Object.getPrototypeOf(t.prototype).constructor;if(Ze!==Object){var Dt=Ki(r,Ze,i);u=_n(_n([],u,!0),Dt,!0)}return u}function Wi(r,t){var i=Object.getPrototypeOf(t.prototype).constructor;if(i!==Object){var a=bn(i),u=Fi(r,a,i,!0),l=u.map(function(M){return M.metadata.filter(function(y){return y.key===yn})}),d=[].concat.apply([],l).length,E=u.length-d;return E>0?E:Wi(r,i)}else return 0}function qi(r){var t={};return r.forEach(function(i){t[i.key.toString()]=i.value}),{inject:t[vn],multiInject:t[qt],targetName:t[Ci],unmanaged:t[yn]}}var _r=function(){function r(t,i,a,u,l){this.id=Vt(),this.serviceIdentifier=t,this.parentContext=i,this.parentRequest=a,this.target=l,this.childRequests=[],this.bindings=Array.isArray(u)?u:[u],this.requestScope=a===null?new Map:null}return r.prototype.addChildRequest=function(t,i,a){var u=new r(t,this.parentContext,this,i,a);return this.childRequests.push(u),u},r}();function An(r){return r._bindingDictionary}function Na(r,t,i,a,u,l){var d=r?qt:vn,E=new Qe(d,i),M=new wn(t,a,i,E);if(u!==void 0){var y=new Qe(u,l);M.metadata.push(y)}return M}function Ui(r,t,i,a,u){var l=zt(i.container,u.serviceIdentifier),d=[];return l.length===mn.NoBindingsAvailable&&i.container.options.autoBindInjectable&&typeof u.serviceIdentifier=="function"&&r.getConstructorMetadata(u.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(u.serviceIdentifier).toSelf(),l=zt(i.container,u.serviceIdentifier)),t?d=l:d=l.filter(function(E){var M=new _r(E.serviceIdentifier,i,a,E,u);return E.constraint(M)}),La(u.serviceIdentifier,d,u,i.container),d}function La(r,t,i,a){switch(t.length){case mn.NoBindingsAvailable:if(i.isOptional())return t;var u=Gt(r),l=ia;throw l+=Ea(u,i),l+=ji(a,u,zt),new Error(l);case mn.OnlyOneBindingAvailable:return t;case mn.MultipleBindingsAvailable:default:if(i.isArray())return t;var u=Gt(r),l=na+" "+u;throw l+=ji(a,u,zt),new Error(l)}}function Vi(r,t,i,a,u,l){var d,E;if(u===null){d=Ui(r,t,a,null,l),E=new _r(i,a,null,d,l);var M=new ka(a,E);a.addPlan(M)}else d=Ui(r,t,a,u,l),E=u.addChildRequest(l.serviceIdentifier,d,l);d.forEach(function(y){var j=null;if(l.isArray())j=E.addChildRequest(y.serviceIdentifier,y,l);else{if(y.cache)return;j=E}if(y.type===ce.Instance&&y.implementationType!==null){var V=Da(r,y.implementationType);if(!a.container.options.skipBaseClassChecks){var Y=Wi(r,y.implementationType);if(V.length<Y){var pe=pa(bn(y.implementationType));throw new Error(pe)}}V.forEach(function(ve){Vi(r,!1,ve.serviceIdentifier,a,j,ve)})}})}function zt(r,t){var i=[],a=An(r);return a.hasKey(t)?i=a.get(t):r.parent!==null&&(i=zt(r.parent,t)),i}function Ba(r,t,i,a,u,l,d,E){E===void 0&&(E=!1);var M=new Bi(t),y=Na(i,a,u,"",l,d);try{return Vi(r,E,u,M,null,y),M}catch(j){throw Ri(j)&&Li(M.plan.rootRequest),j}}function Fa(r,t,i,a){var u=new wn(Ut.Variable,"",t,new Qe(i,a)),l=new Bi(r),d=new _r(t,l,null,[],u);return d}function Te(r){var t=typeof r=="object"&&r!==null||typeof r=="function";return t&&typeof r.then=="function"}function $i(r){return Te(r)?!0:Array.isArray(r)&&r.some(Te)}var Ka=function(r,t,i,a){function u(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function E(j){try{y(a.next(j))}catch(V){d(V)}}function M(j){try{y(a.throw(j))}catch(V){d(V)}}function y(j){j.done?l(j.value):u(j.value).then(E,M)}y((a=a.apply(r,t||[])).next())})},Wa=function(r,t){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,u,l,d;return d={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function E(y){return function(j){return M([y,j])}}function M(y){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,u&&(l=y[0]&2?u.return:y[0]?u.throw||((l=u.return)&&l.call(u),0):u.next)&&!(l=l.call(u,y[1])).done)return l;switch(u=0,l&&(y=[y[0]&2,l.value]),y[0]){case 0:case 1:l=y;break;case 4:return i.label++,{value:y[1],done:!1};case 5:i.label++,u=y[1],y=[0];continue;case 7:y=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(y[0]===6||y[0]===2)){i=0;continue}if(y[0]===3&&(!l||y[1]>l[0]&&y[1]<l[3])){i.label=y[1];break}if(y[0]===6&&i.label<l[1]){i.label=l[1],l=y;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(y);break}l[2]&&i.ops.pop(),i.trys.pop();continue}y=t.call(r,i)}catch(j){y=[6,j],u=0}finally{a=l=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},qa=function(r,t){return t.scope===ye.Singleton&&t.activated?t.cache:t.scope===ye.Request&&r.has(t.id)?r.get(t.id):null},Ua=function(r,t,i){t.scope===ye.Singleton&&$a(t,i),t.scope===ye.Request&&Va(r,t,i)},Va=function(r,t,i){r.has(t.id)||r.set(t.id,i)},$a=function(r,t){r.cache=t,r.activated=!0,Te(t)&&Ga(r,t)},Ga=function(r,t){return Ka(void 0,void 0,void 0,function(){var i,a;return Wa(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,t];case 1:return i=u.sent(),r.cache=i,[3,3];case 2:throw a=u.sent(),r.cache=null,r.activated=!1,a;case 3:return[2]}})})},Ht;(function(r){r.DynamicValue="toDynamicValue",r.Factory="toFactory",r.Provider="toProvider"})(Ht||(Ht={}));var za=function(r){var t=null;switch(r.type){case ce.ConstantValue:case ce.Function:t=r.cache;break;case ce.Constructor:case ce.Instance:t=r.implementationType;break;case ce.DynamicValue:t=r.dynamicValue;break;case ce.Provider:t=r.provider;break;case ce.Factory:t=r.factory;break}if(t===null){var i=Gt(r.serviceIdentifier);throw new Error(ua+" "+i)}},Ha=function(r){switch(r.type){case ce.Factory:return{factory:r.factory,factoryType:Ht.Factory};case ce.Provider:return{factory:r.provider,factoryType:Ht.Provider};case ce.DynamicValue:return{factory:r.dynamicValue,factoryType:Ht.DynamicValue};default:throw new Error("Unexpected factory type "+r.type)}},It=function(){return It=Object.assign||function(r){for(var t,i=1,a=arguments.length;i<a;i++){t=arguments[i];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(r[u]=t[u])}return r},It.apply(this,arguments)},Gi=function(r,t,i,a){function u(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function E(j){try{y(a.next(j))}catch(V){d(V)}}function M(j){try{y(a.throw(j))}catch(V){d(V)}}function y(j){j.done?l(j.value):u(j.value).then(E,M)}y((a=a.apply(r,t||[])).next())})},zi=function(r,t){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,u,l,d;return d={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function E(y){return function(j){return M([y,j])}}function M(y){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,u&&(l=y[0]&2?u.return:y[0]?u.throw||((l=u.return)&&l.call(u),0):u.next)&&!(l=l.call(u,y[1])).done)return l;switch(u=0,l&&(y=[y[0]&2,l.value]),y[0]){case 0:case 1:l=y;break;case 4:return i.label++,{value:y[1],done:!1};case 5:i.label++,u=y[1],y=[0];continue;case 7:y=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(y[0]===6||y[0]===2)){i=0;continue}if(y[0]===3&&(!l||y[1]>l[0]&&y[1]<l[3])){i.label=y[1];break}if(y[0]===6&&i.label<l[1]){i.label=l[1],l=y;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(y);break}l[2]&&i.ops.pop(),i.trys.pop();continue}y=t.call(r,i)}catch(j){y=[6,j],u=0}finally{a=l=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},Ya=function(r,t,i){if(i||arguments.length===2)for(var a=0,u=t.length,l;a<u;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return r.concat(l||Array.prototype.slice.call(t))};function Qa(r,t){return r.reduce(function(i,a){var u=t(a),l=a.target.type;return l===Ut.ConstructorArgument?i.constructorInjections.push(u):(i.propertyRequests.push(a),i.propertyInjections.push(u)),i.isAsync||(i.isAsync=$i(u)),i},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function Xa(r,t,i){var a;if(t.length>0){var u=Qa(t,i),l=It(It({},u),{constr:r});u.isAsync?a=Ja(l):a=Hi(l)}else a=new r;return a}function Hi(r){var t,i=new((t=r.constr).bind.apply(t,Ya([void 0],r.constructorInjections,!1)));return r.propertyRequests.forEach(function(a,u){var l=a.target.identifier,d=r.propertyInjections[u];(!a.target.isOptional()||d!==void 0)&&(i[l]=d)}),i}function Ja(r){return Gi(this,void 0,void 0,function(){var t,i;return zi(this,function(a){switch(a.label){case 0:return[4,Yi(r.constructorInjections)];case 1:return t=a.sent(),[4,Yi(r.propertyInjections)];case 2:return i=a.sent(),[2,Hi(It(It({},r),{constructorInjections:t,propertyInjections:i}))]}})})}function Yi(r){return Gi(this,void 0,void 0,function(){var t,i,a,u;return zi(this,function(l){for(t=[],i=0,a=r;i<a.length;i++)u=a[i],Array.isArray(u)?t.push(Promise.all(u)):t.push(u);return[2,Promise.all(t)]})})}function Qi(r,t){var i=Za(r,t);return Te(i)?i.then(function(){return t}):t}function Za(r,t){var i,a;if(Reflect.hasMetadata(Pi,r)){var u=Reflect.getMetadata(Pi,r);try{return(a=(i=t)[u.value])===null||a===void 0?void 0:a.call(i)}catch(l){if(l instanceof Error)throw new Error(wa(r.name,l.message))}}}function es(r,t){r.scope!==ye.Singleton&&ts(r,t)}function ts(r,t){var i="Class cannot be instantiated in "+(r.scope===ye.Request?"request":"transient")+" scope.";if(typeof r.onDeactivation=="function")throw new Error(wr(t.name,i));if(Reflect.hasMetadata(br,t))throw new Error(_a(t.name,i))}function ns(r,t,i,a){es(r,t);var u=Xa(t,i,a);return Te(u)?u.then(function(l){return Qi(t,l)}):Qi(t,u)}var rs=function(r,t,i,a){function u(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function E(j){try{y(a.next(j))}catch(V){d(V)}}function M(j){try{y(a.throw(j))}catch(V){d(V)}}function y(j){j.done?l(j.value):u(j.value).then(E,M)}y((a=a.apply(r,t||[])).next())})},is=function(r,t){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,u,l,d;return d={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function E(y){return function(j){return M([y,j])}}function M(y){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,u&&(l=y[0]&2?u.return:y[0]?u.throw||((l=u.return)&&l.call(u),0):u.next)&&!(l=l.call(u,y[1])).done)return l;switch(u=0,l&&(y=[y[0]&2,l.value]),y[0]){case 0:case 1:l=y;break;case 4:return i.label++,{value:y[1],done:!1};case 5:i.label++,u=y[1],y=[0];continue;case 7:y=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(y[0]===6||y[0]===2)){i=0;continue}if(y[0]===3&&(!l||y[1]>l[0]&&y[1]<l[3])){i.label=y[1];break}if(y[0]===6&&i.label<l[1]){i.label=l[1],l=y;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(y);break}l[2]&&i.ops.pop(),i.trys.pop();continue}y=t.call(r,i)}catch(j){y=[6,j],u=0}finally{a=l=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},Ar=function(r){return function(t){t.parentContext.setCurrentRequest(t);var i=t.bindings,a=t.childRequests,u=t.target&&t.target.isArray(),l=!t.parentRequest||!t.parentRequest.target||!t.target||!t.parentRequest.target.matchesArray(t.target.serviceIdentifier);if(u&&l)return a.map(function(E){var M=Ar(r);return M(E)});if(t.target.isOptional()&&i.length===0)return;var d=i[0];return us(r,t,d)}},os=function(r,t){var i=Ha(r);return xa(function(){return i.factory.bind(r)(t)},function(){return new Error(Aa(i.factoryType,t.currentRequest.serviceIdentifier.toString()))})},as=function(r,t,i){var a,u=t.childRequests;switch(za(i),i.type){case ce.ConstantValue:case ce.Function:a=i.cache;break;case ce.Constructor:a=i.implementationType;break;case ce.Instance:a=ns(i,i.implementationType,u,Ar(r));break;default:a=os(i,t.parentContext)}return a},ss=function(r,t,i){var a=qa(r,t);return a!==null||(a=i(),Ua(r,t,a)),a},us=function(r,t,i){return ss(r,i,function(){var a=as(r,t,i);return Te(a)?a=a.then(function(u){return Xi(t,i,u)}):a=Xi(t,i,a),a})};function Xi(r,t,i){var a=cs(r.parentContext,t,i),u=hs(r.parentContext.container),l,d=u.next();do{l=d.value;var E=r.parentContext,M=r.serviceIdentifier,y=fs(l,M);Te(a)?a=Ji(y,E,a):a=ls(y,E,a),d=u.next()}while(d.done!==!0&&!An(l).hasKey(r.serviceIdentifier));return a}var cs=function(r,t,i){var a;return typeof t.onActivation=="function"?a=t.onActivation(r,i):a=i,a},ls=function(r,t,i){for(var a=r.next();!a.done;){if(i=a.value(t,i),Te(i))return Ji(r,t,i);a=r.next()}return i},Ji=function(r,t,i){return rs(void 0,void 0,void 0,function(){var a,u;return is(this,function(l){switch(l.label){case 0:return[4,i];case 1:a=l.sent(),u=r.next(),l.label=2;case 2:return u.done?[3,4]:[4,u.value(t,a)];case 3:return a=l.sent(),u=r.next(),[3,2];case 4:return[2,a]}})})},fs=function(r,t){var i=r._activations;return i.hasKey(t)?i.get(t).values():[].values()},hs=function(r){for(var t=[r],i=r.parent;i!==null;)t.push(i),i=i.parent;var a=function(){var l=t.pop();return l!==void 0?{done:!1,value:l}:{done:!0,value:void 0}},u={next:a};return u};function ds(r){var t=Ar(r.plan.rootRequest.requestScope);return t(r.plan.rootRequest)}var Xe=function(r,t){var i=r.parentRequest;return i!==null?t(i)?!0:Xe(i,t):!1},Yt=function(r){return function(t){var i=function(a){return a!==null&&a.target!==null&&a.target.matchesTag(r)(t)};return i.metaData=new Qe(r,t),i}},Sn=Yt(Me),Sr=function(r){return function(t){var i=null;if(t!==null)if(i=t.bindings[0],typeof r=="string"){var a=i.serviceIdentifier;return a===r}else{var u=t.bindings[0].implementationType;return r===u}return!1}},Cn=function(){function r(t){this._binding=t}return r.prototype.when=function(t){return this._binding.constraint=t,new Se(this._binding)},r.prototype.whenTargetNamed=function(t){return this._binding.constraint=Sn(t),new Se(this._binding)},r.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){if(t===null)return!1;var i=t.target!==null&&!t.target.isNamed()&&!t.target.isTagged();return i},new Se(this._binding)},r.prototype.whenTargetTagged=function(t,i){return this._binding.constraint=Yt(t)(i),new Se(this._binding)},r.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(i){return i!==null&&Sr(t)(i.parentRequest)},new Se(this._binding)},r.prototype.whenParentNamed=function(t){return this._binding.constraint=function(i){return i!==null&&Sn(t)(i.parentRequest)},new Se(this._binding)},r.prototype.whenParentTagged=function(t,i){return this._binding.constraint=function(a){return a!==null&&Yt(t)(i)(a.parentRequest)},new Se(this._binding)},r.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(i){return i!==null&&Xe(i,Sr(t))},new Se(this._binding)},r.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(i){return i!==null&&!Xe(i,Sr(t))},new Se(this._binding)},r.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(i){return i!==null&&Xe(i,Sn(t))},new Se(this._binding)},r.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(i){return i!==null&&!Xe(i,Sn(t))},new Se(this._binding)},r.prototype.whenAnyAncestorTagged=function(t,i){return this._binding.constraint=function(a){return a!==null&&Xe(a,Yt(t)(i))},new Se(this._binding)},r.prototype.whenNoAncestorTagged=function(t,i){return this._binding.constraint=function(a){return a!==null&&!Xe(a,Yt(t)(i))},new Se(this._binding)},r.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(i){return i!==null&&Xe(i,t)},new Se(this._binding)},r.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(i){return i!==null&&!Xe(i,t)},new Se(this._binding)},r}(),Se=function(){function r(t){this._binding=t}return r.prototype.onActivation=function(t){return this._binding.onActivation=t,new Cn(this._binding)},r.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Cn(this._binding)},r}(),Je=function(){function r(t){this._binding=t,this._bindingWhenSyntax=new Cn(this._binding),this._bindingOnSyntax=new Se(this._binding)}return r.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},r.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(t,i){return this._bindingWhenSyntax.whenTargetTagged(t,i)},r.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},r.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},r.prototype.whenParentTagged=function(t,i){return this._bindingWhenSyntax.whenParentTagged(t,i)},r.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},r.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},r.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},r.prototype.whenAnyAncestorTagged=function(t,i){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,i)},r.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},r.prototype.whenNoAncestorTagged=function(t,i){return this._bindingWhenSyntax.whenNoAncestorTagged(t,i)},r.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},r.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},r.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},r.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},r}(),ps=function(){function r(t){this._binding=t}return r.prototype.inRequestScope=function(){return this._binding.scope=ye.Request,new Je(this._binding)},r.prototype.inSingletonScope=function(){return this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.inTransientScope=function(){return this._binding.scope=ye.Transient,new Je(this._binding)},r}(),Zi=function(){function r(t){this._binding=t,this._bindingWhenSyntax=new Cn(this._binding),this._bindingOnSyntax=new Se(this._binding),this._bindingInSyntax=new ps(t)}return r.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},r.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},r.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},r.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},r.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(t,i){return this._bindingWhenSyntax.whenTargetTagged(t,i)},r.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},r.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},r.prototype.whenParentTagged=function(t,i){return this._bindingWhenSyntax.whenParentTagged(t,i)},r.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},r.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},r.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},r.prototype.whenAnyAncestorTagged=function(t,i){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,i)},r.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},r.prototype.whenNoAncestorTagged=function(t,i){return this._bindingWhenSyntax.whenNoAncestorTagged(t,i)},r.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},r.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},r.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},r.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},r}(),gs=function(){function r(t){this._binding=t}return r.prototype.to=function(t){return this._binding.type=ce.Instance,this._binding.implementationType=t,new Zi(this._binding)},r.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+da);var t=this._binding.serviceIdentifier;return this.to(t)},r.prototype.toConstantValue=function(t){return this._binding.type=ce.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.toDynamicValue=function(t){return this._binding.type=ce.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Zi(this._binding)},r.prototype.toConstructor=function(t){return this._binding.type=ce.Constructor,this._binding.implementationType=t,this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.toFactory=function(t){return this._binding.type=ce.Factory,this._binding.factory=t,this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.toFunction=function(t){if(typeof t!="function")throw new Error(fa);var i=this.toConstantValue(t);return this._binding.type=ce.Function,this._binding.scope=ye.Singleton,i},r.prototype.toAutoFactory=function(t){return this._binding.type=ce.Factory,this._binding.factory=function(i){var a=function(){return i.container.get(t)};return a},this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.toAutoNamedFactory=function(t){return this._binding.type=ce.Factory,this._binding.factory=function(i){return function(a){return i.container.getNamed(t,a)}},new Je(this._binding)},r.prototype.toProvider=function(t){return this._binding.type=ce.Provider,this._binding.provider=t,this._binding.scope=ye.Singleton,new Je(this._binding)},r.prototype.toService=function(t){this.toDynamicValue(function(i){return i.container.get(t)})},r}(),ys=function(){function r(){}return r.of=function(t,i,a,u,l){var d=new r;return d.bindings=t,d.middleware=i,d.deactivations=u,d.activations=a,d.moduleActivationStore=l,d},r}();function vs(r){return typeof r=="object"&&r!==null&&"clone"in r&&typeof r.clone=="function"}var yt=function(){function r(){this._map=new Map}return r.prototype.getMap=function(){return this._map},r.prototype.add=function(t,i){if(t==null)throw new Error($t);if(i==null)throw new Error($t);var a=this._map.get(t);a!==void 0?a.push(i):this._map.set(t,[i])},r.prototype.get=function(t){if(t==null)throw new Error($t);var i=this._map.get(t);if(i!==void 0)return i;throw new Error(Ii)},r.prototype.remove=function(t){if(t==null)throw new Error($t);if(!this._map.delete(t))throw new Error(Ii)},r.prototype.removeIntersection=function(t){var i=this;this.traverse(function(a,u){var l=t.hasKey(a)?t.get(a):void 0;if(l!==void 0){var d=u.filter(function(E){return!l.some(function(M){return E===M})});i._setValue(a,d)}})},r.prototype.removeByCondition=function(t){var i=this,a=[];return this._map.forEach(function(u,l){for(var d=[],E=0,M=u;E<M.length;E++){var y=M[E],j=t(y);j?a.push(y):d.push(y)}i._setValue(l,d)}),a},r.prototype.hasKey=function(t){if(t==null)throw new Error($t);return this._map.has(t)},r.prototype.clone=function(){var t=new r;return this._map.forEach(function(i,a){i.forEach(function(u){return t.add(a,vs(u)?u.clone():u)})}),t},r.prototype.traverse=function(t){this._map.forEach(function(i,a){t(a,i)})},r.prototype._setValue=function(t,i){i.length>0?this._map.set(t,i):this._map.delete(t)},r}(),ms=function(){function r(){this._map=new Map}return r.prototype.remove=function(t){if(this._map.has(t)){var i=this._map.get(t);return this._map.delete(t),i}return this._getEmptyHandlersStore()},r.prototype.addDeactivation=function(t,i,a){this._getModuleActivationHandlers(t).onDeactivations.add(i,a)},r.prototype.addActivation=function(t,i,a){this._getModuleActivationHandlers(t).onActivations.add(i,a)},r.prototype.clone=function(){var t=new r;return this._map.forEach(function(i,a){t._map.set(a,{onActivations:i.onActivations.clone(),onDeactivations:i.onDeactivations.clone()})}),t},r.prototype._getModuleActivationHandlers=function(t){var i=this._map.get(t);return i===void 0&&(i=this._getEmptyHandlersStore(),this._map.set(t,i)),i},r.prototype._getEmptyHandlersStore=function(){var t={onActivations:new yt,onDeactivations:new yt};return t},r}(),xn=function(){return xn=Object.assign||function(r){for(var t,i=1,a=arguments.length;i<a;i++){t=arguments[i];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(r[u]=t[u])}return r},xn.apply(this,arguments)},Be=function(r,t,i,a){function u(l){return l instanceof i?l:new i(function(d){d(l)})}return new(i||(i=Promise))(function(l,d){function E(j){try{y(a.next(j))}catch(V){d(V)}}function M(j){try{y(a.throw(j))}catch(V){d(V)}}function y(j){j.done?l(j.value):u(j.value).then(E,M)}y((a=a.apply(r,t||[])).next())})},Fe=function(r,t){var i={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,u,l,d;return d={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function E(y){return function(j){return M([y,j])}}function M(y){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,u&&(l=y[0]&2?u.return:y[0]?u.throw||((l=u.return)&&l.call(u),0):u.next)&&!(l=l.call(u,y[1])).done)return l;switch(u=0,l&&(y=[y[0]&2,l.value]),y[0]){case 0:case 1:l=y;break;case 4:return i.label++,{value:y[1],done:!1};case 5:i.label++,u=y[1],y=[0];continue;case 7:y=i.ops.pop(),i.trys.pop();continue;default:if(l=i.trys,!(l=l.length>0&&l[l.length-1])&&(y[0]===6||y[0]===2)){i=0;continue}if(y[0]===3&&(!l||y[1]>l[0]&&y[1]<l[3])){i.label=y[1];break}if(y[0]===6&&i.label<l[1]){i.label=l[1],l=y;break}if(l&&i.label<l[2]){i.label=l[2],i.ops.push(y);break}l[2]&&i.ops.pop(),i.trys.pop();continue}y=t.call(r,i)}catch(j){y=[6,j],u=0}finally{a=l=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},bs=function(r,t,i){if(i||arguments.length===2)for(var a=0,u=t.length,l;a<u;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return r.concat(l||Array.prototype.slice.call(t))},ws=function(){function r(t){var i=t||{};if(typeof i!="object")throw new Error(""+ga);if(i.defaultScope===void 0)i.defaultScope=ye.Transient;else if(i.defaultScope!==ye.Singleton&&i.defaultScope!==ye.Transient&&i.defaultScope!==ye.Request)throw new Error(""+ya);if(i.autoBindInjectable===void 0)i.autoBindInjectable=!1;else if(typeof i.autoBindInjectable!="boolean")throw new Error(""+va);if(i.skipBaseClassChecks===void 0)i.skipBaseClassChecks=!1;else if(typeof i.skipBaseClassChecks!="boolean")throw new Error(""+ma);this.options={autoBindInjectable:i.autoBindInjectable,defaultScope:i.defaultScope,skipBaseClassChecks:i.skipBaseClassChecks},this.id=Vt(),this._bindingDictionary=new yt,this._snapshots=[],this._middleware=null,this._activations=new yt,this._deactivations=new yt,this.parent=null,this._metadataReader=new Ca,this._moduleActivationStore=new ms}return r.merge=function(t,i){for(var a=[],u=2;u<arguments.length;u++)a[u-2]=arguments[u];var l=new r,d=bs([t,i],a,!0).map(function(y){return An(y)}),E=An(l);function M(y,j){y.traverse(function(V,Y){Y.forEach(function(pe){j.add(pe.serviceIdentifier,pe.clone())})})}return d.forEach(function(y){M(y,E)}),l},r.prototype.load=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var a=this._getContainerModuleHelpersFactory(),u=0,l=t;u<l.length;u++){var d=l[u],E=a(d.id);d.registry(E.bindFunction,E.unbindFunction,E.isboundFunction,E.rebindFunction,E.unbindAsyncFunction,E.onActivationFunction,E.onDeactivationFunction)}},r.prototype.loadAsync=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return Be(this,void 0,void 0,function(){var a,u,l,d,E;return Fe(this,function(M){switch(M.label){case 0:a=this._getContainerModuleHelpersFactory(),u=0,l=t,M.label=1;case 1:return u<l.length?(d=l[u],E=a(d.id),[4,d.registry(E.bindFunction,E.unbindFunction,E.isboundFunction,E.rebindFunction,E.unbindAsyncFunction,E.onActivationFunction,E.onDeactivationFunction)]):[3,4];case 2:M.sent(),M.label=3;case 3:return u++,[3,1];case 4:return[2]}})})},r.prototype.unload=function(){for(var t=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];i.forEach(function(u){var l=t._removeModuleBindings(u.id);t._deactivateSingletons(l),t._removeModuleHandlers(u.id)})},r.prototype.unloadAsync=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return Be(this,void 0,void 0,function(){var a,u,l,d;return Fe(this,function(E){switch(E.label){case 0:a=0,u=t,E.label=1;case 1:return a<u.length?(l=u[a],d=this._removeModuleBindings(l.id),[4,this._deactivateSingletonsAsync(d)]):[3,4];case 2:E.sent(),this._removeModuleHandlers(l.id),E.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},r.prototype.bind=function(t){var i=this.options.defaultScope||ye.Transient,a=new ea(t,i);return this._bindingDictionary.add(t,a),new gs(a)},r.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},r.prototype.rebindAsync=function(t){return Be(this,void 0,void 0,function(){return Fe(this,function(i){switch(i.label){case 0:return[4,this.unbindAsync(t)];case 1:return i.sent(),[2,this.bind(t)]}})})},r.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t);this._deactivateSingletons(i)}this._removeServiceFromDictionary(t)},r.prototype.unbindAsync=function(t){return Be(this,void 0,void 0,function(){var i;return Fe(this,function(a){switch(a.label){case 0:return this._bindingDictionary.hasKey(t)?(i=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(i)]):[3,2];case 1:a.sent(),a.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}})})},r.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse(function(i,a){t._deactivateSingletons(a)}),this._bindingDictionary=new yt},r.prototype.unbindAllAsync=function(){return Be(this,void 0,void 0,function(){var t,i=this;return Fe(this,function(a){switch(a.label){case 0:return t=[],this._bindingDictionary.traverse(function(u,l){t.push(i._deactivateSingletonsAsync(l))}),[4,Promise.all(t)];case 1:return a.sent(),this._bindingDictionary=new yt,[2]}})})},r.prototype.onActivation=function(t,i){this._activations.add(t,i)},r.prototype.onDeactivation=function(t,i){this._deactivations.add(t,i)},r.prototype.isBound=function(t){var i=this._bindingDictionary.hasKey(t);return!i&&this.parent&&(i=this.parent.isBound(t)),i},r.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},r.prototype.isBoundNamed=function(t,i){return this.isBoundTagged(t,Me,i)},r.prototype.isBoundTagged=function(t,i,a){var u=!1;if(this._bindingDictionary.hasKey(t)){var l=this._bindingDictionary.get(t),d=Fa(this,t,i,a);u=l.some(function(E){return E.constraint(d)})}return!u&&this.parent&&(u=this.parent.isBoundTagged(t,i,a)),u},r.prototype.snapshot=function(){this._snapshots.push(ys.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},r.prototype.restore=function(){var t=this._snapshots.pop();if(t===void 0)throw new Error(ca);this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},r.prototype.createChild=function(t){var i=new r(t||this.options);return i.parent=this,i},r.prototype.applyMiddleware=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var a=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce(function(u,l){return l(u)},a)},r.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},r.prototype.get=function(t){var i=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(i)},r.prototype.getAsync=function(t){return Be(this,void 0,void 0,function(){var i;return Fe(this,function(a){return i=this._getNotAllArgs(t,!1),[2,this._get(i)]})})},r.prototype.getTagged=function(t,i,a){var u=this._getNotAllArgs(t,!1,i,a);return this._getButThrowIfAsync(u)},r.prototype.getTaggedAsync=function(t,i,a){return Be(this,void 0,void 0,function(){var u;return Fe(this,function(l){return u=this._getNotAllArgs(t,!1,i,a),[2,this._get(u)]})})},r.prototype.getNamed=function(t,i){return this.getTagged(t,Me,i)},r.prototype.getNamedAsync=function(t,i){return this.getTaggedAsync(t,Me,i)},r.prototype.getAll=function(t){var i=this._getAllArgs(t);return this._getButThrowIfAsync(i)},r.prototype.getAllAsync=function(t){var i=this._getAllArgs(t);return this._getAll(i)},r.prototype.getAllTagged=function(t,i,a){var u=this._getNotAllArgs(t,!0,i,a);return this._getButThrowIfAsync(u)},r.prototype.getAllTaggedAsync=function(t,i,a){var u=this._getNotAllArgs(t,!0,i,a);return this._getAll(u)},r.prototype.getAllNamed=function(t,i){return this.getAllTagged(t,Me,i)},r.prototype.getAllNamedAsync=function(t,i){return this.getAllTaggedAsync(t,Me,i)},r.prototype.resolve=function(t){var i=this.isBound(t);i||this.bind(t).toSelf();var a=this.get(t);return i||this.unbind(t),a},r.prototype._preDestroy=function(t,i){var a,u;if(Reflect.hasMetadata(br,t)){var l=Reflect.getMetadata(br,t);return(u=(a=i)[l.value])===null||u===void 0?void 0:u.call(a)}},r.prototype._removeModuleHandlers=function(t){var i=this._moduleActivationStore.remove(t);this._activations.removeIntersection(i.onActivations),this._deactivations.removeIntersection(i.onDeactivations)},r.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition(function(i){return i.moduleId===t})},r.prototype._deactivate=function(t,i){var a=this,u=Object.getPrototypeOf(i).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var l=this._deactivateContainer(i,this._deactivations.get(t.serviceIdentifier).values());if(Te(l))return this._handleDeactivationError(l.then(function(){return a._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,i,u)}),u)}var d=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,i,u);if(Te(d))return this._handleDeactivationError(d,u)}catch(E){if(E instanceof Error)throw new Error(wr(u.name,E.message))}},r.prototype._handleDeactivationError=function(t,i){return Be(this,void 0,void 0,function(){var a;return Fe(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,t];case 1:return u.sent(),[3,3];case 2:if(a=u.sent(),a instanceof Error)throw new Error(wr(i.name,a.message));return[3,3];case 3:return[2]}})})},r.prototype._deactivateContainer=function(t,i){for(var a=this,u=i.next();u.value;){var l=u.value(t);if(Te(l))return l.then(function(){return a._deactivateContainerAsync(t,i)});u=i.next()}},r.prototype._deactivateContainerAsync=function(t,i){return Be(this,void 0,void 0,function(){var a;return Fe(this,function(u){switch(u.label){case 0:a=i.next(),u.label=1;case 1:return a.value?[4,a.value(t)]:[3,3];case 2:return u.sent(),a=i.next(),[3,1];case 3:return[2]}})})},r.prototype._getContainerModuleHelpersFactory=function(){var t=this,i=function(j,V){j._binding.moduleId=V},a=function(j){return function(V){var Y=t.bind(V);return i(Y,j),Y}},u=function(){return function(j){return t.unbind(j)}},l=function(){return function(j){return t.unbindAsync(j)}},d=function(){return function(j){return t.isBound(j)}},E=function(j){return function(V){var Y=t.rebind(V);return i(Y,j),Y}},M=function(j){return function(V,Y){t._moduleActivationStore.addActivation(j,V,Y),t.onActivation(V,Y)}},y=function(j){return function(V,Y){t._moduleActivationStore.addDeactivation(j,V,Y),t.onDeactivation(V,Y)}};return function(j){return{bindFunction:a(j),isboundFunction:d(),onActivationFunction:M(j),onDeactivationFunction:y(j),rebindFunction:E(j),unbindFunction:u(),unbindAsyncFunction:l()}}},r.prototype._getAll=function(t){return Promise.all(this._get(t))},r.prototype._get=function(t){var i=xn(xn({},t),{contextInterceptor:function(u){return u},targetType:Ut.Variable});if(this._middleware){var a=this._middleware(i);if(a==null)throw new Error(la);return a}return this._planAndResolve()(i)},r.prototype._getButThrowIfAsync=function(t){var i=this._get(t);if($i(i))throw new Error(ha(t.serviceIdentifier));return i},r.prototype._getAllArgs=function(t){var i={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t};return i},r.prototype._getNotAllArgs=function(t,i,a,u){var l={avoidConstraints:!1,isMultiInject:i,serviceIdentifier:t,key:a,value:u};return l},r.prototype._planAndResolve=function(){var t=this;return function(i){var a=Ba(t._metadataReader,t,i.isMultiInject,i.targetType,i.serviceIdentifier,i.key,i.value,i.avoidConstraints);a=i.contextInterceptor(a);var u=ds(a);return u}},r.prototype._deactivateIfSingleton=function(t){var i=this;if(t.activated)return Te(t.cache)?t.cache.then(function(a){return i._deactivate(t,a)}):this._deactivate(t,t.cache)},r.prototype._deactivateSingletons=function(t){for(var i=0,a=t;i<a.length;i++){var u=a[i],l=this._deactivateIfSingleton(u);if(Te(l))throw new Error(ba)}},r.prototype._deactivateSingletonsAsync=function(t){return Be(this,void 0,void 0,function(){var i=this;return Fe(this,function(a){switch(a.label){case 0:return[4,Promise.all(t.map(function(u){return i._deactivateIfSingleton(u)}))];case 1:return a.sent(),[2]}})})},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,i,a){return this.parent?this._deactivate.bind(this.parent)(t,i):this._bindingDeactivationAndPreDestroy(t,i,a)},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,i,a){return Be(this,void 0,void 0,function(){return Fe(this,function(u){switch(u.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,i)]:[3,2];case 1:return u.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,i,a)];case 3:u.sent(),u.label=4;case 4:return[2]}})})},r.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch{throw new Error(ra+" "+Gt(t))}},r.prototype._bindingDeactivationAndPreDestroy=function(t,i,a){var u=this;if(typeof t.onDeactivation=="function"){var l=t.onDeactivation(i);if(Te(l))return l.then(function(){return u._preDestroy(a,i)})}return this._preDestroy(a,i)},r.prototype._bindingDeactivationAndPreDestroyAsync=function(t,i,a){return Be(this,void 0,void 0,function(){return Fe(this,function(u){switch(u.label){case 0:return typeof t.onDeactivation!="function"?[3,2]:[4,t.onDeactivation(i)];case 1:u.sent(),u.label=2;case 2:return[4,this._preDestroy(a,i)];case 3:return u.sent(),[2]}})})},r}();function _s(r){for(var t=new Set,i=0,a=r;i<a.length;i++){var u=a[i];if(t.has(u))return u;t.add(u)}}function As(r){return r.prototype!==void 0}function Ss(r){if(r!==void 0)throw new Error(Mi)}function eo(r,t,i,a){Ss(t),to(Oi,r,i.toString(),a)}function Cs(r,t,i){if(As(r))throw new Error(Mi);to(Ei,r.constructor,t,i)}function xs(r){var t=[];if(Array.isArray(r)){t=r;var i=_s(t.map(function(a){return a.key}));if(i!==void 0)throw new Error(Ti+" "+i.toString())}else t=[r];return t}function to(r,t,i,a){var u=xs(a),l={};Reflect.hasOwnMetadata(r,t)&&(l=Reflect.getMetadata(r,t));var d=l[i];if(d===void 0)d=[];else for(var E=function(V){if(u.some(function(Y){return Y.key===V.key}))throw new Error(Ti+" "+V.key.toString())},M=0,y=d;M<y.length;M++){var j=y[M];E(j)}d.push.apply(d,u),l[i]=d,Reflect.defineMetadata(r,l,t)}function no(r){return function(t,i,a){typeof a=="number"?eo(t,i,a,r):Cs(t,i,r)}}function Ie(){return function(r){if(Reflect.hasOwnMetadata(mr,r))throw new Error(ta);var t=Reflect.getMetadata(Xo,r)||[];return Reflect.defineMetadata(mr,t,r),r}}function ro(r){return no(new Qe(Me,r))}function Os(r){return function(t){return function(i,a,u){if(t===void 0){var l=typeof i=="function"?i.name:i.constructor.name;throw new Error(aa(l))}return no(new Qe(r,t))(i,a,u)}}}var Ee=Os(vn);function Es(){return function(r,t,i){var a=new Qe(yn,!0);eo(r,t,i,a)}}var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ps(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}/*! *****************************************************************************
|
|
12
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
14
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
15
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
|
|
17
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
18
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
19
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
20
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
21
|
-
|
|
22
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
23
|
-
and limitations under the License.
|
|
24
|
-
***************************************************************************** */var io;(function(r){(function(t){var i=typeof globalThis=="object"?globalThis:typeof On=="object"?On:typeof self=="object"?self:typeof this=="object"?this:E(),a=u(r);typeof i.Reflect<"u"&&(a=u(i.Reflect,a)),t(a,i),typeof i.Reflect>"u"&&(i.Reflect=r);function u(M,y){return function(j,V){Object.defineProperty(M,j,{configurable:!0,writable:!0,value:V}),y&&y(j,V)}}function l(){try{return Function("return this;")()}catch{}}function d(){try{return(0,eval)("(function() { return this; })()")}catch{}}function E(){return l()||d()}})(function(t,i){var a=Object.prototype.hasOwnProperty,u=typeof Symbol=="function",l=u&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",d=u&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",E=typeof Object.create=="function",M={__proto__:[]}instanceof Array,y=!E&&!M,j={create:E?function(){return st(Object.create(null))}:M?function(){return st({__proto__:null})}:function(){return st({})},has:y?function(x,P){return a.call(x,P)}:function(x,P){return P in x},get:y?function(x,P){return a.call(x,P)?x[P]:void 0}:function(x,P){return x[P]}},V=Object.getPrototypeOf(Function),Y=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Zt(),pe=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:St(),ve=typeof WeakMap=="function"?WeakMap:en(),we=u?Symbol.for("@reflect-metadata:registry"):void 0,Ze=_t(),Dt=$n(Ze);function Mt(x,P,R,B){if(Q(R)){if(!wt(x))throw new TypeError;if(!at(P))throw new TypeError;return mt(x,P)}else{if(!wt(x))throw new TypeError;if(!fe(P))throw new TypeError;if(!fe(B)&&!Q(B)&&!Re(B))throw new TypeError;return Re(B)&&(B=void 0),R=je(R),Ge(x,P,R,B)}}t("decorate",Mt);function In(x,P){function R(B,L){if(!fe(B))throw new TypeError;if(!Q(L)&&!Kr(L))throw new TypeError;ze(x,P,B,L)}return R}t("metadata",In);function vt(x,P,R,B){if(!fe(R))throw new TypeError;return Q(B)||(B=je(B)),ze(x,P,R,B)}t("defineMetadata",vt);function Dn(x,P,R){if(!fe(P))throw new TypeError;return Q(R)||(R=je(R)),Nn(x,P,R)}t("hasMetadata",Dn);function qe(x,P,R){if(!fe(P))throw new TypeError;return Q(R)||(R=je(R)),bt(x,P,R)}t("hasOwnMetadata",qe);function Pe(x,P,R){if(!fe(P))throw new TypeError;return Q(R)||(R=je(R)),Rt(x,P,R)}t("getMetadata",Pe);function Mn(x,P,R){if(!fe(P))throw new TypeError;return Q(R)||(R=je(R)),Ln(x,P,R)}t("getOwnMetadata",Mn);function Fr(x,P){if(!fe(x))throw new TypeError;return Q(P)||(P=je(P)),et(x,P)}t("getMetadataKeys",Fr);function Rn(x,P){if(!fe(x))throw new TypeError;return Q(P)||(P=je(P)),Ke(x,P)}t("getOwnMetadataKeys",Rn);function jn(x,P,R){if(!fe(P))throw new TypeError;if(Q(R)||(R=je(R)),!fe(P))throw new TypeError;Q(R)||(R=je(R));var B=Ve(P,R,!1);return Q(B)?!1:B.OrdinaryDeleteMetadata(x,P,R)}t("deleteMetadata",jn);function mt(x,P){for(var R=x.length-1;R>=0;--R){var B=x[R],L=B(P);if(!Q(L)&&!Re(L)){if(!at(L))throw new TypeError;P=L}}return P}function Ge(x,P,R,B){for(var L=x.length-1;L>=0;--L){var he=x[L],ue=he(P,R,B);if(!Q(ue)&&!Re(ue)){if(!fe(ue))throw new TypeError;B=ue}}return B}function Nn(x,P,R){var B=bt(x,P,R);if(B)return!0;var L=De(P);return Re(L)?!1:Nn(x,L,R)}function bt(x,P,R){var B=Ve(P,R,!1);return Q(B)?!1:Fn(B.OrdinaryHasOwnMetadata(x,P,R))}function Rt(x,P,R){var B=bt(x,P,R);if(B)return Ln(x,P,R);var L=De(P);if(!Re(L))return Rt(x,L,R)}function Ln(x,P,R){var B=Ve(P,R,!1);if(!Q(B))return B.OrdinaryGetOwnMetadata(x,P,R)}function ze(x,P,R,B){var L=Ve(R,B,!0);L.OrdinaryDefineOwnMetadata(x,P,R,B)}function et(x,P){var R=Ke(x,P),B=De(x);if(B===null)return R;var L=et(B,P);if(L.length<=0)return R;if(R.length<=0)return L;for(var he=new pe,ue=[],J=0,T=R;J<T.length;J++){var $=T[J],G=he.has($);G||(he.add($),ue.push($))}for(var z=0,Z=L;z<Z.length;z++){var $=Z[z],G=he.has($);G||(he.add($),ue.push($))}return ue}function Ke(x,P){var R=Ve(x,P,!1);return R?R.OrdinaryOwnMetadataKeys(x,P):[]}function jt(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function Q(x){return x===void 0}function Re(x){return x===null}function Bn(x){return typeof x=="symbol"}function fe(x){return typeof x=="object"?x!==null:typeof x=="function"}function ot(x,P){switch(jt(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var R="string",B=Kn(x,l);if(B!==void 0){var L=B.call(x,R);if(fe(L))throw new TypeError;return L}return Jt(x)}function Jt(x,P){var R,B;{var L=x.toString;if(ie(L)){var B=L.call(x);if(!fe(B))return B}var R=x.valueOf;if(ie(R)){var B=R.call(x);if(!fe(B))return B}}throw new TypeError}function Fn(x){return!!x}function H(x){return""+x}function je(x){var P=ot(x);return Bn(P)?P:H(P)}function wt(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function ie(x){return typeof x=="function"}function at(x){return typeof x=="function"}function Kr(x){switch(jt(x)){case 3:return!0;case 4:return!0;default:return!1}}function Ue(x,P){return x===P||x!==x&&P!==P}function Kn(x,P){var R=x[P];if(R!=null){if(!ie(R))throw new TypeError;return R}}function Wn(x){var P=Kn(x,d);if(!ie(P))throw new TypeError;var R=P.call(x);if(!fe(R))throw new TypeError;return R}function qn(x){return x.value}function Un(x){var P=x.next();return P.done?!1:P}function Nt(x){var P=x.return;P&&P.call(x)}function De(x){var P=Object.getPrototypeOf(x);if(typeof x!="function"||x===V||P!==V)return P;var R=x.prototype,B=R&&Object.getPrototypeOf(R);if(B==null||B===Object.prototype)return P;var L=B.constructor;return typeof L!="function"||L===x?P:L}function Vn(){var x;!Q(we)&&typeof i.Reflect<"u"&&!(we in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(x=At(i.Reflect));var P,R,B,L=new ve,he={registerProvider:ue,getProvider:T,setProvider:G};return he;function ue(z){if(!Object.isExtensible(he))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===z:break;case Q(P):P=z;break;case P===z:break;case Q(R):R=z;break;case R===z:break;default:B===void 0&&(B=new pe),B.add(z);break}}function J(z,Z){if(!Q(P)){if(P.isProviderFor(z,Z))return P;if(!Q(R)){if(R.isProviderFor(z,Z))return P;if(!Q(B))for(var se=Wn(B);;){var ge=Un(se);if(!ge)return;var Ne=qn(ge);if(Ne.isProviderFor(z,Z))return Nt(se),Ne}}}if(!Q(x)&&x.isProviderFor(z,Z))return x}function T(z,Z){var se=L.get(z),ge;return Q(se)||(ge=se.get(Z)),Q(ge)&&(ge=J(z,Z),Q(ge)||(Q(se)&&(se=new Y,L.set(z,se)),se.set(Z,ge))),ge}function $(z){if(Q(z))throw new TypeError;return P===z||R===z||!Q(B)&&B.has(z)}function G(z,Z,se){if(!$(se))throw new Error("Metadata provider not registered.");var ge=T(z,Z);if(ge!==se){if(!Q(ge))return!1;var Ne=L.get(z);Q(Ne)&&(Ne=new Y,L.set(z,Ne)),Ne.set(Z,se)}return!0}}function _t(){var x;return!Q(we)&&fe(i.Reflect)&&Object.isExtensible(i.Reflect)&&(x=i.Reflect[we]),Q(x)&&(x=Vn()),!Q(we)&&fe(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,we,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}function $n(x){var P=new ve,R={isProviderFor:function($,G){var z=P.get($);return Q(z)?!1:z.has(G)},OrdinaryDefineOwnMetadata:ue,OrdinaryHasOwnMetadata:L,OrdinaryGetOwnMetadata:he,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:T};return Ze.registerProvider(R),R;function B($,G,z){var Z=P.get($),se=!1;if(Q(Z)){if(!z)return;Z=new Y,P.set($,Z),se=!0}var ge=Z.get(G);if(Q(ge)){if(!z)return;if(ge=new Y,Z.set(G,ge),!x.setProvider($,G,R))throw Z.delete(G),se&&P.delete($),new Error("Wrong provider for target.")}return ge}function L($,G,z){var Z=B(G,z,!1);return Q(Z)?!1:Fn(Z.has($))}function he($,G,z){var Z=B(G,z,!1);if(!Q(Z))return Z.get($)}function ue($,G,z,Z){var se=B(z,Z,!0);se.set($,G)}function J($,G){var z=[],Z=B($,G,!1);if(Q(Z))return z;for(var se=Z.keys(),ge=Wn(se),Ne=0;;){var tt=Un(ge);if(!tt)return z.length=Ne,z;var ut=qn(tt);try{z[Ne]=ut}catch(tn){try{Nt(ge)}finally{throw tn}}Ne++}}function T($,G,z){var Z=B(G,z,!1);if(Q(Z)||!Z.delete($))return!1;if(Z.size===0){var se=P.get(G);Q(se)||(se.delete(z),se.size===0&&P.delete(se))}return!0}}function At(x){var P=x.defineMetadata,R=x.hasOwnMetadata,B=x.getOwnMetadata,L=x.getOwnMetadataKeys,he=x.deleteMetadata,ue=new ve,J={isProviderFor:function(T,$){var G=ue.get(T);return!Q(G)&&G.has($)?!0:L(T,$).length?(Q(G)&&(G=new pe,ue.set(T,G)),G.add($),!0):!1},OrdinaryDefineOwnMetadata:P,OrdinaryHasOwnMetadata:R,OrdinaryGetOwnMetadata:B,OrdinaryOwnMetadataKeys:L,OrdinaryDeleteMetadata:he};return J}function Ve(x,P,R){var B=Ze.getProvider(x,P);if(!Q(B))return B;if(R){if(Ze.setProvider(x,P,Dt))return Dt;throw new Error("Illegal state.")}}function Zt(){var x={},P=[],R=function(){function J(T,$,G){this._index=0,this._keys=T,this._values=$,this._selector=G}return J.prototype["@@iterator"]=function(){return this},J.prototype[d]=function(){return this},J.prototype.next=function(){var T=this._index;if(T>=0&&T<this._keys.length){var $=this._selector(this._keys[T],this._values[T]);return T+1>=this._keys.length?(this._index=-1,this._keys=P,this._values=P):this._index++,{value:$,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(T){throw this._index>=0&&(this._index=-1,this._keys=P,this._values=P),T},J.prototype.return=function(T){return this._index>=0&&(this._index=-1,this._keys=P,this._values=P),{value:T,done:!0}},J}(),B=function(){function J(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(T){return this._find(T,!1)>=0},J.prototype.get=function(T){var $=this._find(T,!1);return $>=0?this._values[$]:void 0},J.prototype.set=function(T,$){var G=this._find(T,!0);return this._values[G]=$,this},J.prototype.delete=function(T){var $=this._find(T,!1);if($>=0){for(var G=this._keys.length,z=$+1;z<G;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,Ue(T,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},J.prototype.keys=function(){return new R(this._keys,this._values,L)},J.prototype.values=function(){return new R(this._keys,this._values,he)},J.prototype.entries=function(){return new R(this._keys,this._values,ue)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[d]=function(){return this.entries()},J.prototype._find=function(T,$){if(!Ue(this._cacheKey,T)){this._cacheIndex=-1;for(var G=0;G<this._keys.length;G++)if(Ue(this._keys[G],T)){this._cacheIndex=G;break}}return this._cacheIndex<0&&$&&(this._cacheIndex=this._keys.length,this._keys.push(T),this._values.push(void 0)),this._cacheIndex},J}();return B;function L(J,T){return J}function he(J,T){return T}function ue(J,T){return[J,T]}}function St(){var x=function(){function P(){this._map=new Y}return Object.defineProperty(P.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),P.prototype.has=function(R){return this._map.has(R)},P.prototype.add=function(R){return this._map.set(R,R),this},P.prototype.delete=function(R){return this._map.delete(R)},P.prototype.clear=function(){this._map.clear()},P.prototype.keys=function(){return this._map.keys()},P.prototype.values=function(){return this._map.keys()},P.prototype.entries=function(){return this._map.entries()},P.prototype["@@iterator"]=function(){return this.keys()},P.prototype[d]=function(){return this.keys()},P}();return x}function en(){var x=16,P=j.create(),R=B();return function(){function T(){this._key=B()}return T.prototype.has=function($){var G=L($,!1);return G!==void 0?j.has(G,this._key):!1},T.prototype.get=function($){var G=L($,!1);return G!==void 0?j.get(G,this._key):void 0},T.prototype.set=function($,G){var z=L($,!0);return z[this._key]=G,this},T.prototype.delete=function($){var G=L($,!1);return G!==void 0?delete G[this._key]:!1},T.prototype.clear=function(){this._key=B()},T}();function B(){var T;do T="@@WeakMap@@"+J();while(j.has(P,T));return P[T]=!0,T}function L(T,$){if(!a.call(T,R)){if(!$)return;Object.defineProperty(T,R,{value:j.create()})}return T[R]}function he(T,$){for(var G=0;G<$;++G)T[G]=Math.random()*255|0;return T}function ue(T){if(typeof Uint8Array=="function"){var $=new Uint8Array(T);return typeof crypto<"u"?crypto.getRandomValues($):typeof msCrypto<"u"?msCrypto.getRandomValues($):he($,T),$}return he(new Array(T),T)}function J(){var T=ue(x);T[6]=T[6]&79|64,T[8]=T[8]&191|128;for(var $="",G=0;G<x;++G){var z=T[G];(G===4||G===6||G===8)&&($+="-"),z<16&&($+="0"),$+=z.toString(16).toLowerCase()}return $}}function st(x){return x.__=void 0,delete x.__,x}})})(io||(io={}));var ks=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Is=(r,t,i,a)=>{for(var u=a>1?void 0:a?Ts(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&ks(t,i,u),u};let Cr=class{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}};Cr=Is([Ie()],Cr);/**
|
|
25
|
-
* See the LICENSE file distributed with this work for additional
|
|
26
|
-
* information regarding copyright ownership.
|
|
27
|
-
*
|
|
28
|
-
* This is free software; you can redistribute it and/or modify it
|
|
29
|
-
* under the terms of the GNU Affero General Public License as
|
|
30
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
31
|
-
* the License, or (at your option) any later version.
|
|
32
|
-
*
|
|
33
|
-
* This software is distributed in the hope that it will be useful,
|
|
34
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
35
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
36
|
-
* Lesser General Public License for more details.
|
|
37
|
-
*
|
|
38
|
-
* You should have received a copy of the GNU Affero General Public
|
|
39
|
-
* License along with this software; if not, write to the Free
|
|
40
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
41
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
42
|
-
*
|
|
43
|
-
* This file is part of the Cristal Wiki software prototype
|
|
44
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
45
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
46
|
-
*
|
|
47
|
-
**/class Ds{constructor(t,i,a){this.name=t,this.entryFile=i,this.staticModule=a}}var Ms=Object.defineProperty,Rs=Object.getOwnPropertyDescriptor,js=(r,t,i,a)=>{for(var u=a>1?void 0:a?Rs(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Ms(t,i,u),u},Ns=(r,t)=>(i,a)=>t(i,a,r);let xr=class extends Cr{constructor(r){super(),this.remoteExtensions=new Map,this.remoteExtensionDefaultURL="/apps/",this.remoteExtensionDefaultEntryFile="main.bundle.js",this.logger=r,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(r,t,i){this.remoteExtensions.set(r,new Ds(r,t,i))}setRemoteExtensionsConfig(r,t){this.remoteExtensionDefaultURL=r,this.remoteExtensionDefaultEntryFile=t}async loadExtension(r,t){try{const i=this.remoteExtensions.get(r),a=i&&i.entryFile?i.entryFile:this.remoteExtensionDefaultEntryFile,u=this.remoteExtensionDefaultURL+r+"/"+a,l=this.remoteExtensionDefaultURL+r+"/style.css";this.logger?.debug("Ready to import ",u);try{const E=await import(l);document.adoptedStyleSheets=[E.default]}catch{}const d=await import(u);if(d!=null){this.logger?.debug("Found components Init for ",r,d);const E=d.ComponentInit;new E(t),this.logger?.debug("Succesfull components Init for ",r)}else this.logger?.debug("No components to load for ",r);return}catch(i){this.logger?.error("Exception while loading components from ",r,i)}}async loadExtensions(r){for(const t of this.remoteExtensions.keys())await this.loadExtension(t,r)}};xr=js([Ie(),Ns(0,Ee("Logger"))],xr);/**
|
|
48
|
-
* See the LICENSE file distributed with this work for additional
|
|
49
|
-
* information regarding copyright ownership.
|
|
50
|
-
*
|
|
51
|
-
* This is free software; you can redistribute it and/or modify it
|
|
52
|
-
* under the terms of the GNU Affero General Public License as
|
|
53
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
54
|
-
* the License, or (at your option) any later version.
|
|
55
|
-
*
|
|
56
|
-
* This software is distributed in the hope that it will be useful,
|
|
57
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
58
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
59
|
-
* Lesser General Public License for more details.
|
|
60
|
-
*
|
|
61
|
-
* You should have received a copy of the GNU Affero General Public
|
|
62
|
-
* License along with this software; if not, write to the Free
|
|
63
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
64
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
65
|
-
*
|
|
66
|
-
* This file is part of the Cristal Wiki software prototype
|
|
67
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
68
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
69
|
-
*
|
|
70
|
-
**/let Ls=class{constructor(t){this.logger=t.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),this.logger?.debug("Init Extension Manager components begin"),t.bind("ExtensionManager").to(xr),this.logger?.debug("Init Extension Manager components end")}};/**
|
|
71
|
-
* See the LICENSE file distributed with this work for additional
|
|
72
|
-
* information regarding copyright ownership.
|
|
73
|
-
*
|
|
74
|
-
* This is free software; you can redistribute it and/or modify it
|
|
75
|
-
* under the terms of the GNU Affero General Public License as
|
|
76
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
77
|
-
* the License, or (at your option) any later version.
|
|
78
|
-
*
|
|
79
|
-
* This software is distributed in the hope that it will be useful,
|
|
80
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
81
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
82
|
-
* Lesser General Public License for more details.
|
|
83
|
-
*
|
|
84
|
-
* You should have received a copy of the GNU Affero General Public
|
|
85
|
-
* License along with this software; if not, write to the Free
|
|
86
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
87
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
88
|
-
*
|
|
89
|
-
* This file is part of the Cristal Wiki software prototype
|
|
90
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
91
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
92
|
-
*
|
|
93
|
-
**/class Or{constructor(t){this.jsonld=t}getIdentifier(){return this.jsonld.identifier}setIdentifier(t){this.jsonld.identifier=t}getName(){return this.jsonld.name}setName(t){this.jsonld.name=t}getText(){return this.jsonld.text}setText(t){this.jsonld.text=t}get(t){return this.jsonld[t]}set(t,i){this.jsonld[t]=i}getSource(){return this.jsonld}}/**
|
|
94
|
-
* See the LICENSE file distributed with this work for additional
|
|
95
|
-
* information regarding copyright ownership.
|
|
96
|
-
*
|
|
97
|
-
* This is free software; you can redistribute it and/or modify it
|
|
98
|
-
* under the terms of the GNU Affero General Public License as
|
|
99
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
100
|
-
* the License, or (at your option) any later version.
|
|
101
|
-
*
|
|
102
|
-
* This software is distributed in the hope that it will be useful,
|
|
103
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
104
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
105
|
-
* Lesser General Public License for more details.
|
|
106
|
-
*
|
|
107
|
-
* You should have received a copy of the GNU Affero General Public
|
|
108
|
-
* License along with this software; if not, write to the Free
|
|
109
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
110
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
111
|
-
*
|
|
112
|
-
* This file is part of the Cristal Wiki software prototype
|
|
113
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
114
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
115
|
-
*
|
|
116
|
-
**/class Qt{constructor(t="",i="",a="",u=""){this.document=new Or({}),this.source=a,this.syntax=u,this.html="",this.name=i,this.id=t,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(t){this.id=t.id,this.name=t.name,this.source=t.source,this.syntax=t.syntax,this.html=t.html,this.document=new Or(t.document),this.css=t.css,this.js=t.js,this.version=t.version}}var Bs=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Ks=(r,t,i,a)=>{for(var u=a>1?void 0:a?Fs(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Bs(t,i,u),u},Ws=(r,t)=>(i,a)=>t(i,a,r);let En=class{constructor(r){this.logger=r,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(r,t,i,a,u,l,d){this.name=r,this.baseURL=t,this.baseRestURL=i,this.homePage=a,this.serverRendering=u,this.designSystem=l,this.offline=d}setConfigFromObject(r){this.name=r.name,this.baseURL=r.baseURL,this.baseRestURL=r.baseRestURL,this.homePage=r.homePage,this.serverRendering=r.serverRendering,this.offline=r.offline,this.designSystem=r.designSystem}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const r=this.cristal.getContainer().get("WrappingStorage");r?(this.logger.debug("Offline local storage is ready"),r.setStorage(this.storage),r.setWikiConfig(this.storage.getWikiConfig()),this.storage=r):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(r){return r=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}};En=Ks([Ie(),Ws(0,Ee("Logger"))],En);var qs=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,oo=(r,t,i,a)=>{for(var u=a>1?void 0:a?Us(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&qs(t,i,u),u};let Xt=class{setModule(r){this.module=r}debug(...r){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&r.unshift(this.module+":"),console.debug.apply(null,r)}info(...r){r.unshift(this.module+":"),console.info.apply(null,r)}warn(...r){r.unshift(this.module+":"),console.warn.apply(null,r)}error(...r){r.unshift(this.module+":"),console.error.apply(null,r)}};oo([Ee("LoggerConfig")],Xt.prototype,"loggerConfig",2),Xt=oo([Ie()],Xt);var Vs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,Gs=(r,t,i,a)=>{for(var u=a>1?void 0:a?$s(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Vs(t,i,u),u};let Er=class{constructor(r="error"){this.levels=new Map,this.config=new Map,this.defaultLevel=r,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(r,t){const i=this.levels.get(t);i!=null&&this.config.forEach(a=>{if(a.startsWith(r)){const u=this.computedConfig.get(a);(u==null||i&&i>u)&&i&&this.computedConfig.set(a,i)}})}getLevels(){return this.config}getLevel(r){let t=this.config.get(r);return t||(t=this.defaultLevel),t}getLevelId(r){const t=this.levels.get(r);return t||10}setDefaultLevel(r){this.defaultLevel=r,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(r,t){let i=this.computedConfig.get(r);i||(i=this.getDefaultLevelId());const a=this.getLevelId(t);return!!(a&&i>=a)}hasLevelId(r,t){let i=this.computedConfig.get(r);i||(i=this.getDefaultLevelId());const a=t;return!!(a&&i>=a)}};Er=Gs([Ie()],Er);/**
|
|
117
|
-
* See the LICENSE file distributed with this work for additional
|
|
118
|
-
* information regarding copyright ownership.
|
|
119
|
-
*
|
|
120
|
-
* This is free software; you can redistribute it and/or modify it
|
|
121
|
-
* under the terms of the GNU Affero General Public License as
|
|
122
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
123
|
-
* the License, or (at your option) any later version.
|
|
124
|
-
*
|
|
125
|
-
* This software is distributed in the hope that it will be useful,
|
|
126
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
127
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
128
|
-
* Lesser General Public License for more details.
|
|
129
|
-
*
|
|
130
|
-
* You should have received a copy of the GNU Affero General Public
|
|
131
|
-
* License along with this software; if not, write to the Free
|
|
132
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
133
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
134
|
-
*
|
|
135
|
-
* This file is part of the Cristal Wiki software prototype
|
|
136
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
137
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
138
|
-
*
|
|
139
|
-
**/class zs{constructor(t){this.extensionList=t}getLogger(t){let i=this.container.get("Logger");return i||(i=new Xt),i.setModule(t),i}async loadExtensionManager(t){const i="extension-manager",a="/apps/"+i+"/main.bundle.dev.js";try{if(t)this.logger?.debug("Loading static extension Manager"),new Ls(this.container);else{this.logger?.debug("Dynamic extension Manager. Ready to import ",a);const u=await import(a);if(u!=null){this.logger?.debug("Found components Init for ",i,u);const l=u.ComponentInit;new l(this.container),this.logger?.debug("Succesfull components Init for ",i)}else this.logger?.debug("No components to load for ",i)}}catch(u){this.logger?.error("Exception while loading extension Manager from ",a,u)}}async loadExtensions(t,i){this.logger?.debug("Start app"),await this.loadExtensionManager(t);const a=this.container.get("ExtensionManager");if(this.logger?.debug("Extension Manager is ",a),a!=null){if(!i){a.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const u in this.extensionList)a.addRemoteExtension(u,"",!0);await a.loadExtensions(this.container)}this.logger?.debug("After extensions loading")}else this.logger?.debug("Could not start extension Manager");return a}initializeContainer(){this.container=new ws,this.container.bind("LoggerConfig").to(Er).inSingletonScope(),this.container.bind("Logger").to(Xt);const t=this.container.get("LoggerConfig");t&&t.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),this.logger?.info("Logging initialized")}getConfigFromPathName(t){let i="";if(t.startsWith("/")){const a=t.indexOf("/",1);a!=-1&&(i=t.substring(1,a))}return(i==null||i=="")&&(i="XWiki"),i}}var Hs=Object.defineProperty,Ys=Object.getOwnPropertyDescriptor,Qs=(r,t,i,a)=>{for(var u=a>1?void 0:a?Ys(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Hs(t,i,u),u},Xs=(r,t)=>(i,a)=>t(i,a,r);let Pn=class{constructor(r,t){this.logger=r,this.logger.setModule(t)}setWikiConfig(r){this.logger.debug("Setting wiki Config: ",r),this.wikiConfig=r}getWikiConfig(){return this.wikiConfig}};Pn=Qs([Ie(),Xs(0,Es())],Pn);var Js=Object.defineProperty,Zs=Object.getOwnPropertyDescriptor,eu=(r,t,i,a)=>{for(var u=a>1?void 0:a?Zs(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Js(t,i,u),u},tu=(r,t)=>(i,a)=>t(i,a,r);let Pr=class extends Pn{constructor(r){super(r,"storage.components.xwikiStorage")}async isStorageReady(){return!0}getPageRestURL(r,t){return this.logger?.debug("XWiki Loading page",r),this.wikiConfig.baseURL+this.wikiConfig.baseRestURL+"&page="+r+"&format="+t}getPageFromViewURL(r){let t;return r.startsWith(this.wikiConfig.baseURL)?(t=r.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("/","."),t.endsWith(".")&&(t+="WebHome")):t=null,t}getImageURL(r,t){r==""&&(r="Main.WebHome");const i=this.wikiConfig.baseURL+"/bin/download/"+r.replace(".","/")+"/"+t;return this.logger?.debug("final image url ",i),i}async getPageContent(r,t){this.logger?.debug("XWiki Loading page",r),r==""&&(r="Main.WebHome");const i=this.getPageRestURL(r,t);this.logger?.debug("XWiki Loading url",i);const u=await(await fetch(i,{cache:"no-store"})).json();let l="",d="",E={};t=="jsonld"?(E=u,this.wikiConfig.serverRendering?(this.logger?.debug("Using server side rendering for jsonld"),l=u.source,d=u.html):(this.logger?.debug("Using client side rendering for jsonld"),l=u.source,d="")):t=="html"?this.wikiConfig.serverRendering?(this.logger?.debug("Using server side rendering for html"),l=u.source,d=""):(this.logger?.debug("Using client side rendering for html"),l=u.source,d=""):(l="",d="");const M=new Qt;return M.source=l,M.syntax="xwiki",M.html=d,M.document=new Or(E),M.css=u.css,M.js=u.js,M.version=M.document.get("version"),M.headlineRaw=u.headlineRaw,M.headline=u.headline,M.name=u.name,M}async getPanelContent(r,t){const i=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+t+"&panel="+r;this.logger?.debug("XWiki Loading url",i);const u=await(await fetch(i,{cache:"no-store"})).json(),l=new Qt;return l.source=u.source,l.syntax="xwiki",l.html=u.content,l.css=u.css,l.js=u.js,l}async getEditField(r,t){try{const i=r.get("xwikiMapping")[t];let a=i.type,u=i.fieldName;a==null&&(a="document"),u==null&&(u=t);const l=this.wikiConfig.baseURL+"/bin/get/"+r.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+a+"&property="+r.get("className")+"."+u;return this.logger?.debug("XWiki Loading Field url",l),await(await fetch(l,{cache:"no-store"})).text()}catch(i){return this.logger?.error("Exception looking for edit field for field",t,i),""}}async save(r,t,i){const a=this.wikiConfig.baseURL,u=["rest","wikis","xwiki"],l=r.split(".");for(let E=0;E<l.length;E++){const M=E<l.length-1?"spaces":"pages";u.push(M),u.push(l[E])}const d=`${a}/${u.join("/")}`;await fetch(d,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${btoa("Test:xwikirox")}`},body:JSON.stringify({content:t,title:i,syntax:"markdown/1.2"})})}};Pr=eu([Ie(),tu(0,Ee("Logger"))],Pr);var nu=Object.defineProperty,ru=Object.getOwnPropertyDescriptor,iu=(r,t,i,a)=>{for(var u=a>1?void 0:a?ru(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&nu(t,i,u),u},kn=(r,t)=>(i,a)=>t(i,a,r);let kr=class extends En{constructor(r,t,i){super(r),this.cristal=i,this.storage=t,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(r){return r=="html"||r=="jsonld"}defaultPageName(){return"Main.WebHome"}};kr=iu([Ie(),kn(0,Ee("Logger")),kn(1,Ee("Storage")),kn(1,ro("XWiki")),kn(2,Ee("CristalApp"))],kr);var ou=Object.defineProperty,au=Object.getOwnPropertyDescriptor,su=(r,t,i,a)=>{for(var u=a>1?void 0:a?au(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&ou(t,i,u),u},uu=(r,t)=>(i,a)=>t(i,a,r);let Tr=class extends Pn{constructor(r){super(r,"storage.components.githubStorage"),this.hashCode=function(t){let i=0,a,u;if(t.length===0)return""+i;for(a=0;a<t.length;a++)u=t.charCodeAt(a),i=(i<<5)-i+u,i|=0;return""+i}}async isStorageReady(){return!0}getPageRestURL(r,t){return this.logger?.debug("GitHub Loading page",r),this.wikiConfig.baseRestURL+r}getPageFromViewURL(r){let t=null;return r.startsWith(this.wikiConfig.baseURL)&&(t=r.replace(this.wikiConfig.baseURL,"")),t}getImageURL(r,t){return this.wikiConfig.baseRestURL+t}async getPageContent(r,t){this.logger?.debug("GitHub Loading page",r);const i=this.getPageRestURL(r,t),u=await(await fetch(i,{cache:"no-store"})).text();let l="";t=="json"?l="":t=="md"||t=="html"?l=u:l="";const d=new Qt;return d.source=l,d.syntax="md",d.css=[],d.version=this.hashCode(l),d}async getPanelContent(){return new Qt}async getEditField(){return""}save(){throw new Error("Save not supported")}};Tr=su([Ie(),uu(0,Ee("Logger"))],Tr);var cu=Object.defineProperty,lu=Object.getOwnPropertyDescriptor,fu=(r,t,i,a)=>{for(var u=a>1?void 0:a?lu(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&cu(t,i,u),u},Tn=(r,t)=>(i,a)=>t(i,a,r);let Ir=class extends En{constructor(r,t,i){super(r),this.storage=t,this.cristal=i,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}};Ir=fu([Ie(),Tn(0,Ee("Logger")),Tn(1,Ee("Storage")),Tn(1,ro("GitHub")),Tn(2,Ee("CristalApp"))],Ir);var hu=Object.defineProperty,du=Object.getOwnPropertyDescriptor,pu=(r,t,i,a)=>{for(var u=a>1?void 0:a?du(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&hu(t,i,u),u},Dr=(r,t)=>(i,a)=>t(i,a,r);let Mr=class{constructor(r,t,i){this.logger=r,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=t,this.queueWorker=i}setStorage(r){this.storage=r}getStorage(){return this.storage}setWikiConfig(r){return this.storage.setWikiConfig(r)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(r,t){return this.storage.getPageRestURL(r,t)}getPageFromViewURL(r){return this.storage.getPageFromViewURL(r)}getImageURL(r,t){return this.storage.getImageURL(r,t)}async getPageContent(r,t,i){if(this.logger.debug("Trying to get data for page ",r),this.offlineStorage){this.logger.debug("Asking offline storage for ",r);const a=await this.offlineStorage.getPage(this.getWikiConfig().name,r+"_"+t);return a!=null&&a!=null?(this.logger.debug("Loading data from local storage for page",r),(i==null||i)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+r+"_"+t),a):(this.logger.debug("Could not find data in local storage for page",r),this.savePageContent(r,t))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(r,t)}async savePageContent(r,t){const i=await this.storage.getPageContent(r,t);if(i)return i.id=r+"_"+t,this.logger.debug("Saving page to offline storage",r),this.offlineStorage.savePage(this.getWikiConfig().name,r+"_"+t,i),i;throw new Error("Can't save missing page.")}async updatePageContent(r,t){const i=await this.offlineStorage.getPage(this.getWikiConfig().name,r+"_"+t),a=await this.storage.getPageContent(r,t);return i&&a?(a.id=r+"_"+t,this.logger.debug("Saving page to offline storage",r),this.offlineStorage.savePage(this.getWikiConfig().name,r+"_"+t,a),!0):i?.version!=a?.version&&a?(a.id=r+"_"+t,this.logger.debug("Updating page to offline storage",r),this.offlineStorage.updatePage(this.getWikiConfig().name,r+"_"+t,a),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(r,t,i){return this.storage.getPanelContent(r,t,i)}async getEditField(r,t){return await this.storage.getEditField(r,t)}save(r,t,i,a){return this.storage.save(r,t,i,a)}};Mr=pu([Ie(),Dr(0,Ee("Logger")),Dr(1,Ee("OfflineStorage")),Dr(2,Ee("QueueWorker"))],Mr);var ao={exports:{}};(function(r,t){(function(i,a){r.exports=a()})(On,function(){var i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(o[c]=s[c])})(e,n)},a=function(){return(a=Object.assign||function(e){for(var n,o=1,s=arguments.length;o<s;o++)for(var c in n=arguments[o])Object.prototype.hasOwnProperty.call(n,c)&&(e[c]=n[c]);return e}).apply(this,arguments)};function u(e,n,o){for(var s,c=0,f=n.length;c<f;c++)!s&&c in n||((s=s||Array.prototype.slice.call(n,0,c))[c]=n[c]);return e.concat(s||Array.prototype.slice.call(n))}var l=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:On,d=Object.keys,E=Array.isArray;function M(e,n){return typeof n!="object"||d(n).forEach(function(o){e[o]=n[o]}),e}typeof Promise>"u"||l.Promise||(l.Promise=Promise);var y=Object.getPrototypeOf,j={}.hasOwnProperty;function V(e,n){return j.call(e,n)}function Y(e,n){typeof n=="function"&&(n=n(y(e))),(typeof Reflect>"u"?d:Reflect.ownKeys)(n).forEach(function(o){ve(e,o,n[o])})}var pe=Object.defineProperty;function ve(e,n,o,s){pe(e,n,M(o&&V(o,"get")&&typeof o.get=="function"?{get:o.get,set:o.set,configurable:!0}:{value:o,configurable:!0,writable:!0},s))}function we(e){return{from:function(n){return e.prototype=Object.create(n.prototype),ve(e.prototype,"constructor",e),{extend:Y.bind(null,e.prototype)}}}}var Ze=Object.getOwnPropertyDescriptor,Dt=[].slice;function Mt(e,n,o){return Dt.call(e,n,o)}function In(e,n){return n(e)}function vt(e){if(!e)throw new Error("Assertion Failed")}function Dn(e){l.setImmediate?setImmediate(e):setTimeout(e,0)}function qe(e,n){if(typeof n=="string"&&V(e,n))return e[n];if(!n)return e;if(typeof n!="string"){for(var o=[],s=0,c=n.length;s<c;++s){var f=qe(e,n[s]);o.push(f)}return o}var h=n.indexOf(".");if(h!==-1){var p=e[n.substr(0,h)];return p==null?void 0:qe(p,n.substr(h+1))}}function Pe(e,n,o){if(e&&n!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof n!="string"&&"length"in n){vt(typeof o!="string"&&"length"in o);for(var s=0,c=n.length;s<c;++s)Pe(e,n[s],o[s])}else{var f,h,p=n.indexOf(".");p!==-1?(f=n.substr(0,p),(h=n.substr(p+1))===""?o===void 0?E(e)&&!isNaN(parseInt(f))?e.splice(f,1):delete e[f]:e[f]=o:Pe(p=!(p=e[f])||!V(e,f)?e[f]={}:p,h,o)):o===void 0?E(e)&&!isNaN(parseInt(n))?e.splice(n,1):delete e[n]:e[n]=o}}function Mn(e){var n,o={};for(n in e)V(e,n)&&(o[n]=e[n]);return o}var Fr=[].concat;function Rn(e){return Fr.apply([],e)}var rt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Rn([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(n){return n+e+"Array"})}))).filter(function(e){return l[e]}),jn=new Set(rt.map(function(e){return l[e]})),mt=null;function Ge(e){return mt=new WeakMap,e=function n(o){if(!o||typeof o!="object")return o;var s=mt.get(o);if(s)return s;if(E(o)){s=[],mt.set(o,s);for(var c=0,f=o.length;c<f;++c)s.push(n(o[c]))}else if(jn.has(o.constructor))s=o;else{var h,p=y(o);for(h in s=p===Object.prototype?{}:Object.create(p),mt.set(o,s),o)V(o,h)&&(s[h]=n(o[h]))}return s}(e),mt=null,e}var Nn={}.toString;function bt(e){return Nn.call(e).slice(8,-1)}var Rt=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Ln=typeof Rt=="symbol"?function(e){var n;return e!=null&&(n=e[Rt])&&n.apply(e)}:function(){return null};function ze(e,n){return n=e.indexOf(n),0<=n&&e.splice(n,1),0<=n}var et={};function Ke(e){var n,o,s,c;if(arguments.length===1){if(E(e))return e.slice();if(this===et&&typeof e=="string")return[e];if(c=Ln(e)){for(o=[];!(s=c.next()).done;)o.push(s.value);return o}if(e==null)return[e];if(typeof(n=e.length)!="number")return[e];for(o=new Array(n);n--;)o[n]=e[n];return o}for(n=arguments.length,o=new Array(n);n--;)o[n]=arguments[n];return o}var jt=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},At=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],We=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(At),Q={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 Re(e,n){this.name=e,this.message=n}function Bn(e,n){return e+". Errors: "+Object.keys(n).map(function(o){return n[o].toString()}).filter(function(o,s,c){return c.indexOf(o)===s}).join(`
|
|
140
|
-
`)}function fe(e,n,o,s){this.failures=n,this.failedKeys=s,this.successCount=o,this.message=Bn(e,n)}function ot(e,n){this.name="BulkError",this.failures=Object.keys(n).map(function(o){return n[o]}),this.failuresByPos=n,this.message=Bn(e,this.failures)}we(Re).from(Error).extend({toString:function(){return this.name+": "+this.message}}),we(fe).from(Re),we(ot).from(Re);var Jt=We.reduce(function(e,n){return e[n]=n+"Error",e},{}),Fn=Re,H=We.reduce(function(e,n){var o=n+"Error";function s(c,f){this.name=o,c?typeof c=="string"?(this.message="".concat(c).concat(f?`
|
|
141
|
-
`+f:""),this.inner=f||null):typeof c=="object"&&(this.message="".concat(c.name," ").concat(c.message),this.inner=c):(this.message=Q[n]||o,this.inner=null)}return we(s).from(Fn),e[n]=s,e},{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var je=At.reduce(function(e,n){return e[n+"Error"]=H[n],e},{}),wt=We.reduce(function(e,n){return["Syntax","Type","Range"].indexOf(n)===-1&&(e[n+"Error"]=H[n]),e},{});function ie(){}function at(e){return e}function Kr(e,n){return e==null||e===at?n:function(o){return n(e(o))}}function Ue(e,n){return function(){e.apply(this,arguments),n.apply(this,arguments)}}function Kn(e,n){return e===ie?n:function(){var o=e.apply(this,arguments);o!==void 0&&(arguments[0]=o);var s=this.onsuccess,c=this.onerror;this.onsuccess=null,this.onerror=null;var f=n.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?Ue(s,this.onsuccess):s),c&&(this.onerror=this.onerror?Ue(c,this.onerror):c),f!==void 0?f:o}}function Wn(e,n){return e===ie?n:function(){e.apply(this,arguments);var o=this.onsuccess,s=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),o&&(this.onsuccess=this.onsuccess?Ue(o,this.onsuccess):o),s&&(this.onerror=this.onerror?Ue(s,this.onerror):s)}}function qn(e,n){return e===ie?n:function(o){var s=e.apply(this,arguments);M(o,s);var c=this.onsuccess,f=this.onerror;return this.onsuccess=null,this.onerror=null,o=n.apply(this,arguments),c&&(this.onsuccess=this.onsuccess?Ue(c,this.onsuccess):c),f&&(this.onerror=this.onerror?Ue(f,this.onerror):f),s===void 0?o===void 0?void 0:o:M(s,o)}}function Un(e,n){return e===ie?n:function(){return n.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Nt(e,n){return e===ie?n:function(){var o=e.apply(this,arguments);if(o&&typeof o.then=="function"){for(var s=this,c=arguments.length,f=new Array(c);c--;)f[c]=arguments[c];return o.then(function(){return n.apply(s,f)})}return n.apply(this,arguments)}}wt.ModifyError=fe,wt.DexieError=Re,wt.BulkError=ot;var De=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Vn(e){De=e}var _t={},$n=100,rt=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,y(e),e];var n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,y(n),e]}(),At=rt[0],We=rt[1],rt=rt[2],We=We&&We.then,Ve=At&&At.constructor,Zt=!!rt,St=function(e,n){he.push([e,n]),st&&(queueMicrotask(Ne),st=!1)},en=!0,st=!0,x=[],P=[],R=at,B={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ie,pgp:!1,env:{},finalize:ie},L=B,he=[],ue=0,J=[];function T(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var n=this._PSD=L;if(typeof e!="function"){if(e!==_t)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&z(this,this._value))}this._state=null,this._value=null,++n.ref,function o(s,c){try{c(function(f){if(s._state===null){if(f===s)throw new TypeError("A promise cannot be resolved with itself.");var h=s._lib&&tt();f&&typeof f.then=="function"?o(s,function(p,b){f instanceof T?f._then(p,b):f.then(p,b)}):(s._state=!0,s._value=f,Z(s)),h&&ut()}},z.bind(null,s))}catch(f){z(s,f)}}(this,e)}var $={get:function(){var e=L,n=Yn;function o(s,c){var f=this,h=!e.global&&(e!==L||n!==Yn),p=h&&!lt(),b=new T(function(v,A){se(f,new G(lo(s,e,h,p),lo(c,e,h,p),v,A,e))});return this._consoleTask&&(b._consoleTask=this._consoleTask),b}return o.prototype=_t,o},set:function(e){ve(this,"then",e&&e.prototype===_t?$:{get:function(){return e},set:$.set})}};function G(e,n,o,s,c){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof n=="function"?n:null,this.resolve=o,this.reject=s,this.psd=c}function z(e,n){var o,s;P.push(n),e._state===null&&(o=e._lib&&tt(),n=R(n),e._state=!1,e._value=n,s=e,x.some(function(c){return c._value===s._value})||x.push(s),Z(e),o&&ut())}function Z(e){var n=e._listeners;e._listeners=[];for(var o=0,s=n.length;o<s;++o)se(e,n[o]);var c=e._PSD;--c.ref||c.finalize(),ue===0&&(++ue,St(function(){--ue==0&&tn()},[]))}function se(e,n){if(e._state!==null){var o=e._state?n.onFulfilled:n.onRejected;if(o===null)return(e._state?n.resolve:n.reject)(e._value);++n.psd.ref,++ue,St(ge,[o,e,n])}else e._listeners.push(n)}function ge(e,n,o){try{var s,c=n._value;!n._state&&P.length&&(P=[]),s=De&&n._consoleTask?n._consoleTask.run(function(){return e(c)}):e(c),n._state||P.indexOf(c)!==-1||function(f){for(var h=x.length;h;)if(x[--h]._value===f._value)return x.splice(h,1)}(n),o.resolve(s)}catch(f){o.reject(f)}finally{--ue==0&&tn(),--o.psd.ref||o.psd.finalize()}}function Ne(){Ct(B,function(){tt()&&ut()})}function tt(){var e=en;return st=en=!1,e}function ut(){var e,n,o;do for(;0<he.length;)for(e=he,he=[],o=e.length,n=0;n<o;++n){var s=e[n];s[0].apply(null,s[1])}while(0<he.length);st=en=!0}function tn(){var e=x;x=[],e.forEach(function(s){s._PSD.onunhandled.call(null,s._value,s)});for(var n=J.slice(0),o=n.length;o;)n[--o]()}function Gn(e){return new T(_t,!1,e)}function de(e,n){var o=L;return function(){var s=tt(),c=L;try{return ft(o,!0),e.apply(this,arguments)}catch(f){n&&n(f)}finally{ft(c,!1),s&&ut()}}}Y(T.prototype,{then:$,_then:function(e,n){se(this,new G(null,null,e,n,L))},catch:function(e){if(arguments.length===1)return this.then(null,e);var n=e,o=arguments[1];return typeof n=="function"?this.then(null,function(s){return(s instanceof n?o:Gn)(s)}):this.then(null,function(s){return(s&&s.name===n?o:Gn)(s)})},finally:function(e){return this.then(function(n){return T.resolve(e()).then(function(){return n})},function(n){return T.resolve(e()).then(function(){return Gn(n)})})},timeout:function(e,n){var o=this;return e<1/0?new T(function(s,c){var f=setTimeout(function(){return c(new H.Timeout(n))},e);o.then(s,c).finally(clearTimeout.bind(null,f))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&ve(T.prototype,Symbol.toStringTag,"Dexie.Promise"),B.env=co(),Y(T,{all:function(){var e=Ke.apply(null,arguments).map(Qn);return new T(function(n,o){e.length===0&&n([]);var s=e.length;e.forEach(function(c,f){return T.resolve(c).then(function(h){e[f]=h,--s||n(e)},o)})})},resolve:function(e){return e instanceof T?e:e&&typeof e.then=="function"?new T(function(n,o){e.then(n,o)}):new T(_t,!0,e)},reject:Gn,race:function(){var e=Ke.apply(null,arguments).map(Qn);return new T(function(n,o){e.map(function(s){return T.resolve(s).then(n,o)})})},PSD:{get:function(){return L},set:function(e){return L=e}},totalEchoes:{get:function(){return Yn}},newPSD:ct,usePSD:Ct,scheduler:{get:function(){return St},set:function(e){St=e}},rejectionMapper:{get:function(){return R},set:function(e){R=e}},follow:function(e,n){return new T(function(o,s){return ct(function(c,f){var h=L;h.unhandleds=[],h.onunhandled=f,h.finalize=Ue(function(){var p,b=this;p=function(){b.unhandleds.length===0?c():f(b.unhandleds[0])},J.push(function v(){p(),J.splice(J.indexOf(v),1)}),++ue,St(function(){--ue==0&&tn()},[])},h.finalize),e()},n,o,s)})}}),Ve&&(Ve.allSettled&&ve(T,"allSettled",function(){var e=Ke.apply(null,arguments).map(Qn);return new T(function(n){e.length===0&&n([]);var o=e.length,s=new Array(o);e.forEach(function(c,f){return T.resolve(c).then(function(h){return s[f]={status:"fulfilled",value:h}},function(h){return s[f]={status:"rejected",reason:h}}).then(function(){return--o||n(s)})})})}),Ve.any&&typeof AggregateError<"u"&&ve(T,"any",function(){var e=Ke.apply(null,arguments).map(Qn);return new T(function(n,o){e.length===0&&o(new AggregateError([]));var s=e.length,c=new Array(s);e.forEach(function(f,h){return T.resolve(f).then(function(p){return n(p)},function(p){c[h]=p,--s||o(new AggregateError(c))})})})}));var _e={awaits:0,echoes:0,id:0},ku=0,zn=[],Hn=0,Yn=0,Tu=0;function ct(e,n,o,s){var c=L,f=Object.create(c);return f.parent=c,f.ref=0,f.global=!1,f.id=++Tu,B.env,f.env=Zt?{Promise:T,PromiseProp:{value:T,configurable:!0,writable:!0},all:T.all,race:T.race,allSettled:T.allSettled,any:T.any,resolve:T.resolve,reject:T.reject}:{},n&&M(f,n),++c.ref,f.finalize=function(){--this.parent.ref||this.parent.finalize()},s=Ct(f,e,o,s),f.ref===0&&f.finalize(),s}function Lt(){return _e.id||(_e.id=++ku),++_e.awaits,_e.echoes+=$n,_e.id}function lt(){return!!_e.awaits&&(--_e.awaits==0&&(_e.id=0),_e.echoes=_e.awaits*$n,!0)}function Qn(e){return _e.echoes&&e&&e.constructor===Ve?(Lt(),e.then(function(n){return lt(),n},function(n){return lt(),me(n)})):e}function Iu(){var e=zn[zn.length-1];zn.pop(),ft(e,!1)}function ft(e,n){var o,s=L;(n?!_e.echoes||Hn++&&e===L:!Hn||--Hn&&e===L)||queueMicrotask(n?function(c){++Yn,_e.echoes&&--_e.echoes!=0||(_e.echoes=_e.awaits=_e.id=0),zn.push(L),ft(c,!0)}.bind(null,e):Iu),e!==L&&(L=e,s===B&&(B.env=co()),Zt&&(o=B.env.Promise,n=e.env,(s.global||e.global)&&(Object.defineProperty(l,"Promise",n.PromiseProp),o.all=n.all,o.race=n.race,o.resolve=n.resolve,o.reject=n.reject,n.allSettled&&(o.allSettled=n.allSettled),n.any&&(o.any=n.any))))}function co(){var e=l.Promise;return Zt?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(l,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ct(e,n,o,s,c){var f=L;try{return ft(e,!0),n(o,s,c)}finally{ft(f,!1)}}function lo(e,n,o,s){return typeof e!="function"?e:function(){var c=L;o&&Lt(),ft(n,!0);try{return e.apply(this,arguments)}finally{ft(c,!1),s&&queueMicrotask(lt)}}}function Wr(e){Promise===Ve&&_e.echoes===0?Hn===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+We).indexOf("[native code]")===-1&&(Lt=lt=ie);var me=T.reject,xt="",nt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",fo="String expected.",Bt=[],Xn="__dbnames",qr="readonly",Ur="readwrite";function Ot(e,n){return e?n?function(){return e.apply(this,arguments)&&n.apply(this,arguments)}:e:n}var ho={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Jn(e){return typeof e!="string"||/\./.test(e)?function(n){return n}:function(n){return n[e]===void 0&&e in n&&delete(n=Ge(n))[e],n}}function po(){throw H.Type()}function ae(e,n){try{var o=go(e),s=go(n);if(o!==s)return o==="Array"?1:s==="Array"?-1:o==="binary"?1:s==="binary"?-1:o==="string"?1:s==="string"?-1:o==="Date"?1:s!=="Date"?NaN:-1;switch(o){case"number":case"Date":case"string":return n<e?1:e<n?-1:0;case"binary":return function(c,f){for(var h=c.length,p=f.length,b=h<p?h:p,v=0;v<b;++v)if(c[v]!==f[v])return c[v]<f[v]?-1:1;return h===p?0:h<p?-1:1}(yo(e),yo(n));case"Array":return function(c,f){for(var h=c.length,p=f.length,b=h<p?h:p,v=0;v<b;++v){var A=ae(c[v],f[v]);if(A!==0)return A}return h===p?0:h<p?-1:1}(e,n)}}catch{}return NaN}function go(e){var n=typeof e;return n!="object"?n:ArrayBuffer.isView(e)?"binary":(e=bt(e),e==="ArrayBuffer"?"binary":e)}function yo(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var vo=(le.prototype._trans=function(e,n,o){var s=this._tx||L.trans,c=this.name,f=De&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function h(v,A,g){if(!g.schema[c])throw new H.NotFound("Table "+c+" not part of transaction");return n(g.idbtrans,g)}var p=tt();try{var b=s&&s.db._novip===this.db._novip?s===L.trans?s._promise(e,h,o):ct(function(){return s._promise(e,h,o)},{trans:s,transless:L.transless||L}):function v(A,g,S,m){if(A.idbdb&&(A._state.openComplete||L.letThrough||A._vip)){var _=A._createTransaction(g,S,A._dbSchema);try{_.create(),A._state.PR1398_maxLoop=3}catch(C){return C.name===Jt.InvalidState&&A.isOpen()&&0<--A._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),A.close({disableAutoOpen:!1}),A.open().then(function(){return v(A,g,S,m)})):me(C)}return _._promise(g,function(C,w){return ct(function(){return L.trans=_,m(C,w,_)})}).then(function(C){if(g==="readwrite")try{_.idbtrans.commit()}catch{}return g==="readonly"?C:_._completion.then(function(){return C})})}if(A._state.openComplete)return me(new H.DatabaseClosed(A._state.dbOpenError));if(!A._state.isBeingOpened){if(!A._state.autoOpen)return me(new H.DatabaseClosed);A.open().catch(ie)}return A._state.dbReadyPromise.then(function(){return v(A,g,S,m)})}(this.db,e,[this.name],h);return f&&(b._consoleTask=f,b=b.catch(function(v){return console.trace(v),me(v)})),b}finally{p&&ut()}},le.prototype.get=function(e,n){var o=this;return e&&e.constructor===Object?this.where(e).first(n):e==null?me(new H.Type("Invalid argument to Table.get()")):this._trans("readonly",function(s){return o.core.get({trans:s,key:e}).then(function(c){return o.hook.reading.fire(c)})}).then(n)},le.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(E(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var n=d(e);if(n.length===1)return this.where(n[0]).equals(e[n[0]]);var o=this.schema.indexes.concat(this.schema.primKey).filter(function(b){if(b.compound&&n.every(function(A){return 0<=b.keyPath.indexOf(A)})){for(var v=0;v<n.length;++v)if(n.indexOf(b.keyPath[v])===-1)return!1;return!0}return!1}).sort(function(b,v){return b.keyPath.length-v.keyPath.length})[0];if(o&&this.db._maxKey!==xt){var h=o.keyPath.slice(0,n.length);return this.where(h).equals(h.map(function(v){return e[v]}))}!o&&De&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(n.join("+"),"]"));var s=this.schema.idxByName,c=this.db._deps.indexedDB;function f(b,v){return c.cmp(b,v)===0}var p=n.reduce(function(S,v){var A=S[0],g=S[1],S=s[v],m=e[v];return[A||S,A||!S?Ot(g,S&&S.multi?function(_){return _=qe(_,v),E(_)&&_.some(function(C){return f(m,C)})}:function(_){return f(m,qe(_,v))}):g]},[null,null]),h=p[0],p=p[1];return h?this.where(h.name).equals(e[h.keyPath]).filter(p):o?this.filter(p):this.where(n).equals("")},le.prototype.filter=function(e){return this.toCollection().and(e)},le.prototype.count=function(e){return this.toCollection().count(e)},le.prototype.offset=function(e){return this.toCollection().offset(e)},le.prototype.limit=function(e){return this.toCollection().limit(e)},le.prototype.each=function(e){return this.toCollection().each(e)},le.prototype.toArray=function(e){return this.toCollection().toArray(e)},le.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},le.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,E(e)?"[".concat(e.join("+"),"]"):e))},le.prototype.reverse=function(){return this.toCollection().reverse()},le.prototype.mapToClass=function(e){var n,o=this.db,s=this.name;function c(){return n!==null&&n.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof po&&(function(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function A(){this.constructor=b}i(b,v),b.prototype=v===null?Object.create(v):(A.prototype=v.prototype,new A)}(c,n=e),Object.defineProperty(c.prototype,"db",{get:function(){return o},enumerable:!1,configurable:!0}),c.prototype.table=function(){return s},e=c);for(var f=new Set,h=e.prototype;h;h=y(h))Object.getOwnPropertyNames(h).forEach(function(b){return f.add(b)});function p(b){if(!b)return b;var v,A=Object.create(e.prototype);for(v in b)if(!f.has(v))try{A[v]=b[v]}catch{}return A}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=p,this.hook("reading",p),e},le.prototype.defineClass=function(){return this.mapToClass(function(e){M(this,e)})},le.prototype.add=function(e,n){var o=this,s=this.schema.primKey,c=s.auto,f=s.keyPath,h=e;return f&&c&&(h=Jn(f)(e)),this._trans("readwrite",function(p){return o.core.mutate({trans:p,type:"add",keys:n!=null?[n]:null,values:[h]})}).then(function(p){return p.numFailures?T.reject(p.failures[0]):p.lastResult}).then(function(p){if(f)try{Pe(e,f,p)}catch{}return p})},le.prototype.update=function(e,n){return typeof e!="object"||E(e)?this.where(":id").equals(e).modify(n):(e=qe(e,this.schema.primKey.keyPath),e===void 0?me(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(n))},le.prototype.put=function(e,n){var o=this,s=this.schema.primKey,c=s.auto,f=s.keyPath,h=e;return f&&c&&(h=Jn(f)(e)),this._trans("readwrite",function(p){return o.core.mutate({trans:p,type:"put",values:[h],keys:n!=null?[n]:null})}).then(function(p){return p.numFailures?T.reject(p.failures[0]):p.lastResult}).then(function(p){if(f)try{Pe(e,f,p)}catch{}return p})},le.prototype.delete=function(e){var n=this;return this._trans("readwrite",function(o){return n.core.mutate({trans:o,type:"delete",keys:[e]})}).then(function(o){return o.numFailures?T.reject(o.failures[0]):void 0})},le.prototype.clear=function(){var e=this;return this._trans("readwrite",function(n){return e.core.mutate({trans:n,type:"deleteRange",range:ho})}).then(function(n){return n.numFailures?T.reject(n.failures[0]):void 0})},le.prototype.bulkGet=function(e){var n=this;return this._trans("readonly",function(o){return n.core.getMany({keys:e,trans:o}).then(function(s){return s.map(function(c){return n.hook.reading.fire(c)})})})},le.prototype.bulkAdd=function(e,n,o){var s=this,c=Array.isArray(n)?n:void 0,f=(o=o||(c?void 0:n))?o.allKeys:void 0;return this._trans("readwrite",function(h){var v=s.schema.primKey,p=v.auto,v=v.keyPath;if(v&&c)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(c&&c.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var b=e.length,v=v&&p?e.map(Jn(v)):e;return s.core.mutate({trans:h,type:"add",keys:c,values:v,wantResults:f}).then(function(_){var g=_.numFailures,S=_.results,m=_.lastResult,_=_.failures;if(g===0)return f?S:m;throw new ot("".concat(s.name,".bulkAdd(): ").concat(g," of ").concat(b," operations failed"),_)})})},le.prototype.bulkPut=function(e,n,o){var s=this,c=Array.isArray(n)?n:void 0,f=(o=o||(c?void 0:n))?o.allKeys:void 0;return this._trans("readwrite",function(h){var v=s.schema.primKey,p=v.auto,v=v.keyPath;if(v&&c)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(c&&c.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");var b=e.length,v=v&&p?e.map(Jn(v)):e;return s.core.mutate({trans:h,type:"put",keys:c,values:v,wantResults:f}).then(function(_){var g=_.numFailures,S=_.results,m=_.lastResult,_=_.failures;if(g===0)return f?S:m;throw new ot("".concat(s.name,".bulkPut(): ").concat(g," of ").concat(b," operations failed"),_)})})},le.prototype.bulkUpdate=function(e){var n=this,o=this.core,s=e.map(function(h){return h.key}),c=e.map(function(h){return h.changes}),f=[];return this._trans("readwrite",function(h){return o.getMany({trans:h,keys:s,cache:"clone"}).then(function(p){var b=[],v=[];e.forEach(function(g,S){var m=g.key,_=g.changes,C=p[S];if(C){for(var w=0,O=Object.keys(_);w<O.length;w++){var k=O[w],I=_[k];if(k===n.schema.primKey.keyPath){if(ae(I,m)!==0)throw new H.Constraint("Cannot update primary key in bulkUpdate()")}else Pe(C,k,I)}f.push(S),b.push(m),v.push(C)}});var A=b.length;return o.mutate({trans:h,type:"put",keys:b,values:v,updates:{keys:s,changeSpecs:c}}).then(function(g){var S=g.numFailures,m=g.failures;if(S===0)return A;for(var _=0,C=Object.keys(m);_<C.length;_++){var w,O=C[_],k=f[Number(O)];k!=null&&(w=m[O],delete m[O],m[k]=w)}throw new ot("".concat(n.name,".bulkUpdate(): ").concat(S," of ").concat(A," operations failed"),m)})})})},le.prototype.bulkDelete=function(e){var n=this,o=e.length;return this._trans("readwrite",function(s){return n.core.mutate({trans:s,type:"delete",keys:e})}).then(function(h){var c=h.numFailures,f=h.lastResult,h=h.failures;if(c===0)return f;throw new ot("".concat(n.name,".bulkDelete(): ").concat(c," of ").concat(o," operations failed"),h)})},le);function le(){}function nn(e){function n(h,p){if(p){for(var b=arguments.length,v=new Array(b-1);--b;)v[b-1]=arguments[b];return o[h].subscribe.apply(null,v),e}if(typeof h=="string")return o[h]}var o={};n.addEventType=f;for(var s=1,c=arguments.length;s<c;++s)f(arguments[s]);return n;function f(h,p,b){if(typeof h!="object"){var v;p=p||Un;var A={subscribers:[],fire:b=b||ie,subscribe:function(g){A.subscribers.indexOf(g)===-1&&(A.subscribers.push(g),A.fire=p(A.fire,g))},unsubscribe:function(g){A.subscribers=A.subscribers.filter(function(S){return S!==g}),A.fire=A.subscribers.reduce(p,b)}};return o[h]=n[h]=A}d(v=h).forEach(function(g){var S=v[g];if(E(S))f(g,v[g][0],v[g][1]);else{if(S!=="asap")throw new H.InvalidArgument("Invalid event config");var m=f(g,at,function(){for(var _=arguments.length,C=new Array(_);_--;)C[_]=arguments[_];m.subscribers.forEach(function(w){Dn(function(){w.apply(null,C)})})})}})}}function rn(e,n){return we(n).from({prototype:e}),n}function Ft(e,n){return!(e.filter||e.algorithm||e.or)&&(n?e.justLimit:!e.replayFilter)}function Vr(e,n){e.filter=Ot(e.filter,n)}function $r(e,n,o){var s=e.replayFilter;e.replayFilter=s?function(){return Ot(s(),n())}:n,e.justLimit=o&&!s}function Zn(e,n){if(e.isPrimKey)return n.primaryKey;var o=n.getIndexByKeyPath(e.index);if(!o)throw new H.Schema("KeyPath "+e.index+" on object store "+n.name+" is not indexed");return o}function mo(e,n,o){var s=Zn(e,n.schema);return n.openCursor({trans:o,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:s,range:e.range}})}function er(e,n,o,s){var c=e.replayFilter?Ot(e.filter,e.replayFilter()):e.filter;if(e.or){var f={},h=function(p,b,v){var A,g;c&&!c(b,v,function(S){return b.stop(S)},function(S){return b.fail(S)})||((g=""+(A=b.primaryKey))=="[object ArrayBuffer]"&&(g=""+new Uint8Array(A)),V(f,g)||(f[g]=!0,n(p,b,v)))};return Promise.all([e.or._iterate(h,o),bo(mo(e,s,o),e.algorithm,h,!e.keysOnly&&e.valueMapper)])}return bo(mo(e,s,o),Ot(e.algorithm,c),n,!e.keysOnly&&e.valueMapper)}function bo(e,n,o,s){var c=de(s?function(f,h,p){return o(s(f),h,p)}:o);return e.then(function(f){if(f)return f.start(function(){var h=function(){return f.continue()};n&&!n(f,function(p){return h=p},function(p){f.stop(p),h=ie},function(p){f.fail(p),h=ie})||c(f.value,f,function(p){return h=p}),h()})})}var rt=Symbol(),Gr=(wo.prototype.execute=function(e){var n=(n=this.replacePrefix)===null||n===void 0?void 0:n[0];return n&&typeof e=="string"&&e.startsWith(n)?this.replacePrefix[1]+e.substring(n.length):e},wo);function wo(e){Object.assign(this,e)}var Du=(oe.prototype._read=function(e,n){var o=this._ctx;return o.error?o.table._trans(null,me.bind(null,o.error)):o.table._trans("readonly",e).then(n)},oe.prototype._write=function(e){var n=this._ctx;return n.error?n.table._trans(null,me.bind(null,n.error)):n.table._trans("readwrite",e,"locked")},oe.prototype._addAlgorithm=function(e){var n=this._ctx;n.algorithm=Ot(n.algorithm,e)},oe.prototype._iterate=function(e,n){return er(this._ctx,e,n,this._ctx.table.core)},oe.prototype.clone=function(e){var n=Object.create(this.constructor.prototype),o=Object.create(this._ctx);return e&&M(o,e),n._ctx=o,n},oe.prototype.raw=function(){return this._ctx.valueMapper=null,this},oe.prototype.each=function(e){var n=this._ctx;return this._read(function(o){return er(n,e,o,n.table.core)})},oe.prototype.count=function(e){var n=this;return this._read(function(o){var s=n._ctx,c=s.table.core;if(Ft(s,!0))return c.count({trans:o,query:{index:Zn(s,c.schema),range:s.range}}).then(function(h){return Math.min(h,s.limit)});var f=0;return er(s,function(){return++f,!1},o,c).then(function(){return f})}).then(e)},oe.prototype.sortBy=function(e,n){var o=e.split(".").reverse(),s=o[0],c=o.length-1;function f(b,v){return v?f(b[o[v]],v-1):b[s]}var h=this._ctx.dir==="next"?1:-1;function p(b,v){return b=f(b,c),v=f(v,c),b<v?-h:v<b?h:0}return this.toArray(function(b){return b.sort(p)}).then(n)},oe.prototype.toArray=function(e){var n=this;return this._read(function(o){var s=n._ctx;if(s.dir==="next"&&Ft(s,!0)&&0<s.limit){var c=s.valueMapper,f=Zn(s,s.table.core.schema);return s.table.core.query({trans:o,limit:s.limit,values:!0,query:{index:f,range:s.range}}).then(function(p){return p=p.result,c?p.map(c):p})}var h=[];return er(s,function(p){return h.push(p)},o,s.table.core).then(function(){return h})},e)},oe.prototype.offset=function(e){var n=this._ctx;return e<=0||(n.offset+=e,Ft(n)?$r(n,function(){var o=e;return function(s,c){return o===0||(o===1?--o:c(function(){s.advance(o),o=0}),!1)}}):$r(n,function(){var o=e;return function(){return--o<0}})),this},oe.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),$r(this._ctx,function(){var n=e;return function(o,s,c){return--n<=0&&s(c),0<=n}},!0),this},oe.prototype.until=function(e,n){return Vr(this._ctx,function(o,s,c){return!e(o.value)||(s(c),n)}),this},oe.prototype.first=function(e){return this.limit(1).toArray(function(n){return n[0]}).then(e)},oe.prototype.last=function(e){return this.reverse().first(e)},oe.prototype.filter=function(e){var n;return Vr(this._ctx,function(o){return e(o.value)}),(n=this._ctx).isMatch=Ot(n.isMatch,e),this},oe.prototype.and=function(e){return this.filter(e)},oe.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},oe.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},oe.prototype.desc=function(){return this.reverse()},oe.prototype.eachKey=function(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(o,s){e(s.key,s)})},oe.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},oe.prototype.eachPrimaryKey=function(e){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(o,s){e(s.primaryKey,s)})},oe.prototype.keys=function(e){var n=this._ctx;n.keysOnly=!n.isMatch;var o=[];return this.each(function(s,c){o.push(c.key)}).then(function(){return o}).then(e)},oe.prototype.primaryKeys=function(e){var n=this._ctx;if(n.dir==="next"&&Ft(n,!0)&&0<n.limit)return this._read(function(s){var c=Zn(n,n.table.core.schema);return n.table.core.query({trans:s,values:!1,limit:n.limit,query:{index:c,range:n.range}})}).then(function(s){return s.result}).then(e);n.keysOnly=!n.isMatch;var o=[];return this.each(function(s,c){o.push(c.primaryKey)}).then(function(){return o}).then(e)},oe.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},oe.prototype.firstKey=function(e){return this.limit(1).keys(function(n){return n[0]}).then(e)},oe.prototype.lastKey=function(e){return this.reverse().firstKey(e)},oe.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var n={};return Vr(this._ctx,function(c){var s=c.primaryKey.toString(),c=V(n,s);return n[s]=!0,!c}),this},oe.prototype.modify=function(e){var n=this,o=this._ctx;return this._write(function(s){var c,f,h;h=typeof e=="function"?e:(c=d(e),f=c.length,function(w){for(var O=!1,k=0;k<f;++k){var I=c[k],D=e[I],N=qe(w,I);D instanceof Gr?(Pe(w,I,D.execute(N)),O=!0):N!==D&&(Pe(w,I,D),O=!0)}return O});function p(w,I){var k=I.failures,I=I.numFailures;_+=w-I;for(var D=0,N=d(k);D<N.length;D++){var W=N[D];m.push(k[W])}}var b=o.table.core,v=b.schema.primaryKey,A=v.outbound,g=v.extractKey,S=n.db._options.modifyChunkSize||200,m=[],_=0,C=[];return n.clone().primaryKeys().then(function(w){function O(k){var I=Math.min(S,w.length-k);return b.getMany({trans:s,keys:w.slice(k,k+I),cache:"immutable"}).then(function(D){for(var N=[],W=[],F=A?[]:null,K=[],q=0;q<I;++q){var U=D[q],X={value:Ge(U),primKey:w[k+q]};h.call(X,X.value,X)!==!1&&(X.value==null?K.push(w[k+q]):A||ae(g(U),g(X.value))===0?(W.push(X.value),A&&F.push(w[k+q])):(K.push(w[k+q]),N.push(X.value)))}var ee=Ft(o)&&o.limit===1/0&&(typeof e!="function"||e===zr)&&{index:o.index,range:o.range};return Promise.resolve(0<N.length&&b.mutate({trans:s,type:"add",values:N}).then(function(re){for(var te in re.failures)K.splice(parseInt(te),1);p(N.length,re)})).then(function(){return(0<W.length||ee&&typeof e=="object")&&b.mutate({trans:s,type:"put",keys:F,values:W,criteria:ee,changeSpec:typeof e!="function"&&e}).then(function(re){return p(W.length,re)})}).then(function(){return(0<K.length||ee&&e===zr)&&b.mutate({trans:s,type:"delete",keys:K,criteria:ee}).then(function(re){return p(K.length,re)})}).then(function(){return w.length>k+I&&O(k+S)})})}return O(0).then(function(){if(0<m.length)throw new fe("Error modifying one or more objects",m,_,C);return w.length})})})},oe.prototype.delete=function(){var e=this._ctx,n=e.range;return Ft(e)&&(e.isPrimKey||n.type===3)?this._write(function(o){var s=e.table.core.schema.primaryKey,c=n;return e.table.core.count({trans:o,query:{index:s,range:c}}).then(function(f){return e.table.core.mutate({trans:o,type:"deleteRange",range:c}).then(function(h){var p=h.failures;if(h.lastResult,h.results,h=h.numFailures,h)throw new fe("Could not delete some values",Object.keys(p).map(function(b){return p[b]}),f-h);return f-h})})}):this.modify(zr)},oe);function oe(){}var zr=function(e,n){return n.value=null};function Mu(e,n){return e<n?-1:e===n?0:1}function Ru(e,n){return n<e?-1:e===n?0:1}function Le(e,n,o){return e=e instanceof Ao?new e.Collection(e):e,e._ctx.error=new(o||TypeError)(n),e}function Kt(e){return new e.Collection(e,function(){return _o("")}).limit(0)}function tr(e,n,o,s){var c,f,h,p,b,v,A,g=o.length;if(!o.every(function(_){return typeof _=="string"}))return Le(e,fo);function S(_){c=_==="next"?function(w){return w.toUpperCase()}:function(w){return w.toLowerCase()},f=_==="next"?function(w){return w.toLowerCase()}:function(w){return w.toUpperCase()},h=_==="next"?Mu:Ru;var C=o.map(function(w){return{lower:f(w),upper:c(w)}}).sort(function(w,O){return h(w.lower,O.lower)});p=C.map(function(w){return w.upper}),b=C.map(function(w){return w.lower}),A=(v=_)==="next"?"":s}S("next"),e=new e.Collection(e,function(){return ht(p[0],b[g-1]+s)}),e._ondirectionchange=function(_){S(_)};var m=0;return e._addAlgorithm(function(_,C,w){var O=_.key;if(typeof O!="string")return!1;var k=f(O);if(n(k,b,m))return!0;for(var I=null,D=m;D<g;++D){var N=function(W,F,K,q,U,X){for(var ee=Math.min(W.length,q.length),re=-1,te=0;te<ee;++te){var $e=F[te];if($e!==q[te])return U(W[te],K[te])<0?W.substr(0,te)+K[te]+K.substr(te+1):U(W[te],q[te])<0?W.substr(0,te)+q[te]+K.substr(te+1):0<=re?W.substr(0,re)+F[re]+K.substr(re+1):null;U(W[te],$e)<0&&(re=te)}return ee<q.length&&X==="next"?W+K.substr(W.length):ee<W.length&&X==="prev"?W.substr(0,K.length):re<0?null:W.substr(0,re)+q[re]+K.substr(re+1)}(O,k,p[D],b[D],h,v);N===null&&I===null?m=D+1:(I===null||0<h(I,N))&&(I=N)}return C(I!==null?function(){_.continue(I+A)}:w),!1}),e}function ht(e,n,o,s){return{type:2,lower:e,upper:n,lowerOpen:o,upperOpen:s}}function _o(e){return{type:1,lower:e,upper:e}}var Ao=(Object.defineProperty(Ae.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ae.prototype.between=function(e,n,o,s){o=o!==!1,s=s===!0;try{return 0<this._cmp(e,n)||this._cmp(e,n)===0&&(o||s)&&(!o||!s)?Kt(this):new this.Collection(this,function(){return ht(e,n,!o,!s)})}catch{return Le(this,nt)}},Ae.prototype.equals=function(e){return e==null?Le(this,nt):new this.Collection(this,function(){return _o(e)})},Ae.prototype.above=function(e){return e==null?Le(this,nt):new this.Collection(this,function(){return ht(e,void 0,!0)})},Ae.prototype.aboveOrEqual=function(e){return e==null?Le(this,nt):new this.Collection(this,function(){return ht(e,void 0,!1)})},Ae.prototype.below=function(e){return e==null?Le(this,nt):new this.Collection(this,function(){return ht(void 0,e,!1,!0)})},Ae.prototype.belowOrEqual=function(e){return e==null?Le(this,nt):new this.Collection(this,function(){return ht(void 0,e)})},Ae.prototype.startsWith=function(e){return typeof e!="string"?Le(this,fo):this.between(e,e+xt,!0,!0)},Ae.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):tr(this,function(n,o){return n.indexOf(o[0])===0},[e],xt)},Ae.prototype.equalsIgnoreCase=function(e){return tr(this,function(n,o){return n===o[0]},[e],"")},Ae.prototype.anyOfIgnoreCase=function(){var e=Ke.apply(et,arguments);return e.length===0?Kt(this):tr(this,function(n,o){return o.indexOf(n)!==-1},e,"")},Ae.prototype.startsWithAnyOfIgnoreCase=function(){var e=Ke.apply(et,arguments);return e.length===0?Kt(this):tr(this,function(n,o){return o.some(function(s){return n.indexOf(s)===0})},e,xt)},Ae.prototype.anyOf=function(){var e=this,n=Ke.apply(et,arguments),o=this._cmp;try{n.sort(o)}catch{return Le(this,nt)}if(n.length===0)return Kt(this);var s=new this.Collection(this,function(){return ht(n[0],n[n.length-1])});s._ondirectionchange=function(f){o=f==="next"?e._ascending:e._descending,n.sort(o)};var c=0;return s._addAlgorithm(function(f,h,p){for(var b=f.key;0<o(b,n[c]);)if(++c===n.length)return h(p),!1;return o(b,n[c])===0||(h(function(){f.continue(n[c])}),!1)}),s},Ae.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ae.prototype.noneOf=function(){var e=Ke.apply(et,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return Le(this,nt)}var n=e.reduce(function(o,s){return o?o.concat([[o[o.length-1][1],s]]):[[-1/0,s]]},null);return n.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},Ae.prototype.inAnyRange=function(O,n){var o=this,s=this._cmp,c=this._ascending,f=this._descending,h=this._min,p=this._max;if(O.length===0)return Kt(this);if(!O.every(function(k){return k[0]!==void 0&&k[1]!==void 0&&c(k[0],k[1])<=0}))return Le(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var b=!n||n.includeLowers!==!1,v=n&&n.includeUppers===!0,A,g=c;function S(k,I){return g(k[0],I[0])}try{(A=O.reduce(function(k,I){for(var D=0,N=k.length;D<N;++D){var W=k[D];if(s(I[0],W[1])<0&&0<s(I[1],W[0])){W[0]=h(W[0],I[0]),W[1]=p(W[1],I[1]);break}}return D===N&&k.push(I),k},[])).sort(S)}catch{return Le(this,nt)}var m=0,_=v?function(k){return 0<c(k,A[m][1])}:function(k){return 0<=c(k,A[m][1])},C=b?function(k){return 0<f(k,A[m][0])}:function(k){return 0<=f(k,A[m][0])},w=_,O=new this.Collection(this,function(){return ht(A[0][0],A[A.length-1][1],!b,!v)});return O._ondirectionchange=function(k){g=k==="next"?(w=_,c):(w=C,f),A.sort(S)},O._addAlgorithm(function(k,I,D){for(var N,W=k.key;w(W);)if(++m===A.length)return I(D),!1;return!_(N=W)&&!C(N)||(o._cmp(W,A[m][1])===0||o._cmp(W,A[m][0])===0||I(function(){g===c?k.continue(A[m][0]):k.continue(A[m][1])}),!1)}),O},Ae.prototype.startsWithAnyOf=function(){var e=Ke.apply(et,arguments);return e.every(function(n){return typeof n=="string"})?e.length===0?Kt(this):this.inAnyRange(e.map(function(n){return[n,n+xt]})):Le(this,"startsWithAnyOf() only works with strings")},Ae);function Ae(){}function He(e){return de(function(n){return on(n),e(n.target.error),!1})}function on(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var an="storagemutated",Hr="x-storagemutated-1",dt=nn(null,an),ju=(Ye.prototype._lock=function(){return vt(!L.global),++this._reculock,this._reculock!==1||L.global||(L.lockOwnerFor=this),this},Ye.prototype._unlock=function(){if(vt(!L.global),--this._reculock==0)for(L.global||(L.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ct(e[1],e[0])}catch{}}return this},Ye.prototype._locked=function(){return this._reculock&&L.lockOwnerFor!==this},Ye.prototype.create=function(e){var n=this;if(!this.mode)return this;var o=this.db.idbdb,s=this.db._state.dbOpenError;if(vt(!this.idbtrans),!e&&!o)switch(s&&s.name){case"DatabaseClosedError":throw new H.DatabaseClosed(s);case"MissingAPIError":throw new H.MissingAPI(s.message,s);default:throw new H.OpenFailed(s)}if(!this.active)throw new H.TransactionInactive;return vt(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||o).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=de(function(c){on(c),n._reject(e.error)}),e.onabort=de(function(c){on(c),n.active&&n._reject(new H.Abort(e.error)),n.active=!1,n.on("abort").fire(c)}),e.oncomplete=de(function(){n.active=!1,n._resolve(),"mutatedParts"in e&&dt.storagemutated.fire(e.mutatedParts)}),this},Ye.prototype._promise=function(e,n,o){var s=this;if(e==="readwrite"&&this.mode!=="readwrite")return me(new H.ReadOnly("Transaction is readonly"));if(!this.active)return me(new H.TransactionInactive);if(this._locked())return new T(function(f,h){s._blockedFuncs.push([function(){s._promise(e,n,o).then(f,h)},L])});if(o)return ct(function(){var f=new T(function(h,p){s._lock();var b=n(h,p,s);b&&b.then&&b.then(h,p)});return f.finally(function(){return s._unlock()}),f._lib=!0,f});var c=new T(function(f,h){var p=n(f,h,s);p&&p.then&&p.then(f,h)});return c._lib=!0,c},Ye.prototype._root=function(){return this.parent?this.parent._root():this},Ye.prototype.waitFor=function(e){var n,o=this._root(),s=T.resolve(e);o._waitingFor?o._waitingFor=o._waitingFor.then(function(){return s}):(o._waitingFor=s,o._waitingQueue=[],n=o.idbtrans.objectStore(o.storeNames[0]),function f(){for(++o._spinCount;o._waitingQueue.length;)o._waitingQueue.shift()();o._waitingFor&&(n.get(-1/0).onsuccess=f)}());var c=o._waitingFor;return new T(function(f,h){s.then(function(p){return o._waitingQueue.push(de(f.bind(null,p)))},function(p){return o._waitingQueue.push(de(h.bind(null,p)))}).finally(function(){o._waitingFor===c&&(o._waitingFor=null)})})},Ye.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new H.Abort))},Ye.prototype.table=function(e){var n=this._memoizedTables||(this._memoizedTables={});if(V(n,e))return n[e];var o=this.schema[e];if(!o)throw new H.NotFound("Table "+e+" not part of transaction");return o=new this.db.Table(e,o,this),o.core=this.db.core.table(e),n[e]=o},Ye);function Ye(){}function Yr(e,n,o,s,c,f,h){return{name:e,keyPath:n,unique:o,multi:s,auto:c,compound:f,src:(o&&!h?"&":"")+(s?"*":"")+(c?"++":"")+So(n)}}function So(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Qr(e,n,o){return{name:e,primKey:n,indexes:o,mappedClass:null,idxByName:(s=function(c){return[c.name,c]},o.reduce(function(c,f,h){return h=s(f,h),h&&(c[h[0]]=h[1]),c},{}))};var s}var sn=function(e){try{return e.only([[]]),sn=function(){return[[]]},[[]]}catch{return sn=function(){return xt},xt}};function Xr(e){return e==null?function(){}:typeof e=="string"?(n=e).split(".").length===1?function(o){return o[n]}:function(o){return qe(o,n)}:function(o){return qe(o,e)};var n}function Co(e){return[].slice.call(e)}var Nu=0;function un(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function Lu(e,n,b){function s(w){if(w.type===3)return null;if(w.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var m=w.lower,_=w.upper,C=w.lowerOpen,w=w.upperOpen;return m===void 0?_===void 0?null:n.upperBound(_,!!w):_===void 0?n.lowerBound(m,!!C):n.bound(m,_,!!C,!!w)}function c(S){var m,_=S.name;return{name:_,schema:S,mutate:function(C){var w=C.trans,O=C.type,k=C.keys,I=C.values,D=C.range;return new Promise(function(N,W){N=de(N);var F=w.objectStore(_),K=F.keyPath==null,q=O==="put"||O==="add";if(!q&&O!=="delete"&&O!=="deleteRange")throw new Error("Invalid operation type: "+O);var U,X=(k||I||{length:1}).length;if(k&&I&&k.length!==I.length)throw new Error("Given keys array must have same length as given values array.");if(X===0)return N({numFailures:0,failures:{},results:[],lastResult:void 0});function ee(ke){++$e,on(ke)}var re=[],te=[],$e=0;if(O==="deleteRange"){if(D.type===4)return N({numFailures:$e,failures:te,results:[],lastResult:void 0});D.type===3?re.push(U=F.clear()):re.push(U=F.delete(s(D)))}else{var K=q?K?[I,k]:[I,null]:[k,null],ne=K[0],xe=K[1];if(q)for(var Oe=0;Oe<X;++Oe)re.push(U=xe&&xe[Oe]!==void 0?F[O](ne[Oe],xe[Oe]):F[O](ne[Oe])),U.onerror=ee;else for(Oe=0;Oe<X;++Oe)re.push(U=F[O](ne[Oe])),U.onerror=ee}function pr(ke){ke=ke.target.result,re.forEach(function(kt,yi){return kt.error!=null&&(te[yi]=kt.error)}),N({numFailures:$e,failures:te,results:O==="delete"?k:re.map(function(kt){return kt.result}),lastResult:ke})}U.onerror=function(ke){ee(ke),pr(ke)},U.onsuccess=pr})},getMany:function(C){var w=C.trans,O=C.keys;return new Promise(function(k,I){k=de(k);for(var D,N=w.objectStore(_),W=O.length,F=new Array(W),K=0,q=0,U=function(re){re=re.target,F[re._pos]=re.result,++q===K&&k(F)},X=He(I),ee=0;ee<W;++ee)O[ee]!=null&&((D=N.get(O[ee]))._pos=ee,D.onsuccess=U,D.onerror=X,++K);K===0&&k(F)})},get:function(C){var w=C.trans,O=C.key;return new Promise(function(k,I){k=de(k);var D=w.objectStore(_).get(O);D.onsuccess=function(N){return k(N.target.result)},D.onerror=He(I)})},query:(m=v,function(C){return new Promise(function(w,O){w=de(w);var k,I,D,K=C.trans,N=C.values,W=C.limit,U=C.query,F=W===1/0?void 0:W,q=U.index,U=U.range,K=K.objectStore(_),q=q.isPrimaryKey?K:K.index(q.name),U=s(U);if(W===0)return w({result:[]});m?((F=N?q.getAll(U,F):q.getAllKeys(U,F)).onsuccess=function(X){return w({result:X.target.result})},F.onerror=He(O)):(k=0,I=!N&&"openKeyCursor"in q?q.openKeyCursor(U):q.openCursor(U),D=[],I.onsuccess=function(X){var ee=I.result;return ee?(D.push(N?ee.value:ee.primaryKey),++k===W?w({result:D}):void ee.continue()):w({result:D})},I.onerror=He(O))})}),openCursor:function(C){var w=C.trans,O=C.values,k=C.query,I=C.reverse,D=C.unique;return new Promise(function(N,W){N=de(N);var q=k.index,F=k.range,K=w.objectStore(_),K=q.isPrimaryKey?K:K.index(q.name),q=I?D?"prevunique":"prev":D?"nextunique":"next",U=!O&&"openKeyCursor"in K?K.openKeyCursor(s(F),q):K.openCursor(s(F),q);U.onerror=He(W),U.onsuccess=de(function(X){var ee,re,te,$e,ne=U.result;ne?(ne.___id=++Nu,ne.done=!1,ee=ne.continue.bind(ne),re=(re=ne.continuePrimaryKey)&&re.bind(ne),te=ne.advance.bind(ne),$e=function(){throw new Error("Cursor not stopped")},ne.trans=w,ne.stop=ne.continue=ne.continuePrimaryKey=ne.advance=function(){throw new Error("Cursor not started")},ne.fail=de(W),ne.next=function(){var xe=this,Oe=1;return this.start(function(){return Oe--?xe.continue():xe.stop()}).then(function(){return xe})},ne.start=function(xe){function Oe(){if(U.result)try{xe()}catch(ke){ne.fail(ke)}else ne.done=!0,ne.start=function(){throw new Error("Cursor behind last entry")},ne.stop()}var pr=new Promise(function(ke,kt){ke=de(ke),U.onerror=He(kt),ne.fail=kt,ne.stop=function(yi){ne.stop=ne.continue=ne.continuePrimaryKey=ne.advance=$e,ke(yi)}});return U.onsuccess=de(function(ke){U.onsuccess=Oe,Oe()}),ne.continue=ee,ne.continuePrimaryKey=re,ne.advance=te,Oe(),pr},N(ne)):N(null)},W)})},count:function(C){var w=C.query,O=C.trans,k=w.index,I=w.range;return new Promise(function(D,N){var W=O.objectStore(_),F=k.isPrimaryKey?W:W.index(k.name),W=s(I),F=W?F.count(W):F.count();F.onsuccess=de(function(K){return D(K.target.result)}),F.onerror=He(N)})}}}var f,h,p,A=(h=b,p=Co((f=e).objectStoreNames),{schema:{name:f.name,tables:p.map(function(S){return h.objectStore(S)}).map(function(S){var m=S.keyPath,w=S.autoIncrement,_=E(m),C={},w={name:S.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:m==null,compound:_,keyPath:m,autoIncrement:w,unique:!0,extractKey:Xr(m)},indexes:Co(S.indexNames).map(function(O){return S.index(O)}).map(function(D){var k=D.name,I=D.unique,N=D.multiEntry,D=D.keyPath,N={name:k,compound:E(D),keyPath:D,unique:I,multiEntry:N,extractKey:Xr(D)};return C[un(D)]=N}),getIndexByKeyPath:function(O){return C[un(O)]}};return C[":id"]=w.primaryKey,m!=null&&(C[un(m)]=w.primaryKey),w})},hasGetAll:0<p.length&&"getAll"in h.objectStore(p[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),b=A.schema,v=A.hasGetAll,A=b.tables.map(c),g={};return A.forEach(function(S){return g[S.name]=S}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(S){if(!g[S])throw new Error("Table '".concat(S,"' not found"));return g[S]},MIN_KEY:-1/0,MAX_KEY:sn(n),schema:b}}function Bu(e,n,o,s){var c=o.IDBKeyRange;return o.indexedDB,{dbcore:(s=Lu(n,c,s),e.dbcore.reduce(function(f,h){return h=h.create,a(a({},f),h(f))},s))}}function nr(e,s){var o=s.db,s=Bu(e._middlewares,o,e._deps,s);e.core=s.dbcore,e.tables.forEach(function(c){var f=c.name;e.core.schema.tables.some(function(h){return h.name===f})&&(c.core=e.core.table(f),e[f]instanceof e.Table&&(e[f].core=c.core))})}function rr(e,n,o,s){o.forEach(function(c){var f=s[c];n.forEach(function(h){var p=function b(v,A){return Ze(v,A)||(v=y(v))&&b(v,A)}(h,c);(!p||"value"in p&&p.value===void 0)&&(h===e.Transaction.prototype||h instanceof e.Transaction?ve(h,c,{get:function(){return this.table(c)},set:function(b){pe(this,c,{value:b,writable:!0,configurable:!0,enumerable:!0})}}):h[c]=new e.Table(c,f))})})}function Jr(e,n){n.forEach(function(o){for(var s in o)o[s]instanceof e.Table&&delete o[s]})}function Fu(e,n){return e._cfg.version-n._cfg.version}function Ku(e,n,o,s){var c=e._dbSchema;o.objectStoreNames.contains("$meta")&&!c.$meta&&(c.$meta=Qr("$meta",Oo("")[0],[]),e._storeNames.push("$meta"));var f=e._createTransaction("readwrite",e._storeNames,c);f.create(o),f._completion.catch(s);var h=f._reject.bind(f),p=L.transless||L;ct(function(){return L.trans=f,L.transless=p,n!==0?(nr(e,o),v=n,((b=f).storeNames.includes("$meta")?b.table("$meta").get("version").then(function(A){return A??v}):T.resolve(v)).then(function(A){return S=A,m=f,_=o,C=[],A=(g=e)._versions,w=g._dbSchema=or(0,g.idbdb,_),(A=A.filter(function(O){return O._cfg.version>=S})).length!==0?(A.forEach(function(O){C.push(function(){var k=w,I=O._cfg.dbschema;ar(g,k,_),ar(g,I,_),w=g._dbSchema=I;var D=Zr(k,I);D.add.forEach(function(q){ei(_,q[0],q[1].primKey,q[1].indexes)}),D.change.forEach(function(q){if(q.recreate)throw new H.Upgrade("Not yet support for changing primary key");var U=_.objectStore(q.name);q.add.forEach(function(X){return ir(U,X)}),q.change.forEach(function(X){U.deleteIndex(X.name),ir(U,X)}),q.del.forEach(function(X){return U.deleteIndex(X)})});var N=O._cfg.contentUpgrade;if(N&&O._cfg.version>S){nr(g,_),m._memoizedTables={};var W=Mn(I);D.del.forEach(function(q){W[q]=k[q]}),Jr(g,[g.Transaction.prototype]),rr(g,[g.Transaction.prototype],d(W),W),m.schema=W;var F,K=jt(N);return K&&Lt(),D=T.follow(function(){var q;(F=N(m))&&K&&(q=lt.bind(null,null),F.then(q,q))}),F&&typeof F.then=="function"?T.resolve(F):D.then(function(){return F})}}),C.push(function(k){var I,D,N=O._cfg.dbschema;I=N,D=k,[].slice.call(D.db.objectStoreNames).forEach(function(W){return I[W]==null&&D.db.deleteObjectStore(W)}),Jr(g,[g.Transaction.prototype]),rr(g,[g.Transaction.prototype],g._storeNames,g._dbSchema),m.schema=g._dbSchema}),C.push(function(k){g.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(g.idbdb.version/10)===O._cfg.version?(g.idbdb.deleteObjectStore("$meta"),delete g._dbSchema.$meta,g._storeNames=g._storeNames.filter(function(I){return I!=="$meta"})):k.objectStore("$meta").put(O._cfg.version,"version"))})}),function O(){return C.length?T.resolve(C.shift()(m.idbtrans)).then(O):T.resolve()}().then(function(){xo(w,_)})):T.resolve();var g,S,m,_,C,w}).catch(h)):(d(c).forEach(function(A){ei(o,A,c[A].primKey,c[A].indexes)}),nr(e,o),void T.follow(function(){return e.on.populate.fire(f)}).catch(h));var b,v})}function Wu(e,n){xo(e._dbSchema,n),n.db.version%10!=0||n.objectStoreNames.contains("$meta")||n.db.createObjectStore("$meta").add(Math.ceil(n.db.version/10-1),"version");var o=or(0,e.idbdb,n);ar(e,e._dbSchema,n);for(var s=0,c=Zr(o,e._dbSchema).change;s<c.length;s++){var f=function(h){if(h.change.length||h.recreate)return console.warn("Unable to patch indexes of table ".concat(h.name," because it has changes on the type of index or primary key.")),{value:void 0};var p=n.objectStore(h.name);h.add.forEach(function(b){De&&console.debug("Dexie upgrade patch: Creating missing index ".concat(h.name,".").concat(b.src)),ir(p,b)})}(c[s]);if(typeof f=="object")return f.value}}function Zr(e,n){var o,s={del:[],add:[],change:[]};for(o in e)n[o]||s.del.push(o);for(o in n){var c=e[o],f=n[o];if(c){var h={name:o,def:f,recreate:!1,del:[],add:[],change:[]};if(""+(c.primKey.keyPath||"")!=""+(f.primKey.keyPath||"")||c.primKey.auto!==f.primKey.auto)h.recreate=!0,s.change.push(h);else{var p=c.idxByName,b=f.idxByName,v=void 0;for(v in p)b[v]||h.del.push(v);for(v in b){var A=p[v],g=b[v];A?A.src!==g.src&&h.change.push(g):h.add.push(g)}(0<h.del.length||0<h.add.length||0<h.change.length)&&s.change.push(h)}}else s.add.push([o,f])}return s}function ei(e,n,o,s){var c=e.db.createObjectStore(n,o.keyPath?{keyPath:o.keyPath,autoIncrement:o.auto}:{autoIncrement:o.auto});return s.forEach(function(f){return ir(c,f)}),c}function xo(e,n){d(e).forEach(function(o){n.db.objectStoreNames.contains(o)||(De&&console.debug("Dexie: Creating missing table",o),ei(n,o,e[o].primKey,e[o].indexes))})}function ir(e,n){e.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function or(e,n,o){var s={};return Mt(n.objectStoreNames,0).forEach(function(c){for(var f=o.objectStore(c),h=Yr(So(v=f.keyPath),v||"",!0,!1,!!f.autoIncrement,v&&typeof v!="string",!0),p=[],b=0;b<f.indexNames.length;++b){var A=f.index(f.indexNames[b]),v=A.keyPath,A=Yr(A.name,v,!!A.unique,!!A.multiEntry,!1,v&&typeof v!="string",!1);p.push(A)}s[c]=Qr(c,h,p)}),s}function ar(e,n,o){for(var s=o.db.objectStoreNames,c=0;c<s.length;++c){var f=s[c],h=o.objectStore(f);e._hasGetAll="getAll"in h;for(var p=0;p<h.indexNames.length;++p){var b=h.indexNames[p],v=h.index(b).keyPath,A=typeof v=="string"?v:"["+Mt(v).join("+")+"]";!n[f]||(v=n[f].idxByName[A])&&(v.name=b,delete n[f].idxByName[A],n[f].idxByName[b]=v)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&l.WorkerGlobalScope&&l instanceof l.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function Oo(e){return e.split(",").map(function(n,o){var s=(n=n.trim()).replace(/([&*]|\+\+)/g,""),c=/^\[/.test(s)?s.match(/^\[(.*)\]$/)[1].split("+"):s;return Yr(s,c||null,/\&/.test(n),/\*/.test(n),/\+\+/.test(n),E(c),o===0)})}var qu=(sr.prototype._parseStoresSpec=function(e,n){d(e).forEach(function(o){if(e[o]!==null){var s=Oo(e[o]),c=s.shift();if(c.unique=!0,c.multi)throw new H.Schema("Primary key cannot be multi-valued");s.forEach(function(f){if(f.auto)throw new H.Schema("Only primary key can be marked as autoIncrement (++)");if(!f.keyPath)throw new H.Schema("Index must have a name and cannot be an empty string")}),n[o]=Qr(o,c,s)}})},sr.prototype.stores=function(o){var n=this.db;this._cfg.storesSource=this._cfg.storesSource?M(this._cfg.storesSource,o):o;var o=n._versions,s={},c={};return o.forEach(function(f){M(s,f._cfg.storesSource),c=f._cfg.dbschema={},f._parseStoresSpec(s,c)}),n._dbSchema=c,Jr(n,[n._allTables,n,n.Transaction.prototype]),rr(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],d(c),c),n._storeNames=d(c),this},sr.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Nt(this._cfg.contentUpgrade||ie,e),this},sr);function sr(){}function ti(e,n){var o=e._dbNamesDB;return o||(o=e._dbNamesDB=new it(Xn,{addons:[],indexedDB:e,IDBKeyRange:n})).version(1).stores({dbnames:"name"}),o.table("dbnames")}function ni(e){return e&&typeof e.databases=="function"}function ri(e){return ct(function(){return L.letThrough=!0,e()})}function ii(e){return!("from"in e)}var Ce=function(e,n){if(!this){var o=new Ce;return e&&"d"in e&&M(o,e),o}M(this,arguments.length?{d:1,from:e,to:1<arguments.length?n:e}:{d:0})};function cn(e,n,o){var s=ae(n,o);if(!isNaN(s)){if(0<s)throw RangeError();if(ii(e))return M(e,{from:n,to:o,d:1});var c=e.l,s=e.r;if(ae(o,e.from)<0)return c?cn(c,n,o):e.l={from:n,to:o,d:1,l:null,r:null},Eo(e);if(0<ae(n,e.to))return s?cn(s,n,o):e.r={from:n,to:o,d:1,l:null,r:null},Eo(e);ae(n,e.from)<0&&(e.from=n,e.l=null,e.d=s?s.d+1:1),0<ae(o,e.to)&&(e.to=o,e.r=null,e.d=e.l?e.l.d+1:1),o=!e.r,c&&!e.l&&ln(e,c),s&&o&&ln(e,s)}}function ln(e,n){ii(n)||function o(s,b){var f=b.from,h=b.to,p=b.l,b=b.r;cn(s,f,h),p&&o(s,p),b&&o(s,b)}(e,n)}function ur(e,n){var o=oi(n),s=o.next();if(s.done)return!1;for(var c=s.value,f=oi(e),h=f.next(c.from),p=h.value;!s.done&&!h.done;){if(ae(p.from,c.to)<=0&&0<=ae(p.to,c.from))return!0;ae(c.from,p.from)<0?c=(s=o.next(p.from)).value:p=(h=f.next(c.from)).value}return!1}function oi(e){var n=ii(e)?null:{s:0,n:e};return{next:function(o){for(var s=0<arguments.length;n;)switch(n.s){case 0:if(n.s=1,s)for(;n.n.l&&ae(o,n.n.from)<0;)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!s||ae(o,n.n.to)<=0)return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function Eo(e){var n,o,s=(((n=e.r)===null||n===void 0?void 0:n.d)||0)-(((o=e.l)===null||o===void 0?void 0:o.d)||0),c=1<s?"r":s<-1?"l":"";c&&(n=c=="r"?"l":"r",o=a({},e),s=e[c],e.from=s.from,e.to=s.to,e[c]=s[c],o[c]=s[n],(e[n]=o).d=Po(o)),e.d=Po(e)}function Po(o){var n=o.r,o=o.l;return(n?o?Math.max(n.d,o.d):n.d:o?o.d:0)+1}function cr(e,n){return d(n).forEach(function(o){e[o]?ln(e[o],n[o]):e[o]=function s(c){var f,h,p={};for(f in c)V(c,f)&&(h=c[f],p[f]=!h||typeof h!="object"||jn.has(h.constructor)?h:s(h));return p}(n[o])}),e}function ai(e,n){return e.all||n.all||Object.keys(e).some(function(o){return n[o]&&ur(n[o],e[o])})}Y(Ce.prototype,((We={add:function(e){return ln(this,e),this},addKey:function(e){return cn(this,e,e),this},addKeys:function(e){var n=this;return e.forEach(function(o){return cn(n,o,o)}),this}})[Rt]=function(){return oi(this)},We));var Et={},si={},ui=!1;function lr(e){cr(si,e),ui||(ui=!0,setTimeout(function(){ui=!1,ci(si,!(si={}))},0))}function ci(e,n){n===void 0&&(n=!1);var o=new Set;if(e.all)for(var s=0,c=Object.values(Et);s<c.length;s++)ko(h=c[s],e,o,n);else for(var f in e){var h,p=/^idb\:\/\/(.*)\/(.*)\//.exec(f);p&&(f=p[1],p=p[2],(h=Et["idb://".concat(f,"/").concat(p)])&&ko(h,e,o,n))}o.forEach(function(b){return b()})}function ko(e,n,o,s){for(var c=[],f=0,h=Object.entries(e.queries.query);f<h.length;f++){for(var p=h[f],b=p[0],v=[],A=0,g=p[1];A<g.length;A++){var S=g[A];ai(n,S.obsSet)?S.subscribers.forEach(function(w){return o.add(w)}):s&&v.push(S)}s&&c.push([b,v])}if(s)for(var m=0,_=c;m<_.length;m++){var C=_[m],b=C[0],v=C[1];e.queries.query[b]=v}}function Uu(e){var n=e._state,o=e._deps.indexedDB;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(function(){return n.dbOpenError?me(n.dbOpenError):e});n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;var s=n.openCanceller,c=Math.round(10*e.verno),f=!1;function h(){if(n.openCanceller!==s)throw new H.DatabaseClosed("db.open() was cancelled")}function p(){return new T(function(S,m){if(h(),!o)throw new H.MissingAPI;var _=e.name,C=n.autoSchema||!c?o.open(_):o.open(_,c);if(!C)throw new H.MissingAPI;C.onerror=He(m),C.onblocked=de(e._fireOnBlocked),C.onupgradeneeded=de(function(w){var O;A=C.transaction,n.autoSchema&&!e._options.allowEmptyDB?(C.onerror=on,A.abort(),C.result.close(),(O=o.deleteDatabase(_)).onsuccess=O.onerror=de(function(){m(new H.NoSuchDatabase("Database ".concat(_," doesnt exist")))})):(A.onerror=He(m),w=w.oldVersion>Math.pow(2,62)?0:w.oldVersion,g=w<1,e.idbdb=C.result,f&&Wu(e,A),Ku(e,w/10,A,m))},m),C.onsuccess=de(function(){A=null;var w,O,k,I,D,N=e.idbdb=C.result,W=Mt(N.objectStoreNames);if(0<W.length)try{var F=N.transaction((I=W).length===1?I[0]:I,"readonly");if(n.autoSchema)O=N,k=F,(w=e).verno=O.version/10,k=w._dbSchema=or(0,O,k),w._storeNames=Mt(O.objectStoreNames,0),rr(w,[w._allTables],d(k),k);else if(ar(e,e._dbSchema,F),((D=Zr(or(0,(D=e).idbdb,F),D._dbSchema)).add.length||D.change.some(function(K){return K.add.length||K.change.length}))&&!f)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."),N.close(),c=N.version+1,f=!0,S(p());nr(e,F)}catch{}Bt.push(e),N.onversionchange=de(function(K){n.vcFired=!0,e.on("versionchange").fire(K)}),N.onclose=de(function(K){e.on("close").fire(K)}),g&&(D=e._deps,F=_,N=D.indexedDB,D=D.IDBKeyRange,ni(N)||F===Xn||ti(N,D).put({name:F}).catch(ie)),S()},m)}).catch(function(S){switch(S?.name){case"UnknownError":if(0<n.PR1398_maxLoop)return n.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),p();break;case"VersionError":if(0<c)return c=0,p()}return T.reject(S)})}var b,v=n.dbReadyResolve,A=null,g=!1;return T.race([s,(typeof navigator>"u"?T.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(S){function m(){return indexedDB.databases().finally(S)}b=setInterval(m,100),m()}).finally(function(){return clearInterval(b)}):Promise.resolve()).then(p)]).then(function(){return h(),n.onReadyBeingFired=[],T.resolve(ri(function(){return e.on.ready.fire(e.vip)})).then(function S(){if(0<n.onReadyBeingFired.length){var m=n.onReadyBeingFired.reduce(Nt,ie);return n.onReadyBeingFired=[],T.resolve(ri(function(){return m(e.vip)})).then(S)}})}).finally(function(){n.openCanceller===s&&(n.onReadyBeingFired=null,n.isBeingOpened=!1)}).catch(function(S){n.dbOpenError=S;try{A&&A.abort()}catch{}return s===n.openCanceller&&e._close(),me(S)}).finally(function(){n.openComplete=!0,v()}).then(function(){var S;return g&&(S={},e.tables.forEach(function(m){m.schema.indexes.forEach(function(_){_.name&&(S["idb://".concat(e.name,"/").concat(m.name,"/").concat(_.name)]=new Ce(-1/0,[[[]]]))}),S["idb://".concat(e.name,"/").concat(m.name,"/")]=S["idb://".concat(e.name,"/").concat(m.name,"/:dels")]=new Ce(-1/0,[[[]]])}),dt(an).fire(S),ci(S,!0)),e})}function li(e){function n(f){return e.next(f)}var o=c(n),s=c(function(f){return e.throw(f)});function c(f){return function(b){var p=f(b),b=p.value;return p.done?b:b&&typeof b.then=="function"?b.then(o,s):E(b)?Promise.all(b).then(o,s):o(b)}}return c(n)()}function fr(e,n,o){for(var s=E(e)?e.slice():[e],c=0;c<o;++c)s.push(n);return s}var Vu={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return a(a({},e),{table:function(n){var o=e.table(n),s=o.schema,c={},f=[];function h(g,S,m){var _=un(g),C=c[_]=c[_]||[],w=g==null?0:typeof g=="string"?1:g.length,O=0<S,O=a(a({},m),{name:O?"".concat(_,"(virtual-from:").concat(m.name,")"):m.name,lowLevelIndex:m,isVirtual:O,keyTail:S,keyLength:w,extractKey:Xr(g),unique:!O&&m.unique});return C.push(O),O.isPrimaryKey||f.push(O),1<w&&h(w===2?g[0]:g.slice(0,w-1),S+1,m),C.sort(function(k,I){return k.keyTail-I.keyTail}),O}n=h(s.primaryKey.keyPath,0,s.primaryKey),c[":id"]=[n];for(var p=0,b=s.indexes;p<b.length;p++){var v=b[p];h(v.keyPath,0,v)}function A(g){var S,m=g.query.index;return m.isVirtual?a(a({},g),{query:{index:m.lowLevelIndex,range:(S=g.query.range,m=m.keyTail,{type:S.type===1?2:S.type,lower:fr(S.lower,S.lowerOpen?e.MAX_KEY:e.MIN_KEY,m),lowerOpen:!0,upper:fr(S.upper,S.upperOpen?e.MIN_KEY:e.MAX_KEY,m),upperOpen:!0})}}):g}return a(a({},o),{schema:a(a({},s),{primaryKey:n,indexes:f,getIndexByKeyPath:function(g){return(g=c[un(g)])&&g[0]}}),count:function(g){return o.count(A(g))},query:function(g){return o.query(A(g))},openCursor:function(g){var S=g.query.index,m=S.keyTail,_=S.isVirtual,C=S.keyLength;return _?o.openCursor(A(g)).then(function(O){return O&&w(O)}):o.openCursor(g);function w(O){return Object.create(O,{continue:{value:function(k){k!=null?O.continue(fr(k,g.reverse?e.MAX_KEY:e.MIN_KEY,m)):g.unique?O.continue(O.key.slice(0,C).concat(g.reverse?e.MIN_KEY:e.MAX_KEY,m)):O.continue()}},continuePrimaryKey:{value:function(k,I){O.continuePrimaryKey(fr(k,e.MAX_KEY,m),I)}},primaryKey:{get:function(){return O.primaryKey}},key:{get:function(){var k=O.key;return C===1?k[0]:k.slice(0,C)}},value:{get:function(){return O.value}}})}}})}})}};function fi(e,n,o,s){return o=o||{},s=s||"",d(e).forEach(function(c){var f,h,p;V(n,c)?(f=e[c],h=n[c],typeof f=="object"&&typeof h=="object"&&f&&h?(p=bt(f))!==bt(h)?o[s+c]=n[c]:p==="Object"?fi(f,h,o,s+c+"."):f!==h&&(o[s+c]=n[c]):f!==h&&(o[s+c]=n[c])):o[s+c]=void 0}),d(n).forEach(function(c){V(e,c)||(o[s+c]=n[c])}),o}function hi(e,n){return n.type==="delete"?n.keys:n.keys||n.values.map(e.extractKey)}var $u={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return a(a({},e),{table:function(n){var o=e.table(n),s=o.schema.primaryKey;return a(a({},o),{mutate:function(c){var f=L.trans,h=f.table(n).hook,p=h.deleting,b=h.creating,v=h.updating;switch(c.type){case"add":if(b.fire===ie)break;return f._promise("readwrite",function(){return A(c)},!0);case"put":if(b.fire===ie&&v.fire===ie)break;return f._promise("readwrite",function(){return A(c)},!0);case"delete":if(p.fire===ie)break;return f._promise("readwrite",function(){return A(c)},!0);case"deleteRange":if(p.fire===ie)break;return f._promise("readwrite",function(){return function g(S,m,_){return o.query({trans:S,values:!1,query:{index:s,range:m},limit:_}).then(function(C){var w=C.result;return A({type:"delete",keys:w,trans:S}).then(function(O){return 0<O.numFailures?Promise.reject(O.failures[0]):w.length<_?{failures:[],numFailures:0,lastResult:void 0}:g(S,a(a({},m),{lower:w[w.length-1],lowerOpen:!0}),_)})})}(c.trans,c.range,1e4)},!0)}return o.mutate(c);function A(g){var S,m,_,C=L.trans,w=g.keys||hi(s,g);if(!w)throw new Error("Keys missing");return(g=g.type==="add"||g.type==="put"?a(a({},g),{keys:w}):a({},g)).type!=="delete"&&(g.values=u([],g.values)),g.keys&&(g.keys=u([],g.keys)),S=o,_=w,((m=g).type==="add"?Promise.resolve([]):S.getMany({trans:m.trans,keys:_,cache:"immutable"})).then(function(O){var k=w.map(function(I,D){var N,W,F,K=O[D],q={onerror:null,onsuccess:null};return g.type==="delete"?p.fire.call(q,I,K,C):g.type==="add"||K===void 0?(N=b.fire.call(q,I,g.values[D],C),I==null&&N!=null&&(g.keys[D]=I=N,s.outbound||Pe(g.values[D],s.keyPath,I))):(N=fi(K,g.values[D]),(W=v.fire.call(q,N,I,K,C))&&(F=g.values[D],Object.keys(W).forEach(function(U){V(F,U)?F[U]=W[U]:Pe(F,U,W[U])}))),q});return o.mutate(g).then(function(I){for(var D=I.failures,N=I.results,W=I.numFailures,I=I.lastResult,F=0;F<w.length;++F){var K=(N||w)[F],q=k[F];K==null?q.onerror&&q.onerror(D[F]):q.onsuccess&&q.onsuccess(g.type==="put"&&O[F]?g.values[F]:K)}return{failures:D,results:N,numFailures:W,lastResult:I}}).catch(function(I){return k.forEach(function(D){return D.onerror&&D.onerror(I)}),Promise.reject(I)})})}}})}})}};function To(e,n,o){try{if(!n||n.keys.length<e.length)return null;for(var s=[],c=0,f=0;c<n.keys.length&&f<e.length;++c)ae(n.keys[c],e[f])===0&&(s.push(o?Ge(n.values[c]):n.values[c]),++f);return s.length===e.length?s:null}catch{return null}}var Gu={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var o=e.table(n);return a(a({},o),{getMany:function(s){if(!s.cache)return o.getMany(s);var c=To(s.keys,s.trans._cache,s.cache==="clone");return c?T.resolve(c):o.getMany(s).then(function(f){return s.trans._cache={keys:s.keys,values:s.cache==="clone"?Ge(f):f},f})},mutate:function(s){return s.type!=="add"&&(s.trans._cache=null),o.mutate(s)}})}}}};function Io(e,n){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!n.schema.primaryKey.outbound}function Do(e,n){switch(e){case"query":return n.values&&!n.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var zu={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,o=new Ce(e.MIN_KEY,e.MAX_KEY);return a(a({},e),{transaction:function(s,c,f){if(L.subscr&&c!=="readonly")throw new H.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(L.querier));return e.transaction(s,c,f)},table:function(s){var c=e.table(s),f=c.schema,h=f.primaryKey,g=f.indexes,p=h.extractKey,b=h.outbound,v=h.autoIncrement&&g.filter(function(m){return m.compound&&m.keyPath.includes(h.keyPath)}),A=a(a({},c),{mutate:function(m){function _(U){return U="idb://".concat(n,"/").concat(s,"/").concat(U),I[U]||(I[U]=new Ce)}var C,w,O,k=m.trans,I=m.mutatedParts||(m.mutatedParts={}),D=_(""),N=_(":dels"),W=m.type,q=m.type==="deleteRange"?[m.range]:m.type==="delete"?[m.keys]:m.values.length<50?[hi(h,m).filter(function(U){return U}),m.values]:[],F=q[0],K=q[1],q=m.trans._cache;return E(F)?(D.addKeys(F),(q=W==="delete"||F.length===K.length?To(F,q):null)||N.addKeys(F),(q||K)&&(C=_,w=q,O=K,f.indexes.forEach(function(U){var X=C(U.name||"");function ee(te){return te!=null?U.extractKey(te):null}function re(te){return U.multiEntry&&E(te)?te.forEach(function($e){return X.addKey($e)}):X.addKey(te)}(w||O).forEach(function(te,xe){var ne=w&&ee(w[xe]),xe=O&&ee(O[xe]);ae(ne,xe)!==0&&(ne!=null&&re(ne),xe!=null&&re(xe))})}))):F?(K={from:F.lower,to:F.upper},N.add(K),D.add(K)):(D.add(o),N.add(o),f.indexes.forEach(function(U){return _(U.name).add(o)})),c.mutate(m).then(function(U){return!F||m.type!=="add"&&m.type!=="put"||(D.addKeys(U.results),v&&v.forEach(function(X){var ee=m.values.map(function(te){return X.extractKey(te)}),re=X.keyPath.findIndex(function(te){return te===h.keyPath});U.results.forEach(function(te){return ee[re]=te}),_(X.name).addKeys(ee)})),k.mutatedParts=cr(k.mutatedParts||{},I),U})}}),g=function(_){var C=_.query,_=C.index,C=C.range;return[_,new Ce((_=C.lower)!==null&&_!==void 0?_:e.MIN_KEY,(C=C.upper)!==null&&C!==void 0?C:e.MAX_KEY)]},S={get:function(m){return[h,new Ce(m.key)]},getMany:function(m){return[h,new Ce().addKeys(m.keys)]},count:g,query:g,openCursor:g};return d(S).forEach(function(m){A[m]=function(_){var C=L.subscr,w=!!C,O=Io(L,c)&&Do(m,_)?_.obsSet={}:C;if(w){var k=function(K){return K="idb://".concat(n,"/").concat(s,"/").concat(K),O[K]||(O[K]=new Ce)},I=k(""),D=k(":dels"),C=S[m](_),w=C[0],C=C[1];if((m==="query"&&w.isPrimaryKey&&!_.values?D:k(w.name||"")).add(C),!w.isPrimaryKey){if(m!=="count"){var N=m==="query"&&b&&_.values&&c.query(a(a({},_),{values:!1}));return c[m].apply(this,arguments).then(function(K){if(m==="query"){if(b&&_.values)return N.then(function(ee){return ee=ee.result,I.addKeys(ee),K});var q=_.values?K.result.map(p):K.result;(_.values?I:D).addKeys(q)}else if(m==="openCursor"){var U=K,X=_.values;return U&&Object.create(U,{key:{get:function(){return D.addKey(U.primaryKey),U.key}},primaryKey:{get:function(){var ee=U.primaryKey;return D.addKey(ee),ee}},value:{get:function(){return X&&I.addKey(U.primaryKey),U.value}}})}return K})}D.add(o)}}return c[m].apply(this,arguments)}}),A}})}};function Mo(e,n,o){if(o.numFailures===0)return n;if(n.type==="deleteRange")return null;var s=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return o.numFailures===s?null:(n=a({},n),E(n.keys)&&(n.keys=n.keys.filter(function(c,f){return!(f in o.failures)})),"values"in n&&E(n.values)&&(n.values=n.values.filter(function(c,f){return!(f in o.failures)})),n)}function di(e,n){return o=e,((s=n).lower===void 0||(s.lowerOpen?0<ae(o,s.lower):0<=ae(o,s.lower)))&&(e=e,(n=n).upper===void 0||(n.upperOpen?ae(e,n.upper)<0:ae(e,n.upper)<=0));var o,s}function Ro(e,n,S,s,c,f){if(!S||S.length===0)return e;var h=n.query.index,p=h.multiEntry,b=n.query.range,v=s.schema.primaryKey.extractKey,A=h.extractKey,g=(h.lowLevelIndex||h).extractKey,S=S.reduce(function(m,_){var C=m,w=_.type==="add"||_.type==="put"?_.values.filter(function(D){return D=A(D),p&&E(D)?D.some(function(N){return di(N,b)}):di(D,b)}).map(function(D){return D=Ge(D),f&&Object.freeze(D),D}):[];switch(_.type){case"add":C=m.concat(n.values?w:w.map(function(N){return v(N)}));break;case"put":var O=new Ce().addKeys(_.values.map(function(N){return v(N)})),C=m.filter(function(N){return N=n.values?v(N):N,!ur(new Ce(N),O)}).concat(n.values?w:w.map(function(N){return v(N)}));break;case"delete":var k=new Ce().addKeys(_.keys);C=m.filter(function(N){return N=n.values?v(N):N,!ur(new Ce(N),k)});break;case"deleteRange":var I=_.range;C=m.filter(function(N){return!di(v(N),I)})}return C},e);return S===e?e:(S.sort(function(m,_){return ae(g(m),g(_))||ae(v(m),v(_))}),n.limit&&n.limit<1/0&&(S.length>n.limit?S.length=n.limit:e.length===n.limit&&S.length<n.limit&&(c.dirty=!0)),f?Object.freeze(S):S)}function jo(e,n){return ae(e.lower,n.lower)===0&&ae(e.upper,n.upper)===0&&!!e.lowerOpen==!!n.lowerOpen&&!!e.upperOpen==!!n.upperOpen}function Hu(e,n){return function(o,s,c,f){if(o===void 0)return s!==void 0?-1:0;if(s===void 0)return 1;if((s=ae(o,s))===0){if(c&&f)return 0;if(c)return 1;if(f)return-1}return s}(e.lower,n.lower,e.lowerOpen,n.lowerOpen)<=0&&0<=function(o,s,c,f){if(o===void 0)return s!==void 0?1:0;if(s===void 0)return-1;if((s=ae(o,s))===0){if(c&&f)return 0;if(c)return-1;if(f)return 1}return s}(e.upper,n.upper,e.upperOpen,n.upperOpen)}function Yu(e,n,o,s){e.subscribers.add(o),s.addEventListener("abort",function(){var c,f;e.subscribers.delete(o),e.subscribers.size===0&&(c=e,f=n,setTimeout(function(){c.subscribers.size===0&&ze(f,c)},3e3))})}var Qu={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return a(a({},e),{transaction:function(o,s,c){var f,h,p=e.transaction(o,s,c);return s==="readwrite"&&(h=(f=new AbortController).signal,c=function(b){return function(){if(f.abort(),s==="readwrite"){for(var v=new Set,A=0,g=o;A<g.length;A++){var S=g[A],m=Et["idb://".concat(n,"/").concat(S)];if(m){var _=e.table(S),C=m.optimisticOps.filter(function(X){return X.trans===p});if(p._explicit&&b&&p.mutatedParts)for(var w=0,O=Object.values(m.queries.query);w<O.length;w++)for(var k=0,I=(W=O[w]).slice();k<I.length;k++)ai((F=I[k]).obsSet,p.mutatedParts)&&(ze(W,F),F.subscribers.forEach(function(X){return v.add(X)}));else if(0<C.length){m.optimisticOps=m.optimisticOps.filter(function(X){return X.trans!==p});for(var D=0,N=Object.values(m.queries.query);D<N.length;D++)for(var W,F,K,q=0,U=(W=N[D]).slice();q<U.length;q++)(F=U[q]).res!=null&&p.mutatedParts&&(b&&!F.dirty?(K=Object.isFrozen(F.res),K=Ro(F.res,F.req,C,_,F,K),F.dirty?(ze(W,F),F.subscribers.forEach(function(X){return v.add(X)})):K!==F.res&&(F.res=K,F.promise=T.resolve({result:K}))):(F.dirty&&ze(W,F),F.subscribers.forEach(function(X){return v.add(X)})))}}}v.forEach(function(X){return X()})}}},p.addEventListener("abort",c(!1),{signal:h}),p.addEventListener("error",c(!1),{signal:h}),p.addEventListener("complete",c(!0),{signal:h})),p},table:function(o){var s=e.table(o),c=s.schema.primaryKey;return a(a({},s),{mutate:function(f){var h=L.trans;if(c.outbound||h.db._options.cache==="disabled"||h.explicit)return s.mutate(f);var p=Et["idb://".concat(n,"/").concat(o)];return p?(h=s.mutate(f),f.type!=="add"&&f.type!=="put"||!(50<=f.values.length||hi(c,f).some(function(b){return b==null}))?(p.optimisticOps.push(f),f.mutatedParts&&lr(f.mutatedParts),h.then(function(b){0<b.numFailures&&(ze(p.optimisticOps,f),(b=Mo(0,f,b))&&p.optimisticOps.push(b),f.mutatedParts&&lr(f.mutatedParts))}),h.catch(function(){ze(p.optimisticOps,f),f.mutatedParts&&lr(f.mutatedParts)})):h.then(function(b){var v=Mo(0,a(a({},f),{values:f.values.map(function(m,g){var S,m=(S=c.keyPath)!==null&&S!==void 0&&S.includes(".")?Ge(m):a({},m);return Pe(m,c.keyPath,b.results[g]),m})}),b);p.optimisticOps.push(v),queueMicrotask(function(){return f.mutatedParts&&lr(f.mutatedParts)})}),h):s.mutate(f)},query:function(f){if(!Io(L,s)||!Do("query",f))return s.query(f);var h=((v=L.trans)===null||v===void 0?void 0:v.db._options.cache)==="immutable",g=L,p=g.requery,b=g.signal,v=function(_,C,w,O){var k=Et["idb://".concat(_,"/").concat(C)];if(!k)return[];if(!(C=k.queries[w]))return[null,!1,k,null];var I=C[(O.query?O.query.index.name:null)||""];if(!I)return[null,!1,k,null];switch(w){case"query":var D=I.find(function(N){return N.req.limit===O.limit&&N.req.values===O.values&&jo(N.req.query.range,O.query.range)});return D?[D,!0,k,I]:[I.find(function(N){return("limit"in N.req?N.req.limit:1/0)>=O.limit&&(!O.values||N.req.values)&&Hu(N.req.query.range,O.query.range)}),!1,k,I];case"count":return D=I.find(function(N){return jo(N.req.query.range,O.query.range)}),[D,!!D,k,I]}}(n,o,"query",f),A=v[0],g=v[1],S=v[2],m=v[3];return A&&g?A.obsSet=f.obsSet:(g=s.query(f).then(function(_){var C=_.result;if(A&&(A.res=C),h){for(var w=0,O=C.length;w<O;++w)Object.freeze(C[w]);Object.freeze(C)}else _.result=Ge(C);return _}).catch(function(_){return m&&A&&ze(m,A),Promise.reject(_)}),A={obsSet:f.obsSet,promise:g,subscribers:new Set,type:"query",req:f,dirty:!1},m?m.push(A):(m=[A],(S=S||(Et["idb://".concat(n,"/").concat(o)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[f.query.index.name||""]=m)),Yu(A,m,p,b),A.promise.then(function(_){return{result:Ro(_.result,f,S?.optimisticOps,s,A,h)}})}})}})}};function hr(e,n){return new Proxy(e,{get:function(o,s,c){return s==="db"?n:Reflect.get(o,s,c)}})}var it=(be.prototype.version=function(e){if(isNaN(e)||e<.1)throw new H.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new H.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var n=this._versions,o=n.filter(function(s){return s._cfg.version===e})[0];return o||(o=new this.Version(e),n.push(o),n.sort(Fu),o.stores({}),this._state.autoSchema=!1,o)},be.prototype._whenReady=function(e){var n=this;return this.idbdb&&(this._state.openComplete||L.letThrough||this._vip)?e():new T(function(o,s){if(n._state.openComplete)return s(new H.DatabaseClosed(n._state.dbOpenError));if(!n._state.isBeingOpened){if(!n._state.autoOpen)return void s(new H.DatabaseClosed);n.open().catch(ie)}n._state.dbReadyPromise.then(o,s)}).then(e)},be.prototype.use=function(e){var n=e.stack,o=e.create,s=e.level,c=e.name;return c&&this.unuse({stack:n,name:c}),e=this._middlewares[n]||(this._middlewares[n]=[]),e.push({stack:n,create:o,level:s??10,name:c}),e.sort(function(f,h){return f.level-h.level}),this},be.prototype.unuse=function(e){var n=e.stack,o=e.name,s=e.create;return n&&this._middlewares[n]&&(this._middlewares[n]=this._middlewares[n].filter(function(c){return s?c.create!==s:!!o&&c.name!==o})),this},be.prototype.open=function(){var e=this;return Ct(B,function(){return Uu(e)})},be.prototype._close=function(){var e=this._state,n=Bt.indexOf(this);if(0<=n&&Bt.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new T(function(o){e.dbReadyResolve=o}),e.openCanceller=new T(function(o,s){e.cancelOpen=s}))},be.prototype.close=function(o){var n=(o===void 0?{disableAutoOpen:!0}:o).disableAutoOpen,o=this._state;n?(o.isBeingOpened&&o.cancelOpen(new H.DatabaseClosed),this._close(),o.autoOpen=!1,o.dbOpenError=new H.DatabaseClosed):(this._close(),o.autoOpen=this._options.autoOpen||o.isBeingOpened,o.openComplete=!1,o.dbOpenError=null)},be.prototype.delete=function(e){var n=this;e===void 0&&(e={disableAutoOpen:!0});var o=0<arguments.length&&typeof arguments[0]!="object",s=this._state;return new T(function(c,f){function h(){n.close(e);var p=n._deps.indexedDB.deleteDatabase(n.name);p.onsuccess=de(function(){var b,v,A;b=n._deps,v=n.name,A=b.indexedDB,b=b.IDBKeyRange,ni(A)||v===Xn||ti(A,b).delete(v).catch(ie),c()}),p.onerror=He(f),p.onblocked=n._fireOnBlocked}if(o)throw new H.InvalidArgument("Invalid closeOptions argument to db.delete()");s.isBeingOpened?s.dbReadyPromise.then(h):h()})},be.prototype.backendDB=function(){return this.idbdb},be.prototype.isOpen=function(){return this.idbdb!==null},be.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},be.prototype.hasFailed=function(){return this._state.dbOpenError!==null},be.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(be.prototype,"tables",{get:function(){var e=this;return d(this._allTables).map(function(n){return e._allTables[n]})},enumerable:!1,configurable:!0}),be.prototype.transaction=function(){var e=function(n,o,s){var c=arguments.length;if(c<2)throw new H.InvalidArgument("Too few arguments");for(var f=new Array(c-1);--c;)f[c-1]=arguments[c];return s=f.pop(),[n,Rn(f),s]}.apply(this,arguments);return this._transaction.apply(this,e)},be.prototype._transaction=function(e,n,o){var s=this,c=L.trans;c&&c.db===this&&e.indexOf("!")===-1||(c=null);var f,h,p=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(h=n.map(function(v){if(v=v instanceof s.Table?v.name:v,typeof v!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return v}),e=="r"||e===qr)f=qr;else{if(e!="rw"&&e!=Ur)throw new H.InvalidArgument("Invalid transaction mode: "+e);f=Ur}if(c){if(c.mode===qr&&f===Ur){if(!p)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");c=null}c&&h.forEach(function(v){if(c&&c.storeNames.indexOf(v)===-1){if(!p)throw new H.SubTransaction("Table "+v+" not included in parent transaction.");c=null}}),p&&c&&!c.active&&(c=null)}}catch(v){return c?c._promise(null,function(A,g){g(v)}):me(v)}var b=function v(A,g,S,m,_){return T.resolve().then(function(){var C=L.transless||L,w=A._createTransaction(g,S,A._dbSchema,m);if(w.explicit=!0,C={trans:w,transless:C},m)w.idbtrans=m.idbtrans;else try{w.create(),w.idbtrans._explicit=!0,A._state.PR1398_maxLoop=3}catch(I){return I.name===Jt.InvalidState&&A.isOpen()&&0<--A._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),A.close({disableAutoOpen:!1}),A.open().then(function(){return v(A,g,S,null,_)})):me(I)}var O,k=jt(_);return k&&Lt(),C=T.follow(function(){var I;(O=_.call(w,w))&&(k?(I=lt.bind(null,null),O.then(I,I)):typeof O.next=="function"&&typeof O.throw=="function"&&(O=li(O)))},C),(O&&typeof O.then=="function"?T.resolve(O).then(function(I){return w.active?I:me(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):C.then(function(){return O})).then(function(I){return m&&w._resolve(),w._completion.then(function(){return I})}).catch(function(I){return w._reject(I),me(I)})})}.bind(null,this,f,h,c,o);return c?c._promise(f,b,"lock"):L.trans?Ct(L.transless,function(){return s._whenReady(b)}):this._whenReady(b)},be.prototype.table=function(e){if(!V(this._allTables,e))throw new H.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},be);function be(e,n){var o=this;this._middlewares={},this.verno=0;var s=be.dependencies;this._options=n=a({addons:be.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},s=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var c,f,h,p,b,v={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ie,dbReadyPromise:null,cancelOpen:ie,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};v.dbReadyPromise=new T(function(g){v.dbReadyResolve=g}),v.openCanceller=new T(function(g,S){v.cancelOpen=S}),this._state=v,this.name=e,this.on=nn(this,"populate","blocked","versionchange","close",{ready:[Nt,ie]}),this.on.ready.subscribe=In(this.on.ready.subscribe,function(g){return function(S,m){be.vip(function(){var _,C=o._state;C.openComplete?(C.dbOpenError||T.resolve().then(S),m&&g(S)):C.onReadyBeingFired?(C.onReadyBeingFired.push(S),m&&g(S)):(g(S),_=o,m||g(function w(){_.on.ready.unsubscribe(S),_.on.ready.unsubscribe(w)}))})}}),this.Collection=(c=this,rn(Du.prototype,function(O,w){this.db=c;var m=ho,_=null;if(w)try{m=w()}catch(k){_=k}var C=O._ctx,w=C.table,O=w.hook.reading.fire;this._ctx={table:w,index:C.index,isPrimKey:!C.index||w.schema.primKey.keyPath&&C.index===w.schema.primKey.name,range:m,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:_,or:C.or,valueMapper:O!==at?O:null}})),this.Table=(f=this,rn(vo.prototype,function(g,S,m){this.db=f,this._tx=m,this.name=g,this.schema=S,this.hook=f._allTables[g]?f._allTables[g].hook:nn(null,{creating:[Kn,ie],reading:[Kr,at],updating:[qn,ie],deleting:[Wn,ie]})})),this.Transaction=(h=this,rn(ju.prototype,function(g,S,m,_,C){var w=this;this.db=h,this.mode=g,this.storeNames=S,this.schema=m,this.chromeTransactionDurability=_,this.idbtrans=null,this.on=nn(this,"complete","error","abort"),this.parent=C||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 T(function(O,k){w._resolve=O,w._reject=k}),this._completion.then(function(){w.active=!1,w.on.complete.fire()},function(O){var k=w.active;return w.active=!1,w.on.error.fire(O),w.parent?w.parent._reject(O):k&&w.idbtrans&&w.idbtrans.abort(),me(O)})})),this.Version=(p=this,rn(qu.prototype,function(g){this.db=p,this._cfg={version:g,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(b=this,rn(Ao.prototype,function(g,S,m){if(this.db=b,this._ctx={table:g,index:S===":id"?null:S,or:m},this._cmp=this._ascending=ae,this._descending=function(_,C){return ae(C,_)},this._max=function(_,C){return 0<ae(_,C)?_:C},this._min=function(_,C){return ae(_,C)<0?_:C},this._IDBKeyRange=b._deps.IDBKeyRange,!this._IDBKeyRange)throw new H.MissingAPI})),this.on("versionchange",function(g){0<g.newVersion?console.warn("Another connection wants to upgrade database '".concat(o.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(o.name,"'. Closing db now to resume the delete request.")),o.close({disableAutoOpen:!1})}),this.on("blocked",function(g){!g.newVersion||g.newVersion<g.oldVersion?console.warn("Dexie.delete('".concat(o.name,"') was blocked")):console.warn("Upgrade '".concat(o.name,"' blocked by other connection holding version ").concat(g.oldVersion/10))}),this._maxKey=sn(n.IDBKeyRange),this._createTransaction=function(g,S,m,_){return new o.Transaction(g,S,m,o._options.chromeTransactionDurability,_)},this._fireOnBlocked=function(g){o.on("blocked").fire(g),Bt.filter(function(S){return S.name===o.name&&S!==o&&!S._state.vcFired}).map(function(S){return S.on("versionchange").fire(g)})},this.use(Gu),this.use(Qu),this.use(zu),this.use(Vu),this.use($u);var A=new Proxy(this,{get:function(g,S,m){if(S==="_vip")return!0;if(S==="table")return function(C){return hr(o.table(C),A)};var _=Reflect.get(g,S,m);return _ instanceof vo?hr(_,A):S==="tables"?_.map(function(C){return hr(C,A)}):S==="_createTransaction"?function(){return hr(_.apply(this,arguments),A)}:_}});this.vip=A,s.forEach(function(g){return g(o)})}var dr,We=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Xu=(pi.prototype.subscribe=function(e,n,o){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:n,complete:o})},pi.prototype[We]=function(){return this},pi);function pi(e){this._subscribe=e}try{dr={indexedDB:l.indexedDB||l.mozIndexedDB||l.webkitIndexedDB||l.msIndexedDB,IDBKeyRange:l.IDBKeyRange||l.webkitIDBKeyRange}}catch{dr={indexedDB:null,IDBKeyRange:null}}function No(e){var n,o=!1,s=new Xu(function(c){var f=jt(e),h,p=!1,b={},v={},A={get closed(){return p},unsubscribe:function(){p||(p=!0,h&&h.abort(),g&&dt.storagemutated.unsubscribe(m))}};c.start&&c.start(A);var g=!1,S=function(){return Wr(_)},m=function(C){cr(b,C),ai(v,b)&&S()},_=function(){var C,w,O;!p&&dr.indexedDB&&(b={},C={},h&&h.abort(),h=new AbortController,O=function(k){var I=tt();try{f&&Lt();var D=ct(e,k);return D=f?D.finally(lt):D}finally{I&&ut()}}(w={subscr:C,signal:h.signal,requery:S,querier:e,trans:null}),Promise.resolve(O).then(function(k){o=!0,n=k,p||w.signal.aborted||(b={},function(I){for(var D in I)if(V(I,D))return;return 1}(v=C)||g||(dt(an,m),g=!0),Wr(function(){return!p&&c.next&&c.next(k)}))},function(k){o=!1,["DatabaseClosedError","AbortError"].includes(k?.name)||p||Wr(function(){p||c.error&&c.error(k)})}))};return setTimeout(S,0),A});return s.hasValue=function(){return o},s.getValue=function(){return n},s}var Pt=it;function gi(e){var n=pt;try{pt=!0,dt.storagemutated.fire(e),ci(e,!0)}finally{pt=n}}Y(Pt,a(a({},wt),{delete:function(e){return new Pt(e,{addons:[]}).delete()},exists:function(e){return new Pt(e,{addons:[]}).open().then(function(n){return n.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return n=Pt.dependencies,o=n.indexedDB,n=n.IDBKeyRange,(ni(o)?Promise.resolve(o.databases()).then(function(s){return s.map(function(c){return c.name}).filter(function(c){return c!==Xn})}):ti(o,n).toCollection().primaryKeys()).then(e)}catch{return me(new H.MissingAPI)}var n,o},defineClass:function(){return function(e){M(this,e)}},ignoreTransaction:function(e){return L.trans?Ct(L.transless,e):e()},vip:ri,async:function(e){return function(){try{var n=li(e.apply(this,arguments));return n&&typeof n.then=="function"?n:T.resolve(n)}catch(o){return me(o)}}},spawn:function(e,n,o){try{var s=li(e.apply(o,n||[]));return s&&typeof s.then=="function"?s:T.resolve(s)}catch(c){return me(c)}},currentTransaction:{get:function(){return L.trans||null}},waitFor:function(e,n){return n=T.resolve(typeof e=="function"?Pt.ignoreTransaction(e):e).timeout(n||6e4),L.trans?L.trans.waitFor(n):n},Promise:T,debug:{get:function(){return De},set:function(e){Vn(e)}},derive:we,extend:M,props:Y,override:In,Events:nn,on:dt,liveQuery:No,extendObservabilitySet:cr,getByKeyPath:qe,setByKeyPath:Pe,delByKeyPath:function(e,n){typeof n=="string"?Pe(e,n,void 0):"length"in n&&[].map.call(n,function(o){Pe(e,o,void 0)})},shallowClone:Mn,deepClone:Ge,getObjectDiff:fi,cmp:ae,asap:Dn,minKey:-1/0,addons:[],connections:Bt,errnames:Jt,dependencies:dr,cache:Et,semVer:"4.0.4",version:"4.0.4".split(".").map(function(e){return parseInt(e)}).reduce(function(e,n,o){return e+n/Math.pow(10,2*o)})})),Pt.maxKey=sn(Pt.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(dt(an,function(e){pt||(e=new CustomEvent(Hr,{detail:e}),pt=!0,dispatchEvent(e),pt=!1)}),addEventListener(Hr,function(e){e=e.detail,pt||gi(e)}));var Wt,pt=!1,Lo=function(){};return typeof BroadcastChannel<"u"&&((Lo=function(){(Wt=new BroadcastChannel(Hr)).onmessage=function(e){return e.data&&gi(e.data)}})(),typeof Wt.unref=="function"&&Wt.unref(),dt(an,function(e){pt||Wt.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!it.disableBfCache&&e.persisted){De&&console.debug("Dexie: handling persisted pagehide"),Wt?.close();for(var n=0,o=Bt;n<o.length;n++)o[n].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!it.disableBfCache&&e.persisted&&(De&&console.debug("Dexie: handling persisted pageshow"),Lo(),gi({all:new Ce(-1/0,[[]])}))})),T.rejectionMapper=function(e,n){return!e||e instanceof Re||e instanceof TypeError||e instanceof SyntaxError||!e.name||!je[e.name]?e:(n=new je[e.name](n||e.message,e),"stack"in e&&ve(n,"stack",{get:function(){return this.inner.stack}}),n)},Vn(De),a(it,Object.freeze({__proto__:null,Dexie:it,liveQuery:No,Entity:po,cmp:ae,PropModSymbol:rt,PropModification:Gr,replacePrefix:function(e,n){return new Gr({replacePrefix:[e,n]})},default:it,RangeSet:Ce,mergeRanges:ln,rangesOverlap:ur}),{default:it}),it})})(ao);var gu=ao.exports,Rr=Ps(gu);const so=Symbol.for("Dexie"),jr=globalThis[so]||(globalThis[so]=Rr);if(Rr.semVer!==jr.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Rr.semVer} and ${jr.semVer}`);/**
|
|
142
|
-
* See the LICENSE file distributed with this work for additional
|
|
143
|
-
* information regarding copyright ownership.
|
|
144
|
-
*
|
|
145
|
-
* This is free software; you can redistribute it and/or modify it
|
|
146
|
-
* under the terms of the GNU Affero General Public License as
|
|
147
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
148
|
-
* the License, or (at your option) any later version.
|
|
149
|
-
*
|
|
150
|
-
* This software is distributed in the hope that it will be useful,
|
|
151
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
152
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
153
|
-
* Lesser General Public License for more details.
|
|
154
|
-
*
|
|
155
|
-
* You should have received a copy of the GNU Affero General Public
|
|
156
|
-
* License along with this software; if not, write to the Free
|
|
157
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
158
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
159
|
-
*
|
|
160
|
-
* This file is part of the Cristal Wiki software prototype
|
|
161
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
162
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
163
|
-
*
|
|
164
|
-
**/class yu extends jr{constructor(t){super("pages_"+t),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var vu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,bu=(r,t,i,a)=>{for(var u=a>1?void 0:a?mu(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&vu(t,i,u),u},wu=(r,t)=>(i,a)=>t(i,a,r);let Nr=class{constructor(r){this.pageStorageMap=new Map,this.logger=r,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(r){let t=this.pageStorageMap.get(r);return t==null&&(t=new yu(r),this.pageStorageMap.set(r,t)),t}async getPage(r,t){try{this.logger.debug("Ready to load page from local storage",t);const i=this.getPageStorage(r);this.logger.debug("pageStorage is ready, asking for page");const a=await i.pages.get(t),u=new Qt;return u.fromObject(a),u}catch(i){this.logger.debug("Exception while trying to read from local storage",i);return}}async savePage(r,t,i){try{await this.getPageStorage(r).pages.put(i.toObject(),t)}catch(a){this.logger.debug("Exception while trying to store in local storage",r,t,i,a)}}async updatePage(r,t,i){try{const a=this.getPageStorage(r);this.logger.debug("Ready to store",i),await a.pages.update(t,i.toObject())}catch(a){this.logger.debug("Exception while trying to store in local storage",r,t,i,a)}}};Nr=bu([Ie(),wu(0,Ee("Logger"))],Nr);/**
|
|
165
|
-
* See the LICENSE file distributed with this work for additional
|
|
166
|
-
* information regarding copyright ownership.
|
|
167
|
-
*
|
|
168
|
-
* This is free software; you can redistribute it and/or modify it
|
|
169
|
-
* under the terms of the GNU Affero General Public License as
|
|
170
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
171
|
-
* the License, or (at your option) any later version.
|
|
172
|
-
*
|
|
173
|
-
* This software is distributed in the hope that it will be useful,
|
|
174
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
175
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
176
|
-
* Lesser General Public License for more details.
|
|
177
|
-
*
|
|
178
|
-
* You should have received a copy of the GNU Affero General Public
|
|
179
|
-
* License along with this software; if not, write to the Free
|
|
180
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
181
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
182
|
-
*
|
|
183
|
-
* This file is part of the Cristal Wiki software prototype
|
|
184
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
185
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
186
|
-
*
|
|
187
|
-
**/class _u{constructor(t){this.logger=t.get("Logger"),this.logger.setModule("storage.components.componentsInit"),this.logger?.debug("Init Sample Module components begin"),t.bind("OfflineStorage").to(Nr).inSingletonScope(),t.bind("WrappingStorage").to(Mr).inSingletonScope(),t.bind("WikiConfig").to(kr).whenTargetNamed("XWiki"),t.bind("WikiConfig").to(Ir).whenTargetNamed("GitHub"),t.bind("Storage").to(Pr).whenTargetNamed("XWiki"),t.bind("Storage").to(Tr).whenTargetNamed("GitHub"),this.logger?.debug("Init Sample Module components end")}}var Au=Object.defineProperty,Su=Object.getOwnPropertyDescriptor,Cu=(r,t,i,a)=>{for(var u=a>1?void 0:a?Su(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&Au(t,i,u),u};let Lr=class{constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(r){this.container=r}getWikiConfig(){return this.wikiConfig}setWikiConfig(r){this.wikiConfig=r}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(r){console.log(r),r.forEach((t,i)=>{const a=t?.configType;if(t){const u=this.container.getNamed("WikiConfig",a);u.setConfigFromObject(t),this.availableConfigurations.set(i,u)}})}getAvailableConfigurations(){return this.availableConfigurations}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(){throw new Error("Method not implemented.")}getLoggerConfig(){throw new Error("Method not implemented.")}renderContent(){throw new Error("Method not implemented.")}};Lr=Cu([Ie()],Lr);var xu=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,Eu=(r,t,i,a)=>{for(var u=a>1?void 0:a?Ou(t,i):t,l=r.length-1,d;l>=0;l--)(d=r[l])&&(u=(a?d(t,i,u):d(u))||u);return a&&u&&xu(t,i,u),u};let Br=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};Br=Eu([Ie()],Br);/**
|
|
188
|
-
* See the LICENSE file distributed with this work for additional
|
|
189
|
-
* information regarding copyright ownership.
|
|
190
|
-
*
|
|
191
|
-
* This is free software; you can redistribute it and/or modify it
|
|
192
|
-
* under the terms of the GNU Affero General Public License as
|
|
193
|
-
* published by the Free Software Foundation; either version 2.1 of
|
|
194
|
-
* the License, or (at your option) any later version.
|
|
195
|
-
*
|
|
196
|
-
* This software is distributed in the hope that it will be useful,
|
|
197
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
198
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
199
|
-
* Lesser General Public License for more details.
|
|
200
|
-
*
|
|
201
|
-
* You should have received a copy of the GNU Affero General Public
|
|
202
|
-
* License along with this software; if not, write to the Free
|
|
203
|
-
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
204
|
-
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
205
|
-
*
|
|
206
|
-
* This file is part of the Cristal Wiki software prototype
|
|
207
|
-
* @copyright Copyright (c) 2023 XWiki SAS
|
|
208
|
-
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
209
|
-
*
|
|
210
|
-
**/class Pu{constructor(){this.currentNumber=0,this.queue=[],this.initialized=!1}async start(){for(console.log("Starting worker thread"),this.initialize();;)await this.sleep(1e3),this.checkQueue()}setPageLoadedCallback(t){this.fct=t}sleep(t){return new Promise(i=>setTimeout(i,t))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const i=this.queue.pop();i&&await this.handleQueueItem(i),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(t){console.log("Handling queue item code ready to process",t);try{let i=null,a=null,u=null;const l=t.indexOf(":"),d=t.lastIndexOf("_");if(l!=-1&&d!=-1){i=t.substring(0,l),a=t.substring(l+1,d),u=t.substring(d+1);const E=this.getWikiConfig(i);E==null?console.log("Could not find config for page",t):(console.log("Updating page ",a,u),await E.storage.updatePageContent(a,u)&&(console.log("Page updated. Calling back to main thread"),this.fct(t)))}else console.log("Could not process page",t)}catch(i){console.log("Exception while trying to load",t,i)}}add(t){return console.log("Worker in add"),this.currentNumber+=t,this.currentNumber}addToQueue(t){console.log("Worker in addToQueue",t),this.queue.includes(t)||this.queue.push(t)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(t){const i=this.configMap.get(t);if(i==null){console.error("Failed to find wikiConfig for configName",t);return}const u=new Map(Object.entries(i)).get("configType");console.log("Looking for wikiConfig for name",t,"and type",u);let l;try{return l=this.container.getNamed("WikiConfig",u),this.cristal.setWikiConfig(l),l.setConfigFromObject(i),l.initialize(),console.debug("Found wikiConfig for",t,"and type",u,":",l),l}catch(d){console.error("Failed to find wikiConfig for name",t,"and type",u,d);return}}async initialize(){console.log("Starting initialize");const t=["storage"],a=await(await fetch("/config.json")).json();this.configMap=new Map(Object.entries(a)),console.log("Loaded json config",this.configMap);const u=new zs(t);u.initializeContainer(),this.container=u.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(Lr).inSingletonScope(),this.container.bind("QueueWorker").to(Br).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new _u(u.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const uo=new Pu;uo.start(),onconnect=r=>{yr(uo,r.ports[0])},console.log("Worker code loaded")})();
|
|
211
|
-
//# sourceMappingURL=worker-CybHddrE.js.map
|