@trintel/zooy 1.1.1 → 1.1.2

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.
@@ -1 +1 @@
1
- var bt=Object.create;var J=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var It=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of St(e))!Wt.call(t,o)&&o!==n&&J(t,o,{get:()=>e[o],enumerable:!(s=Et(e,o))||s.enumerable});return t};var d=(t,e,n)=>(n=t!=null?bt(At(t)):{},It(e||!t||!t.__esModule?J(n,"default",{value:t,enumerable:!0}):n,t));const m=require("./component-library-registry-BBQV6Kpv.js"),c=require("./zoo-CY2QpG41.js");let st=require("badu"),D=require("ramda");D=m.__toESM(D);let Pt=require("@carbon/web-components/lib/components/data-table/defs.js");var kt=m.__exportAll({cdsTableWrap:()=>xt}),K=(t,e,n)=>{const s=customElements.get("cds-table"),o=customElements.get("cds-pagination"),a=customElements.get(s.selectorTableBatchActions);customElements.get("cds-popover");const r=e.dataBinder,l=e.pagination,u=e.skeleton,A=e.querySelector(s.selectorTableToolbarSearch),W=e.querySelector(s.selectorTableBatchActions),x=e.querySelector(s.selectorTableBody),O=["button","a","input","select","textarea",'[role="button"]',".cds--table-expand",".cds--table-column-checkbox"].join(","),G=e.querySelectorAll(s.selectorHeaderCell+"[is-sortable]"),nt=e.isSortable||G.length>0,z=Symbol(),F=Symbol(),w=new Map,ot=i=>{t.listen(e,"click",p=>{const v=p.target.closest(s.selectorTableRow);if(!v||p.composedPath().some(f=>f.matches&&f.matches(O)))return;p.stopPropagation();const g=c.getSemanticAttributes(v);t.dispatchPanelEvent(i,{...g})})},at=i=>{t.listen(e,s.eventExpandoToggle,p=>{const v=p.target,g=v.tagName==="CDS-TABLE-HEADER-ROW",f=p.detail.expanded,E={tableAttrs:n,...c.getSemanticAttributes(v),target:v,allRows:g,didExpand:f};t.dispatchPanelEvent(i,E)})},rt=i=>{w.set(z,p=>{t.dispatchPanelEvent(i,p)})},ct=i=>{w.set(F,p=>{const v=p.detail.selectedRows,g=Math.min(v.length,W.totalRowsCount),f=p.target,E=c.getSemanticAttributes(f),I=v.map(c.getSemanticAttributes),_={tableAttrs:n,...E,target:f,selectCount:g,selection:I};t.dispatchPanelEvent(i,_)})},it=i=>{t.listen(e,s.eventTableRowSelect,p=>{const v=p.target,g=p.detail.selectedRows||[],f=g.length,E=g.map(c.getSemanticAttributes),I={tableAttrs:n,...c.getSemanticAttributes(v),selectCount:f,selection:E,target:v};t.dispatchPanelEvent(i,I)})},lt=()=>{t.listen(e,s.eventBeforeSort,i=>{const p=i.target,v=i.detail.oldSortDirection,g=i.detail.sortDirection,f=c.getSemanticAttributes(p),E=f.sortField,I=g===Pt.TABLE_SORT_DIRECTION.DESCENDING?`-${E}`:E;i.cancelBubble=!0,i.stopPropagation(),i.preventDefault(),x.innerHTML="",u&&u.show(),G.forEach((C,b)=>{C===p?(C.setAttribute("sort-active","true"),C.setAttribute("sort-direction",g)):(C.removeAttribute("sort-active"),C.setAttribute("sort-direction","none"))});const _={ordering:I};r.fetchData(_).then(()=>{l.setData(r),u&&u.hide()}),w.has(z)&&w.get(z)({tableAttrs:n,...f,sortNow:g,sortWas:v,sortField:E,ordering:I,target:p})})},dt=()=>{t.listen(e,s.eventTableRowSelectAll,i=>{i.detail.selectedRows.length===0&&e.querySelectorAll(s.selectorTableRow).forEach(p=>{p.disabled=!1,p.selected=!1}),w.has(F)&&w.get(F)(i)})},pt=()=>{t.listen(e,s.eventBeforeChangeSelectionAll,i=>{i.stopPropagation(),i.detail.callback&&i.detail.callback()})},ut=i=>{const p=e.querySelector("cds-table-header-row");t.listen(i,a.eventClickSelectAll,v=>{v.stopPropagation(),p.dispatchEvent(new CustomEvent(s.eventBeforeChangeSelectionAll,{bubbles:!0,cancelable:!0,composed:!0,detail:{selected:!0,callback:()=>{i.selectedRowsCount=i.totalRowsCount,e.querySelectorAll(s.selectorTableRow).forEach(g=>{g.disabled=!0})}}}))})},vt=i=>{t.listen(i,"keydown",p=>{if(p.key==="Enter"){u&&u.show(),l.totalItems=0,e.querySelector("cds-table-body").replaceChildren();const v={search:i.value||"",offset:0};r.fetchData(v).then(()=>{l.setData(r),u&&u.hide()})}})},mt=i=>{t.listen(i,s.eventSearchInput,p=>{if((p.detail.value||"")===""){const v={search:"",offset:0};u&&u.show(),r.fetchData(v).then(()=>{u&&u.hide(),l.setData(r)})}})},gt=i=>{i.caret=!1;const p=i.querySelector("cds-icon-button, button:not([slot])"),v=i.querySelectorAll("cds-checkbox"),g=i.querySelectorAll("cds-modal-footer-button"),f=[...i.querySelectorAll("cds-checkbox-group")].map(c.getSemanticAttributes).map(D.pathOr("noop",["zoo","filter","field"])).reduce((b,S)=>(b[S]=null,b),{offset:0});if(!p||!g){console.error("Improperly configured Batch Filter popover");return}new MutationObserver(()=>{i.classList.toggle("cds--overflow-menu--open",i.open)}).observe(i,{attributes:!0,attributeFilter:["open"]});const E=Symbol(),I=Symbol(),_=[...g].reduce((b,S,y)=>(S.hasAttribute("reset-filter")&&b.set(E,S),S.hasAttribute("apply-filter")&&b.set(I,S),b),new Map),C=()=>{const b=new Map;return v.forEach(S=>{const y=S.getAttribute("id");if(!y||!y.includes(":"))return;const[B,M]=y.split(":");b.has(B)||b.set(B,[]),S.checked&&b.get(B).push(M)}),b};if(_.has(E)){const b=S=>S.checked=!1;t.listen(_.get(E),"click",S=>{S.stopPropagation(),v.forEach(b),u&&u.show(),r.fetchData(f).then(()=>{l&&l.setData(r),u&&u.hide(),i.open=!1})})}_.has(I)&&t.listen(_.get(I),"click",b=>{b.stopPropagation();const S=[...C()].reduce((y,[B,M])=>(y[B]=M===[]?null:M,y),{offset:0});u&&u.show(),r.fetchData(S).then(()=>{l&&l.setData(r),u&&u.hide(),i.open=!1})}),t.listen(p,"click",b=>{b.stopPropagation(),i.open=!i.open,i.classList.toggle("cds--overflow-menu--open",i.open)})},ht=()=>{t.listen(l,o.eventPageSizeChanged,i=>{const p={limit:l.pageSize,offset:0};r.fetchData(p).then(()=>{l.setData(r)})})},ft=()=>{let i=null;t.listen(l,o.eventChangeCurrent,p=>{const{page:v}=p.detail,g=l.pageSize,f=(v-1)*g;if(f!==i){i=f;const E={limit:g,offset:f};r.fetchData(E).then(()=>{l.setData(r),u&&u.hide()})}})};r&&l&&(ht(),ft()),r&&A&&(vt(A),mt(A));const V=e.querySelector(s.selectorTableToolbarContent);if(V){const i=V.querySelectorAll("cds-popover[data-batch-filter]");r&&i&&i.forEach(gt)}e.isSelectable&&(dt(),pt(),W&&ut(W)),r&&nt&&lt();const Z={zoo:{event:{row:{click:ot,expand:at,check:{one:it,all:ct}},column:{sort:rt}}}};(0,st.objToPaths)(n).forEach(([i,p])=>{D.hasPath(i,Z)&&D.path(i,Z)(p)})},_t=t=>{const e=document.createElement("cds-pagination");return e.backwardText="Previous page",e.forwardText="Next page",e.itemsPerPageText="Items per page:",e.pageSize=t.limit,e.size="lg",[10,25,50,100,500].forEach(n=>{const s=document.createElement("cds-select-item");s.value=n.toString(),s.textContent=n.toString(),e.appendChild(s)}),e.setData=n=>{if(n.isPaginated){const{count:s}=D.pick(["count"],n.data);e.pagesUnknown=Math.ceil(s/n.limit)>100,e.totalItems=s,e.pagesUnknown?e.formatStatusWithIndeterminateTotal=({start:o,end:a})=>`${o}–${a} of ${s} item${s<=1?"":"s"}`:delete e.formatStatusWithIndeterminateTotal}},e},Ct=t=>{if(!t.parentNode){console.error("[Carbon Table] Cannot create skeleton: table has no parent node");return}const e=!!t.querySelector("cds-table-header-title"),n=!!t.querySelector("cds-table-header-description"),s=!!t.querySelector("cds-table-toolbar"),o=[...t.querySelectorAll("cds-table-header-cell")].length,a=t.hasAttribute("zebra"),r=t.getAttribute("size"),l=document.createElement("cds-table-skeleton");l.showHeader=e||n,l.showToolbar=s,l.zebra=a,l.columnCount=o,l.size=r,l.show=()=>l.classList.remove("hidden"),l.hide=()=>l.classList.add("hidden");const u=document.createElement("div");return u.classList.add("zoo-datatable-skeleton-wrapper"),t.parentNode.insertBefore(u,t),u.appendChild(l),u.appendChild(t),l},yt=(t,e)=>{const n=e.getAttribute("zoo-url-api"),s=parseInt(e.getAttribute("data-page-size")||25,10);if(n)return new c.Binder(t,n,e,{urlParams:{limit:s}})},xt={selector:"cds-table",init:function(t){const e=c.getSemanticAttributes(t),n=this,s=yt(n,t);if((0,st.isDefAndNotNull)(s)){t.dataBinder=s;const o=Ct(t);t.skeleton=o;const a=_t(s);t.pagination=a,t.after(a),s.fetchData().then(r=>{o.hide(),a.setData(s),K(n,t,e)})}else K(n,t,e)}},wt=m.__exportAll({cdsPaginationWrap:()=>Dt}),Dt={selector:"cds-pagination",init:function(t){const e=this,n=customElements.get("cds-pagination");let s=null;e.listen(t,n.eventChangeCurrent,o=>{const a=o.detail.page,r=t.pageSize,l=(a-1)*r;l!==s&&(s=l,e.dispatchPanelEvent("pagination-changed-current",{detail:{page:a,pageSize:r,action:"page-change"}}))}),e.listen(t,n.eventPageSizeChanged,o=>{const a=t.pageSize;s=null,e.dispatchPanelEvent("pagination-changed-page-size",{detail:{page:1,pageSize:a,action:"page-size-change"}})})}},Bt=m.__exportAll({cdsModalBodyContentWrap:()=>Ft,cdsModalBodyWrap:()=>zt,cdsModalCloseButWrap:()=>Ot,cdsModalFooterButWrap:()=>Lt,cdsModalFooterWrap:()=>Rt,cdsModalHeaderWrap:()=>Nt,cdsModalHeadingWrap:()=>Tt,cdsModalLabelWrap:()=>qt,cdsModalWrap:()=>Mt}),Mt={selector:"cds-modal",init:function(t){const e=customElements.get("cds-modal"),n=c.getSemanticAttributes(t),s=c.getEventAttribute(t,"open-event","event");s&&this.listen(t,"cds-modal-beingopened",r=>{this.dispatchPanelEvent(s,{...n,action:"opened"})});const o=t.getAttribute("before-close-event");o&&this.listen(t,e.eventBeforeClose,r=>{this.dispatchPanelEvent(o,{...n,action:"closing",cancelable:!0})}),this.listen(t,e.eventClose,r=>{this.dispatchPanelEvent("destroy_me",{...n,action:"closed",triggeredBy:r.detail?.triggeredBy})});const a=c.getEventAttribute(t,"primary-event","event");a&&this.listen(t,"cds-modal-primary-focus",r=>{this.dispatchPanelEvent(a,{...n,action:"primary"})})}},Nt={selector:"cds-modal-header"},Tt={selector:"cds-modal-heading"},qt={selector:"cds-modal-label"},Ot={selector:"cds-modal-close-button"},zt={selector:"cds-modal-body"},Ft={selector:"cds-modal-body-content"},Rt={selector:"cds-modal-footer"},Lt={selector:"cds-modal-footer-button",init:function(t){const e=c.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",s=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const n=e.event;n&&this.listen(t,"click",s=>{s.stopPropagation(),this.dispatchPanelEvent(n,e)})}},Ht=m.__exportAll({cdsMenuButtonWrap:()=>jt,cdsMenuWrap:()=>Ut}),Ut={selector:"cds-menu",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-menu-opened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-menu-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})}),this.listen(t,"click",o=>{if(o.target.tagName==="CDS-MENU-ITEM"){const a=c.getSemanticAttributes(o.target),r=a.event||e.event;r&&(o.stopPropagation(),this.dispatchPanelEvent(r,{...e,...a}))}}),this.listen(t,"cds-item-changed",o=>{const a=o.detail.triggeredBy,r=c.getSemanticAttributes(a),l=r.event||e.event;l&&this.dispatchPanelEvent(l,{...e,...r,action:"selection-changed"})})}},jt={selector:"cds-menu-button",init:function(t){const e=c.getSemanticAttributes(t),n=t.querySelector("cds-menu");n&&this.listen(n,"click",s=>{if(s.target.tagName==="CDS-MENU-ITEM"){const o=c.getSemanticAttributes(s.target),a=o.event||e.event;a&&(s.stopPropagation(),this.dispatchPanelEvent(a,{...e,...o}))}})}},$t=m.__exportAll({cdsButFabWrap:()=>Jt,cdsButtonWrap:()=>Gt,cdsComboButWrap:()=>Qt,cdsCopyButWrap:()=>Kt,cdsIconButToggleWrap:()=>Zt,cdsIconButWrap:()=>Vt}),Gt={selector:"cds-button",init:function(t){const e=c.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",s=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const n=e.event;n&&this.listen(t,"click",s=>{s.stopPropagation(),this.dispatchPanelEvent(n,c.getSemanticAttributes(t))})}},Vt={selector:"cds-icon-button:not([data-toggle])",event:"click",getData:(t,e)=>e},Zt={selector:"cds-icon-button[data-toggle]",init:function(t){const e=c.getSemanticAttributes(t);e.event&&this.listen(t,"click",n=>{n.stopPropagation(),t.isSelected=!t.isSelected,this.dispatchPanelEvent(e.event,{...e,isOn:t.isSelected})})}},Jt={selector:"cds-button[data-fab]",event:"click",getData:(t,e)=>e},Kt={selector:"cds-copy-button",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"click",o=>{o.stopPropagation(),this.dispatchPanelEvent(n,{...e,action:"copy"})});const s=t.getAttribute("success-event");if(s){const o=new MutationObserver(()=>{t.hasAttribute("feedback-shown")&&this.dispatchPanelEvent(s,{...e,action:"copied"})});o.observe(t,{attributes:!0,attributeFilter:["feedback-shown"]}),t._copyObserver=o}}},Qt={selector:"cds-combo-button",init:function(t){const e=c.getSemanticAttributes(t);e.event&&this.listen(t,"click",s=>{const o=s.composedPath(),a=o.some(l=>l.tagName==="CDS-MENU-ITEM"),r=o.some(l=>l.tagName==="CDS-ICON-BUTTON");!a&&!r&&(s.stopPropagation(),this.dispatchPanelEvent(e.event,{...e,action:"primary"}))});const n=t.querySelector("cds-menu");n&&this.listen(n,"click",s=>{if(s.target.tagName==="CDS-MENU-ITEM"){const o=c.getSemanticAttributes(s.target),a=o.event||c.getEventAttribute(t,"menu-event","event");a&&this.dispatchPanelEvent(a,{...e,...o,action:"menu-item"})}})}},Xt=m.__exportAll({cdsComboBoxWrap:()=>te,cdsDropdownWrap:()=>Yt,cdsMultiSelectWrap:()=>ee}),Yt={selector:"cds-dropdown",init:function(t){const e=customElements.get("cds-dropdown"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{this.dispatchPanelEvent(s,{...n,value:t.value,selectedValue:a.detail?.item?.value,selectedText:a.detail?.item?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},te={selector:"cds-combo-box",init:function(t){const e=customElements.get("cds-combo-box"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{const r=a.detail?.item;this.dispatchPanelEvent(s,{...n,value:t.value,selectedValue:r?.value,selectedText:r?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},ee={selector:"cds-multi-select",init:function(t){const e=customElements.get("cds-multi-select"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{const r=t.value?t.value.split(","):[];this.dispatchPanelEvent(s,{...n,selectedItems:r})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},se=m.__exportAll({cdsDatePickerWrap:()=>ne,cdsTimePickerWrap:()=>oe}),ne={selector:"cds-date-picker",init:function(t){const e=customElements.get("cds-date-picker"),n=c.getSemanticAttributes(t),s=t.querySelector('cds-date-picker-input[kind="from"]'),o=t.querySelector('cds-date-picker-input[kind="to"]'),a=s&&o,r=n.event;r&&this.listen(t,e.eventChange,u=>{let A;a?A={from:s.value||"",to:o.value||""}:A=t.value,this.dispatchPanelEvent(r,{...n,value:A})});const l=t.getAttribute("error-event");l&&this.listen(t,e.eventFlatpickrError,u=>{this.dispatchPanelEvent(l,{...n,error:u.detail})})}},oe={selector:"cds-time-picker",event:"cds-time-picker-changed",getData:(t,e,n)=>({...e,value:n.value})},ae=m.__exportAll({cdsFileUploaderWrap:()=>re}),re={selector:"cds-file-uploader",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;if(n){const o=t.querySelector('input[type="file"]');o&&this.listen(o,"change",a=>{this.dispatchPanelEvent(n,{...e,files:Array.from(a.target.files||[])})})}const s=t.getAttribute("delete-event");s&&this.listen(t,"cds-file-uploader-item-deleted",o=>{this.dispatchPanelEvent(s,{...e,fileName:o.detail?.fileName,fileId:o.detail?.fileId})})}},ce=m.__exportAll({cdsAccordionWrap:()=>le,cdsContentSwitcherWrap:()=>de,cdsTabsWrap:()=>ie}),ie={selector:"cds-tabs",init:function(t){const e=customElements.get("cds-tabs"),n=c.getSemanticAttributes(t),s=t.getAttribute("before-select-event");s&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(s,{...n,tabValue:a.detail.value,cancelable:!0})});const o=n.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,l=c.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...n,...l,tabValue:a.detail.value})})}},le={selector:"cds-accordion",init:function(t){const e=customElements.get("cds-accordion-item"),n=c.getSemanticAttributes(t);[...t.querySelectorAll("cds-accordion-item")].forEach(s=>{const o=c.getSemanticAttributes(s),a=o.event||n.event;a&&this.listen(s,e.eventToggle,r=>{this.dispatchPanelEvent(a,{...n,...o,open:r.detail.open})})})}},de={selector:"cds-content-switcher",init:function(t){const e=customElements.get("cds-content-switcher"),n=c.getSemanticAttributes(t),s=t.getAttribute("before-select-event");s&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(s,{...n,value:a.detail.value,cancelable:!0})});const o=n.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,l=c.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...n,...l,value:r.getAttribute("value")})})}},pe=m.__exportAll({cdsBreadCrumbWrap:()=>me,cdsBreadcrumbItemWrap:()=>ue,cdsBreadcrumbLinkWrap:()=>ve}),ue={selector:"cds-breadcrumb-item"},ve={selector:"cds-breadcrumb-link",event:"click",getData:(t,e,n)=>(t.preventDefault(),{...e,href:n.getAttribute("href")})},me={selector:"cds-breadcrumb",init:function(t){const e=this,n=c.getSemanticAttributes(t),s=n.event;if(s){const o=r=>{e.dispatchPanelEvent(s,{...n,...r})};e.listen(t,"click",r=>{const l=r.target.closest("cds-breadcrumb-link");l&&(r.preventDefault(),r.stopPropagation(),o(c.getSemanticAttributes(l)))});const a=t.querySelector("cds-overflow-menu-body");a&&e.listen(a,"cds-overflow-menu-item-clicked",r=>{r.stopPropagation(),o(c.getSemanticAttributes(r.target))})}}},ge=m.__exportAll({cdsNumberInputWrap:()=>be,cdsPasswordInputWrap:()=>Ee,cdsSearchWrap:()=>Se,cdsTextAreaWrap:()=>fe,cdsTextInputWrap:()=>he}),he={selector:"cds-text-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},fe={selector:"cds-textarea",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},be={selector:"cds-number-input",event:"cds-number-input",getData:(t,e,n)=>({...e,value:t.detail.value,direction:t.detail.direction})},Ee={selector:"cds-password-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},Se={selector:"cds-search",event:"cds-search-input",getData:(t,e,n)=>({...e,value:n.value})},Ae=m.__exportAll({cdsCheckboxWrap:()=>We,cdsRadioButGroupWrap:()=>Ie,cdsSelectWrap:()=>ke,cdsSliderWrap:()=>_e,cdsToggleWrap:()=>Pe}),We={selector:"cds-checkbox",event:"cds-checkbox-changed",getData:(t,e,n)=>({...e,checked:t.detail.checked,value:n.value})},Ie={selector:"cds-radio-button-group",event:"cds-radio-button-group-changed",getData:(t,e)=>({...e,value:t.detail?.value})},Pe={selector:"cds-toggle",event:"cds-toggle-changed",getData:(t,e)=>({...e,isOn:t.detail.checked,value:t.detail.checked})},ke={selector:"cds-select",event:"cds-select-selected",getData:(t,e)=>({...e,value:t.detail.value})},_e={selector:"cds-slider",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"cds-slider-changed",o=>{this.dispatchPanelEvent(n,{...e,value:o.detail.value})});const s=t.getAttribute("input-event");s&&this.listen(t,"cds-slider-input-changed",o=>{this.dispatchPanelEvent(s,{...e,value:o.detail.value})})}},Ce=m.__exportAll({cdsFilterTagWrap:()=>we,cdsSDismissibleTagWrap:()=>xe,cdsTagsWrap:()=>ye}),ye={selector:"cds-tag",event:"click",getData:(t,e)=>e},xe={selector:"cds-dismissible-tag",init:function(t){const e=c.getSemanticAttributes(t),n=t.getAttribute("click-event");n&&this.listen(t,"click",o=>{o.target.closest("button")||this.dispatchPanelEvent(n,{...e})});const s=e.event;s&&this.listen(t,"cds-dismissible-tag-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},we={selector:"cds-filter-tag",event:"cds-filter-tag-closed",getData:(t,e)=>({...e,action:"remove"})},De=m.__exportAll({cdsOverflowMenuWrap:()=>Be,cdsStructuredListWrap:()=>Me,cdsTreeViewWrap:()=>Ne}),Be={selector:"cds-overflow-menu",init:function(t){const e=c.getSemanticAttributes(t),n=e.event,s=t.querySelector("cds-overflow-menu-body");n&&s&&this.listen(s,"cds-overflow-menu-item-clicked",o=>{o.stopPropagation();const a=c.getSemanticAttributes(o.target);this.dispatchPanelEvent(n,{...e,...a})})}},Me={selector:"cds-structured-list",init:function(t){const e=c.getSemanticAttributes(t);[...t.querySelectorAll("cds-structured-list-row")].forEach(n=>{const s=c.getSemanticAttributes(n),o=s.event||e.event;o&&this.listen(n,"click",a=>{a.stopPropagation(),this.dispatchPanelEvent(o,{...e,...s})})}),t.hasAttribute("selection")&&this.listen(t,"cds-structured-list-selected",n=>{const s=n.detail.row,o=c.getSemanticAttributes(s),a=e.event;a&&this.dispatchPanelEvent(a,{...e,...o})})}},Ne={selector:"cds-tree-view",init:function(t){const e=c.getSemanticAttributes(t);this.listen(t,"cds-tree-node-selected",s=>{const o=s.detail.node,a=c.getSemanticAttributes(o),r=a.event||e.event;r&&this.dispatchPanelEvent(r,{...e,...a,nodeId:o.id,label:o.getAttribute("label")})});const n=c.getEventAttribute(t,"expand-event");n&&this.listen(t,"cds-tree-node-expanded",s=>{this.dispatchPanelEvent(n,{...e,nodeId:s.detail.node.id,expanded:s.detail.expanded})})}},Te=m.__exportAll({cdsActionableNotificationWrap:()=>ze,cdsInlineNotificationWrap:()=>Oe,cdsToastNotificationWrap:()=>qe}),qe={selector:"cds-toast-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Oe={selector:"cds-inline-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},ze={selector:"cds-actionable-notification",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"close-event","event");n&&this.listen(t,"cds-notification-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})});const s=c.getEventAttribute(t,"action-event");s&&this.listen(t,"cds-notification-actioned",o=>{this.dispatchPanelEvent(s,{...e,action:"actioned"})})}},Fe=m.__exportAll({cdsClickableTileWrap:()=>Re,cdsExpandableTileWrap:()=>Le,cdsRadioTileWrap:()=>Ue,cdsSelectableTileWrap:()=>He}),Re={selector:"cds-clickable-tile",event:"click",getData:(t,e)=>({...e,href:t.currentTarget.getAttribute("href")})},Le={selector:"cds-expandable-tile",init:function(t){const e=c.getSemanticAttributes(t),n=t.getAttribute("before-toggle-event");n&&this.listen(t,"cds-expandable-tile-beingtoggled",o=>{this.dispatchPanelEvent(n,{...e,expanded:o.detail.expanded,cancelable:!0})});const s=e.event;s&&this.listen(t,"cds-expandable-tile-toggled",o=>{this.dispatchPanelEvent(s,{...e,expanded:o.detail.expanded})})}},He={selector:"cds-selectable-tile",event:"cds-selectable-tile-changed",getData:(t,e,n)=>({...e,selected:t.detail.selected,value:n.value})},Ue={selector:"cds-radio-tile",event:"cds-selectable-tile-changed",getData:(t,e,n)=>({...e,selected:t.detail.selected,value:n.value})},je=m.__exportAll({cdsInlineLoadingWrap:()=>Ve,cdsProgressBarWrap:()=>$e,cdsProgressIndicatorWrap:()=>Ge}),$e={selector:"cds-progress-bar",init:function(t){const e=c.getSemanticAttributes(t);if(e.event){const n=new MutationObserver(()=>{const s=parseFloat(t.getAttribute("value")||"0");s>=parseFloat(t.getAttribute("max")||"100")&&this.dispatchPanelEvent(e.event,{...e,value:s,status:"complete"})});n.observe(t,{attributes:!0,attributeFilter:["value"]}),t._progressObserver=n}}},Ge={selector:"cds-progress-indicator",init:function(t){const e=c.getSemanticAttributes(t);this.listen(t,"cds-progress-step-click",n=>{const s=n.target,o=c.getSemanticAttributes(s),a=o.event||e.event;a&&this.dispatchPanelEvent(a,{...e,...o,stepIndex:s.getAttribute("data-index"),stepLabel:s.getAttribute("label")})})}},Ve={selector:"cds-inline-loading",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"cds-inline-loading-onsuccess",o=>{this.dispatchPanelEvent(n,{...e,status:"finished"})});const s=t.getAttribute("status-event");if(s){const o=new MutationObserver(a=>{a.forEach(r=>{if(r.attributeName==="status"){const l=t.getAttribute("status");this.dispatchPanelEvent(s,{...e,status:l})}})});o.observe(t,{attributes:!0,attributeFilter:["status"]}),t._statusObserver=o}}},Ze=m.__exportAll({cdsPopoverWrap:()=>Ke,cdsToggletipWrap:()=>Qe,cdsTooltipWrap:()=>Je}),Je={selector:"cds-tooltip",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-tooltip-beingopened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-tooltip-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},Ke={selector:"cds-popover",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-popover-beingopened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-popover-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},Qe={selector:"cds-toggletip",init:function(t){const e=c.getSemanticAttributes(t);if(e.event){const n=new MutationObserver(s=>{s.forEach(o=>{if(o.attributeName==="open"){const a=t.hasAttribute("open");this.dispatchPanelEvent(e.event,{...e,action:a?"opened":"closed",open:a})}})});n.observe(t,{attributes:!0,attributeFilter:["open"]}),t._toggletipObserver=n}}},Xe=m.__exportAll({cdsCodeSnipWrap:()=>ts,cdsLinkWrap:()=>Ye}),Ye={selector:"cds-link",event:"click",getData:(t,e,n)=>({...e,href:n.getAttribute("href")})},ts={selector:"cds-code-snippet",event:"cds-copy-button-clicked",getData:(t,e)=>({...e,action:"copied"})},es=m.__exportAll({cdsBadgeIndicatorWrap:()=>ls,cdsFormGroupWrap:()=>os,cdsFormItemWrap:()=>ns,cdsFormWrap:()=>ss,cdsHeadingWrap:()=>rs,cdsIconIndicatorWrap:()=>is,cdsIconWrap:()=>cs,cdsLoadingWrap:()=>ds,cdsSkeletonPlaceholderWrap:()=>us,cdsSkeletonTextWrap:()=>ps,cdsStackWrap:()=>as}),ss={selector:"cds-form"},ns={selector:"cds-form-item"},os={selector:"cds-form-group"},as={selector:"cds-stack"},rs={selector:"cds-heading"},cs={selector:"cds-icon"},is={selector:"cds-icon-indicator"},ls={selector:"cds-badge-indicator"},ds={selector:"cds-loading"},ps={selector:"cds-skeleton-text"},us={selector:"cds-skeleton-placeholder"};function h(t){return Object.values(t).filter(e=>typeof e=="object"&&e!==null&&e.selector)}var vs=[...h(wt),...h(kt),...h(Bt),...h(Ht),...h($t),...h(Xt),...h(se),...h(ae),...h(ce),...h(pe),...h(ge),...h(Ae),...h(Ce),...h(De),...h(Te),...h(Fe),...h(je),...h(Ze),...h(Xe),...h(es)];function ms(){const t=new Map;return vs.forEach(e=>{t.set(e.selector,e)}),t}var gs=()=>import("@carbon/web-components/es/components/accordion/index.js"),R=()=>import("@carbon/web-components/es/components/breadcrumb/index.js"),hs=()=>import("@carbon/web-components/es/components/stack/index.js"),fs=()=>import("@carbon/web-components/es/components/structured-list/index.js"),N=()=>import("@carbon/web-components/es/components/tile/index.js"),bs=()=>import("@carbon/web-components/es/components/tree-view/index.js"),Es=()=>import("@carbon/web-components/es/components/link/index.js"),Ss=()=>import("@carbon/web-components/es/components/tabs/index.js"),As=()=>import("@carbon/web-components/es/components/content-switcher/index.js"),Q=()=>import("@carbon/web-components/es/components/menu/index.js"),Ws=()=>import("@carbon/web-components/es/components/overflow-menu/index.js"),L=()=>import("@carbon/web-components/es/components/button/index.js"),X=()=>import("@carbon/web-components/es/components/icon-button/index.js"),Is=()=>import("@carbon/web-components/es/components/combo-button/index.js"),Ps=()=>import("@carbon/web-components/es/components/copy-button/index.js"),ks=()=>import("@carbon/web-components/es/components/checkbox/index.js"),_s=()=>import("@carbon/web-components/es/components/radio-button/index.js"),Cs=()=>import("@carbon/web-components/es/components/toggle/index.js"),H=()=>import("@carbon/web-components/es/components/select/index.js"),ys=()=>import("@carbon/web-components/es/components/slider/index.js"),U=()=>import("@carbon/web-components/es/components/text-input/index.js"),xs=()=>import("@carbon/web-components/es/components/textarea/index.js"),ws=()=>import("@carbon/web-components/es/components/number-input/index.js"),Ds=()=>import("@carbon/web-components/es/components/password-input/index.js"),Y=()=>import("@carbon/web-components/es/components/search/index.js"),Bs=()=>import("@carbon/web-components/es/components/combo-box/index.js"),Ms=()=>import("@carbon/web-components/es/components/dropdown/index.js"),Ns=()=>import("@carbon/web-components/es/components/multi-select/index.js"),Ts=()=>import("@carbon/web-components/es/components/date-picker/index.js"),qs=()=>import("@carbon/web-components/es/components/time-picker/index.js"),Os=()=>import("@carbon/web-components/es/components/file-uploader/index.js"),tt=()=>import("@carbon/web-components/es/components/form/index.js"),zs=()=>import("@carbon/web-components/es/components/form-group/index.js"),Fs=()=>import("@carbon/web-components/es/components/data-table/index.js"),et=()=>import("@carbon/web-components/es/components/pagination/index.js"),Rs=()=>import("@carbon/web-components/es/components/code-snippet/index.js"),j=()=>import("@carbon/web-components/es/components/tag/index.js"),Ls=()=>import("@carbon/web-components/es/components/badge-indicator/index.js"),$=()=>import("@carbon/web-components/es/components/notification/index.js"),Hs=()=>import("@carbon/web-components/es/components/loading/index.js"),Us=()=>import("@carbon/web-components/es/components/inline-loading/index.js"),js=()=>import("@carbon/web-components/es/components/progress-bar/index.js"),$s=()=>import("@carbon/web-components/es/components/progress-indicator/index.js"),Gs=()=>import("@carbon/web-components/es/components/skeleton-placeholder/index.js"),Vs=()=>import("@carbon/web-components/es/components/skeleton-text/index.js"),P=()=>import("@carbon/web-components/es/components/modal/index.js"),k=()=>import("@carbon/web-components/es/components/tooltip/index.js"),Zs=()=>import("@carbon/web-components/es/components/popover/index.js"),Js=()=>import("@carbon/web-components/es/components/toggle-tip/index.js"),Ks=()=>import("@carbon/web-components/es/components/heading/index.js"),Qs=()=>import("@carbon/web-components/es/components/icon/index.js"),Xs=()=>import("@carbon/web-components/es/components/icon-indicator/index.js"),q={"cds-table":[k,L,U,Y,H,et,Fs],"cds-pagination":[H,U,et],"cds-button":[k,L],"cds-icon-button:not([data-toggle])":[k,X],"cds-icon-button[data-toggle]":[k,X],"cds-button[data-fab]":[k,L],"cds-copy-button":[k,Ps],"cds-combo-button":[k,Is],"cds-checkbox":[ks],"cds-radio-button-group":[_s],"cds-toggle":[Cs],"cds-select":[H],"cds-slider":[ys],"cds-text-input":[U],"cds-textarea":[xs],"cds-number-input":[ws],"cds-password-input":[k,Ds],"cds-search":[Y],"cds-dropdown":[Ms],"cds-combo-box":[Bs],"cds-multi-select":[Ns],"cds-date-picker":[Ts],"cds-time-picker":[qs],"cds-file-uploader":[Os],"cds-tabs":[Ss],"cds-accordion":[gs],"cds-content-switcher":[As],"cds-breadcrumb":[R],"cds-breadcrumb-item":[R],"cds-breadcrumb-link":[R],"cds-menu":[Q],"cds-menu-button":[Q],"cds-overflow-menu":[Ws],"cds-structured-list":[fs],"cds-tree-view":[bs],"cds-modal":[P],"cds-modal-header":[P],"cds-modal-heading":[P],"cds-modal-label":[P],"cds-modal-close-button":[P],"cds-modal-body":[P],"cds-modal-body-content":[P],"cds-modal-footer":[P],"cds-modal-footer-button":[P],"cds-toast-notification":[$],"cds-inline-notification":[$],"cds-actionable-notification":[$],"cds-clickable-tile":[N],"cds-expandable-tile":[N],"cds-selectable-tile":[N],"cds-radio-tile":[N],"cds-progress-bar":[js],"cds-progress-indicator":[$s],"cds-inline-loading":[Us],"cds-tooltip":[k],"cds-popover":[Zs],"cds-toggletip":[Js],"cds-tag":[j],"cds-dismissible-tag":[j],"cds-filter-tag":[j],"cds-link":[Es],"cds-code-snippet":[Rs],"cds-form":[tt],"cds-form-item":[tt],"cds-form-group":[zs],"cds-stack":[hs],"cds-heading":[Ks],"cds-icon":[Qs],"cds-icon-indicator":[Xs],"cds-badge-indicator":[Ls],"cds-loading":[Hs],"cds-skeleton-text":[Vs],"cds-skeleton-placeholder":[Gs]};function Ys(t){const e=new Map;if(!t||!(t instanceof Element))return e;for(const s of Object.keys(T))e.set(s,[]);for(const[s,o]of Object.entries(T))t.matches(s)&&e.get(s).push(t);const n=t.querySelectorAll("*");for(const s of n)for(const[o,a]of Object.entries(T))s.matches(o)&&e.get(o).push(s);for(const[s,o]of e.entries())o.length===0&&e.delete(s);return e}function tn(t){const e=new Set;for(const[n,s]of t.entries())s.length>0&&q[n]&&q[n].forEach(o=>e.add(o));return e}async function en(t,e){if(t.size===0)return;const n=Array.from(t).map(async s=>(e.has(s)||e.set(s,s()),e.get(s)));await Promise.all(n)}function sn(t,e){let n=0;for(const[s,o]of t.entries()){const a=T[s];o.forEach(r=>{if(a.init){a.init.call(e,r);return}if(a.multiEvent){const A=c.getSemanticAttributes(r);a.events.forEach(W=>{const x=c.getEventAttribute(r,W.attrName,"event");x&&e.listen(r,W.type,O=>{e.dispatchPanelEvent(x,W.getData(O,A,r))})});return}const l=c.getSemanticAttributes(r),u=l.event;u&&e.listen(r,a.event,A=>{A.stopPropagation();const W=a.getData(A,l,r),x=W._eventOverride||u;delete W._eventOverride,e.dispatchPanelEvent(x,W)})}),n+=o.length}return n}var T={...Object.fromEntries(ms())},nn=async function(t,e){const n=Ys(t);if(n.size===0){this.debugMe("[Carbon] No Carbon components found in panel");return}this.carbonComponents||(this.carbonComponents=new Map);for(const[a,r]of n.entries())this.carbonComponents.set(a,r);const s=tn(n);if(s.size>0)try{await en(s,e)}catch(a){console.error("[Carbon] Failed to load some component modules:",a)}const o=sn(n,this);o>0&&this.debugMe(`[Carbon] Total components initialized: ${o}`)},on=(t={})=>{const{preload:e=[]}=t,n=new Map;if(e.length>0){const s=e.filter(a=>q[a]?!0:(console.warn(`[Carbon] No import found for selector: ${a}`),!1)),o=s.flatMap(a=>q[a].map(r=>(n.has(r)||n.set(r,r()),n.get(r))));Promise.all(o).then(()=>console.debug(`[Carbon] Preloaded: ${s.join(", ")}`)).catch(a=>console.warn("[Carbon] Preload error:",a))}m.ComponentLibraryRegistry.register("carbon",{cache:n,render:async function(s,o){try{await nn.call(this,s,o)}catch(a){console.error("[Carbon] Initialization error:",a)}},dispose:function(s){},config:{version:"2.0",description:"IBM Carbon Design System Web Components"}}),console.debug("[Zooy] Carbon Design System library registered")};exports.registerCarbonLibrary=on;
1
+ var bt=Object.create;var J=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty;var It=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of St(e))!Wt.call(t,o)&&o!==n&&J(t,o,{get:()=>e[o],enumerable:!(s=Et(e,o))||s.enumerable});return t};var d=(t,e,n)=>(n=t!=null?bt(At(t)):{},It(e||!t||!t.__esModule?J(n,"default",{value:t,enumerable:!0}):n,t));const m=require("./component-library-registry-BBQV6Kpv.js"),c=require("./zoo-CY2QpG41.js");let st=require("badu"),D=require("ramda");D=m.__toESM(D);let Pt=require("@carbon/web-components/lib/components/data-table/defs.js");var kt=m.__exportAll({cdsTableWrap:()=>xt}),K=(t,e,n)=>{const s=customElements.get("cds-table"),o=customElements.get("cds-pagination"),a=customElements.get(s.selectorTableBatchActions);customElements.get("cds-popover");const r=e.dataBinder,l=e.pagination,u=e.skeleton,A=e.querySelector(s.selectorTableToolbarSearch),W=e.querySelector(s.selectorTableBatchActions),x=e.querySelector(s.selectorTableBody),O=["button","a","input","select","textarea",'[role="button"]',".cds--table-expand",".cds--table-column-checkbox"].join(","),G=e.querySelectorAll(s.selectorHeaderCell+"[is-sortable]"),nt=e.isSortable||G.length>0,z=Symbol(),F=Symbol(),w=new Map,ot=i=>{t.listen(e,"click",p=>{const v=p.target.closest(s.selectorTableRow);if(!v||p.composedPath().some(f=>f.matches&&f.matches(O)))return;p.stopPropagation();const g=c.getSemanticAttributes(v);t.dispatchPanelEvent(i,{...g})})},at=i=>{t.listen(e,s.eventExpandoToggle,p=>{const v=p.target,g=v.tagName==="CDS-TABLE-HEADER-ROW",f=p.detail.expanded,E={tableAttrs:n,...c.getSemanticAttributes(v),target:v,allRows:g,didExpand:f};t.dispatchPanelEvent(i,E)})},rt=i=>{w.set(z,p=>{t.dispatchPanelEvent(i,p)})},ct=i=>{w.set(F,p=>{const v=p.detail.selectedRows,g=Math.min(v.length,W.totalRowsCount),f=p.target,E=c.getSemanticAttributes(f),I=v.map(c.getSemanticAttributes),_={tableAttrs:n,...E,target:f,selectCount:g,selection:I};t.dispatchPanelEvent(i,_)})},it=i=>{t.listen(e,s.eventTableRowSelect,p=>{const v=p.target,g=p.detail.selectedRows||[],f=g.length,E=g.map(c.getSemanticAttributes),I={tableAttrs:n,...c.getSemanticAttributes(v),selectCount:f,selection:E,target:v};t.dispatchPanelEvent(i,I)})},lt=()=>{t.listen(e,s.eventBeforeSort,i=>{const p=i.target,v=i.detail.oldSortDirection,g=i.detail.sortDirection,f=c.getSemanticAttributes(p),E=f.sortField,I=g===Pt.TABLE_SORT_DIRECTION.DESCENDING?`-${E}`:E;i.cancelBubble=!0,i.stopPropagation(),i.preventDefault(),x.innerHTML="",u&&u.show(),G.forEach((C,b)=>{C===p?(C.setAttribute("sort-active","true"),C.setAttribute("sort-direction",g)):(C.removeAttribute("sort-active"),C.setAttribute("sort-direction","none"))});const _={ordering:I};r.fetchData(_).then(()=>{l.setData(r),u&&u.hide()}),w.has(z)&&w.get(z)({tableAttrs:n,...f,sortNow:g,sortWas:v,sortField:E,ordering:I,target:p})})},dt=()=>{t.listen(e,s.eventTableRowSelectAll,i=>{i.detail.selectedRows.length===0&&e.querySelectorAll(s.selectorTableRow).forEach(p=>{p.disabled=!1,p.selected=!1}),w.has(F)&&w.get(F)(i)})},pt=()=>{t.listen(e,s.eventBeforeChangeSelectionAll,i=>{i.stopPropagation(),i.detail.callback&&i.detail.callback()})},ut=i=>{const p=e.querySelector("cds-table-header-row");t.listen(i,a.eventClickSelectAll,v=>{v.stopPropagation(),p.dispatchEvent(new CustomEvent(s.eventBeforeChangeSelectionAll,{bubbles:!0,cancelable:!0,composed:!0,detail:{selected:!0,callback:()=>{i.selectedRowsCount=i.totalRowsCount,e.querySelectorAll(s.selectorTableRow).forEach(g=>{g.disabled=!0})}}}))})},vt=i=>{t.listen(i,"keydown",p=>{if(p.key==="Enter"){u&&u.show(),l.totalItems=0,e.querySelector("cds-table-body").replaceChildren();const v={search:i.value||"",offset:0};r.fetchData(v).then(()=>{l.setData(r),u&&u.hide()})}})},mt=i=>{t.listen(i,s.eventSearchInput,p=>{if((p.detail.value||"")===""){const v={search:"",offset:0};u&&u.show(),r.fetchData(v).then(()=>{u&&u.hide(),l.setData(r)})}})},gt=i=>{i.caret=!1;const p=i.querySelector("cds-icon-button, button:not([slot])"),v=i.querySelectorAll("cds-checkbox"),g=i.querySelectorAll("cds-modal-footer-button"),f=[...i.querySelectorAll("cds-checkbox-group")].map(c.getSemanticAttributes).map(D.pathOr("noop",["zoo","filter","field"])).reduce((b,S)=>(b[S]=null,b),{offset:0});if(!p||!g){console.error("Improperly configured Batch Filter popover");return}new MutationObserver(()=>{i.classList.toggle("cds--overflow-menu--open",i.open)}).observe(i,{attributes:!0,attributeFilter:["open"]});const E=Symbol(),I=Symbol(),_=[...g].reduce((b,S,y)=>(S.hasAttribute("reset-filter")&&b.set(E,S),S.hasAttribute("apply-filter")&&b.set(I,S),b),new Map),C=()=>{const b=new Map;return v.forEach(S=>{const y=S.getAttribute("id");if(!y||!y.includes(":"))return;const[B,M]=y.split(":");b.has(B)||b.set(B,[]),S.checked&&b.get(B).push(M)}),b};if(_.has(E)){const b=S=>S.checked=!1;t.listen(_.get(E),"click",S=>{S.stopPropagation(),v.forEach(b),u&&u.show(),r.fetchData(f).then(()=>{l&&l.setData(r),u&&u.hide(),i.open=!1})})}_.has(I)&&t.listen(_.get(I),"click",b=>{b.stopPropagation();const S=[...C()].reduce((y,[B,M])=>(y[B]=M===[]?null:M,y),{offset:0});u&&u.show(),r.fetchData(S).then(()=>{l&&l.setData(r),u&&u.hide(),i.open=!1})}),t.listen(p,"click",b=>{b.stopPropagation(),i.open=!i.open,i.classList.toggle("cds--overflow-menu--open",i.open)})},ht=()=>{t.listen(l,o.eventPageSizeChanged,i=>{const p={limit:l.pageSize,offset:0};r.fetchData(p).then(()=>{l.setData(r)})})},ft=()=>{let i=null;t.listen(l,o.eventChangeCurrent,p=>{const{page:v}=p.detail,g=l.pageSize,f=(v-1)*g;if(f!==i){i=f;const E={limit:g,offset:f};r.fetchData(E).then(()=>{l.setData(r),u&&u.hide()})}})};r&&l&&(ht(),ft()),r&&A&&(vt(A),mt(A));const V=e.querySelector(s.selectorTableToolbarContent);if(V){const i=V.querySelectorAll("cds-popover[data-batch-filter]");r&&i&&i.forEach(gt)}e.isSelectable&&(dt(),pt(),W&&ut(W)),r&&nt&&lt();const Z={zoo:{event:{row:{click:ot,expand:at,check:{one:it,all:ct}},column:{sort:rt}}}};(0,st.objToPaths)(n).forEach(([i,p])=>{D.hasPath(i,Z)&&D.path(i,Z)(p)})},_t=t=>{const e=document.createElement("cds-pagination");return e.backwardText="Previous page",e.forwardText="Next page",e.itemsPerPageText="Items per page:",e.pageSize=t.limit,e.size="lg",[10,25,50,100,500].forEach(n=>{const s=document.createElement("cds-select-item");s.value=n.toString(),s.textContent=n.toString(),e.appendChild(s)}),e.setData=n=>{if(n.isPaginated){const{count:s}=D.pick(["count"],n.data);e.pagesUnknown=Math.ceil(s/n.limit)>100,e.totalItems=s,e.pagesUnknown?e.formatStatusWithIndeterminateTotal=({start:o,end:a})=>`${o}–${a} of ${s} item${s<=1?"":"s"}`:delete e.formatStatusWithIndeterminateTotal}},e},Ct=t=>{if(!t.parentNode){console.error("[Carbon Table] Cannot create skeleton: table has no parent node");return}const e=!!t.querySelector("cds-table-header-title"),n=!!t.querySelector("cds-table-header-description"),s=!!t.querySelector("cds-table-toolbar"),o=[...t.querySelectorAll("cds-table-header-cell")].length,a=t.hasAttribute("zebra"),r=t.getAttribute("size"),l=document.createElement("cds-table-skeleton");l.showHeader=e||n,l.showToolbar=s,l.zebra=a,l.columnCount=o,l.size=r,l.show=()=>l.classList.remove("hidden"),l.hide=()=>l.classList.add("hidden");const u=document.createElement("div");return u.classList.add("zoo-datatable-skeleton-wrapper"),t.parentNode.insertBefore(u,t),u.appendChild(l),u.appendChild(t),l},yt=(t,e)=>{const n=e.getAttribute("zoo-url-api"),s=parseInt(e.getAttribute("data-page-size")||25,10);if(n)return new c.Binder(t,n,e,{urlParams:{limit:s}})},xt={selector:"cds-table",init:function(t){const e=c.getSemanticAttributes(t),n=this,s=yt(n,t);if((0,st.isDefAndNotNull)(s)){t.dataBinder=s;const o=Ct(t);t.skeleton=o;const a=_t(s);t.pagination=a,t.after(a),s.fetchData().then(r=>{o.hide(),a.setData(s),K(n,t,e)})}else K(n,t,e)}},wt=m.__exportAll({cdsPaginationWrap:()=>Dt}),Dt={selector:"cds-pagination",init:function(t){const e=this,n=customElements.get("cds-pagination");let s=null;e.listen(t,n.eventChangeCurrent,o=>{const a=o.detail.page,r=t.pageSize,l=(a-1)*r;l!==s&&(s=l,e.dispatchPanelEvent("pagination-changed-current",{detail:{page:a,pageSize:r,action:"page-change"}}))}),e.listen(t,n.eventPageSizeChanged,o=>{const a=t.pageSize;s=null,e.dispatchPanelEvent("pagination-changed-page-size",{detail:{page:1,pageSize:a,action:"page-size-change"}})})}},Bt=m.__exportAll({cdsModalBodyContentWrap:()=>Ft,cdsModalBodyWrap:()=>zt,cdsModalCloseButWrap:()=>Ot,cdsModalFooterButWrap:()=>Lt,cdsModalFooterWrap:()=>Rt,cdsModalHeaderWrap:()=>Nt,cdsModalHeadingWrap:()=>Tt,cdsModalLabelWrap:()=>qt,cdsModalWrap:()=>Mt}),Mt={selector:"cds-modal",init:function(t){const e=customElements.get("cds-modal"),n=c.getSemanticAttributes(t),s=c.getEventAttribute(t,"open-event","event");s&&this.listen(t,"cds-modal-beingopened",r=>{this.dispatchPanelEvent(s,{...n,action:"opened"})});const o=t.getAttribute("before-close-event");o&&this.listen(t,e.eventBeforeClose,r=>{this.dispatchPanelEvent(o,{...n,action:"closing",cancelable:!0})}),this.listen(t,e.eventClose,r=>{this.dispatchPanelEvent("destroy_me",{...n,action:"closed",triggeredBy:r.detail?.triggeredBy})});const a=c.getEventAttribute(t,"primary-event","event");a&&this.listen(t,"cds-modal-primary-focus",r=>{this.dispatchPanelEvent(a,{...n,action:"primary"})})}},Nt={selector:"cds-modal-header"},Tt={selector:"cds-modal-heading"},qt={selector:"cds-modal-label"},Ot={selector:"cds-modal-close-button"},zt={selector:"cds-modal-body"},Ft={selector:"cds-modal-body-content"},Rt={selector:"cds-modal-footer"},Lt={selector:"cds-modal-footer-button",init:function(t){const e=c.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",s=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const n=e.event;n&&this.listen(t,"click",s=>{s.stopPropagation(),this.dispatchPanelEvent(n,e)})}},Ht=m.__exportAll({cdsMenuButtonWrap:()=>jt,cdsMenuWrap:()=>Ut}),Ut={selector:"cds-menu",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-menu-opened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-menu-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})}),this.listen(t,"click",o=>{if(o.target.tagName==="CDS-MENU-ITEM"){const a=c.getSemanticAttributes(o.target),r=a.event||e.event;r&&(o.stopPropagation(),this.dispatchPanelEvent(r,{...e,...a}))}}),this.listen(t,"cds-item-changed",o=>{const a=o.detail.triggeredBy,r=c.getSemanticAttributes(a),l=r.event||e.event;l&&this.dispatchPanelEvent(l,{...e,...r,action:"selection-changed"})})}},jt={selector:"cds-menu-button",init:function(t){const e=c.getSemanticAttributes(t),n=t.querySelector("cds-menu");n&&this.listen(n,"click",s=>{if(s.target.tagName==="CDS-MENU-ITEM"){const o=c.getSemanticAttributes(s.target),a=o.event||e.event;a&&(s.stopPropagation(),this.dispatchPanelEvent(a,{...e,...o}))}})}},$t=m.__exportAll({cdsButFabWrap:()=>Jt,cdsButtonWrap:()=>Gt,cdsComboButWrap:()=>Qt,cdsCopyButWrap:()=>Kt,cdsIconButToggleWrap:()=>Zt,cdsIconButWrap:()=>Vt}),Gt={selector:"cds-button",init:function(t){const e=c.getSemanticAttributes(t);if(t.getAttribute("type")==="submit"){this.listen(t,"click",s=>{let o=t.closest("form");if(!o){const a=t.getAttribute("form");a&&(o=document.getElementById(a))}o&&o.requestSubmit()});return}const n=e.event;n&&this.listen(t,"click",s=>{s.stopPropagation(),this.dispatchPanelEvent(n,c.getSemanticAttributes(t))})}},Vt={selector:"cds-icon-button:not([data-toggle])",event:"click",getData:(t,e)=>e},Zt={selector:"cds-icon-button[data-toggle]",init:function(t){const e=c.getSemanticAttributes(t);e.event&&this.listen(t,"click",n=>{n.stopPropagation(),t.isSelected=!t.isSelected,this.dispatchPanelEvent(e.event,{...e,isOn:t.isSelected})})}},Jt={selector:"cds-button[data-fab]",event:"click",getData:(t,e)=>e},Kt={selector:"cds-copy-button",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"click",o=>{o.stopPropagation(),this.dispatchPanelEvent(n,{...e,action:"copy"})});const s=t.getAttribute("success-event");if(s){const o=new MutationObserver(()=>{t.hasAttribute("feedback-shown")&&this.dispatchPanelEvent(s,{...e,action:"copied"})});o.observe(t,{attributes:!0,attributeFilter:["feedback-shown"]}),t._copyObserver=o}}},Qt={selector:"cds-combo-button",init:function(t){const e=c.getSemanticAttributes(t);e.event&&this.listen(t,"click",s=>{const o=s.composedPath(),a=o.some(l=>l.tagName==="CDS-MENU-ITEM"),r=o.some(l=>l.tagName==="CDS-ICON-BUTTON");!a&&!r&&(s.stopPropagation(),this.dispatchPanelEvent(e.event,{...e,action:"primary"}))});const n=t.querySelector("cds-menu");n&&this.listen(n,"click",s=>{if(s.target.tagName==="CDS-MENU-ITEM"){const o=c.getSemanticAttributes(s.target),a=o.event||c.getEventAttribute(t,"menu-event","event");a&&this.dispatchPanelEvent(a,{...e,...o,action:"menu-item"})}})}},Xt=m.__exportAll({cdsComboBoxWrap:()=>te,cdsDropdownWrap:()=>Yt,cdsMultiSelectWrap:()=>ee}),Yt={selector:"cds-dropdown",init:function(t){const e=customElements.get("cds-dropdown"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{this.dispatchPanelEvent(s,{...n,value:t.value,selectedValue:a.detail?.item?.value,selectedText:a.detail?.item?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},te={selector:"cds-combo-box",init:function(t){const e=customElements.get("cds-combo-box"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{const r=a.detail?.item;this.dispatchPanelEvent(s,{...n,value:t.value,selectedValue:r?.value,selectedText:r?.textContent?.trim()})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},ee={selector:"cds-multi-select",init:function(t){const e=customElements.get("cds-multi-select"),n=c.getSemanticAttributes(t),s=n.event;s&&this.listen(t,e.eventSelect,a=>{const r=t.value?t.value.split(","):[];this.dispatchPanelEvent(s,{...n,selectedItems:r})});const o=t.getAttribute("toggle-event");o&&this.listen(t,e.eventToggle,a=>{this.dispatchPanelEvent(o,{...n,open:t.hasAttribute("open")})})}},se=m.__exportAll({cdsDatePickerWrap:()=>ne,cdsTimePickerWrap:()=>oe}),ne={selector:"cds-date-picker",init:function(t){const e=customElements.get("cds-date-picker"),n=c.getSemanticAttributes(t),s=t.querySelector('cds-date-picker-input[kind="from"]'),o=t.querySelector('cds-date-picker-input[kind="to"]'),a=s&&o,r=n.event;r&&this.listen(t,e.eventChange,u=>{let A;a?A={from:s.value||"",to:o.value||""}:A=t.value,this.dispatchPanelEvent(r,{...n,value:A})});const l=t.getAttribute("error-event");l&&this.listen(t,e.eventFlatpickrError,u=>{this.dispatchPanelEvent(l,{...n,error:u.detail})})}},oe={selector:"cds-time-picker",event:"cds-time-picker-changed",getData:(t,e,n)=>({...e,value:n.value})},ae=m.__exportAll({cdsFileUploaderWrap:()=>re}),re={selector:"cds-file-uploader",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;if(n){const o=t.querySelector('input[type="file"]');o&&this.listen(o,"change",a=>{this.dispatchPanelEvent(n,{...e,files:Array.from(a.target.files||[])})})}const s=t.getAttribute("delete-event");s&&this.listen(t,"cds-file-uploader-item-deleted",o=>{this.dispatchPanelEvent(s,{...e,fileName:o.detail?.fileName,fileId:o.detail?.fileId})})}},ce=m.__exportAll({cdsAccordionWrap:()=>le,cdsContentSwitcherWrap:()=>de,cdsTabsWrap:()=>ie}),ie={selector:"cds-tabs",init:function(t){const e=customElements.get("cds-tabs"),n=c.getSemanticAttributes(t),s=t.getAttribute("before-select-event");s&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(s,{...n,tabValue:a.detail.value,cancelable:!0})});const o=n.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,l=c.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...n,...l,tabValue:a.detail.value})})}},le={selector:"cds-accordion",init:function(t){const e=customElements.get("cds-accordion-item"),n=c.getSemanticAttributes(t);[...t.querySelectorAll("cds-accordion-item")].forEach(s=>{const o=c.getSemanticAttributes(s),a=o.event||n.event;a&&this.listen(s,e.eventToggle,r=>{this.dispatchPanelEvent(a,{...n,...o,open:r.detail.open})})})}},de={selector:"cds-content-switcher",init:function(t){const e=customElements.get("cds-content-switcher"),n=c.getSemanticAttributes(t),s=t.getAttribute("before-select-event");s&&this.listen(t,e.eventBeforeSelect,a=>{this.dispatchPanelEvent(s,{...n,value:a.detail.value,cancelable:!0})});const o=n.event;o&&this.listen(t,e.eventSelect,a=>{const r=a.detail.item,l=c.getSemanticAttributes(r);this.dispatchPanelEvent(o,{...n,...l,value:r.getAttribute("value")})})}},pe=m.__exportAll({cdsBreadCrumbWrap:()=>me,cdsBreadcrumbItemWrap:()=>ue,cdsBreadcrumbLinkWrap:()=>ve}),ue={selector:"cds-breadcrumb-item"},ve={selector:"cds-breadcrumb-link",event:"click",getData:(t,e,n)=>(t.preventDefault(),{...e,href:n.getAttribute("href")})},me={selector:"cds-breadcrumb",init:function(t){const e=this,n=c.getSemanticAttributes(t),s=n.event;if(s){const o=r=>{e.dispatchPanelEvent(s,{...n,...r})};e.listen(t,"click",r=>{const l=r.target.closest("cds-breadcrumb-link");l&&(r.preventDefault(),r.stopPropagation(),o(c.getSemanticAttributes(l)))});const a=t.querySelector("cds-overflow-menu-body");a&&e.listen(a,"cds-overflow-menu-item-clicked",r=>{r.stopPropagation(),o(c.getSemanticAttributes(r.target))})}}},ge=m.__exportAll({cdsNumberInputWrap:()=>be,cdsPasswordInputWrap:()=>Ee,cdsSearchWrap:()=>Se,cdsTextAreaWrap:()=>fe,cdsTextInputWrap:()=>he}),he={selector:"cds-text-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},fe={selector:"cds-textarea",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},be={selector:"cds-number-input",event:"cds-number-input",getData:(t,e,n)=>({...e,value:t.detail.value,direction:t.detail.direction})},Ee={selector:"cds-password-input",multiEvent:!0,events:[{type:"input",attrName:"event",getData:(t,e)=>({...e,value:t.currentTarget.value})},{type:"change",attrName:"change-event",getData:(t,e)=>({...e,value:t.currentTarget.value})}]},Se={selector:"cds-search",event:"cds-search-input",getData:(t,e,n)=>({...e,value:n.value})},Ae=m.__exportAll({cdsCheckboxWrap:()=>We,cdsRadioButGroupWrap:()=>Ie,cdsSelectWrap:()=>ke,cdsSliderWrap:()=>_e,cdsToggleWrap:()=>Pe}),We={selector:"cds-checkbox",event:"cds-checkbox-changed",getData:(t,e,n)=>({...e,checked:t.detail.checked,value:n.value})},Ie={selector:"cds-radio-button-group",event:"cds-radio-button-group-changed",getData:(t,e)=>({...e,value:t.detail?.value})},Pe={selector:"cds-toggle",event:"cds-toggle-changed",getData:(t,e)=>({...e,isOn:t.detail.checked,value:t.detail.checked})},ke={selector:"cds-select",event:"cds-select-selected",getData:(t,e)=>({...e,value:t.detail.value})},_e={selector:"cds-slider",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"cds-slider-changed",o=>{this.dispatchPanelEvent(n,{...e,value:o.detail.value})});const s=t.getAttribute("input-event");s&&this.listen(t,"cds-slider-input-changed",o=>{this.dispatchPanelEvent(s,{...e,value:o.detail.value})})}},Ce=m.__exportAll({cdsFilterTagWrap:()=>we,cdsSDismissibleTagWrap:()=>xe,cdsTagsWrap:()=>ye}),ye={selector:"cds-tag",event:"click",getData:(t,e)=>e},xe={selector:"cds-dismissible-tag",init:function(t){const e=c.getSemanticAttributes(t),n=t.getAttribute("click-event");n&&this.listen(t,"click",o=>{o.target.closest("button")||this.dispatchPanelEvent(n,{...e})});const s=e.event;s&&this.listen(t,"cds-dismissible-tag-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},we={selector:"cds-filter-tag",event:"cds-filter-tag-closed",getData:(t,e)=>({...e,action:"remove"})},De=m.__exportAll({cdsOverflowMenuWrap:()=>Be,cdsStructuredListWrap:()=>Me,cdsTreeViewWrap:()=>Ne}),Be={selector:"cds-overflow-menu",init:function(t){const e=c.getSemanticAttributes(t),n=e.event,s=t.querySelector("cds-overflow-menu-body");n&&s&&this.listen(s,"cds-overflow-menu-item-clicked",o=>{o.stopPropagation();const a=c.getSemanticAttributes(o.target);this.dispatchPanelEvent(n,{...e,...a})})}},Me={selector:"cds-structured-list",init:function(t){const e=c.getSemanticAttributes(t);[...t.querySelectorAll("cds-structured-list-row")].forEach(n=>{const s=c.getSemanticAttributes(n),o=s.event||e.event;o&&this.listen(n,"click",a=>{a.stopPropagation(),this.dispatchPanelEvent(o,{...e,...s})})}),t.hasAttribute("selection")&&this.listen(t,"cds-structured-list-selected",n=>{const s=n.detail.row,o=c.getSemanticAttributes(s),a=e.event;a&&this.dispatchPanelEvent(a,{...e,...o})})}},Ne={selector:"cds-tree-view",init:function(t){const e=c.getSemanticAttributes(t);this.listen(t,"cds-tree-node-selected",s=>{const o=s.detail.node,a=c.getSemanticAttributes(o),r=a.event||e.event;r&&this.dispatchPanelEvent(r,{...e,...a,nodeId:o.id,label:o.getAttribute("label")})});const n=c.getEventAttribute(t,"expand-event");n&&this.listen(t,"cds-tree-node-expanded",s=>{this.dispatchPanelEvent(n,{...e,nodeId:s.detail.node.id,expanded:s.detail.expanded})})}},Te=m.__exportAll({cdsActionableNotificationWrap:()=>ze,cdsInlineNotificationWrap:()=>Oe,cdsToastNotificationWrap:()=>qe}),qe={selector:"cds-toast-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},Oe={selector:"cds-inline-notification",event:"cds-notification-closed",getData:(t,e)=>({...e,action:"closed"})},ze={selector:"cds-actionable-notification",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"close-event","event");n&&this.listen(t,"cds-notification-closed",o=>{this.dispatchPanelEvent(n,{...e,action:"closed"})});const s=c.getEventAttribute(t,"action-event");s&&this.listen(t,"cds-notification-actioned",o=>{this.dispatchPanelEvent(s,{...e,action:"actioned"})})}},Fe=m.__exportAll({cdsClickableTileWrap:()=>Re,cdsExpandableTileWrap:()=>Le,cdsRadioTileWrap:()=>Ue,cdsSelectableTileWrap:()=>He}),Re={selector:"cds-clickable-tile",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;if(n){const s=e.href||t.getAttribute("href")||"";t.removeAttribute("href"),t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),this.dispatchPanelEvent(n,{...e,href:s})},!0)}}},Le={selector:"cds-expandable-tile",init:function(t){const e=c.getSemanticAttributes(t),n=t.getAttribute("before-toggle-event");n&&this.listen(t,"cds-expandable-tile-beingtoggled",o=>{this.dispatchPanelEvent(n,{...e,expanded:o.detail.expanded,cancelable:!0})});const s=e.event;s&&this.listen(t,"cds-expandable-tile-toggled",o=>{this.dispatchPanelEvent(s,{...e,expanded:o.detail.expanded})})}},He={selector:"cds-selectable-tile",event:"cds-selectable-tile-changed",getData:(t,e,n)=>({...e,selected:t.detail.selected,value:n.value})},Ue={selector:"cds-radio-tile",event:"cds-selectable-tile-changed",getData:(t,e,n)=>({...e,selected:t.detail.selected,value:n.value})},je=m.__exportAll({cdsInlineLoadingWrap:()=>Ve,cdsProgressBarWrap:()=>$e,cdsProgressIndicatorWrap:()=>Ge}),$e={selector:"cds-progress-bar",init:function(t){const e=c.getSemanticAttributes(t);if(e.event){const n=new MutationObserver(()=>{const s=parseFloat(t.getAttribute("value")||"0");s>=parseFloat(t.getAttribute("max")||"100")&&this.dispatchPanelEvent(e.event,{...e,value:s,status:"complete"})});n.observe(t,{attributes:!0,attributeFilter:["value"]}),t._progressObserver=n}}},Ge={selector:"cds-progress-indicator",init:function(t){const e=c.getSemanticAttributes(t);this.listen(t,"cds-progress-step-click",n=>{const s=n.target,o=c.getSemanticAttributes(s),a=o.event||e.event;a&&this.dispatchPanelEvent(a,{...e,...o,stepIndex:s.getAttribute("data-index"),stepLabel:s.getAttribute("label")})})}},Ve={selector:"cds-inline-loading",init:function(t){const e=c.getSemanticAttributes(t),n=e.event;n&&this.listen(t,"cds-inline-loading-onsuccess",o=>{this.dispatchPanelEvent(n,{...e,status:"finished"})});const s=t.getAttribute("status-event");if(s){const o=new MutationObserver(a=>{a.forEach(r=>{if(r.attributeName==="status"){const l=t.getAttribute("status");this.dispatchPanelEvent(s,{...e,status:l})}})});o.observe(t,{attributes:!0,attributeFilter:["status"]}),t._statusObserver=o}}},Ze=m.__exportAll({cdsPopoverWrap:()=>Ke,cdsToggletipWrap:()=>Qe,cdsTooltipWrap:()=>Je}),Je={selector:"cds-tooltip",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-tooltip-beingopened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-tooltip-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},Ke={selector:"cds-popover",init:function(t){const e=c.getSemanticAttributes(t),n=c.getEventAttribute(t,"open-event");n&&this.listen(t,"cds-popover-beingopened",o=>{this.dispatchPanelEvent(n,{...e,action:"opened"})});const s=c.getEventAttribute(t,"close-event");s&&this.listen(t,"cds-popover-closed",o=>{this.dispatchPanelEvent(s,{...e,action:"closed"})})}},Qe={selector:"cds-toggletip",init:function(t){const e=c.getSemanticAttributes(t);if(e.event){const n=new MutationObserver(s=>{s.forEach(o=>{if(o.attributeName==="open"){const a=t.hasAttribute("open");this.dispatchPanelEvent(e.event,{...e,action:a?"opened":"closed",open:a})}})});n.observe(t,{attributes:!0,attributeFilter:["open"]}),t._toggletipObserver=n}}},Xe=m.__exportAll({cdsCodeSnipWrap:()=>ts,cdsLinkWrap:()=>Ye}),Ye={selector:"cds-link",event:"click",getData:(t,e,n)=>({...e,href:n.getAttribute("href")})},ts={selector:"cds-code-snippet",event:"cds-copy-button-clicked",getData:(t,e)=>({...e,action:"copied"})},es=m.__exportAll({cdsBadgeIndicatorWrap:()=>ls,cdsFormGroupWrap:()=>os,cdsFormItemWrap:()=>ns,cdsFormWrap:()=>ss,cdsHeadingWrap:()=>rs,cdsIconIndicatorWrap:()=>is,cdsIconWrap:()=>cs,cdsLoadingWrap:()=>ds,cdsSkeletonPlaceholderWrap:()=>us,cdsSkeletonTextWrap:()=>ps,cdsStackWrap:()=>as}),ss={selector:"cds-form"},ns={selector:"cds-form-item"},os={selector:"cds-form-group"},as={selector:"cds-stack"},rs={selector:"cds-heading"},cs={selector:"cds-icon"},is={selector:"cds-icon-indicator"},ls={selector:"cds-badge-indicator"},ds={selector:"cds-loading"},ps={selector:"cds-skeleton-text"},us={selector:"cds-skeleton-placeholder"};function h(t){return Object.values(t).filter(e=>typeof e=="object"&&e!==null&&e.selector)}var vs=[...h(wt),...h(kt),...h(Bt),...h(Ht),...h($t),...h(Xt),...h(se),...h(ae),...h(ce),...h(pe),...h(ge),...h(Ae),...h(Ce),...h(De),...h(Te),...h(Fe),...h(je),...h(Ze),...h(Xe),...h(es)];function ms(){const t=new Map;return vs.forEach(e=>{t.set(e.selector,e)}),t}var gs=()=>import("@carbon/web-components/es/components/accordion/index.js"),R=()=>import("@carbon/web-components/es/components/breadcrumb/index.js"),hs=()=>import("@carbon/web-components/es/components/stack/index.js"),fs=()=>import("@carbon/web-components/es/components/structured-list/index.js"),N=()=>import("@carbon/web-components/es/components/tile/index.js"),bs=()=>import("@carbon/web-components/es/components/tree-view/index.js"),Es=()=>import("@carbon/web-components/es/components/link/index.js"),Ss=()=>import("@carbon/web-components/es/components/tabs/index.js"),As=()=>import("@carbon/web-components/es/components/content-switcher/index.js"),Q=()=>import("@carbon/web-components/es/components/menu/index.js"),Ws=()=>import("@carbon/web-components/es/components/overflow-menu/index.js"),L=()=>import("@carbon/web-components/es/components/button/index.js"),X=()=>import("@carbon/web-components/es/components/icon-button/index.js"),Is=()=>import("@carbon/web-components/es/components/combo-button/index.js"),Ps=()=>import("@carbon/web-components/es/components/copy-button/index.js"),ks=()=>import("@carbon/web-components/es/components/checkbox/index.js"),_s=()=>import("@carbon/web-components/es/components/radio-button/index.js"),Cs=()=>import("@carbon/web-components/es/components/toggle/index.js"),H=()=>import("@carbon/web-components/es/components/select/index.js"),ys=()=>import("@carbon/web-components/es/components/slider/index.js"),U=()=>import("@carbon/web-components/es/components/text-input/index.js"),xs=()=>import("@carbon/web-components/es/components/textarea/index.js"),ws=()=>import("@carbon/web-components/es/components/number-input/index.js"),Ds=()=>import("@carbon/web-components/es/components/password-input/index.js"),Y=()=>import("@carbon/web-components/es/components/search/index.js"),Bs=()=>import("@carbon/web-components/es/components/combo-box/index.js"),Ms=()=>import("@carbon/web-components/es/components/dropdown/index.js"),Ns=()=>import("@carbon/web-components/es/components/multi-select/index.js"),Ts=()=>import("@carbon/web-components/es/components/date-picker/index.js"),qs=()=>import("@carbon/web-components/es/components/time-picker/index.js"),Os=()=>import("@carbon/web-components/es/components/file-uploader/index.js"),tt=()=>import("@carbon/web-components/es/components/form/index.js"),zs=()=>import("@carbon/web-components/es/components/form-group/index.js"),Fs=()=>import("@carbon/web-components/es/components/data-table/index.js"),et=()=>import("@carbon/web-components/es/components/pagination/index.js"),Rs=()=>import("@carbon/web-components/es/components/code-snippet/index.js"),j=()=>import("@carbon/web-components/es/components/tag/index.js"),Ls=()=>import("@carbon/web-components/es/components/badge-indicator/index.js"),$=()=>import("@carbon/web-components/es/components/notification/index.js"),Hs=()=>import("@carbon/web-components/es/components/loading/index.js"),Us=()=>import("@carbon/web-components/es/components/inline-loading/index.js"),js=()=>import("@carbon/web-components/es/components/progress-bar/index.js"),$s=()=>import("@carbon/web-components/es/components/progress-indicator/index.js"),Gs=()=>import("@carbon/web-components/es/components/skeleton-placeholder/index.js"),Vs=()=>import("@carbon/web-components/es/components/skeleton-text/index.js"),P=()=>import("@carbon/web-components/es/components/modal/index.js"),k=()=>import("@carbon/web-components/es/components/tooltip/index.js"),Zs=()=>import("@carbon/web-components/es/components/popover/index.js"),Js=()=>import("@carbon/web-components/es/components/toggle-tip/index.js"),Ks=()=>import("@carbon/web-components/es/components/heading/index.js"),Qs=()=>import("@carbon/web-components/es/components/icon/index.js"),Xs=()=>import("@carbon/web-components/es/components/icon-indicator/index.js"),q={"cds-table":[k,L,U,Y,H,et,Fs],"cds-pagination":[H,U,et],"cds-button":[k,L],"cds-icon-button:not([data-toggle])":[k,X],"cds-icon-button[data-toggle]":[k,X],"cds-button[data-fab]":[k,L],"cds-copy-button":[k,Ps],"cds-combo-button":[k,Is],"cds-checkbox":[ks],"cds-radio-button-group":[_s],"cds-toggle":[Cs],"cds-select":[H],"cds-slider":[ys],"cds-text-input":[U],"cds-textarea":[xs],"cds-number-input":[ws],"cds-password-input":[k,Ds],"cds-search":[Y],"cds-dropdown":[Ms],"cds-combo-box":[Bs],"cds-multi-select":[Ns],"cds-date-picker":[Ts],"cds-time-picker":[qs],"cds-file-uploader":[Os],"cds-tabs":[Ss],"cds-accordion":[gs],"cds-content-switcher":[As],"cds-breadcrumb":[R],"cds-breadcrumb-item":[R],"cds-breadcrumb-link":[R],"cds-menu":[Q],"cds-menu-button":[Q],"cds-overflow-menu":[Ws],"cds-structured-list":[fs],"cds-tree-view":[bs],"cds-modal":[P],"cds-modal-header":[P],"cds-modal-heading":[P],"cds-modal-label":[P],"cds-modal-close-button":[P],"cds-modal-body":[P],"cds-modal-body-content":[P],"cds-modal-footer":[P],"cds-modal-footer-button":[P],"cds-toast-notification":[$],"cds-inline-notification":[$],"cds-actionable-notification":[$],"cds-clickable-tile":[N],"cds-expandable-tile":[N],"cds-selectable-tile":[N],"cds-radio-tile":[N],"cds-progress-bar":[js],"cds-progress-indicator":[$s],"cds-inline-loading":[Us],"cds-tooltip":[k],"cds-popover":[Zs],"cds-toggletip":[Js],"cds-tag":[j],"cds-dismissible-tag":[j],"cds-filter-tag":[j],"cds-link":[Es],"cds-code-snippet":[Rs],"cds-form":[tt],"cds-form-item":[tt],"cds-form-group":[zs],"cds-stack":[hs],"cds-heading":[Ks],"cds-icon":[Qs],"cds-icon-indicator":[Xs],"cds-badge-indicator":[Ls],"cds-loading":[Hs],"cds-skeleton-text":[Vs],"cds-skeleton-placeholder":[Gs]};function Ys(t){const e=new Map;if(!t||!(t instanceof Element))return e;for(const s of Object.keys(T))e.set(s,[]);for(const[s,o]of Object.entries(T))t.matches(s)&&e.get(s).push(t);const n=t.querySelectorAll("*");for(const s of n)for(const[o,a]of Object.entries(T))s.matches(o)&&e.get(o).push(s);for(const[s,o]of e.entries())o.length===0&&e.delete(s);return e}function tn(t){const e=new Set;for(const[n,s]of t.entries())s.length>0&&q[n]&&q[n].forEach(o=>e.add(o));return e}async function en(t,e){if(t.size===0)return;const n=Array.from(t).map(async s=>(e.has(s)||e.set(s,s()),e.get(s)));await Promise.all(n)}function sn(t,e){let n=0;for(const[s,o]of t.entries()){const a=T[s];o.forEach(r=>{if(a.init){a.init.call(e,r);return}if(a.multiEvent){const A=c.getSemanticAttributes(r);a.events.forEach(W=>{const x=c.getEventAttribute(r,W.attrName,"event");x&&e.listen(r,W.type,O=>{e.dispatchPanelEvent(x,W.getData(O,A,r))})});return}const l=c.getSemanticAttributes(r),u=l.event;u&&e.listen(r,a.event,A=>{A.stopPropagation();const W=a.getData(A,l,r),x=W._eventOverride||u;delete W._eventOverride,e.dispatchPanelEvent(x,W)})}),n+=o.length}return n}var T={...Object.fromEntries(ms())},nn=async function(t,e){const n=Ys(t);if(n.size===0){this.debugMe("[Carbon] No Carbon components found in panel");return}this.carbonComponents||(this.carbonComponents=new Map);for(const[a,r]of n.entries())this.carbonComponents.set(a,r);const s=tn(n);if(s.size>0)try{await en(s,e)}catch(a){console.error("[Carbon] Failed to load some component modules:",a)}const o=sn(n,this);o>0&&this.debugMe(`[Carbon] Total components initialized: ${o}`)},on=(t={})=>{const{preload:e=[]}=t,n=new Map;if(e.length>0){const s=e.filter(a=>q[a]?!0:(console.warn(`[Carbon] No import found for selector: ${a}`),!1)),o=s.flatMap(a=>q[a].map(r=>(n.has(r)||n.set(r,r()),n.get(r))));Promise.all(o).then(()=>console.debug(`[Carbon] Preloaded: ${s.join(", ")}`)).catch(a=>console.warn("[Carbon] Preload error:",a))}m.ComponentLibraryRegistry.register("carbon",{cache:n,render:async function(s,o){try{await nn.call(this,s,o)}catch(a){console.error("[Carbon] Initialization error:",a)}},dispose:function(s){},config:{version:"2.0",description:"IBM Carbon Design System Web Components"}}),console.debug("[Zooy] Carbon Design System library registered")};exports.registerCarbonLibrary=on;
package/dist/zooy.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./chunks/component-library-registry-BBQV6Kpv.js"),p=require("./chunks/tree-utils-BYnipT-p.js"),U=require("./chunks/zoo-CY2QpG41.js");let a=require("badu"),De=require("ramda");var L=class extends EventTarget{#e=!1;#t=!1;#s=new Map;#r=new Set;#i=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.#r}get activeIntervals(){return this.#i}debugMe(...e){this.#e&&console.log.apply(null,[this.constructor.name,"DEBUG:",...e])}isListenedToBy(e){this.#r.add(e)}listen(e,t,s,r=!1){e.addEventListener(t,s,r);const i=this.listeningTo.get(e)||{};i[t]=()=>e.removeEventListener(t,s,r),this.listeningTo.set(e,i),(0,a.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)&&((0,a.isDef)(e.isObservedBy)&&e.isObservedBy.delete(this),(0,a.isDef)(t)?(Object.entries(this.listeningTo.get(e)).forEach(([s,r])=>{s===t&&r()}),Object.keys(this.listeningTo.get(e)).length||this.listeningTo.delete(e)):(Object.values(this.listeningTo.get(e)).forEach(s=>s()),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 s=setInterval(e,t);this.activeIntervals.add(s)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#t=!0}dispose(){this.disposeInternal()}},k=class{constructor(e,t){this.value_=e,this.data_=t||{}}getValue(){return this.value_}getData(){return this.data_}},u={COMP:(0,a.randomId)(),COMP_DRAG_START:(0,a.randomId)(),COMP_DRAG_MOVE:(0,a.randomId)(),COMP_DRAG_END:(0,a.randomId)(),PANEL:(0,a.randomId)(),VIEW:(0,a.randomId)(),SPLIT:(0,a.randomId)(),SPLIT_WILL_OPEN:(0,a.randomId)(),SPLIT_DID_OPEN:(0,a.randomId)(),SPLIT_WILL_CLOSE:(0,a.randomId)(),SPLIT_DID_CLOSE:(0,a.randomId)(),SPLIT_TRANSITION_END:(0,a.randomId)(),READY:(0,a.randomId)(),PANEL_MINIMIZE:(0,a.randomId)(),FORM_SUBMIT_SUCCESS:(0,a.randomId)()},A={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"},w=class extends L{static compEventCode(){return u.COMP}static compReadyCode(){return u.READY}static compErrors(){return A}#e;#t;#s;#r;#i;#n;#o;#a;constructor(){super(),this.#e=()=>document.createElement("div"),this.#t=!1,this.#s=void 0,this.#r=void 0,this.#i=void 0,this.#n=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(e){this.#i=e}get target(){return this.#i}set model(e){this.#r=e}get model(){return this.#r}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(A.ALREADY_DISPOSED)}render(e){this.render_(e)}render_(e){if(this.disposed)throw new Error(A.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(A.ALREADY_RENDERED);this.#s||this.createDom();const t=this.#s;e&&(this.#i=e),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#i?p.isInPage(t)||this.#i.insertBefore(t,null):p.isInPage(t)||document.body.appendChild(t),(!this.#n||this.#n.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?p.removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(e=>{!e.isInDocument&&e.getElement()&&e.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(u.READY))}exitDocument(){[...this.#o.values()].forEach(e=>{e.isInDocument&&e.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,p.removeNode(this.getElement()),this.placeholderDom&&p.removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(e=>e.disposeInternal()),this.outOfTreeElements.forEach(p.removeNode),this.#s&&p.removeNode(this.#s),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#r=null,this.#n=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const e=this.getElement();if(e)for(const t of b.ComponentLibraryRegistry.getRegisteredLibraries())try{const s=b.ComponentLibraryRegistry.get(t);s.dispose&&s.dispose(e)}catch(s){console.debug(`[${t}] Cleanup error during component disposal (non-critical):`,s)}super.dispose()}dispatchCompEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.COMP,s);return this.dispatchEvent(r)}},c={CLICK:"click",RIGHTCLICK:"rightclick",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend",ANIMATIONEND:"animationend"},Ce=[c.TOUCHMOVE,c.TOUCHSTART,c.TOUCHEND],be=e=>Ce.includes(e.type),x=e=>(be(e)&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),e),Me=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i),h=o.currentTarget,[g,_]=p.getPos(h),E=o.clientX-g,D=o.clientY-_,n=e(g,_,E,D,h),l=s(g,_,E,D,h),d=t(g,_,E,D,h);let m=Te(d,h,E,D);["x","ew"].includes(r)?m=ye(d,h,E,D):["y","ns"].includes(r)&&(m=Le(d,h,E,D));let v=!1;const f=M=>{v=!0,m(M)},S=M=>{document.removeEventListener(c.MOUSEMOVE,f,!0),document.removeEventListener(c.TOUCHMOVE,f,!0),document.removeEventListener(c.MOUSEUP,S,!0),document.removeEventListener(c.TOUCHEND,S,!0),v&&l(M)};return document.addEventListener(c.MOUSEUP,S,!0),document.addEventListener(c.TOUCHEND,S,!0),document.addEventListener(c.MOUSEMOVE,f,!0),document.addEventListener(c.TOUCHMOVE,f,!0),n(i),S},Te=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.left=`${o.clientX-s}px`,t.style.top=`${o.clientY-r}px`,e(o)},ye=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.left=`${o.clientX-s}px`,e(o)},Le=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.top=`${o.clientY-r}px`,e(o)},q=(e,t)=>(s,r,i,o,h)=>g=>{e.dispatchCompEvent(t,{component:e,browserEvent:g,left:s,top:r,clientX:g.clientX,clientY:g.clientY,xOrg:i,yOrg:o,deltaX:g.clientX-i-s,deltaY:g.clientY-o-r,target:h})},z=class extends w{#e;#t;#s;#r;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.#r=t=>null}cancelDrag(e){this.#r(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=>s=>{this.#r=t(s)};if(this.isInDocument&&this.#s){const t=q(this,u.COMP_DRAG_MOVE),s=Me(q(this,u.COMP_DRAG_START),t,q(this,u.COMP_DRAG_END),this.#e);this.#s=!1,this.#t=this.#t||this.getElement(),this.listen(this.#t,c.MOUSEDOWN,e(s)),this.listen(this.#t,c.TOUCHSTART,s),this.#t.classList.remove("locked")}}lock(){this.stopListeningTo(this.#t,c.MOUSEDOWN),this.stopListeningTo(this.#t,c.TOUCHSTART),this.#s=!0,this.#t.classList.add("locked")}},se=b.__exportAll({getPath:()=>j,getQueryData:()=>oe,objectToUrlParms:()=>ae,queryDataToMap:()=>le}),we=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),re={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7},ie=e=>e.match(we),ne=(e,t)=>e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):"",j=e=>ne(ie(e)[re.PATH],!0),oe=e=>ne(ie(e)[re.QUERY_DATA],!0),ae=e=>[...Object.entries(e)].map(t=>`${t[0]}=${t[1]}`).join("&"),Q=e=>e!=null&&e!=="",le=e=>e.split("&").reduce((t,s)=>{const[r,i]=s.split("=");return Q(r)&&Q(i)&&t.set(r,i),t},new Map),Ie=(0,a.stripLeadingChar)(" "),Oe=(0,a.stripLeadingChar)("/"),Re=e=>document.cookie.split(";").map(t=>t.split("=")).reduce((t,s)=>t.set(Ie(s[0]),s[1]),new Map).get(e),Pe=e=>{let t=0,s;const r=i=>{const o=i>0;return o?t+=1:t-=1,o?t===1:t===0};return i=>{s=s||document.getElementById(e),s&&r(i)&&s.classList.toggle("viz",t>0)}},ce=Pe("the_loader"),$=()=>Promise.resolve(ce(1)),V=e=>(ce(0),Promise.resolve(e)),I=e=>e.ok?Promise.resolve(e):Promise.reject(new Error(`${e.url} ${e.status} (${e.statusText})`)),Ae=e=>t=>{if(t.type==="opaqueredirect"||t.redirected){const s=Oe(j(t.url));e.setIsRedirected(!0,s),console.log("Redirect detected",s)}return I(t)},R=e=>e.json(),H=e=>e.text().then(t=>Promise.resolve(t),t=>Promise.reject(new Error(`Could not get text from response: ${t}`))),Ne=e=>e.headers.get("Content-Type")==="application/json"?R(e):H(e),N=(e,t,s="POST",r=void 0)=>{const i=new Headers;i.append("Content-type","application/json"),i.append("X-Requested-With","XMLHttpRequest"),e&&e!==""&&i.append("Authorization",`Bearer ${e}`);const o={cache:"no-cache",method:s,headers:i,credentials:"include",body:JSON.stringify(t)};return r&&(o.signal=r),o},he=(e,t,s=!1,r=void 0)=>{const i=new Headers;if(t&&t!==""&&i.append("Authorization",`Bearer ${t}`),i.append("X-Requested-With","XMLHttpRequest"),s){const h=Re("csrftoken");h&&s&&i.append("X-CSRFToken",h)}const o={cache:"no-cache",method:e,headers:i,redirect:"follow",credentials:"include"};return r&&(o.signal=r),o},Ve=(e,t,s=void 0)=>{const r=he("POST",e,!1,s);return r.body=new FormData(t.formEl),r},Z=(e,t=void 0)=>{const s=new Headers;s.append("Authorization",`Bearer ${e}`),s.append("X-Requested-With","XMLHttpRequest");const r={cache:"no-cache",headers:s,credentials:"include"};return t&&(r.signal=t),r},Ue=(e,t)=>{const s=new Request(e);return fetch(s,t).then(I).then(H)},y=(e,t=void 0)=>s=>(V("").then(a.identity),s.name==="AbortError"?console.info(e,"ABORTED!"):console.error(e,s),t),P=class{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()),s=e.processSubmitReply.bind(e),r=y("Form submit error");return $().then(()=>fetch(t,Ve(this.jwt,e,e.abortController.signal))).then(Ae(e)).then(V).then(Ne).then(s).catch(r)}putNoBody(e,t=void 0,s=!1){const r=y("putNobody error");return Ue(e,he("PUT",this.jwt,s,t)).catch(r)}fetch(e,t=void 0){const s=new Request(e.toString()),r=y(`UMan Text GET Fetch: ${e}`);return $().then(()=>fetch(s,Z(this.jwt,t))).then(I).then(V).then(H).catch(r)}fetchAndSplit(e,t=void 0){const s=y(`fetchAndSplit: ${e}`);return this.fetch(e,t).then(p.handleTemplateProm).catch(s)}async fetchJson(e,t=void 0,s=void 0){const r=new Request(e.toString()),i=y(`fetchJson: ${e}`,s),o=Z(this.jwt,t);await $();let h;try{h=await(await fetch(r,o)).json()}catch(g){return i(g)}return await V(),h}patchJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`patchJson: ${e}`),o=N(this.jwt,t,"PATCH",s);return fetch(r,o).then(I).then(R).catch(i)}postJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`postJson: ${e}`),o=N(this.jwt,t,"POST",s);return fetch(r,o).then(I).then(R).catch(i)}putJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`putJson: ${e}`),o=N(this.jwt,t,"PUT",s);return fetch(r,o).then(I).then(R).catch(i)}delJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`delJson: ${e}`),o=N(this.jwt,t,"DELETE",s);return fetch(r,o).then(I).then(R).catch(i)}},B=class extends w{static panelEventCode(){return u.PANEL}static compReadyCode(){return u.READY}constructor(e){super(),this.qParamMap_=new Map,this.uri_="",e&&this.parseUri(e),this.evalScripts=p.evalScripts(this),this.evalModules=p.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?"?"+ae(Object.fromEntries(this.qParamMap_)):"";return this.uri_+e}set user(e){this.user_=e}get user(){return this.user_||(this.user_=new P),this.user_}parseUri(e){this.uri_=j(e),this.qParamMap_=le(oe(e))}addToQParams(e,t){this.qParamMap_.set(e,t)}removeFromQParams(e){this.qParamMap_.delete(e)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(e){return this.carbonComponents?.get(e)||[]}getCarbonComponentById(e){if(this.carbonComponents)for(const t of this.carbonComponents.values()){const s=t.find(r=>r.id===e);if(s)return s}}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(s=>(this.assertCanRenderAsync(),e&&e(this),this.onRenderWithTemplateReply(s).catch(r=>{r.message!==w.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",r)}),this)).catch(s=>{throw console.error("Panel.renderWithTemplate fetch failed:",s),s}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(e){return this.responseObject=p.splitScripts(e),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(e,t){const s=this.getElement();if((0,a.isUndefined)(s))return;const r=e.html;if(t.startsWith("."))[...s.querySelectorAll(t)].filter(i=>(0,a.isDefAndNotNull)(i.id)).map(i=>[i,r.querySelector(`#${i.id}`)]).filter(([i,o])=>(0,a.isDefAndNotNull)(o)).forEach(([i,o])=>{i.parentNode.replaceChild(o,i),this.parseContent(o)});else if(t.startsWith("#")){const i=r.querySelector(t),o=s.querySelector(t);o.parentNode.replaceChild(i,o),this.parseContent(i)}this.evalScripts(e.scripts),this.evalModules(e.modules)}renderWithJSON(e){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(t=>{this.assertCanRenderAsync(),e&&e(t,this),this.onRenderWithJSON(t).then(a.identity)}).catch(t=>{throw console.error("Panel.renderWithJSON fetch failed:",t),t}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(e){return Promise.resolve(this)}onAsyncJsonReply(e,t,s){}onAsyncHtmlReply(e,t){}onViewDataBroadcast(e){}parseContent(e){if(this.debugMe("Enable interactions. Panel:",e),typeof window.customElements<"u"&&b.ComponentLibraryRegistry.has("carbon")){const n=b.ComponentLibraryRegistry.get("carbon");n.render.call(this,e,n.cache).catch(l=>console.error("[Zooy] Carbon initialization failed:",l))}if(b.ComponentLibraryRegistry.has("mdc")){const n=b.ComponentLibraryRegistry.get("mdc");n.render.call(this,e,n.cache)}e.classList.contains("zoo__modal-base")&&e.classList.contains("close_on_click")&&this.listen(e,c.CLICK,n=>{n.target===e&&this.dispatchPanelEvent("destroy_me")}),[...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(n=>{this.listen(n,c.CLICK,l=>{l.stopPropagation();const d=l.currentTarget,m=p.getElDataMap(d);this.dispatchPanelEvent(m.zv,Object.assign({orgEvt:l,trigger:d,href:d.href||m.href},m))})}),[...e.querySelectorAll("[href]:not(.external)")].forEach(n=>{this.listen(n,c.CLICK,l=>{const d=l.currentTarget;l.preventDefault(),l.stopPropagation();const m=p.getElDataMap(d),v=m.zv||"href";this.dispatchPanelEvent(v,Object.assign({orgEvt:l,trigger:l.target,href:d.href||m.href},m))})}),[...e.querySelectorAll("form.intercept_submit")].forEach(n=>{n.noValidate=!0,this.listen(n,c.SUBMIT,l=>{l.preventDefault(),l.stopPropagation();const d=p.getElDataMap(n),m=p.formToJSON(n.elements);this.dispatchPanelEvent(d.zv,Object.assign({orgEvt:l,trigger:l.target,formData:m,href:d.href},d))})}),[...e.querySelectorAll(".zoo__toggle_class_driver")].forEach(n=>{const l=p.getElDataMap(n),d=l.toggle_class_target_id,m=l.toggle_class,v=e.querySelector(`#${d}`);v&&m&&n.addEventListener(c.CLICK,f=>{f.stopPropagation(),v.classList.toggle(m)})});const t=Array.from(e.querySelectorAll(".folder_drop_zone")),s=Array.from(e.querySelectorAll("[draggable]")),r=n=>{n.preventDefault(),n.target.classList.add("drag_over")},i=n=>{n.preventDefault()},o=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},h=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},g=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},_=n=>{n.dataTransfer.dropEffect="move";const l=p.getElDataMap(n.target);n.dataTransfer.setData("text/plain",JSON.stringify(l)),n.target.classList.add("drag_in_progress")},E=n=>{n.target.classList.remove("drag_in_progress")},D=n=>{g(n),n.stopPropagation();const l=JSON.parse(n.dataTransfer.getData("text/plain")),d=p.getElDataMap(n.target);return this.dispatchPanelEvent("drop_on",{custom:{on:d,from:l}}),!1};t.forEach(n=>{this.listen(n,c.DRAGOVER,i),this.listen(n,c.DRAGENTER,r),this.listen(n,c.DRAGEXIT,h),this.listen(n,c.DRAGLEAVE,o),this.listen(n,c.DROP,D)}),s.forEach(n=>{this.listen(n,c.DRAGSTART,_),this.listen(n,c.DRAGEND,E)}),[...e.querySelectorAll(".zoo_async_json")].forEach(n=>{const l=p.getElDataMap(n),d=l.href,m=this.onAsyncJsonReply.bind(this,n,l);this.user.fetchJson(d,this.abortController.signal).then(m);const v=l.z_json_reusable;v&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[v]=()=>{this.user.fetchJson(d,this.abortController.signal).then(m)});const f=(0,a.toNumber)(l.z_interval);(0,a.isNumber)(f)&&this.doOnBeat(()=>{this.user.fetchJson(d,this.abortController.signal).then(m)},f*60*1e3)}),[...e.querySelectorAll(".zoo_async_html")].forEach(n=>{const l=p.getElDataMap(n),d=l.href;this.user.fetchAndSplit(d,this.abortController.signal).then(v=>{n.appendChild(v.html),this.parseContent(n),this.evalScripts(v.scripts),this.evalModules(v.modules),this.onAsyncHtmlReply(n,l)});const m=(0,a.toNumber)(l.z_interval);(0,a.isNumber)(m)&&this.doOnBeat(()=>{this.user.fetchAndSplit(d,this.abortController.signal).then(v=>{n.replaceChildren(v.html),this.parseContent(n),this.evalScripts(v.scripts),this.evalModules(v.modules)})},m*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 s=new k(e,t),r=L.makeEvent(u.PANEL,s);return this.debugMe(`PANEL EVENT FIRED:
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./chunks/component-library-registry-BBQV6Kpv.js"),p=require("./chunks/tree-utils-BYnipT-p.js"),U=require("./chunks/zoo-CY2QpG41.js");let a=require("badu"),De=require("ramda");var L=class extends EventTarget{#e=!1;#t=!1;#s=new Map;#r=new Set;#i=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.#r}get activeIntervals(){return this.#i}debugMe(...e){this.#e&&console.log.apply(null,[this.constructor.name,"DEBUG:",...e])}isListenedToBy(e){this.#r.add(e)}listen(e,t,s,r=!1){e.addEventListener(t,s,r);const i=this.listeningTo.get(e)||{};i[t]=()=>e.removeEventListener(t,s,r),this.listeningTo.set(e,i),(0,a.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)&&((0,a.isDef)(e.isObservedBy)&&e.isObservedBy.delete(this),(0,a.isDef)(t)?(Object.entries(this.listeningTo.get(e)).forEach(([s,r])=>{s===t&&r()}),Object.keys(this.listeningTo.get(e)).length||this.listeningTo.delete(e)):(Object.values(this.listeningTo.get(e)).forEach(s=>s()),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 s=setInterval(e,t);this.activeIntervals.add(s)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#t=!0}dispose(){this.disposeInternal()}},k=class{constructor(e,t){this.value_=e,this.data_=t||{}}getValue(){return this.value_}getData(){return this.data_}},u={COMP:(0,a.randomId)(),COMP_DRAG_START:(0,a.randomId)(),COMP_DRAG_MOVE:(0,a.randomId)(),COMP_DRAG_END:(0,a.randomId)(),PANEL:(0,a.randomId)(),VIEW:(0,a.randomId)(),SPLIT:(0,a.randomId)(),SPLIT_WILL_OPEN:(0,a.randomId)(),SPLIT_DID_OPEN:(0,a.randomId)(),SPLIT_WILL_CLOSE:(0,a.randomId)(),SPLIT_DID_CLOSE:(0,a.randomId)(),SPLIT_TRANSITION_END:(0,a.randomId)(),READY:(0,a.randomId)(),PANEL_MINIMIZE:(0,a.randomId)(),FORM_SUBMIT_SUCCESS:(0,a.randomId)()},A={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"},w=class extends L{static compEventCode(){return u.COMP}static compReadyCode(){return u.READY}static compErrors(){return A}#e;#t;#s;#r;#i;#n;#o;#a;constructor(){super(),this.#e=()=>document.createElement("div"),this.#t=!1,this.#s=void 0,this.#r=void 0,this.#i=void 0,this.#n=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(e){this.#i=e}get target(){return this.#i}set model(e){this.#r=e}get model(){return this.#r}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(A.ALREADY_DISPOSED)}render(e){this.render_(e)}render_(e){if(this.disposed)throw new Error(A.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(A.ALREADY_RENDERED);this.#s||this.createDom();const t=this.#s;e&&(this.#i=e),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#i?p.isInPage(t)||this.#i.insertBefore(t,null):p.isInPage(t)||document.body.appendChild(t),(!this.#n||this.#n.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?p.removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(e=>{!e.isInDocument&&e.getElement()&&e.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(u.READY))}exitDocument(){[...this.#o.values()].forEach(e=>{e.isInDocument&&e.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,p.removeNode(this.getElement()),this.placeholderDom&&p.removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(e=>e.disposeInternal()),this.outOfTreeElements.forEach(p.removeNode),this.#s&&p.removeNode(this.#s),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#r=null,this.#n=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const e=this.getElement();if(e)for(const t of b.ComponentLibraryRegistry.getRegisteredLibraries())try{const s=b.ComponentLibraryRegistry.get(t);s.dispose&&s.dispose(e)}catch(s){console.debug(`[${t}] Cleanup error during component disposal (non-critical):`,s)}super.dispose()}dispatchCompEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.COMP,s);return this.dispatchEvent(r)}},c={CLICK:"click",RIGHTCLICK:"rightclick",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend",ANIMATIONEND:"animationend"},Ce=[c.TOUCHMOVE,c.TOUCHSTART,c.TOUCHEND],be=e=>Ce.includes(e.type),x=e=>(be(e)&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),e),Me=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i),h=o.currentTarget,[g,_]=p.getPos(h),E=o.clientX-g,D=o.clientY-_,n=e(g,_,E,D,h),l=s(g,_,E,D,h),d=t(g,_,E,D,h);let m=Te(d,h,E,D);["x","ew"].includes(r)?m=ye(d,h,E,D):["y","ns"].includes(r)&&(m=Le(d,h,E,D));let v=!1;const f=M=>{v=!0,m(M)},S=M=>{document.removeEventListener(c.MOUSEMOVE,f,!0),document.removeEventListener(c.TOUCHMOVE,f,!0),document.removeEventListener(c.MOUSEUP,S,!0),document.removeEventListener(c.TOUCHEND,S,!0),v&&l(M)};return document.addEventListener(c.MOUSEUP,S,!0),document.addEventListener(c.TOUCHEND,S,!0),document.addEventListener(c.MOUSEMOVE,f,!0),document.addEventListener(c.TOUCHMOVE,f,!0),n(i),S},Te=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.left=`${o.clientX-s}px`,t.style.top=`${o.clientY-r}px`,e(o)},ye=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.left=`${o.clientX-s}px`,e(o)},Le=(e,t,s,r)=>i=>{i.preventDefault();const o=x(i);t.style.top=`${o.clientY-r}px`,e(o)},q=(e,t)=>(s,r,i,o,h)=>g=>{e.dispatchCompEvent(t,{component:e,browserEvent:g,left:s,top:r,clientX:g.clientX,clientY:g.clientY,xOrg:i,yOrg:o,deltaX:g.clientX-i-s,deltaY:g.clientY-o-r,target:h})},z=class extends w{#e;#t;#s;#r;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.#r=t=>null}cancelDrag(e){this.#r(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=>s=>{this.#r=t(s)};if(this.isInDocument&&this.#s){const t=q(this,u.COMP_DRAG_MOVE),s=Me(q(this,u.COMP_DRAG_START),t,q(this,u.COMP_DRAG_END),this.#e);this.#s=!1,this.#t=this.#t||this.getElement(),this.listen(this.#t,c.MOUSEDOWN,e(s)),this.listen(this.#t,c.TOUCHSTART,s),this.#t.classList.remove("locked")}}lock(){this.stopListeningTo(this.#t,c.MOUSEDOWN),this.stopListeningTo(this.#t,c.TOUCHSTART),this.#s=!0,this.#t.classList.add("locked")}},se=b.__exportAll({getPath:()=>j,getQueryData:()=>oe,objectToUrlParms:()=>ae,queryDataToMap:()=>le}),we=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),re={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7},ie=e=>e.match(we),ne=(e,t)=>e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):"",j=e=>ne(ie(e)[re.PATH],!0),oe=e=>ne(ie(e)[re.QUERY_DATA],!0),ae=e=>[...Object.entries(e)].map(t=>`${t[0]}=${t[1]}`).join("&"),Q=e=>e!=null&&e!=="",le=e=>e.split("&").reduce((t,s)=>{const[r,i]=s.split("=");return Q(r)&&Q(i)&&t.set(r,i),t},new Map),Ie=(0,a.stripLeadingChar)(" "),Oe=(0,a.stripLeadingChar)("/"),Re=e=>document.cookie.split(";").map(t=>t.split("=")).reduce((t,s)=>t.set(Ie(s[0]),s[1]),new Map).get(e),Pe=e=>{let t=0,s;const r=i=>{const o=i>0;return o?t+=1:t-=1,o?t===1:t===0};return i=>{s=s||document.getElementById(e),s&&r(i)&&s.classList.toggle("viz",t>0)}},ce=Pe("the_loader"),$=()=>Promise.resolve(ce(1)),V=e=>(ce(0),Promise.resolve(e)),I=e=>e.ok?Promise.resolve(e):Promise.reject(new Error(`${e.url} ${e.status} (${e.statusText})`)),Ae=e=>t=>{if(t.type==="opaqueredirect"||t.redirected){const s=Oe(j(t.url));e.setIsRedirected(!0,s),console.log("Redirect detected",s)}return I(t)},R=e=>e.json(),H=e=>e.text().then(t=>Promise.resolve(t),t=>Promise.reject(new Error(`Could not get text from response: ${t}`))),Ne=e=>e.headers.get("Content-Type")==="application/json"?R(e):H(e),N=(e,t,s="POST",r=void 0)=>{const i=new Headers;i.append("Content-type","application/json"),i.append("X-Requested-With","XMLHttpRequest"),e&&e!==""&&i.append("Authorization",`Bearer ${e}`);const o={cache:"no-cache",method:s,headers:i,credentials:"include",body:JSON.stringify(t)};return r&&(o.signal=r),o},he=(e,t,s=!1,r=void 0)=>{const i=new Headers;if(t&&t!==""&&i.append("Authorization",`Bearer ${t}`),i.append("X-Requested-With","XMLHttpRequest"),s){const h=Re("csrftoken");h&&s&&i.append("X-CSRFToken",h)}const o={cache:"no-cache",method:e,headers:i,redirect:"follow",credentials:"include"};return r&&(o.signal=r),o},Ve=(e,t,s=void 0)=>{const r=he("POST",e,!1,s);return r.body=new FormData(t.formEl),r},Z=(e,t=void 0)=>{const s=new Headers;s.append("Authorization",`Bearer ${e}`),s.append("X-Requested-With","XMLHttpRequest");const r={cache:"no-cache",headers:s,credentials:"include"};return t&&(r.signal=t),r},Ue=(e,t)=>{const s=new Request(e);return fetch(s,t).then(I).then(H)},y=(e,t=void 0)=>s=>(V("").then(a.identity),s.name==="AbortError"?console.info(e,"ABORTED!"):console.error(e,s),t),P=class{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()),s=e.processSubmitReply.bind(e),r=y("Form submit error");return $().then(()=>fetch(t,Ve(this.jwt,e,e.abortController.signal))).then(Ae(e)).then(V).then(Ne).then(s).catch(r)}putNoBody(e,t=void 0,s=!1){const r=y("putNobody error");return Ue(e,he("PUT",this.jwt,s,t)).catch(r)}fetch(e,t=void 0){const s=new Request(e.toString()),r=y(`UMan Text GET Fetch: ${e}`);return $().then(()=>fetch(s,Z(this.jwt,t))).then(I).then(V).then(H).catch(r)}fetchAndSplit(e,t=void 0){const s=y(`fetchAndSplit: ${e}`);return this.fetch(e,t).then(p.handleTemplateProm).catch(s)}async fetchJson(e,t=void 0,s=void 0){const r=new Request(e.toString()),i=y(`fetchJson: ${e}`,s),o=Z(this.jwt,t);await $();let h;try{h=await(await fetch(r,o)).json()}catch(g){return i(g)}return await V(),h}patchJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`patchJson: ${e}`),o=N(this.jwt,t,"PATCH",s);return fetch(r,o).then(I).then(R).catch(i)}postJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`postJson: ${e}`),o=N(this.jwt,t,"POST",s);return fetch(r,o).then(I).then(R).catch(i)}putJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`putJson: ${e}`),o=N(this.jwt,t,"PUT",s);return fetch(r,o).then(I).then(R).catch(i)}delJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`delJson: ${e}`),o=N(this.jwt,t,"DELETE",s);return fetch(r,o).then(I).then(R).catch(i)}},B=class extends w{static panelEventCode(){return u.PANEL}static compReadyCode(){return u.READY}constructor(e){super(),this.qParamMap_=new Map,this.uri_="",e&&this.parseUri(e),this.evalScripts=p.evalScripts(this),this.evalModules=p.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?"?"+ae(Object.fromEntries(this.qParamMap_)):"";return this.uri_+e}set user(e){this.user_=e}get user(){return this.user_||(this.user_=new P),this.user_}parseUri(e){this.uri_=j(e),this.qParamMap_=le(oe(e))}addToQParams(e,t){this.qParamMap_.set(e,t)}removeFromQParams(e){this.qParamMap_.delete(e)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(e){return this.carbonComponents?.get(e)||[]}getCarbonComponentById(e){if(this.carbonComponents)for(const t of this.carbonComponents.values()){const s=t.find(r=>r.id===e);if(s)return s}}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(s=>(this.assertCanRenderAsync(),e&&e(this),this.onRenderWithTemplateReply(s).catch(r=>{r.message!==w.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",r)}),this)).catch(s=>{throw console.error("Panel.renderWithTemplate fetch failed:",s),s}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(e){return this.responseObject=p.splitScripts(e),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(e,t){const s=this.getElement();if((0,a.isUndefined)(s))return;const r=e.html;if(t.startsWith("."))[...s.querySelectorAll(t)].filter(i=>(0,a.isDefAndNotNull)(i.id)).map(i=>[i,r.querySelector(`#${i.id}`)]).filter(([i,o])=>(0,a.isDefAndNotNull)(o)).forEach(([i,o])=>{i.parentNode.replaceChild(o,i),this.parseContent(o)});else if(t.startsWith("#")){const i=r.querySelector(t),o=s.querySelector(t);o.parentNode.replaceChild(i,o),this.parseContent(i)}this.evalScripts(e.scripts),this.evalModules(e.modules)}renderWithJSON(e){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(t=>{this.assertCanRenderAsync(),e&&e(t,this),this.onRenderWithJSON(t).then(a.identity)}).catch(t=>{throw console.error("Panel.renderWithJSON fetch failed:",t),t}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(e){return Promise.resolve(this)}onAsyncJsonReply(e,t,s){}onAsyncHtmlReply(e,t){}onViewDataBroadcast(e){}parseContent(e){if(this.debugMe("Enable interactions. Panel:",e),typeof window.customElements<"u"&&b.ComponentLibraryRegistry.has("carbon")){const n=b.ComponentLibraryRegistry.get("carbon");n.render.call(this,e,n.cache).catch(l=>console.error("[Zooy] Carbon initialization failed:",l))}if(b.ComponentLibraryRegistry.has("mdc")){const n=b.ComponentLibraryRegistry.get("mdc");n.render.call(this,e,n.cache)}e.classList.contains("zoo__modal-base")&&e.classList.contains("close_on_click")&&this.listen(e,c.CLICK,n=>{n.target===e&&this.dispatchPanelEvent("destroy_me")}),[...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(n=>{this.listen(n,c.CLICK,l=>{l.stopPropagation();const d=l.currentTarget,m=p.getElDataMap(d);this.dispatchPanelEvent(m.zv,Object.assign({orgEvt:l,trigger:d,href:d.href||m.href},m))})}),[...e.querySelectorAll("[href]:not(.external):not([event])")].forEach(n=>{this.listen(n,c.CLICK,l=>{const d=l.currentTarget;l.preventDefault(),l.stopPropagation();const m=p.getElDataMap(d),v=m.zv||"href";this.dispatchPanelEvent(v,Object.assign({orgEvt:l,trigger:l.target,href:d.href||m.href},m))})}),[...e.querySelectorAll("form.intercept_submit")].forEach(n=>{n.noValidate=!0,this.listen(n,c.SUBMIT,l=>{l.preventDefault(),l.stopPropagation();const d=p.getElDataMap(n),m=p.formToJSON(n.elements);this.dispatchPanelEvent(d.zv,Object.assign({orgEvt:l,trigger:l.target,formData:m,href:d.href},d))})}),[...e.querySelectorAll(".zoo__toggle_class_driver")].forEach(n=>{const l=p.getElDataMap(n),d=l.toggle_class_target_id,m=l.toggle_class,v=e.querySelector(`#${d}`);v&&m&&n.addEventListener(c.CLICK,f=>{f.stopPropagation(),v.classList.toggle(m)})});const t=Array.from(e.querySelectorAll(".folder_drop_zone")),s=Array.from(e.querySelectorAll("[draggable]")),r=n=>{n.preventDefault(),n.target.classList.add("drag_over")},i=n=>{n.preventDefault()},o=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},h=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},g=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},_=n=>{n.dataTransfer.dropEffect="move";const l=p.getElDataMap(n.target);n.dataTransfer.setData("text/plain",JSON.stringify(l)),n.target.classList.add("drag_in_progress")},E=n=>{n.target.classList.remove("drag_in_progress")},D=n=>{g(n),n.stopPropagation();const l=JSON.parse(n.dataTransfer.getData("text/plain")),d=p.getElDataMap(n.target);return this.dispatchPanelEvent("drop_on",{custom:{on:d,from:l}}),!1};t.forEach(n=>{this.listen(n,c.DRAGOVER,i),this.listen(n,c.DRAGENTER,r),this.listen(n,c.DRAGEXIT,h),this.listen(n,c.DRAGLEAVE,o),this.listen(n,c.DROP,D)}),s.forEach(n=>{this.listen(n,c.DRAGSTART,_),this.listen(n,c.DRAGEND,E)}),[...e.querySelectorAll(".zoo_async_json")].forEach(n=>{const l=p.getElDataMap(n),d=l.href,m=this.onAsyncJsonReply.bind(this,n,l);this.user.fetchJson(d,this.abortController.signal).then(m);const v=l.z_json_reusable;v&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[v]=()=>{this.user.fetchJson(d,this.abortController.signal).then(m)});const f=(0,a.toNumber)(l.z_interval);(0,a.isNumber)(f)&&this.doOnBeat(()=>{this.user.fetchJson(d,this.abortController.signal).then(m)},f*60*1e3)}),[...e.querySelectorAll(".zoo_async_html")].forEach(n=>{const l=p.getElDataMap(n),d=l.href;this.user.fetchAndSplit(d,this.abortController.signal).then(v=>{n.appendChild(v.html),this.parseContent(n),this.evalScripts(v.scripts),this.evalModules(v.modules),this.onAsyncHtmlReply(n,l)});const m=(0,a.toNumber)(l.z_interval);(0,a.isNumber)(m)&&this.doOnBeat(()=>{this.user.fetchAndSplit(d,this.abortController.signal).then(v=>{n.replaceChildren(v.html),this.parseContent(n),this.evalScripts(v.scripts),this.evalModules(v.modules)})},m*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 s=new k(e,t),r=L.makeEvent(u.PANEL,s);return this.debugMe(`PANEL EVENT FIRED:
2
2
  value:${e}
3
3
  data:${t}`),this.dispatchEvent(r)}},de=class extends B{#e=null;#t=new Map;#s=!0;constructor(e,t=!0){super(e),this.#s=t,this.onSubmitSucFunc=(s,r)=>null}get formEl(){return this.#e}enterDocument(){super.enterDocument(),this.formIdElementToForm_()}formIdElementToForm_(){this.#e=this.getFormFromId(),this.#e&&(this.#a(this.#e),this.#r())}getFormFromId(e){let t=null,s=this.getElement().querySelector("form");return e&&(s=document.getElementById(e)||s),s&&s.tagName.toLowerCase()==="form"&&(t=s),t}#r(){this.#e&&(this.listen(this.#e,c.CHANGE,e=>{this.#o(e)},{passive:!0}),this.listen(this.#e,c.INPUT,e=>{this.clearAllValidationErrors(),this.#o(e)}),this.listen(this.#e,c.INVALID,e=>{e.preventDefault();const t=e.target;this.#n(t),this.displayFieldError(t)},{passive:!0}))}checkAllFields(){const e=[...this.#e.elements].map(t=>[this.#i(t),t]).filter(t=>!t[0]);return e.forEach(t=>this.displayFieldError(t[1])),e.length===0}clearAllValidationErrors(){[...this.#e?this.#e.elements:[]].forEach(e=>this.#n(e)),[...this.#e.querySelectorAll(".non-field-errors")].forEach(e=>e.classList.remove("alert-error"))}displayAlert_(e,t,s){const r=document.getElementById(`${e.id}-helper-text`)||document.createElement("p");r.textContent=t,this.#t.set(e,r)}#i(e){this.#n(e);let t=!e.willValidate;return e.willValidate&&(t=e.checkValidity()),t}#n(e){e.classList.remove("error"),this.#t.has(e)&&(this.#t.get(e).textContent=""),this.#t.delete(e)}displayFieldError(e,t){const s=t||e.validationMessage;e.classList.add("error"),this.displayAlert_(e,s,"alert-error")}displayFieldSuccess(e,t){this.displayAlert_(e,t,"alert-success")}displayFieldInfo(e,t){this.displayAlert_(e,t,"alert-info")}#o(e){this.#i(e.target)}#a(e){if(e&&this.#s){e.noValidate=!0;const t=this.user;this.listen(e,c.SUBMIT,s=>{s.preventDefault(),this.debugMe("Intercepted from SUBMIT"),this.checkAllFields()&&t&&t.formSubmit(this)})}return e}onSubmitSuccess(e){this.onSubmitSucFunc=e}replaceForm(e){if(this.responseObject=p.splitScripts(e),this.responseObject.html){if(this.redirected){this.removeAllListener();const t=this.getElement(),s=t.parentNode;this.setElementInternal_(this.responseObject.html),s.replaceChild(this.getElement(),t)}else{const t=this.responseObject.html.querySelector("form");t&&p.replaceNode(t,this.#e);const s=this.responseObject.html.querySelector('button[type="submit"]'),r=this.getElement().querySelector('button[type="submit"]');s&&r&&p.replaceNode(s,r)}this.enterDocument()}}refreshFromFromServer(){const e=this.user,t=this.uri;return e?e.fetch(t,this.abortController.signal).then(s=>this.replaceForm(s)):Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"))}processSubmitReply(e){this.clearAllValidationErrors();let t=!1;if((0,a.whatType)(e)==="object"&&e.success)return Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this,e),this.dispatchCompEvent(u.FORM_SUBMIT_SUCCESS)});if(e==="success"?(this.debugMe(`
4
4
  1.REDIRECTED: ${this.redirected}
@@ -16,4 +16,4 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
16
16
  SUCCESS: ${t}`)}},ue=class extends w{static splitEventCode(){return u.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=a.identity,t=!1){this.nestNames.forEach(s=>this.closeAndLock(s,e,t))}openAndUnlockAll(e=a.identity,t=!1){this.nestNames.forEach(s=>this.openAndUnlock(s,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,s=a.identity,r=!1){const{sizeNow:i,nestEl:o,canResize:h}=this.nestMap_.get(e);h&&(r||i===t?(o.classList.remove("animated"),o.style.flexBasis=`${t}px`,this.nestMap_.get(e).sizeNow=t,s()):(o.classList.add("animated"),this.nestCallbackMap_.set(e,()=>{o.classList.remove("animated"),this.nestMap_.get(e).sizeNow=t,s()}),o.style.flexBasis=`${t}px`))}closeAndLock(e,t=a.identity,s=!1){const{nestEl:r,dragEl:i,canResize:o}=this.nestMap_.get(e);if(!o)return;const h=()=>{i.classList.add("locked","closed"),r.classList.add("closed"),t()};this.resize(e,0,h,s)}closeAndUnlock(e,t=a.identity,s=!1){const{nestEl:r,dragEl:i,canResize:o}=this.nestMap_.get(e);if(!o)return;const h=()=>{r.classList.remove("closed"),i.classList.remove("closed","locked"),i.classList.add("collapsed"),t()};this.resize(e,0,h,s)}openAndUnlock(e,t,s,r=!1){const{nestEl:i,dragEl:o,defSize:h,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const E=t||g||h;i.classList.remove("closed"),o.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(e,E,s,r)},50)}openAndLock(e,t,s,r=!1){const{nestEl:i,dragEl:o,defSize:h,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const E=t||g||h;i.classList.remove("closed"),o.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(e,E,s,r)},50)}close(e,t=a.identity,s=!1){const{dragEl:r,canResize:i,nestEl:o}=this.nestMap_.get(e);if(!i)return;this.dispatchSplitEvent(u.SPLIT_WILL_CLOSE,{nestName:e,nestEl:o});const h=()=>{r.classList.add("collapsed"),this.dispatchSplitEvent(u.SPLIT_DID_CLOSE,{nestName:e,nestEl:o}),t()};this.resize(e,0,h,s)}open(e,t=a.identity,s=!1){const{defSize:r,lastSize:i,dragEl:o,canResize:h,nestEl:g}=this.nestMap_.get(e);if(!h)return;this.dispatchSplitEvent(u.SPLIT_WILL_OPEN,{nestName:e,nestEl:g}),o.classList.remove("collapsed","closed");const _=i||r,E=()=>{this.dispatchSplitEvent(u.SPLIT_DID_OPEN,{nestName:e,nestEl:g}),t()};this.resize(e,_,E,s)}toggle(e,t,s=!1){this.nestMap_.get(e).sizeNow===0?this.open(e,t,s):this.close(e,t,s)}addSplit(e=void 0,t="EW",s=100,r=100,i=[],o=[],h=[],g=[],_=[]){const E=e||this.getElement();if(this.splitNests_.has(E))return["Already used!",E];ze(E,t),this.splitNests_.add(E);let D="";if(e){const C=[...this.nestMap_.entries()].find(([T,{nestEl:O}])=>O===e);if(C)D=C[0];else return["Element not managed by this component",e]}const n=`${D}A`,l=ee(s,["zoo_nest__A",n,...i]),d=new z(t);d.domFunc=te([`zoo_drag_${n}`,...g],_),d.render(E),this.nestMap_.set(n,{side:"A",nestEl:l,dragger:d,dragEl:d.getElement(),defSize:s,sizeNow:-1,canResize:!0});const m=`${D}B`,v=ke(["zoo_nest__B",m,...o]);this.nestMap_.set(m,{nestEl:v,canResize:!1});const f=`${D}C`,S=new z(t);S.domFunc=te([`zoo_drag_${f}`,...g],_),S.render(E);const M=ee(r,["zoo_nest__C",f,...h]);this.nestMap_.set(f,{side:"C",nestEl:M,dragger:S,dragEl:S.getElement(),defSize:r,sizeNow:-1,canResize:!0}),[l,d.getElement(),v,S.getElement(),M].forEach(C=>E.appendChild(C));let J=0;const G=(C,T,O,_e)=>{let F;const Y=C==="NS"?"height":"width",Se=C==="NS"?"deltaY":"deltaX";return X=>{switch(X.detail.value_){case u.COMP_DRAG_START:F=T.getBoundingClientRect()[Y],J=v.getBoundingClientRect()[Y]+F,this.nestMap_.get(O).dragEl.classList.remove("collapsed");break;case u.COMP_DRAG_MOVE:{const K=Math.min(J,F+_e*X.detail.data_[Se]);this.nestMap_.get(O).lastSize=K,T.style.flexBasis=K+"px";break}case u.COMP_DRAG_END:this.dispatchSplitEvent(u.COMP_DRAG_END,this.nestMap_.get(O));break;default:break}}};this.listen(d,w.compEventCode(),G(t,l,n,1)),this.listen(S,w.compEventCode(),G(t,M,f,-1)),this.listen(d.getElement(),c.DBLCLICK,()=>this.toggle(n)),this.listen(S.getElement(),c.DBLCLICK,()=>this.toggle(f)),this.listen(d.getElement().querySelector(".zoo_grabber"),c.CLICK,()=>this.toggle(n)),this.listen(S.getElement().querySelector(".zoo_grabber"),c.CLICK,()=>this.toggle(f)),this.listen(l,c.TRANSITIONEND,C=>{if(C.propertyName==="flex-basis"&&C.target===l){const T=this.nestCallbackMap_.get(n);this.nestCallbackMap_.delete(n),T&&T(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(n))}}),this.listen(M,c.TRANSITIONEND,C=>{if(C.propertyName==="flex-basis"&&C.target===M){const T=this.nestCallbackMap_.get(f);this.nestCallbackMap_.delete(f),T&&T(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(f))}})}dispatchSplitEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.SPLIT,s);return this.dispatchEvent(r)}},ze=(e,t)=>(e.classList.add("zoo_split",`zoo_split__${t.toLowerCase()}`),e),ee=(e,t=[])=>{const s=document.createElement("div");return s.setAttribute("id",(0,a.randomId)(7)),s.classList.add("zoo_nest","zoo_nest__outer",...t),s.style.flexBasis=e+"px",s},ke=(e=[])=>{const t=document.createElement("div");return t.setAttribute("id",(0,a.randomId)(7)),t.classList.add("zoo_nest","zoo_nest__inner",...e),t},te=(e=[],t=[])=>()=>{const s=document.createElement("div");s.setAttribute("id",(0,a.randomId)(7)),s.classList.add("zoo_dragger",...e);const r=document.createElement("div");return r.classList.add("zoo_grabber",...t),s.appendChild(r),s},xe={toggle_tree:function(e,t){p.toggleTree(e,t)},"tree_toggle-children":function(e,t){p.toggleTreeChildren(t,e)}},pe={search:function(e,t){let s=`${e.href}`;const r=e.formData.q,i=e.targetval;if(r!==""&&(s=`${s}?q=${r}`),i!==""){let o=i;i.includes("page=")&&(o=i.split("&").filter(h=>!h.includes("page=")).join("&")),s=r!==""?`${s}&${o}`:`${s}?${o}`}this.user.fetchAndSplit(s,t.abortController.signal).then(o=>t.onReplacePartialDom(o,e.zvptarget))},reset_search:function(e,t){const s=e.trigger.closest("form");t.removeFromQParams("q"),s.elements.q.value="",s.dispatchEvent(new Event("submit"))}},me={paginate:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(r=>t.onReplacePartialDom(r,e.zvptarget))},list_filter:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(r=>t.onReplacePartialDom(r,e.zvptarget))}},ge=b.__exportAll({MdcTreeHandlers:()=>xe,QueryParamHandlers:()=>me,SearchHandlers:()=>pe}),W=class extends L{#e=void 0;#t=void 0;#s={};static viewEventCode(){return u.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}set recordHistory(e){this.#t=e}get recordHistory(){return this.#t}set registerViewConstructor(e){this.#e=e}get registerViewConstructor(){return this.#e}set utils(e){this.#s=e}get utils(){return this.#s}set split(e){this.split_=e,this.listen(this.split_,u.SPLIT,t=>{const s=t.detail.getValue(),r=t.detail.getData();switch(s){case u.SPLIT_WILL_OPEN:this.onSplitWillOpen(r);break;case u.SPLIT_WILL_CLOSE:this.onSplitWillClose(r);break;case u.SPLIT_DID_CLOSE:this.onSplitDidClose(r);break;case u.SPLIT_DID_OPEN:this.onSplitDidOpen(r);break;case u.SPLIT_TRANSITION_END:break;default:(0,a.identity)()}})}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 P),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,B.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(e){this.panelMap.has(e)&&this.panelMap.get(e).dispose()}removePanel(e){const[t,s]=[...this.panelMap.entries()].find(([r,i])=>i===e);t&&s&&(s.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,s)=>{this.removePanel(s)}),e.set("switch_view",(t,s)=>{this.debugMe("switch_view received: eventData",t);const r=t.view;this.switchViewMap_.has(r)?this.switchViewMap_.get(r)(t,s):this.debugMe("NO VIEW FOUND FOR:",r,this.switchViewMap_)}),Object.entries({...pe,...me}).forEach(([t,s])=>{e.set(t,s.bind(this))}),e}mapPanEv(e,t){this.panelEventMap_.set(e,t)}mapSwitchView(e,t){this.switchViewMap_.set(e,t)}onPanelEvent(e){let t=e.detail.getValue();if(this.debugMe(`PanelEvent Value: ${t}`),!(0,a.isDefAndNotNull)(t)){this.debugMe(`The panel received an event without a value.
17
17
  There is nothing we can do with that.`);return}const s=e.detail.getData();t?.startsWith("switch_view:")&&(s.view=t.split(":")[1],t="switch_view");const r=e.target;this.panelEventMap_.has(t)?this.panelEventMap_.get(t)(s,r):this.debugMe(`NO EVENT MATCH - This usually you are missing
18
18
  a "mapPanEv(${t} ..." statement in your panel JS
19
- or you have a "event='${t}'" attribute in your panel HTML`,{event:e,eventValue:t,eventData:s,panel:r.constructor.name})}onSplitWillOpen(e){}onSplitWillClose(e){}onSplitDidClose(e){}onSplitDidOpen(e){}dispatchViewEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.VIEW,s);return this.dispatchEvent(r)}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)}},Ee=class extends L{#e=new Map;#t=null;#s=void 0;#r=void 0;#i=new Map;#n={};constructor(){super(),this.#i=this.#o(),window.addEventListener("popstate",e=>{e.state!==null&&this.navTo(e.state)}),this.doOnBeat(()=>{document.dispatchEvent(new CustomEvent("zoo-tick-60",{detail:{timestamp:Date.now()}}))},6e4)}set split(e){this.#r=e}get split(){if(!this.#r)throw new Error("No SPLIT component available");return this.#r}set user(e){this.#s=e,this.#t&&(this.#t.user=this.user)}get user(){return this.#s||(this.#s=new P),this.#s}get utils(){return this.#n}registerUtil(e){this.#n=(0,De.mergeRight)(this.#n,e)}#o(){return new Map().set("switch_view",(e,t)=>{if(this.#e.has(e.view)){const s=this.#e.get(e.view)(e.pk||e.recordId,e);this.switchView(s)}})}mapViewEv(e,t){this.#i.set(e,t)}registerViewConstructor(e,t){this.#e.set(e,t)}onViewEvent(e){const t=e.detail.getValue(),s=e.detail.getData(),r=e.target;this.#i.has(t)?this.#i.get(t)(s,r):console.warn("Unhandled VIEW Event:",e,t,s,r)}setActiveView(e){this.#t&&(this.stopListeningTo(this.#t),this.#t.dispose(),this.#t=null),this.#t=e,this.#t.render()}initView(e){return e.user=this.user,e.split=this.split,e.utils=this.utils,e.recordHistory=this.recordHistory.bind(this),e.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(e,W.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,s=this.#t;if(s.switchViewMap_.has(t))this.debugMe("NAV:VIEW:MAP",e),s.switchViewMap_.get(t)(e);else if(this.#e.has(t)){const r=this.#e.get(t)(e.pk,e);this.debugMe("NAV:NEW:VIEW",e),this.switchView(r)}}};async function ve(e={}){const{registerCarbonLibrary:t}=await Promise.resolve().then(()=>require("./chunks/register-g5KUNRdI.js"));return t(e)}async function fe(){const{registerMdcLibrary:e}=await Promise.resolve().then(()=>require("./chunks/register-HYODt48Q.js"));return e()}var Be={Evt:L,Component:w,Dragger:z,Panel:B,FormPanel:de,Split:ue,UserManager:P,View:W,Conductor:Ee,DataBinder:U.Binder,UiEventType:u,domUtils:p.utils_exports,uriUtils:se,registerCarbonLibrary:ve,registerMdcLibrary:fe,ComponentLibraryRegistry:b.ComponentLibraryRegistry,handlers:ge,zoo:U.zoo_exports};exports.Binder=U.Binder;exports.Component=w;exports.ComponentLibraryRegistry=b.ComponentLibraryRegistry;exports.Conductor=Ee;exports.Dragger=z;exports.Evt=L;exports.FormPanel=de;exports.Panel=B;exports.Split=ue;exports.UiEventType=u;exports.UserManager=P;exports.View=W;exports.default=Be;Object.defineProperty(exports,"domUtils",{enumerable:!0,get:function(){return p.utils_exports}});Object.defineProperty(exports,"handlers",{enumerable:!0,get:function(){return ge}});exports.registerCarbonLibrary=ve;exports.registerMdcLibrary=fe;Object.defineProperty(exports,"uriUtils",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"zoo",{enumerable:!0,get:function(){return U.zoo_exports}});
19
+ or you have a "event='${t}'" attribute in your panel HTML`,{event:e,eventValue:t,eventData:s,panel:r.constructor.name})}onSplitWillOpen(e){}onSplitWillClose(e){}onSplitDidClose(e){}onSplitDidOpen(e){}dispatchViewEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.VIEW,s);return this.dispatchEvent(r)}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)}},Ee=class extends L{#e=new Map;#t=null;#s=void 0;#r=void 0;#i=new Map;#n={};constructor(){super(),this.#i=this.#o(),window.addEventListener("popstate",e=>{e.state!==null&&this.navTo(e.state)}),this.doOnBeat(()=>{document.dispatchEvent(new CustomEvent("zoo-tick-60",{detail:{timestamp:Date.now()}}))},6e4)}set split(e){this.#r=e}get split(){if(!this.#r)throw new Error("No SPLIT component available");return this.#r}set user(e){this.#s=e,this.#t&&(this.#t.user=this.user)}get user(){return this.#s||(this.#s=new P),this.#s}get utils(){return this.#n}registerUtil(e){this.#n=(0,De.mergeRight)(this.#n,e)}#o(){return new Map().set("switch_view",(e,t)=>{if(this.#e.has(e.view)){const s=this.#e.get(e.view)(e.pk||e.recordId,e);this.switchView(s)}})}mapViewEv(e,t){this.#i.set(e,t)}registerViewConstructor(e,t){this.#e.set(e,t)}onViewEvent(e){const t=e.detail.getValue(),s=e.detail.getData(),r=e.target;this.#i.has(t)?this.#i.get(t)(s,r):console.warn("Unhandled VIEW Event:",e,t,s,r)}setActiveView(e){this.#t&&(this.stopListeningTo(this.#t),this.#t.dispose(),this.#t=null),this.#t=e,this.#t.render()}initView(e){return e.user=this.user,e.split=this.split,e.utils=this.utils,e.recordHistory=this.recordHistory.bind(this),e.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(e,W.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,s=this.#t;if(s.switchViewMap_.has(t))this.debugMe("NAV:VIEW:MAP",e),s.switchViewMap_.get(t)(e);else if(this.#e.has(t)){const r=this.#e.get(t)(e.pk,e);this.debugMe("NAV:NEW:VIEW",e),this.switchView(r)}}};async function ve(e={}){const{registerCarbonLibrary:t}=await Promise.resolve().then(()=>require("./chunks/register-uV9z3usH.js"));return t(e)}async function fe(){const{registerMdcLibrary:e}=await Promise.resolve().then(()=>require("./chunks/register-HYODt48Q.js"));return e()}var Be={Evt:L,Component:w,Dragger:z,Panel:B,FormPanel:de,Split:ue,UserManager:P,View:W,Conductor:Ee,DataBinder:U.Binder,UiEventType:u,domUtils:p.utils_exports,uriUtils:se,registerCarbonLibrary:ve,registerMdcLibrary:fe,ComponentLibraryRegistry:b.ComponentLibraryRegistry,handlers:ge,zoo:U.zoo_exports};exports.Binder=U.Binder;exports.Component=w;exports.ComponentLibraryRegistry=b.ComponentLibraryRegistry;exports.Conductor=Ee;exports.Dragger=z;exports.Evt=L;exports.FormPanel=de;exports.Panel=B;exports.Split=ue;exports.UiEventType=u;exports.UserManager=P;exports.View=W;exports.default=Be;Object.defineProperty(exports,"domUtils",{enumerable:!0,get:function(){return p.utils_exports}});Object.defineProperty(exports,"handlers",{enumerable:!0,get:function(){return ge}});exports.registerCarbonLibrary=ve;exports.registerMdcLibrary=fe;Object.defineProperty(exports,"uriUtils",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"zoo",{enumerable:!0,get:function(){return U.zoo_exports}});
package/dist/zooy.es.js CHANGED
@@ -573,7 +573,7 @@ var L = class extends EventTarget {
573
573
  href: h.href || u.href
574
574
  }, u));
575
575
  });
576
- }), [...e.querySelectorAll("[href]:not(.external)")].forEach((n) => {
576
+ }), [...e.querySelectorAll("[href]:not(.external):not([event])")].forEach((n) => {
577
577
  this.listen(n, l.CLICK, (a) => {
578
578
  const h = a.currentTarget;
579
579
  a.preventDefault(), a.stopPropagation();
@@ -1250,7 +1250,7 @@ var L = class extends EventTarget {
1250
1250
  };
1251
1251
  };
1252
1252
  async function ot(e = {}) {
1253
- const { registerCarbonLibrary: t } = await import("./chunks/register-D7SMu1Gy.js");
1253
+ const { registerCarbonLibrary: t } = await import("./chunks/register-aF5kN8wT.js");
1254
1254
  return t(e);
1255
1255
  }
1256
1256
  async function at() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trintel/zooy",
3
3
  "description": "UI Building Blocks",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "main": "./dist/zooy.cjs.js",
6
6
  "module": "./dist/zooy.es.js",
7
7
  "type": "module",