@trintel/zooy 1.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +471 -0
- package/dist/chunks/16-30f5E9no.js +1 -0
- package/dist/chunks/16-41wFkj7S.js +1 -0
- package/dist/chunks/16-4Ffg4DOO.js +1 -0
- package/dist/chunks/16-8pr5mbIO.js +28 -0
- package/dist/chunks/16-B56B50XT.js +1 -0
- package/dist/chunks/16-BFJN6B6d.js +39 -0
- package/dist/chunks/16-BTonF5Je.js +29 -0
- package/dist/chunks/16-BiShwKPX.js +28 -0
- package/dist/chunks/16-BwDdccyH.js +33 -0
- package/dist/chunks/16-C7Xs-wKv.js +1 -0
- package/dist/chunks/16-CDRTWf-C.js +21 -0
- package/dist/chunks/16-CSWwhDUY.js +21 -0
- package/dist/chunks/16-ChlL35BX.js +62 -0
- package/dist/chunks/16-CpNRIuiB.js +1 -0
- package/dist/chunks/16-CqC9427V.js +21 -0
- package/dist/chunks/16-Cubm18Em.js +1 -0
- package/dist/chunks/16-D3Ol0pdg.js +21 -0
- package/dist/chunks/16-DH311Of_.js +1 -0
- package/dist/chunks/16-Dlq3qxDh.js +1 -0
- package/dist/chunks/16-Drl9-5Gn.js +21 -0
- package/dist/chunks/16-Dt4v0bcc.js +1 -0
- package/dist/chunks/16-DylBiJnm.js +1 -0
- package/dist/chunks/20-CZPIOG-A.js +84 -0
- package/dist/chunks/20-gmyNFvDv.js +1 -0
- package/dist/chunks/button-DdJepOoE.js +271 -0
- package/dist/chunks/button-skeleton-COf2kCDL.js +48 -0
- package/dist/chunks/button-skeleton-rf3WDPTZ.js +21 -0
- package/dist/chunks/button-zHEPxpXa.js +66 -0
- package/dist/chunks/carbon-element-CbfPUYRT.js +1 -0
- package/dist/chunks/carbon-element-DzDuXiyl.js +25 -0
- package/dist/chunks/checkbox-B5mHvx0J.js +200 -0
- package/dist/chunks/checkbox-BRPCg-DN.js +40 -0
- package/dist/chunks/class-map-BfNAkUL_.js +5 -0
- package/dist/chunks/class-map-DEHG4tmw.js +32 -0
- package/dist/chunks/collection-helpers-BwUB2CEz.js +8 -0
- package/dist/chunks/collection-helpers-CYLIiyii.js +1 -0
- package/dist/chunks/content-switcher-item-DeGjVRQY.js +350 -0
- package/dist/chunks/content-switcher-item-DucclV1b.js +27 -0
- package/dist/chunks/defs-DMmigODC.js +1077 -0
- package/dist/chunks/defs-DPD20sPK.js +1 -0
- package/dist/chunks/directive-Dp4ZTz-F.js +5 -0
- package/dist/chunks/directive-kLG6oqUu.js +27 -0
- package/dist/chunks/dropdown-item-BgLQ1VLo.js +69 -0
- package/dist/chunks/dropdown-item-DPdwOION.js +620 -0
- package/dist/chunks/focus-B9JYe97T.js +20 -0
- package/dist/chunks/focus-rQSNiwy7.js +1 -0
- package/dist/chunks/form-D6Tce4-W.js +1 -0
- package/dist/chunks/form-DpI-v6DA.js +20 -0
- package/dist/chunks/host-listener-CN245INl.js +37 -0
- package/dist/chunks/host-listener-DD3oGxvg.js +16 -0
- package/dist/chunks/host-listener-gxrTpxgv.js +1 -0
- package/dist/chunks/host-listener-rUcT_LUW.js +1 -0
- package/dist/chunks/icon-loader-Dk_AU26w.js +7 -0
- package/dist/chunks/icon-loader-o_JYDmJX.js +1 -0
- package/dist/chunks/icon-loader-utils-BBjK16O-.js +5 -0
- package/dist/chunks/icon-loader-utils-BEOGXn0q.js +117 -0
- package/dist/chunks/if-defined-BdZRLDJ6.js +5 -0
- package/dist/chunks/if-defined-C0yJsxi2.js +10 -0
- package/dist/chunks/if-non-empty-CEHK-hqx.js +1 -0
- package/dist/chunks/if-non-empty-DTGflHtA.js +5 -0
- package/dist/chunks/index-16wphaSo.js +4 -0
- package/dist/chunks/index-27oFQaOS.js +37 -0
- package/dist/chunks/index-45EApaFs.js +205 -0
- package/dist/chunks/index-5jmZyISW.js +1 -0
- package/dist/chunks/index-B1vQ44Hl.js +363 -0
- package/dist/chunks/index-B3CDjjXh.js +214 -0
- package/dist/chunks/index-B3mXrMt1.js +24 -0
- package/dist/chunks/index-B7mGUQhz.js +79 -0
- package/dist/chunks/index-BBNaYDog.js +22 -0
- package/dist/chunks/index-BBt9OmO5.js +12 -0
- package/dist/chunks/index-BIaF1Dfx.js +107 -0
- package/dist/chunks/index-BJAuRs3y.js +75 -0
- package/dist/chunks/index-BJKftWYn.js +89 -0
- package/dist/chunks/index-BLjNrhkN.js +4 -0
- package/dist/chunks/index-BOTu9u-3.js +86 -0
- package/dist/chunks/index-BPVpH8ll.js +160 -0
- package/dist/chunks/index-BRuvyoCz.js +15 -0
- package/dist/chunks/index-BSgHSOVT.js +65 -0
- package/dist/chunks/index-BSh7UYcP.js +9 -0
- package/dist/chunks/index-BUxB7aWd.js +96 -0
- package/dist/chunks/index-BXIxcS00.js +22 -0
- package/dist/chunks/index-BXczHDk-.js +187 -0
- package/dist/chunks/index-BaVyBv2V.js +25 -0
- package/dist/chunks/index-BgbqX0uv.js +234 -0
- package/dist/chunks/index-BjQlt8g2.js +451 -0
- package/dist/chunks/index-BoNLj7PW.js +44 -0
- package/dist/chunks/index-BwIoRMDI.js +24 -0
- package/dist/chunks/index-Bwix1iwB.js +38 -0
- package/dist/chunks/index-BxVW3p3I.js +258 -0
- package/dist/chunks/index-ByKyGGzb.js +3 -0
- package/dist/chunks/index-ByTSSU1x.js +1 -0
- package/dist/chunks/index-C8LyfVmf.js +428 -0
- package/dist/chunks/index-CBbsFlsv.js +290 -0
- package/dist/chunks/index-CByffhPq.js +762 -0
- package/dist/chunks/index-CIbRjtWm.js +32 -0
- package/dist/chunks/index-CIzeMGQv.js +81 -0
- package/dist/chunks/index-CLGxSjLW.js +62 -0
- package/dist/chunks/index-CMF5Cawn.js +70 -0
- package/dist/chunks/index-CO-A2KY9.js +562 -0
- package/dist/chunks/index-CONgwvp0.js +12 -0
- package/dist/chunks/index-CT43RMOu.js +20 -0
- package/dist/chunks/index-CUgiXqyk.js +4 -0
- package/dist/chunks/index-C_K070Kn.js +284 -0
- package/dist/chunks/index-C_ttE2g9.js +16 -0
- package/dist/chunks/index-CcgnA1uu.js +29 -0
- package/dist/chunks/index-Cd7aoWrX.js +336 -0
- package/dist/chunks/index-Ce-pMzBC.js +19 -0
- package/dist/chunks/index-CgYZ66P_.js +187 -0
- package/dist/chunks/index-ChcHMeAS.js +35 -0
- package/dist/chunks/index-Cixdzvwd.js +682 -0
- package/dist/chunks/index-Clq0Fl19.js +15 -0
- package/dist/chunks/index-CtxTJnIm.js +58 -0
- package/dist/chunks/index-Cv1hWa_y.js +242 -0
- package/dist/chunks/index-CzTjJ8lP.js +432 -0
- package/dist/chunks/index-D0xRAPD5.js +75 -0
- package/dist/chunks/index-D25buhRm.js +79 -0
- package/dist/chunks/index-D4DqJG5_.js +16 -0
- package/dist/chunks/index-D5GGFPcS.js +251 -0
- package/dist/chunks/index-D5kiHJpX.js +413 -0
- package/dist/chunks/index-DEjRiv5B.js +1 -0
- package/dist/chunks/index-DFA4_spk.js +160 -0
- package/dist/chunks/index-DFZsXFsx.js +19 -0
- package/dist/chunks/index-DGauWNwV.js +156 -0
- package/dist/chunks/index-DIR0jr3f.js +127 -0
- package/dist/chunks/index-DNeagy5a.js +65 -0
- package/dist/chunks/index-DO0fmDR9.js +2 -0
- package/dist/chunks/index-DSitHBEh.js +36 -0
- package/dist/chunks/index-DW7ST0tB.js +1 -0
- package/dist/chunks/index-DWfFgEXE.js +110 -0
- package/dist/chunks/index-DX6WAtmo.js +874 -0
- package/dist/chunks/index-DaPfSuLu.js +393 -0
- package/dist/chunks/index-DbKlVm7y.js +74 -0
- package/dist/chunks/index-DdNZTQw1.js +48 -0
- package/dist/chunks/index-Dgi-m1K-.js +1 -0
- package/dist/chunks/index-Dh4uigJs.js +454 -0
- package/dist/chunks/index-DnYNK1mz.js +8 -0
- package/dist/chunks/index-DnierBep.js +510 -0
- package/dist/chunks/index-DnpSGM23.js +213 -0
- package/dist/chunks/index-DntY4deR.js +41 -0
- package/dist/chunks/index-Dp4A8k6C.js +103 -0
- package/dist/chunks/index-Dphpk5r2.js +1 -0
- package/dist/chunks/index-DrBrgF-v.js +49 -0
- package/dist/chunks/index-Dr_cqQ-_.js +77 -0
- package/dist/chunks/index-Dt-nBtrQ.js +26 -0
- package/dist/chunks/index-DurPWBYc.js +24 -0
- package/dist/chunks/index-DwTj7cFr.js +57 -0
- package/dist/chunks/index-DyZVAYLv.js +52 -0
- package/dist/chunks/index-Hh597Yu6.js +121 -0
- package/dist/chunks/index-LxkAuMAA.js +1 -0
- package/dist/chunks/index-OaQhvPR1.js +46 -0
- package/dist/chunks/index-UPr2EvBX.js +149 -0
- package/dist/chunks/index-WNXgzThF.js +2340 -0
- package/dist/chunks/index-WvrCPen2.js +367 -0
- package/dist/chunks/index-cTXIVcWI.js +45 -0
- package/dist/chunks/index-caLn8cu1.js +1603 -0
- package/dist/chunks/index-hLI0Bnyb.js +77 -0
- package/dist/chunks/index-jBse-XgU.js +35 -0
- package/dist/chunks/index-oTjafsfN.js +25 -0
- package/dist/chunks/index-qNmuI3RB.js +149 -0
- package/dist/chunks/index-qiqzy9MI.js +23 -0
- package/dist/chunks/index-rwBsdvh6.js +87 -0
- package/dist/chunks/index-siqJUhKa.js +1 -0
- package/dist/chunks/index-w-G9CFId.js +1 -0
- package/dist/chunks/index-x6SeA7x7.js +405 -0
- package/dist/chunks/loading-icon-DJQIjg97.js +23 -0
- package/dist/chunks/loading-icon-DhJR6LyV.js +16 -0
- package/dist/chunks/main-DUusfqrI.js +18 -0
- package/dist/chunks/main-Dp7wHHgP.js +2882 -0
- package/dist/chunks/on-BPhwbVf3.js +10 -0
- package/dist/chunks/on-XRofyGQh.js +1 -0
- package/dist/chunks/property-DCYiZTFF.js +5 -0
- package/dist/chunks/property-pT1z5CCa.js +36 -0
- package/dist/chunks/query-CbRg6ZGy.js +23 -0
- package/dist/chunks/query-Dh8joWcT.js +9 -0
- package/dist/chunks/radio-group-manager-DBAEmhDM.js +1 -0
- package/dist/chunks/radio-group-manager-Du5wSOS1.js +102 -0
- package/dist/chunks/register-BK21_Wkj.js +11035 -0
- package/dist/chunks/register-BMNs2hNG.js +2157 -0
- package/dist/chunks/register-Cc9zkA5F.js +1 -0
- package/dist/chunks/register-JwwMwdRf.js +1273 -0
- package/dist/chunks/search-C3raqgOD.js +30 -0
- package/dist/chunks/search-CIhxkVjj.js +239 -0
- package/dist/chunks/select-item-4aISXm0r.js +76 -0
- package/dist/chunks/select-item-DjoxYopL.js +356 -0
- package/dist/chunks/settings-BPOpwVkr.js +594 -0
- package/dist/chunks/settings-CK2vhfPu.js +78 -0
- package/dist/chunks/shared-enums-BJDDuJr7.js +1 -0
- package/dist/chunks/shared-enums-DALKjQ7e.js +7 -0
- package/dist/chunks/state-Bpmgn27B.js +12 -0
- package/dist/chunks/state-FnSmMH94.js +5 -0
- package/dist/chunks/text-input-BygzMjjc.js +371 -0
- package/dist/chunks/text-input-cjcnMXO-.js +68 -0
- package/dist/chunks/tooltip-content-BjdZJ_Ui.js +134 -0
- package/dist/chunks/tooltip-content-DHyDYyOH.js +3 -0
- package/dist/chunks/tslib.es6-B07k2eac.js +1 -0
- package/dist/chunks/tslib.es6-C5gLNDSD.js +160 -0
- package/dist/chunks/unsafe-html-C_MKAcuC.js +5 -0
- package/dist/chunks/unsafe-html-D49sIpJ5.js +27 -0
- package/dist/chunks/validity-BMLNCMmP.js +1 -0
- package/dist/chunks/validity-CTz7ivUd.js +59 -0
- package/dist/zooy.cjs.js +1 -0
- package/dist/zooy.es.js +4 -0
- package/package.json +57 -0
- package/src/sass/carbon-icons.scss +46 -0
- package/src/sass/main.scss +7 -0
- package/src/sass/panels.scss +642 -0
- package/src/sass/reset.scss +43 -0
- package/src/sass/split.scss +131 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { p as c, x as s } from "./settings-BPOpwVkr.js";
|
|
2
|
+
var o = ({ description: r, small: e }) => {
|
|
3
|
+
const i = e ? "42" : "44";
|
|
4
|
+
return s`
|
|
5
|
+
<svg class="${c}--loading__svg" viewBox="0 0 100 100">
|
|
6
|
+
${r ? s` <title>${r}</title> ` : void 0}
|
|
7
|
+
<circle
|
|
8
|
+
?hidden="${!e}"
|
|
9
|
+
class="${c}--loading__background"
|
|
10
|
+
cx="50%"
|
|
11
|
+
cy="50%"
|
|
12
|
+
r="${i}" />
|
|
13
|
+
<circle
|
|
14
|
+
class="${c}--loading__stroke"
|
|
15
|
+
cx="50%"
|
|
16
|
+
cy="50%"
|
|
17
|
+
r="${i}" />
|
|
18
|
+
</svg>
|
|
19
|
+
`;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
o as g
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";const e=require("./settings-CK2vhfPu.js");var s=({description:i,small:c})=>{const r=c?"42":"44";return e.x`
|
|
2
|
+
<svg class="${e.prefix}--loading__svg" viewBox="0 0 100 100">
|
|
3
|
+
${i?e.x` <title>${i}</title> `:void 0}
|
|
4
|
+
<circle
|
|
5
|
+
?hidden="${!c}"
|
|
6
|
+
class="${e.prefix}--loading__background"
|
|
7
|
+
cx="50%"
|
|
8
|
+
cy="50%"
|
|
9
|
+
r="${r}" />
|
|
10
|
+
<circle
|
|
11
|
+
class="${e.prefix}--loading__stroke"
|
|
12
|
+
cx="50%"
|
|
13
|
+
cy="50%"
|
|
14
|
+
r="${r}" />
|
|
15
|
+
</svg>
|
|
16
|
+
`};exports.getLoadingIcon=s;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";const numericString="0123456789".split("");[...numericString];const alphaLower="abcdefghijklmnopqrstuvwxyz".split(""),alphaUpper="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");[...alphaLower,...alphaUpper,...numericString];new Map().set("true",!0).set("false",!1);const compose=(...n)=>(...e)=>n.reduce((t,r)=>i=>t(r(i)))(...e),identity=n=>n,whatType=n=>typeof n,isDef=n=>n!==void 0,isUndefined=n=>n===void 0,isDefAndNotNull=n=>n!=null,isString=n=>whatType(n)==="string",isNumber=n=>whatType(n)==="number"&&!Number.isNaN(n),isArray=n=>n instanceof Array,reverse=n=>Array.from(n).reduce((e,t)=>[t,...e],[]),toLowerCase=n=>n.toLowerCase(),toString=n=>n+"",toNumber=n=>+n;compose(toLowerCase,toString);const makeRandomString=()=>{let n=2147483648;return Math.floor(Math.random()*n).toString(36)+Math.abs(Math.floor(Math.random()*n)^Date.now()).toString(36)},stripLeadingChar=n=>e=>e.startsWith(n)?e.slice(n.length):e,join=n=>e=>e.join(n);compose(join(""),reverse);const pathOr=(n,e)=>t=>{const r=e.reduce((i,o)=>{try{return i[maybeNumber(o)]}catch{return}},t);return r===void 0?n:r},randomId=n=>{const e=makeRandomString();return n?e.substr(0,n):e},maybeNumber=n=>{if(n===null||whatType(n)==="string"&&n.length>1&&n.startsWith("0")&&!n.startsWith("0."))return n;const e=1*n;return e>Number.MAX_SAFE_INTEGER||Number.isNaN(e)?n:e};compose(toNumber,join(""),reverse,toString);class EVT extends EventTarget{#e=!1;#t=!1;#s=new Map;#n=new Set;#r=new Set;static makeEvent(e,t){return new CustomEvent(e,{detail:t})}set debugMode(e){if(typeof e!="boolean")throw new Error("This must be a boolean");this.#e=e}get debugMode(){return this.#e}get disposed(){return this.#t}get listeningTo(){return this.#s}get isObservedBy(){return this.#n}get activeIntervals(){return this.#r}debugMe(...e){this.#e&&console.log.apply(null,[this.constructor.name,"DEBUG:",...e])}isListenedToBy(e){this.#n.add(e)}listen(e,t,r,i=!1){e.addEventListener(t,r,i);const o=this.listeningTo.get(e)||{};o[t]=()=>e.removeEventListener(t,r,i),this.listeningTo.set(e,o),isDef(e.isListenedToBy)&&e.isListenedToBy(this)}stopBeingListenedTo(){for(const e of this.isObservedBy)e.stopListeningTo(this),this.isObservedBy.delete(e)}stopListeningTo(e,t){e&&this.listeningTo.has(e)&&(isDef(e.isObservedBy)&&e.isObservedBy.delete(this),isDef(t)?(Object.entries(this.listeningTo.get(e)).forEach(([r,i])=>{r===t&&i()}),Object.keys(this.listeningTo.get(e)).length||this.listeningTo.delete(e)):(Object.values(this.listeningTo.get(e)).forEach(r=>r()),this.listeningTo.delete(e)))}removeAllListener(){for(const e of this.listeningTo.keys())this.stopListeningTo(e)}clearAllIntervals(){for(const e of this.activeIntervals)clearInterval(e),this.activeIntervals.delete(e)}doOnBeat(e,t){const r=setInterval(e,t);this.activeIntervals.add(r)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#t=!0}dispose(){this.disposeInternal()}}class ZooyEventData{constructor(e,t){this.value_=e,this.data_=t||{}}getValue(){return this.value_}getData(){return this.data_}}const UiEventType={COMP:randomId(),COMP_DRAG_START:randomId(),COMP_DRAG_MOVE:randomId(),COMP_DRAG_END:randomId(),PANEL:randomId(),VIEW:randomId(),SPLIT:randomId(),SPLIT_WILL_OPEN:randomId(),SPLIT_DID_OPEN:randomId(),SPLIT_WILL_CLOSE:randomId(),SPLIT_DID_CLOSE:randomId(),SPLIT_TRANSITION_END:randomId(),READY:randomId(),PANEL_MINIMIZE:randomId(),FORM_SUBMIT_SUCCESS:randomId()};var EN_US=["second","minute","hour","day","week","month","year"];function en_US(n,e){if(e===0)return["just now","right now"];var t=EN_US[Math.floor(e/2)];return n>1&&(t+="s"),[n+" "+t+" ago","in "+n+" "+t]}var ZH_CN=["秒","分钟","小时","天","周","个月","年"];function zh_CN(n,e){if(e===0)return["刚刚","片刻后"];var t=ZH_CN[~~(e/2)];return[n+" "+t+"前",n+" "+t+"后"]}var Locales={},register=function(n,e){Locales[n]=e},getLocale=function(n){return Locales[n]||Locales.en_US},SEC_ARRAY=[60,60,24,7,365/7/12,12];function toDate(n){return n instanceof Date?n:!isNaN(n)||/^\d+$/.test(n)?new Date(parseInt(n)):(n=(n||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(n))}function formatDiff(n,e){var t=n<0?1:0;n=Math.abs(n);for(var r=n,i=0;n>=SEC_ARRAY[i]&&i<SEC_ARRAY.length;i++)n/=SEC_ARRAY[i];return n=Math.floor(n),i*=2,n>(i===0?9:1)&&(i+=1),e(n,i,r)[t].replace("%s",n.toString())}function diffSec(n,e){var t=new Date;return(+t-+toDate(n))/1e3}var format=function(n,e,t){var r=diffSec(n);return formatDiff(r,getLocale(e))};register("en_US",en_US);register("zh_CN",zh_CN);const getInputChecked_=function(n){return n.checked?n.value:null},getSelectSingle_=function(n){const e=n.selectedIndex;return e>=0?n.options[e].value:null},getSelectMultiple_=function(n){const e=[];for(let t,r=0;t=n.options[r];r++)t.selected&&e.push(t.value);return e.length?e:null},getValue=function(n){const e=n.type;switch(isString(e)&&e.toLowerCase()){case"checkbox":case"radio":return getInputChecked_(n);case"select-one":return getSelectSingle_(n);case"select-multiple":return getSelectMultiple_(n);default:return n.value!==null&&n.value!==void 0?n.value:null}},formToJSON=n=>[...n].reduce((e,t)=>(e[t.name]=t.value,e),{}),replaceNode=(n,e)=>{const t=e.parentNode;t&&t.replaceChild(n,e)},removeNode=n=>n&&n.parentNode?n.parentNode.removeChild(n):null,insertSiblingAfter=(n,e)=>{e.parentNode&&e.parentNode.insertBefore(n,e.nextSibling)},isInPage=n=>n===document.body?!1:document.body.contains(n),getPos=n=>[n.offsetLeft,n.offsetTop],randomColour=n=>[1,2,3].map(()=>Math.floor(Math.random()*256)+1).reduce((e,t)=>`${e}${t},`,"rgba(")+`${n||.5}`,totalWidth=n=>{const e=window.getComputedStyle(n),t=n.offsetWidth,r=parseFloat(e.marginLeft)+parseFloat(e.marginRight),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),o=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);return t+r-i+o},totalHeight=n=>{const e=window.getComputedStyle(n),t=n.offsetHeight,r=parseFloat(e.marginTop)+parseFloat(e.marginBottom),i=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),o=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);return t+r-i+o},evalScripts=comp=>arr=>{arr&&Array.from(arr).forEach(s=>{(function(){eval(s.text)}).bind(comp)()})},evalModules=n=>e=>{e&&Array.from(e).forEach(t=>{(function(){const r=document.createElement("script");r.type="module",r.textContent=t.textContent;const i=n.getElement(),o=getElDataMap(t).zv_comp_access;o&&(i.zvComponent=n,i.classList.add(o)),i.appendChild(r)}).bind(n)()})},splitScripts=n=>{const t=new DOMParser().parseFromString(n,"text/html");return{html:t.body.firstElementChild,scripts:t.querySelectorAll('script:not([type="module"])'),modules:t.querySelectorAll('script[type="module"]')}},handleTemplateProm=n=>Promise.resolve(splitScripts(n)),enableClass=(n,e,t)=>{t?n.classList.add(e):n.classList.remove(e)},toggleClass=(n,e)=>{const t=!Array.from(n.classList).includes(e);return enableClass(n,e,t),t},getElDataMap=n=>n?Object.assign({},n.dataset||{}):{},dtFormatter={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},dFormatter={year:"numeric",month:"short",day:"numeric"},dtf=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),dateToZooyStdTimeString=n=>{const[{value:e},,{value:t},,{value:r},,{value:i},,{value:o},,{value:a},,]=dtf.formatToParts(n);return`${t} ${e} ${r} ${i}:${o}:${a}`},parseMomentAgo=(n,e="both",t=void 0)=>{let r=n;isNumber(r)&&r<9466848e5?r=r*1e3:t&&(r=r+t);const i=new Date(r),o=format(i),a=dateToZooyStdTimeString(i);switch(e){case"time|ago":return`${a}|${o}`;case"ago":return`${o}`;case"datetime":case"time":return`${a}`;case"both":case"ago (time)":default:return`${o} (${a})`}},parseObfuscated=n=>{const t=(i=>o=>o<i.length-4)(n);return(i=>i.split("").map((o,a)=>t(a)?"*":o).join(""))(n)},parseMap=new Map().set(void 0,(n,e,t)=>identity(n)).set("",(n,e,t)=>identity(n)).set("class_update_only",(n,e,t)=>identity(n)).set("frac_100",(n,e,t)=>Math.round(n*100*100)/100).set("date_and_time",(n,e,t)=>new Date(n).toLocaleString(void 0,dtFormatter)).set("date",(n,e,t)=>new Date(n).toLocaleString(void 0,dFormatter)).set("moment_ago",(n,e,t)=>parseMomentAgo(n,"both",t.zdd_date_tz||void 0)).set("moment_ago_only",(n,e,t)=>parseMomentAgo(n,"ago",t.zdd_date_tz||void 0)).set("moment_ago_datetime",(n,e,t)=>parseMomentAgo(n,"datetime",t.zdd_date_tz||void 0)).set("pretty-json",(n,e,t)=>JSON.stringify(n,null,4)).set("obfuscated",(n,e,t)=>parseObfuscated(n)).set("linear-progress",(n,e,t)=>{const r=toNumber(t.zpmax),i=e.linProg;return r&&i&&(i.progress=n/r,n=void 0),n}),parseDataPropKvDef=n=>n.trim().split(",").map(r=>r.trim()).map(r=>{const[i,o]=r.split(":").map(a=>a.trim());return[i,o]}).filter(([r,i])=>r!==""&&i!==""),parseDataProps=(n,e)=>{const t=getElDataMap(n);delete n.dataset.zoodatapropkv;const r=t.zoodatapropkv||"";return parseDataPropKvDef(r).forEach(([o,a])=>{n.dataset[o]=pathOr(void 0,a.split("."))(e)}),n},mapDataToEls=(n,e,t=new Map,r=void 0)=>{if(!e)return;const i=new Map([...parseMap,...t]);[...n.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach(o=>{const a=getElDataMap(o),p=a.zdd||"",f=a.zdd_parse_as,_=a.zdd_render_effect||"",g=a.zdd_class_update,v=a.zdd_template_loop_index,c=a.zdd_units||"";let l=pathOr(void 0,p.split("."))(e);if(isDefAndNotNull(l)&&(l=i.has(f)?i.get(f)(l,o,a):l),v&&isNumber(r)&&(console.log("loopIndex: ",v," opt_loopIndex: ",r),v==="zero_indexed"?o.innerHTML=r:v==="one_indexed"?o.innerHTML=r+1:o.innerHTML=r),g){const[d,h,u]=g.split(":"),m=pathOr(void 0,d.split("."))(e);if(isDefAndNotNull(m))switch(h){case"swap":{const E=/\{}/gi,y=u.replace(E,""),T=u.replace(E,m);o.classList.remove(...[...o.classList].filter(b=>b.includes(y))),o.classList.add(T);break}case"remove_on_data":o.classList.remove(u);break;case"choice_map":u.split("|").filter(E=>E!=="").forEach(E=>{const[y,T]=E.split(">");y===m+""?o.classList.add.apply(o.classList,T.split(".")):o.classList.remove.apply(o.classList,T.split("."))});break}}if(f==="templated-array"&&isArray(l))if(l.length===0)o.classList.add("display__none");else{o.classList.remove("display__none"),l=l||[];const d=o.firstElementChild;d.classList.remove("display__none"),o.replaceChildren(...l.map((h,u)=>{const m=d.cloneNode(!0),E=parseDataProps(m,h);return mapDataToEls(E,h,void 0,u),E}))}else if(isDefAndNotNull(l))if(_==="typewriter"){let d=0;const h=l+c,u=5,m=()=>{d<h.length&&(o.innerHTML+=h.charAt(d),d++,setTimeout(m,u))};o.innerHTML="",m()}else o.innerHTML=l+c})},domUtils=Object.freeze(Object.defineProperty({__proto__:null,dateToZooyStdTimeString,dtf,enableClass,evalModules,evalScripts,formToJSON,getElDataMap,getPos,getValue,handleTemplateProm,insertSiblingAfter,isInPage,mapDataToEls,parseDataPropKvDef,parseMap,parseMomentAgo,randomColour,removeNode,replaceNode,splitScripts,toggleClass,totalHeight,totalWidth},Symbol.toStringTag,{value:"Module"}));class ComponentLibraryRegistry{static#e=new Map;static register(e,t){if(!t.render)throw new Error(`Component library '${e}' must provide a render function`);this.#e.set(e,{...t,dispose:t.dispose||null,cache:new Map,config:t.config||{}}),console.debug(`[ComponentLibraryRegistry] Registered: ${e}`)}static get(e){if(!this.#e.has(e)){const t=Array.from(this.#e.keys()).join(", ");throw new Error(`Component library '${e}' is not registered. Available: ${t||"none"}`)}return this.#e.get(e)}static has(e){return this.#e.has(e)}static getRegisteredLibraries(){return Array.from(this.#e.keys())}static getCacheStats(){const e={};for(const[t,r]of this.#e.entries())e[t]={cacheSize:r.cache.size,config:r.config};return e}static clearAllCaches(){for(const[e,t]of this.#e.entries())t.cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${e}`)}static clearCache(e){this.get(e).cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${e}`)}static unregister(e){return this.#e.delete(e)}static unregisterAll(){this.#e.clear()}}const ComponentError={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",ALREADY_DISPOSED:"Component already disposed",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"};class Component extends EVT{static compEventCode(){return UiEventType.COMP}static compReadyCode(){return UiEventType.READY}static compErrors(){return ComponentError}#e;#t;#s;#n;#r;#o;#i;#a;constructor(){super(),this.#e=()=>document.createElement("div"),this.#t=!1,this.#s=void 0,this.#n=void 0,this.#r=void 0,this.#o=void 0,this.#i=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(e){this.#r=e}get target(){return this.#r}set model(e){this.#n=e}get model(){return this.#n}set isInDocument(e){this.#t=e}get isInDocument(){return this.#t}set domFunc(e){this.#e=e}set readyFunc(e){this.#a=e}setElementInternal_(e){this.#s=e}getElement(){return this.#s}createDom(){this.#s=this.#e()}assertCanRenderAsync(){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED)}render(e){this.render_(e)}render_(e){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(ComponentError.ALREADY_RENDERED);this.#s||this.createDom();const t=this.#s;e&&(this.#r=e),this.placeholderDom&&removeNode(this.placeholderDom),this.#r?isInPage(t)||this.#r.insertBefore(t,null):isInPage(t)||document.body.appendChild(t),(!this.#o||this.#o.isInDocument)&&this.enterDocument()}hoist(e,t=void 0){t||(t=document.querySelector("body")),t.appendChild(e),this.outOfTreeElements.push(e)}executeBeforeReady(){this.#a()}enterDocument(){this.disposed?removeNode(this.getElement()):(this.isInDocument=!0,[...this.#i.values()].forEach(e=>{!e.isInDocument&&e.getElement()&&e.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(UiEventType.READY))}exitDocument(){[...this.#i.values()].forEach(e=>{e.isInDocument&&e.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,removeNode(this.getElement()),this.placeholderDom&&removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#i&&[...this.#i.values()].forEach(e=>e.disposeInternal()),this.outOfTreeElements.forEach(removeNode),this.#s&&removeNode(this.#s),this.placeholderDom&&removeNode(this.placeholderDom),this.#i=null,this.#s=void 0,this.#n=null,this.#o=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const e=this.getElement();if(e)for(const t of ComponentLibraryRegistry.getRegisteredLibraries())try{const r=ComponentLibraryRegistry.get(t);r.dispose&&r.dispose(e)}catch(r){console.debug(`[${t}] Cleanup error during component disposal (non-critical):`,r)}super.dispose()}dispatchCompEvent(e,t){const r=new ZooyEventData(e,t),i=EVT.makeEvent(UiEventType.COMP,r);return this.dispatchEvent(i)}}const EV={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEMOVE:"mousemove",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend"},touchEvents=[EV.TOUCHMOVE,EV.TOUCHSTART,EV.TOUCHEND],isTouchEvent=n=>touchEvents.includes(n.type),normalizeEvent=n=>(isTouchEvent(n)&&(n.clientX=n.targetTouches[0].clientX,n.clientY=n.targetTouches[0].clientY),n),dragStartListener=(n,e,t,r)=>i=>{i.preventDefault();const o=normalizeEvent(i),a=o.currentTarget,[p,f]=getPos(a),_=o.clientX-p,g=o.clientY-f,v=n(p,f,_,g,a),c=t(p,f,_,g,a),l=e(p,f,_,g,a);let d=freeMoveListener(l,a,_,g);["x","ew"].includes(r)?d=xMoveOnlyListener(l,a,_):["y","ns"].includes(r)&&(d=yMoveOnlyListener(l,a,_,g));let h=!1;const u=E=>{h=!0,d(E)},m=E=>{document.removeEventListener(EV.MOUSEMOVE,u,!0),document.removeEventListener(EV.TOUCHMOVE,u,!0),document.removeEventListener(EV.MOUSEUP,m,!0),document.removeEventListener(EV.TOUCHEND,m,!0),h&&c(E)};return document.addEventListener(EV.MOUSEUP,m,!0),document.addEventListener(EV.TOUCHEND,m,!0),document.addEventListener(EV.MOUSEMOVE,u,!0),document.addEventListener(EV.TOUCHMOVE,u,!0),v(i),m},freeMoveListener=(n,e,t,r)=>i=>{i.preventDefault();const o=normalizeEvent(i);e.style.left=`${o.clientX-t}px`,e.style.top=`${o.clientY-r}px`,n(o)},xMoveOnlyListener=(n,e,t,r)=>i=>{i.preventDefault();const o=normalizeEvent(i);e.style.left=`${o.clientX-t}px`,n(o)},yMoveOnlyListener=(n,e,t,r)=>i=>{i.preventDefault();const o=normalizeEvent(i);e.style.top=`${o.clientY-r}px`,n(o)},makeEmitter=(n,e)=>(t,r,i,o,a)=>p=>{n.dispatchCompEvent(e,{component:n,browserEvent:p,left:t,top:r,clientX:p.clientX,clientY:p.clientY,xOrg:i,yOrg:o,deltaX:p.clientX-i-t,deltaY:p.clientY-o-r,target:a})};class Dragger extends Component{#e;#t;#s;#n;constructor(e="xy"){super(),this.#e=["x","y","xy","ew","ns"].includes(e.toLowerCase())?e.toLowerCase():"xy",this.#t=void 0,this.#s=!0,this.#n=t=>null}cancelDrag(e){this.#n(e)}set moveFreedom(e){this.#e=e,this.#s||(this.lock(),this.unlock())}get moveFreedom(){return this.#e}executeBeforeReady(){this.unlock(),super.executeBeforeReady()}unlock(){const e=t=>r=>{this.#n=t(r)};if(this.isInDocument&&this.#s){const t=makeEmitter(this,UiEventType.COMP_DRAG_MOVE),r=makeEmitter(this,UiEventType.COMP_DRAG_START),i=makeEmitter(this,UiEventType.COMP_DRAG_END),o=dragStartListener(r,t,i,this.#e);this.#s=!1,this.#t=this.#t||this.getElement(),this.listen(this.#t,EV.MOUSEDOWN,e(o)),this.listen(this.#t,EV.TOUCHSTART,o),this.#t.classList.remove("locked")}}lock(){this.stopListeningTo(this.#t,EV.MOUSEDOWN),this.stopListeningTo(this.#t,EV.TOUCHSTART),this.#s=!0,this.#t.classList.add("locked")}}const splitRe_=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),ComponentIndex={PATH:5,QUERY_DATA:6},split=n=>n.match(splitRe_),decodeOrEmpty_=(n,e)=>n?decodeURI(n.replace(/%25/g,"%2525")):"",getPath=n=>decodeOrEmpty_(split(n)[ComponentIndex.PATH]),getQueryData=n=>decodeOrEmpty_(split(n)[ComponentIndex.QUERY_DATA]),objectToUrlParms=n=>[...Object.entries(n)].map(e=>`${e[0]}=${e[1]}`).join("&"),isValidValue=n=>n!=null&&n!=="",queryDataToMap=n=>n.split("&").reduce((e,t)=>{const[r,i]=t.split("=");return isValidValue(r)&&isValidValue(i)&&e.set(r,i),e},new Map),uriUtils=Object.freeze(Object.defineProperty({__proto__:null,getPath,getQueryData,objectToUrlParms,queryDataToMap},Symbol.toStringTag,{value:"Module"})),stripLeadingSpace=stripLeadingChar(" "),stripLeadingSlash=stripLeadingChar("/"),getCookieByName=n=>document.cookie.split(";").map(e=>e.split("=")).reduce((e,t)=>e.set(stripLeadingSpace(t[0]),t[1]),new Map).get(n),spinner=n=>{let e=0,t;const r=i=>{const o=i>0;return o?e+=1:e-=1,o?e===1:e===0};return i=>{t=t||document.getElementById(n),t&&r(i)&&t.classList.toggle("viz",e>0)}},spin=spinner("the_loader"),startSpin=()=>Promise.resolve(spin(1)),stopSpin=n=>(spin(0),Promise.resolve(n)),checkStatus=n=>n.ok?Promise.resolve(n):Promise.reject(new Error(`${n.url} ${n.status} (${n.statusText})`)),checkStatusTwo=n=>e=>{if(e.type==="opaqueredirect"||e.redirected){const t=stripLeadingSlash(getPath(e.url));n.setIsRedirected(!0,t),console.log("Redirect detected",t)}return checkStatus(e)},getJson=n=>n.status===204?Promise.resolve({}):n.json().then(e=>Promise.resolve(e),e=>Promise.reject(new Error(`Could not get JSON from response: ${e}`))),getText=n=>n.text().then(e=>Promise.resolve(e),e=>Promise.reject(new Error(`Could not get text from response: ${e}`))),getTextOrJson=n=>n.headers.get("Content-Type")==="application/json"?getJson(n):getText(n),jsonInit=(n,e,t="POST",r=void 0)=>{const i=new Headers;i.append("Content-type","application/json"),i.append("X-Requested-With","XMLHttpRequest"),n&&n!==""&&i.append("Authorization",`Bearer ${n}`);const o={cache:"no-cache",method:t,headers:i,credentials:"include",body:JSON.stringify(e)};return r&&(o.signal=r),o},basicPutPostPatchInit=(n,e,t=!1,r=void 0)=>{const i=new Headers;if(e&&e!==""&&i.append("Authorization",`Bearer ${e}`),i.append("X-Requested-With","XMLHttpRequest"),t){const a=getCookieByName("csrftoken");a&&t&&i.append("X-CSRFToken",a)}const o={cache:"no-cache",method:n,headers:i,redirect:"follow",credentials:"include"};return r&&(o.signal=r),o},formPostInit=(n,e,t=void 0)=>{const i=basicPutPostPatchInit("POST",n,!1,t);return i.body=new FormData(e.formEl),i},basicGetInit=(n,e=void 0)=>{const t=new Headers;t.append("Authorization",`Bearer ${n}`),t.append("X-Requested-With","XMLHttpRequest");const r={cache:"no-cache",headers:t,credentials:"include"};return e&&(r.signal=e),r},putPostPatchNobody=(n,e)=>{const t=new Request(n);return fetch(t,e).then(checkStatus).then(getText)},genCatchClause=(n,e=void 0)=>t=>(stopSpin("").then(identity),t.name==="AbortError"?console.info(n,"ABORTED!"):console.error(n,t),e);class UserManager{constructor(e){this.user_={},this.jwt="",e&&this.updateProfileFromJwt(e).then(()=>{})}updateProfileFromJwt(e,t=!1){return t&&this.jwt!==""?Promise.resolve("User Profile Already exists"):e.non_field_errors?Promise.reject(new Error(`JWT ${e.non_field_errors}`)):(this.updateToken(e.token),this.updateProfile(e.user),Promise.resolve("User Profile Updated"))}updateProfile(e){this.user_=e}updateToken(e){this.jwt=e}get id(){return this.user_.id}get name(){return this.user_.name}get surname(){return this.user_.surname}get salutation(){let e=this.name;const t=this.surname;return t&&(e=e+" "+t),e}formSubmit(e){const t=new Request(e.uri.toString()),r=e.processSubmitReply.bind(e),i=genCatchClause("Form submit error");return startSpin().then(()=>fetch(t,formPostInit(this.jwt,e,e.abortController.signal))).then(checkStatusTwo(e)).then(stopSpin).then(getTextOrJson).then(r).catch(i)}putNoBody(e,t=void 0,r=!1){const i=genCatchClause("putNobody error"),o=basicPutPostPatchInit("PUT",this.jwt,r,t);return putPostPatchNobody(e,o).catch(i)}fetch(e,t=void 0){const r=new Request(e.toString()),i=genCatchClause(`UMan Text GET Fetch: ${e}`);return startSpin().then(()=>fetch(r,basicGetInit(this.jwt,t))).then(checkStatus).then(stopSpin).then(getText).catch(i)}fetchAndSplit(e,t=void 0){const r=genCatchClause(`fetchAndSplit: ${e}`);return this.fetch(e,t).then(handleTemplateProm).catch(r)}fetchJson(e,t=void 0){const r=new Request(e.toString()),i=genCatchClause(`fetchJson: ${e}`,{}),o=basicGetInit(this.jwt,t);return startSpin().then(()=>fetch(r,o)).then(checkStatus).then(stopSpin).then(getJson).catch(i)}patchJson(e,t,r=void 0){const i=new Request(e.toString()),o=genCatchClause(`patchJson: ${e}`),a=jsonInit(this.jwt,t,"PATCH",r);return fetch(i,a).then(checkStatus).then(getJson).catch(o)}postJson(e,t,r=void 0){const i=new Request(e.toString()),o=genCatchClause(`postJson: ${e}`),a=jsonInit(this.jwt,t,"POST",r);return fetch(i,a).then(checkStatus).then(getJson).catch(o)}putJson(e,t,r=void 0){const i=new Request(e.toString()),o=genCatchClause(`putJson: ${e}`),a=jsonInit(this.jwt,t,"PUT",r);return fetch(i,a).then(checkStatus).then(getJson).catch(o)}delJson(e,t,r=void 0){const i=new Request(e.toString()),o=genCatchClause(`delJson: ${e}`),a=jsonInit(this.jwt,t,"DELETE",r);return fetch(i,a).then(checkStatus).then(getJson).catch(o)}}class Panel extends Component{static panelEventCode(){return UiEventType.PANEL}static compReadyCode(){return UiEventType.READY}constructor(e){super(),this.qParamMap_=new Map,this.uri_="",e&&this.parseUri(e),this.evalScripts=evalScripts(this),this.evalModules=evalModules(this),this.redirected=!1,this.responseObject={html:null,scripts:null},this.user_=void 0,"AbortController"in window?this.abortController=new AbortController:this.abortController={signal:void 0,abort:()=>{}},this.listMap=new Map}get uri(){const e=this.qParamMap_.size>0?"?"+objectToUrlParms(Object.fromEntries(this.qParamMap_)):"";return this.uri_+e}set user(e){this.user_=e}get user(){return this.user_||(this.user_=new UserManager),this.user_}parseUri(e){this.uri_=getPath(e),this.qParamMap_=queryDataToMap(getQueryData(e))}addToQParams(e,t){this.qParamMap_.set(e,t)}removeFromQParams(e){this.qParamMap_.delete(e)}clearQParams(){this.qParamMap_.clear()}renderPlaceHolder(e){this.target&&(this.placeholderDom=e,this.target.insertBefore(this.placeholderDom,null))}renderWithTemplate(e){const t=this.user;return t?t.fetch(this.uri,this.abortController.signal).then(r=>(this.assertCanRenderAsync(),e&&e(this),this.onRenderWithTemplateReply(r).catch(i=>{i.message!==Component.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",i)}),this)).catch(r=>{throw console.error("Panel.renderWithTemplate fetch failed:",r),r}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(e){return this.responseObject=splitScripts(e),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(e,t){const r=this.getElement();if(isUndefined(r))return;const i=e.html;if(t.startsWith("."))[...r.querySelectorAll(t)].filter(o=>isDefAndNotNull(o.id)).map(o=>[o,i.querySelector(`#${o.id}`)]).filter(([o,a])=>isDefAndNotNull(a)).forEach(([o,a])=>{o.parentNode.replaceChild(a,o),this.parseContent(a)});else if(t.startsWith("#")){const o=i.querySelector(t),a=r.querySelector(t);a.parentNode.replaceChild(o,a),this.parseContent(o)}this.evalScripts(e.scripts),this.evalModules(e.modules)}renderWithJSON(e){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(r=>{this.assertCanRenderAsync(),e&&e(r,this),this.onRenderWithJSON(r).then(identity)}).catch(r=>{throw console.error("Panel.renderWithJSON fetch failed:",r),r}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(e){return Promise.resolve(this)}onAsyncJsonReply(e,t,r){}onAsyncHtmlReply(e,t){}onViewDataBroadcast(e){}parseContent(e){if(this.debugMe("Enable interactions. Panel:",e),typeof window.customElements<"u"&&ComponentLibraryRegistry.has("carbon")){const c=ComponentLibraryRegistry.get("carbon");c.render.call(this,e,c.cache).catch(l=>console.error("[Zooy] Carbon initialization failed:",l))}if(ComponentLibraryRegistry.has("mdc")){const c=ComponentLibraryRegistry.get("mdc");c.render.call(this,e,c.cache)}e.classList.contains("zoo__modal-base")&&e.classList.contains("close_on_click")&&this.listen(e,EV.CLICK,c=>{c.target===e&&this.dispatchPanelEvent("destroy_me")}),[...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(c=>{this.listen(c,EV.CLICK,l=>{l.stopPropagation();const d=l.currentTarget,h=getElDataMap(d);this.dispatchPanelEvent(h.zv,Object.assign({orgEvt:l,trigger:d,href:d.href||h.href},h))})}),[...e.querySelectorAll("[href]:not(.external)")].forEach(c=>{this.listen(c,EV.CLICK,l=>{const d=l.currentTarget;l.preventDefault(),l.stopPropagation();const h=getElDataMap(d),u=h.zv||"href";this.dispatchPanelEvent(u,Object.assign({orgEvt:l,trigger:l.target,href:d.href||h.href},h))})}),[...e.querySelectorAll("form.intercept_submit")].forEach(c=>{c.noValidate=!0,this.listen(c,EV.SUBMIT,l=>{l.preventDefault(),l.stopPropagation();const d=getElDataMap(c),h=formToJSON(c.elements);this.dispatchPanelEvent(d.zv,Object.assign({orgEvt:l,trigger:l.target,formData:h,href:d.href},d))})}),[...e.querySelectorAll(".zoo__toggle_class_driver")].forEach(c=>{const l=getElDataMap(c),d=l.toggle_class_target_id,h=l.toggle_class,u=e.querySelector(`#${d}`);u&&h&&c.addEventListener(EV.CLICK,m=>{m.stopPropagation(),u.classList.toggle(h)})});const t=Array.from(e.querySelectorAll(".folder_drop_zone")),r=Array.from(e.querySelectorAll("[draggable]")),i=c=>{c.preventDefault(),c.target.classList.add("drag_over")},o=c=>{c.preventDefault()},a=c=>{c.preventDefault(),c.target.classList.remove("drag_over")},p=c=>{c.preventDefault(),c.target.classList.remove("drag_over")},f=c=>{c.preventDefault(),c.target.classList.remove("drag_over")},_=c=>{c.dataTransfer.dropEffect="move";const l=getElDataMap(c.target);c.dataTransfer.setData("text/plain",JSON.stringify(l)),c.target.classList.add("drag_in_progress")},g=c=>{c.target.classList.remove("drag_in_progress")},v=c=>{f(c),c.stopPropagation();const l=JSON.parse(c.dataTransfer.getData("text/plain")),d=getElDataMap(c.target);return this.dispatchPanelEvent("drop_on",{custom:{on:d,from:l}}),!1};t.forEach(c=>{this.listen(c,EV.DRAGOVER,o),this.listen(c,EV.DRAGENTER,i),this.listen(c,EV.DRAGEXIT,p),this.listen(c,EV.DRAGLEAVE,a),this.listen(c,EV.DROP,v)}),r.forEach(c=>{this.listen(c,EV.DRAGSTART,_),this.listen(c,EV.DRAGEND,g)}),[...e.querySelectorAll(".zoo_async_json")].forEach(c=>{const l=getElDataMap(c),d=l.href,h=this.onAsyncJsonReply.bind(this,c,l);this.user.fetchJson(d,this.abortController.signal).then(h);const u=l.z_json_reusable;u&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[u]=()=>{this.user.fetchJson(d,this.abortController.signal).then(h)});const m=toNumber(l.z_interval);isNumber(m)&&this.doOnBeat(()=>{this.user.fetchJson(d,this.abortController.signal).then(h)},m*60*1e3)}),[...e.querySelectorAll(".zoo_async_html")].forEach(c=>{const l=getElDataMap(c),d=l.href;this.user.fetchAndSplit(d,this.abortController.signal).then(u=>{c.appendChild(u.html),this.parseContent(c),this.evalScripts(u.scripts),this.evalModules(u.modules),this.onAsyncHtmlReply(c,l)});const h=toNumber(l.z_interval);isNumber(h)&&this.doOnBeat(()=>{this.user.fetchAndSplit(d,this.abortController.signal).then(u=>{c.replaceChildren(u.html),this.parseContent(c),this.evalScripts(u.scripts),this.evalModules(u.modules)})},h*60*1e3)})}enterDocument(){const e=this.getElement();this.parseContent(e),this.evalScripts(this.responseObject.scripts),this.evalModules(this.responseObject.modules),super.enterDocument()}exitDocument(){this.abortController.abort(),super.exitDocument()}setIsRedirected(e,t){this.redirected=e,this.redirected&&t&&(this.uri_=t)}dispatchPanelEvent(e,t){const r=new ZooyEventData(e,t),i=EVT.makeEvent(UiEventType.PANEL,r);return this.debugMe("PANEL EVENT FIRED. Value:",e,"Opt DATA:",t),this.dispatchEvent(i)}}class FormPanel extends Panel{#e=null;#t=new Map;#s=!0;constructor(e,t=!0){super(e),this.#s=t,this.debugMode=!0,this.onSubmitSucFunc=(r,i)=>null}get formEl(){return this.#e}enterDocument(){super.enterDocument(),this.formIdElementToForm_()}formIdElementToForm_(){this.#e=this.getFormFromId(),this.#e&&(this.#a(this.#e),this.#n())}getFormFromId(e){let t=null,r=this.getElement().querySelector("form");return e&&(r=document.getElementById(e)||r),r&&r.tagName.toLowerCase()==="form"&&(t=r),t}#n(){this.#e&&(this.listen(this.#e,EV.CHANGE,e=>{this.#i(e)},{passive:!0}),this.listen(this.#e,EV.INPUT,e=>{this.clearAllValidationErrors(),this.#i(e)}),this.listen(this.#e,EV.INVALID,e=>{e.preventDefault();const t=e.target;this.#o(t),this.displayFieldError(t)},{passive:!0}))}checkAllFields(){const e=[...this.#e.elements].map(t=>[this.#r(t),t]).filter(t=>!t[0]);return e.forEach(t=>this.displayFieldError(t[1])),e.length===0}clearAllValidationErrors(){[...this.#e?this.#e.elements:[]].forEach(r=>this.#o(r)),[...this.#e.querySelectorAll(".non-field-errors")].forEach(r=>r.classList.remove("alert-error"))}displayAlert_(e,t,r){const i=document.getElementById(`${e.id}-helper-text`)||document.createElement("p");i.textContent=t,this.#t.set(e,i)}#r(e){this.#o(e);let t=!e.willValidate;return e.willValidate&&(t=e.checkValidity()),t}#o(e){e.classList.remove("error"),this.#t.has(e)&&(this.#t.get(e).textContent=""),this.#t.delete(e)}displayFieldError(e,t){const r=t||e.validationMessage;e.classList.add("error"),this.displayAlert_(e,r,"alert-error")}displayFieldSuccess(e,t){this.displayAlert_(e,t,"alert-success")}displayFieldInfo(e,t){this.displayAlert_(e,t,"alert-info")}#i(e){this.#r(e.target)}#a(e){if(e&&this.#s){e.noValidate=!0;const t=this.user;this.listen(e,EV.SUBMIT,r=>{r.preventDefault(),this.debugMe("Intercepted from SUBMIT"),this.checkAllFields()&&t&&t.formSubmit(this)})}return e}onSubmitSuccess(e){this.onSubmitSucFunc=e}replaceForm(e){if(this.responseObject=splitScripts(e),this.responseObject.html){if(this.redirected){this.removeAllListener();const t=this.getElement(),r=t.parentNode;this.setElementInternal_(this.responseObject.html),r.replaceChild(this.getElement(),t)}else{const t=this.responseObject.html.querySelector("form");t&&replaceNode(t,this.#e);const r=this.responseObject.html.querySelector('button[type="submit"]'),i=this.getElement().querySelector('button[type="submit"]');r&&i&&replaceNode(r,i)}this.enterDocument()}}refreshFromFromServer(){const e=this.user,t=this.uri;return e?e.fetch(t,this.abortController.signal).then(r=>this.replaceForm(r)):Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"))}processSubmitReply(e){this.clearAllValidationErrors();let t=!1;if(whatType(e)==="object"&&e.success)return Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this,e),this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS)});if(e==="success"?(this.debugMe(`
|
|
2
|
+
1.REDIRECTED: ${this.redirected}
|
|
3
|
+
REPLY: ${e}`),t=!0):e===`redirected_success
|
|
4
|
+
`?(this.debugMe(`
|
|
5
|
+
2.REDIRECTED: ${this.redirected}
|
|
6
|
+
REPLY: ${e}`),t=!0,this.redirected=!1):(this.debugMe(`
|
|
7
|
+
3.REDIRECTED: ${this.redirected}
|
|
8
|
+
REPLY: Some form HTML`),this.replaceForm(e)),t&&this.redirected)return this.debugMe(`
|
|
9
|
+
4.REDIRECTED: ${this.redirected}
|
|
10
|
+
SUCCESS: ${t}`),this.redirected=!1,Promise.resolve(this);if(t)return this.debugMe(`
|
|
11
|
+
5.REDIRECTED: ${this.redirected}
|
|
12
|
+
SUCCESS: ${t}`),Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this),this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS)});this.debugMe(`
|
|
13
|
+
6.REDIRECTED: ${this.redirected}
|
|
14
|
+
SUCCESS: ${t}`)}}class Split extends Component{static splitEventCode(){return UiEventType.SPLIT}constructor(){super(),this.dragImage_=document.createElement("canvas"),this.nestMap_=new Map,this.nestCallbackMap_=new Map,this.splitNests_=new Set}get nests(){return[...this.nestMap_.entries()].filter(([e,{nestEl:t}])=>t)}getNest(e){return this.nestMap_.get(e)?.nestEl}get nestNames(){return[...this.nestMap_.entries()].filter(([e,t])=>!this.splitNests_.has(t)).map(([e])=>e)}closeAndLockAll(e=identity,t=!1){this.nestNames.forEach(r=>this.closeAndLock(r,e,t))}openAndUnlockAll(e=identity,t=!1){this.nestNames.forEach(r=>this.openAndUnlock(r,e,t))}lock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.add("locked")}unlock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.remove("locked")}resize(e,t,r=identity,i=!1){const{sizeNow:o,nestEl:a,canResize:p}=this.nestMap_.get(e);p&&(i||o===t?(a.classList.remove("animated"),a.style.flexBasis=`${t}px`,this.nestMap_.get(e).sizeNow=t,r()):(a.classList.add("animated"),this.nestCallbackMap_.set(e,()=>{a.classList.remove("animated"),this.nestMap_.get(e).sizeNow=t,r()}),a.style.flexBasis=`${t}px`))}closeAndLock(e,t=identity,r=!1){const{nestEl:i,dragEl:o,canResize:a}=this.nestMap_.get(e);if(!a)return;const p=()=>{o.classList.add("locked","closed"),i.classList.add("closed"),t()};this.resize(e,0,p,r)}closeAndUnlock(e,t=identity,r=!1){const{nestEl:i,dragEl:o,canResize:a}=this.nestMap_.get(e);if(!a)return;const p=()=>{i.classList.remove("closed"),o.classList.remove("closed","locked"),o.classList.add("collapsed"),t()};this.resize(e,0,p,r)}openAndUnlock(e,t,r,i=!1){const{nestEl:o,dragEl:a,defSize:p,lastSize:f,canResize:_}=this.nestMap_.get(e);if(!_)return;const g=t||f||p;o.classList.remove("closed"),a.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(e,g,r,i)},50)}openAndLock(e,t,r,i=!1){const{nestEl:o,dragEl:a,defSize:p,lastSize:f,canResize:_}=this.nestMap_.get(e);if(!_)return;const g=t||f||p;o.classList.remove("closed"),a.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(e,g,r,i)},50)}close(e,t=identity,r=!1){const{dragEl:i,canResize:o,nestEl:a}=this.nestMap_.get(e);if(!o)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE,{nestName:e,nestEl:a});const p=()=>{i.classList.add("collapsed"),this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE,{nestName:e,nestEl:a}),t()};this.resize(e,0,p,r)}open(e,t=identity,r=!1){const{defSize:i,lastSize:o,dragEl:a,canResize:p,nestEl:f}=this.nestMap_.get(e);if(!p)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN,{nestName:e,nestEl:f}),a.classList.remove("collapsed","closed");const _=o||i,g=()=>{this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN,{nestName:e,nestEl:f}),t()};this.resize(e,_,g,r)}toggle(e,t,r=!1){this.nestMap_.get(e).sizeNow===0?this.open(e,t,r):this.close(e,t,r)}addSplit(e=void 0,t="EW",r=100,i=100,o=[],a=[],p=[],f=[],_=[]){const g=e||this.getElement();if(this.splitNests_.has(g))return["Already used!",g];convertElToSplit(g,t),this.splitNests_.add(g);let v="";if(e){const S=[...this.nestMap_.entries()].find(([C,{nestEl:D}])=>D===e);if(S)v=S[0];else return["Element not managed by this component",e]}const c=`${v}A`,l=makeOuterNest(r,["zoo_nest__A",c,...o]),d=new Dragger(t);d.domFunc=makeDraggerEl([`zoo_drag_${c}`,...f],_),d.render(g),this.nestMap_.set(c,{side:"A",nestEl:l,dragger:d,dragEl:d.getElement(),defSize:r,sizeNow:-1,canResize:!0});const h=`${v}B`,u=makeInnerNest(["zoo_nest__B",h,...a]);this.nestMap_.set(h,{nestEl:u,canResize:!1});const m=`${v}C`,E=new Dragger(t);E.domFunc=makeDraggerEl([`zoo_drag_${m}`,...f],_),E.render(g);const y=makeOuterNest(i,["zoo_nest__C",m,...p]);this.nestMap_.set(m,{side:"C",nestEl:y,dragger:E,dragEl:E.getElement(),defSize:i,sizeNow:-1,canResize:!0}),[l,d.getElement(),u,E.getElement(),y].forEach(S=>g.appendChild(S));let T=0;const b=(S,C,D,O)=>{let M;const w=S==="NS"?"height":"width",A=S==="NS"?"deltaY":"deltaX";return L=>{switch(L.detail.value_){case UiEventType.COMP_DRAG_START:M=C.getBoundingClientRect()[w],T=u.getBoundingClientRect()[w]+M,this.nestMap_.get(D).dragEl.classList.remove("collapsed");break;case UiEventType.COMP_DRAG_MOVE:{const I=Math.min(T,M+O*L.detail.data_[A]);this.nestMap_.get(D).lastSize=I,C.style.flexBasis=I+"px";break}case UiEventType.COMP_DRAG_END:this.dispatchSplitEvent(UiEventType.COMP_DRAG_END,this.nestMap_.get(D));break}}};this.listen(d,Component.compEventCode(),b(t,l,c,1)),this.listen(E,Component.compEventCode(),b(t,y,m,-1)),this.listen(d.getElement(),EV.DBLCLICK,()=>this.toggle(c)),this.listen(E.getElement(),EV.DBLCLICK,()=>this.toggle(m)),this.listen(d.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(c)),this.listen(E.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(m)),this.listen(l,EV.TRANSITIONEND,S=>{if(S.propertyName==="flex-basis"&&S.target===l){const C=this.nestCallbackMap_.get(c);this.nestCallbackMap_.delete(c),C&&C(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(c))}}),this.listen(y,EV.TRANSITIONEND,S=>{if(S.propertyName==="flex-basis"&&S.target===y){const C=this.nestCallbackMap_.get(m);this.nestCallbackMap_.delete(m),C&&C(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(m))}})}dispatchSplitEvent(e,t){const r=new ZooyEventData(e,t),i=EVT.makeEvent(UiEventType.SPLIT,r);return this.dispatchEvent(i)}}const convertElToSplit=(n,e)=>(n.classList.add("zoo_split",`zoo_split__${e.toLowerCase()}`),n),makeOuterNest=(n,e=[])=>{const t=document.createElement("div");return t.setAttribute("id",randomId(7)),t.classList.add("zoo_nest","zoo_nest__outer",...e),t.style.flexBasis=n+"px",t},makeInnerNest=(n=[])=>{const e=document.createElement("div");return e.setAttribute("id",randomId(7)),e.classList.add("zoo_nest","zoo_nest__inner",...n),e},makeDraggerEl=(n=[],e=[])=>()=>{const t=document.createElement("div");t.setAttribute("id",randomId(7)),t.classList.add("zoo_dragger",...n);const r=document.createElement("div");return r.classList.add("zoo_grabber",...e),t.appendChild(r),t},needsToScroll=n=>{const t=n.getBoundingClientRect().bottom;return r=>r.getBoundingClientRect().bottom>t},treeNodeSelect=n=>e=>{const t=n.getElement().querySelector(".zv_tree_container"),r=needsToScroll(t),i=n.getElement().querySelectorAll(".tree-node");let o;[...i].forEach(a=>{enableClass(a,"mdc-deprecated-list-item--activated",a.id===`tree-node_${e}`),a.id===`tree-node_${e}`&&(o=a)}),o&&r(o)&&o.scrollIntoView(!1)},toggleTree=(n,e)=>{const t=e.getElement().querySelector(".children"),r=n.isOn,i=e.getElement().querySelectorAll(".children"),o=e.getElement().querySelectorAll(".zoo__reveal_icon");[...i].forEach(a=>enableClass(a,"zoo__tree-children__hidden",a!==t&&!r)),[...o].forEach(a=>enableClass(a,"zoo__icon_rotated",a!==t&&!r))},toggleTreeChildren=(n,e)=>{const t=e.trigger,r=t.getAttribute("data-child-id"),i=n.getElement().querySelector(`#${r}`);toggleClass(i,"zoo__tree-children__hidden"),toggleClass(t,"zoo__icon_rotated")},_openTreeFromNodeUp=(n,e)=>{const t=e.parentElement;t.classList.contains("children")&&(enableClass(t,"zoo__tree-children__hidden",!1),_openTreeFromNodeUp(n,t))},treeUtils=Object.freeze(Object.defineProperty({__proto__:null,_openTreeFromNodeUp,toggleTree,toggleTreeChildren,treeNodeSelect},Symbol.toStringTag,{value:"Module"})),MdcTreeHandlers={toggle_tree:function(n,e){toggleTree(n,e)},"tree_toggle-children":function(n,e){toggleTreeChildren(e,n)}},SearchHandlers={search:function(n,e){let t=`${n.href}`;const r=n.formData.q,i=n.targetval;if(r!==""&&(t=`${t}?q=${r}`),i!==""){let o=i;i.includes("page=")&&(o=i.split("&").filter(a=>!a.includes("page=")).join("&")),t=r!==""?`${t}&${o}`:`${t}?${o}`}this.user.fetchAndSplit(t,e.abortController.signal).then(o=>e.onReplacePartialDom(o,n.zvptarget))},reset_search:function(n,e){const t=n.trigger.closest("form");e.removeFromQParams("q"),t.elements.q.value="",t.dispatchEvent(new Event("submit"))}},QueryParamHandlers={paginate:function(n,e){const t=`${n.href}?${n.targetval}`;this.user.fetchAndSplit(t,e.abortController.signal).then(r=>e.onReplacePartialDom(r,n.zvptarget))},list_filter:function(n,e){const t=`${n.href}?${n.targetval}`;this.user.fetchAndSplit(t,e.abortController.signal).then(r=>e.onReplacePartialDom(r,n.zvptarget))}},handlers=Object.freeze(Object.defineProperty({__proto__:null,MdcTreeHandlers,QueryParamHandlers,SearchHandlers},Symbol.toStringTag,{value:"Module"}));class View extends EVT{static viewEventCode(){return UiEventType.VIEW}constructor(){super(),this.panelMap=new Map,this.user_=void 0,this.split_=void 0,this.panelEventMap_=this.initPanelEventsInternal_(),this.switchViewMap_=new Map,this.metaData_=new Map,this.recordHistory_=void 0,this.registerViewConstructor_=void 0}set recordHistory(e){this.recordHistory_=e}get recordHistory(){return this.recordHistory_}set registerViewConstructor(e){this.registerViewConstructor_=e}get registerViewConstructor(){return this.registerViewConstructor_}set split(e){this.split_=e,this.listen(this.split_,UiEventType.SPLIT,t=>{const r=t.detail.getValue(),i=t.detail.getData();switch(r){case UiEventType.SPLIT_WILL_OPEN:this.onSplitWillOpen(i);break;case UiEventType.SPLIT_WILL_CLOSE:this.onSplitWillClose(i);break;case UiEventType.SPLIT_DID_CLOSE:this.onSplitDidClose(i);break;case UiEventType.SPLIT_DID_OPEN:this.onSplitDidOpen(i);break;case UiEventType.SPLIT_TRANSITION_END:break}})}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(e){this.user_=e,this.panelMap.forEach(t=>t.user=e)}get user(){return this.user_||(this.user_=new UserManager),this.user_}render(){this.initPanelEvents(),this.preRender(),this.configurePanels(),this.displayPanels(),this.postRender()}initPanelEvents(){}preRender(){}configurePanels(){}displayPanels(){}postRender(){}dispose(){[...this.panelMap.values()].forEach(e=>e.dispose()),super.dispose()}addPanelToView(e,t){t.user=this.user,this.removePanelByName(e),this.panelMap.set(e,t),this.listen(t,Panel.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(e){this.panelMap.has(e)&&this.panelMap.get(e).dispose()}removePanel(e){const[t,r]=[...this.panelMap.entries()].find(([i,o])=>o===e);t&&r&&(r.dispose(),this.panelMap.delete(t))}getPanelByName(e){return this.panelMap.get(e)}broadcastToPanels(e){[...this.panelMap.values()].forEach(t=>t.onViewDataBroadcast(e))}initPanelEventsInternal_(){const e=new Map;return e.set("destroy_me",(t,r)=>{this.removePanel(r)}),e.set("switch_view",(t,r)=>{this.debugMe("switch_view received: eventData",t);const i=t.view;this.switchViewMap_.has(i)?this.switchViewMap_.get(i)(t,r):this.debugMe("NO VIEW FOUND FOR:",i,this.switchViewMap_)}),Object.entries({...SearchHandlers,...QueryParamHandlers}).forEach(([t,r])=>{e.set(t,r.bind(this))}),e}mapPanEv(e,t){this.panelEventMap_.set(e,t)}mapSwitchView(e,t){this.switchViewMap_.set(e,t)}onPanelEvent(e){const t=e.detail.getValue(),r=e.detail.getData(),i=e.target;this.panelEventMap_.has(t)?this.panelEventMap_.get(t)(r,i):this.debugMe(`NO EVENT MATCH
|
|
15
|
+
oPe: ${e}
|
|
16
|
+
eventValue: ${t}
|
|
17
|
+
eventData: ${JSON.stringify(r,void 0,2)}
|
|
18
|
+
ePanel: ${i.constructor.name}`)}onSplitWillOpen(e){}onSplitWillClose(e){}onSplitDidClose(e){}onSplitDidOpen(e){}dispatchViewEvent(e,t){const r=new ZooyEventData(e,t),i=EVT.makeEvent(UiEventType.VIEW,r);return this.dispatchEvent(i)}get metaData(){return this.metaData_}setMetaData(e,t){return this.metaData_.set(e,t),this.metaData}getMetaData(e){return this.metaData_.get(e)}hasMetaData(e){return this.metaData_.has(e)}}class Conductor extends EVT{constructor(){super(),this.activeView_=null,this.user_=void 0,this.split_=void 0,this.viewEventMap_=this.initViewEventsInternal_(),this.viewConstructorMap_=new Map,window.addEventListener("popstate",e=>{e.state!==null&&this.navTo(e.state)})}set split(e){this.split_=e}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(e){this.user_=e,this.activeView_&&(this.activeView_.user=this.user)}get user(){return this.user_||(this.user_=new UserManager),this.user_}initViewEventsInternal_(){return new Map().set("switch_view",(e,t)=>{if(this.viewConstructorMap_.has(e.view)){const r=this.viewConstructorMap_.get(e.view)(e.pk,e);this.switchView(r)}})}mapViewEv(e,t){this.viewEventMap_.set(e,t)}registerViewConstructor(e,t){this.viewConstructorMap_.set(e,t)}onViewEvent(e){const t=e.detail.getValue(),r=e.detail.getData(),i=e.target;this.viewEventMap_.has(t)?this.viewEventMap_.get(t)(r,i):console.warn("Unhandled VIEW Event:",e,t,r,i)}setActiveView(e){this.activeView_&&(this.stopListeningTo(this.activeView_),this.activeView_.dispose(),this.activeView_=null,delete this.activeView_),this.activeView_=e,this.activeView_.render()}initView(e){return e.user=this.user,e.split=this.split,e.recordHistory=this.recordHistory.bind(this),e.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(e,View.viewEventCode(),this.onViewEvent.bind(this)),e}switchView(e){this.setActiveView(this.initView(e))}recordHistory(e){this.debugMe("HISTORY",e),e.init?history.replaceState(e,"",document.location.href):e.history||history.pushState(e,"",null)}navTo=e=>{e.history=!0;const t=e.view,r=this.activeView_;if(r.switchViewMap_.has(t))this.debugMe("NAV:VIEW:MAP",e),r.switchViewMap_.get(t)(e);else if(this.viewConstructorMap_.has(t)){const i=this.viewConstructorMap_.get(t)(e.pk,e);this.debugMe("NAV:NEW:VIEW",e),this.switchView(i)}}}async function loadIcon(n,e=16){try{return(await import(`@carbon/icons/es/${n}/${e}.js`)).default}catch(t){throw console.error(`[Zooy] Failed to load icon: ${n}/${e}`,t),new Error(`Icon not found: ${n}/${e}. Check https://carbondesignsystem.com/guidelines/icons/library/`)}}function iconDataToElement(n,e={}){const t=document.createElementNS("http://www.w3.org/2000/svg","svg"),r={...n.attrs,focusable:"false",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",...e};return Object.entries(r).forEach(([i,o])=>{t.setAttribute(i,o)}),n.content&&n.content.forEach(i=>{const o=document.createElementNS("http://www.w3.org/2000/svg",i.elem);i.attrs&&Object.entries(i.attrs).forEach(([a,p])=>{o.setAttribute(a,p)}),t.appendChild(o)}),t}async function createIcon(n,e=16,t={}){const r=await loadIcon(n,e);return iconDataToElement(r,t)}async function getIconSVG(n,e=16,t={}){return(await createIcon(n,e,t)).outerHTML}const Icons={ADD:"add",EDIT:"edit",DELETE:"trash-can",SAVE:"save",CLOSE:"close",SEARCH:"search",FILTER:"filter",SETTINGS:"settings",CHEVRON_LEFT:"chevron--left",CHEVRON_RIGHT:"chevron--right",CHEVRON_UP:"chevron--up",CHEVRON_DOWN:"chevron--down",ARROW_LEFT:"arrow--left",ARROW_RIGHT:"arrow--right",MENU:"menu",CHECKMARK:"checkmark",ERROR:"error",WARNING:"warning",INFO:"information",FOLDER:"folder",DOCUMENT:"document",DOWNLOAD:"download",UPLOAD:"upload",OVERFLOW_MENU:"overflow-menu--vertical",VIEW:"view",VIEW_OFF:"view--off",COPY:"copy",LINK:"link",USER:"user",NOTIFICATION:"notification"};async function carbonIcon(n,e=16){return createIcon(n,e,{slot:"icon"})}const icons=Object.freeze(Object.defineProperty({__proto__:null,Icons,carbonIcon,createIcon,getIconSVG,iconDataToElement,loadIcon},Symbol.toStringTag,{value:"Module"}));async function registerCarbonLibrary(){const{registerCarbonLibrary:n}=await Promise.resolve().then(()=>require("./register-Cc9zkA5F.js"));return n()}async function registerMdcLibrary(){const{registerMdcLibrary:n}=await Promise.resolve().then(()=>require("./register-BMNs2hNG.js"));return n()}const zooy={EVT,Component,Dragger,Panel,FormPanel,Split,UserManager,View,Conductor,UiEventType,domUtils,uriUtils,icons,registerCarbonLibrary,registerMdcLibrary,ComponentLibraryRegistry,handlers};exports.ComponentLibraryRegistry=ComponentLibraryRegistry;exports.getElDataMap=getElDataMap;exports.isDefAndNotNull=isDefAndNotNull;exports.toLowerCase=toLowerCase;exports.treeUtils=treeUtils;exports.zooy=zooy;
|