@trintel/zooy 1.0.20 → 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.
Files changed (224) hide show
  1. package/dist/chunks/component-library-registry-BBQV6Kpv.js +1 -0
  2. package/dist/chunks/component-library-registry-DB5UeqC2.js +58 -0
  3. package/dist/chunks/register-D3pWAXhm.js +266 -0
  4. package/dist/chunks/register-HYODt48Q.js +1 -0
  5. package/dist/chunks/register-aF5kN8wT.js +1379 -0
  6. package/dist/chunks/register-uV9z3usH.js +1 -0
  7. package/dist/chunks/{tree-utils-D7kpr-Wj.js → tree-utils-B2JEGXHR.js} +2 -1
  8. package/dist/chunks/tree-utils-BYnipT-p.js +1 -0
  9. package/dist/chunks/zoo-CY2QpG41.js +52 -0
  10. package/dist/chunks/zoo-DgdxBjlN.js +390 -0
  11. package/dist/zooy.cjs.js +4 -4
  12. package/dist/zooy.es.js +226 -237
  13. package/package.json +1 -1
  14. package/dist/chunks/16-B2HVhDIW.js +0 -1
  15. package/dist/chunks/16-B9Ad4Fob.js +0 -19
  16. package/dist/chunks/16-BXsOcjPx.js +0 -19
  17. package/dist/chunks/16-BZCBqUx6.js +0 -1
  18. package/dist/chunks/16-BmOXGjZf.js +0 -1
  19. package/dist/chunks/16-BsQdCz_w.js +0 -27
  20. package/dist/chunks/16-C-Rp3Nso.js +0 -1
  21. package/dist/chunks/16-C36sVk5F.js +0 -26
  22. package/dist/chunks/16-CZycT1I8.js +0 -1
  23. package/dist/chunks/16-Ce_hDgPW.js +0 -1
  24. package/dist/chunks/16-CinLDpNC.js +0 -19
  25. package/dist/chunks/16-Cj0hOjaI.js +0 -1
  26. package/dist/chunks/16-Cx-PCMJJ.js +0 -26
  27. package/dist/chunks/16-D8XFc44J.js +0 -110
  28. package/dist/chunks/16-DVx7Niko.js +0 -33
  29. package/dist/chunks/16-DZJZDJYY.js +0 -1
  30. package/dist/chunks/16-DoCnqtvj.js +0 -35
  31. package/dist/chunks/16-DyCV3lkl.js +0 -19
  32. package/dist/chunks/16-SwMpxJpB.js +0 -19
  33. package/dist/chunks/16-jVjxC8Bu.js +0 -1
  34. package/dist/chunks/16-ma2Q_204.js +0 -1
  35. package/dist/chunks/16-qZ3FOIw0.js +0 -1
  36. package/dist/chunks/20-BwzzGcZC.js +0 -80
  37. package/dist/chunks/20-CqNSki3g.js +0 -1
  38. package/dist/chunks/accordion-0mybViUv.js +0 -236
  39. package/dist/chunks/accordion-CvcaulG8.js +0 -45
  40. package/dist/chunks/badge-indicator-BUdDkz6Z.js +0 -18
  41. package/dist/chunks/badge-indicator-DuYbJV5o.js +0 -1
  42. package/dist/chunks/breadcrumb-CYKgjbdB.js +0 -19
  43. package/dist/chunks/breadcrumb-DB0PkiBX.js +0 -140
  44. package/dist/chunks/button-1g5b3tWS.js +0 -268
  45. package/dist/chunks/button-BKj8189A.js +0 -4
  46. package/dist/chunks/button-DAOoyQ8b.js +0 -67
  47. package/dist/chunks/button-DfRkC-OR.js +0 -72
  48. package/dist/chunks/button-skeleton-C0mW3D7v.js +0 -44
  49. package/dist/chunks/button-skeleton-KFGdwtUH.js +0 -21
  50. package/dist/chunks/carbon-element-BsPGNbmz.js +0 -1
  51. package/dist/chunks/carbon-element-Z5iEnFdr.js +0 -24
  52. package/dist/chunks/checkbox-CBD8Qmjx.js +0 -37
  53. package/dist/chunks/checkbox-CewERWBu.js +0 -40
  54. package/dist/chunks/checkbox-CxxD4wgP.js +0 -176
  55. package/dist/chunks/checkbox-DKS7fw29.js +0 -168
  56. package/dist/chunks/class-map-BwUbMyhc.js +0 -1
  57. package/dist/chunks/class-map-qeLb1IA_.js +0 -27
  58. package/dist/chunks/code-snippet-BJhK27fG.js +0 -205
  59. package/dist/chunks/code-snippet-BUQFh_v7.js +0 -53
  60. package/dist/chunks/collection-helpers-DPVzwwb8.js +0 -7
  61. package/dist/chunks/collection-helpers-g7DrZSRQ.js +0 -1
  62. package/dist/chunks/combo-box-BCOUQHyG.js +0 -39
  63. package/dist/chunks/combo-box-Bms5blM6.js +0 -325
  64. package/dist/chunks/combo-button-BSBAvBIW.js +0 -15
  65. package/dist/chunks/combo-button-Bc3hx7VJ.js +0 -92
  66. package/dist/chunks/component-library-registry-CJ1Yb_8E.js +0 -98
  67. package/dist/chunks/component-library-registry-Co7WzTfw.js +0 -1
  68. package/dist/chunks/content-switcher-BuLZ3Aae.js +0 -1
  69. package/dist/chunks/content-switcher-DIODRHwc.js +0 -2
  70. package/dist/chunks/content-switcher-item-0YPDXW1z.js +0 -27
  71. package/dist/chunks/content-switcher-item-DkRD8k8n.js +0 -272
  72. package/dist/chunks/copy-button-XD4reiTK.js +0 -121
  73. package/dist/chunks/copy-button-eI9B8iKc.js +0 -17
  74. package/dist/chunks/data-table-BImLEoIA.js +0 -1243
  75. package/dist/chunks/data-table-YLNCQhJx.js +0 -158
  76. package/dist/chunks/date-picker-CWIAwkKj.js +0 -66
  77. package/dist/chunks/date-picker-CXjiOkZH.js +0 -2167
  78. package/dist/chunks/decorate-Cnz2C5jL.js +0 -62
  79. package/dist/chunks/decorate-DT052P_1.js +0 -72
  80. package/dist/chunks/decorators-CHZSYVOk.js +0 -1
  81. package/dist/chunks/decorators-CK8kfuyw.js +0 -87
  82. package/dist/chunks/deep-shadow-contains-BlQ_KSu4.js +0 -15
  83. package/dist/chunks/deep-shadow-contains-OTuAt1VE.js +0 -1
  84. package/dist/chunks/directive-CtTB8jL3.js +0 -31
  85. package/dist/chunks/directive-DWoJrOxt.js +0 -1
  86. package/dist/chunks/dropdown-Cg9JduA5.js +0 -4
  87. package/dist/chunks/dropdown-item-CYwutWei.js +0 -677
  88. package/dist/chunks/dropdown-item-H53zayYk.js +0 -73
  89. package/dist/chunks/dropdown-jdFaaXEa.js +0 -32
  90. package/dist/chunks/file-uploader-6FOP_GAh.js +0 -79
  91. package/dist/chunks/file-uploader-BTk1MqcJ.js +0 -342
  92. package/dist/chunks/floating-controller-BphaSUPY.js +0 -1012
  93. package/dist/chunks/floating-controller-C4ivnNvp.js +0 -1
  94. package/dist/chunks/focus-C1mbe9-i.js +0 -1
  95. package/dist/chunks/focus-Dpis0wA_.js +0 -13
  96. package/dist/chunks/form-BEmId1-D.js +0 -20
  97. package/dist/chunks/form-BmSVyKnm.js +0 -1
  98. package/dist/chunks/form-DUzcwJO9.js +0 -23
  99. package/dist/chunks/form-crnrWPVH.js +0 -3
  100. package/dist/chunks/form-group-Dax3eYD4.js +0 -43
  101. package/dist/chunks/form-group-dIvuqjw2.js +0 -12
  102. package/dist/chunks/heading-BbB6mvMG.js +0 -47
  103. package/dist/chunks/heading-UN9MO1TN.js +0 -5
  104. package/dist/chunks/host-listener-BBI7oAFw.js +0 -37
  105. package/dist/chunks/host-listener-BzjpIsFF.js +0 -1
  106. package/dist/chunks/host-listener-CtA1D-wt.js +0 -1
  107. package/dist/chunks/host-listener-DJEakRMM.js +0 -17
  108. package/dist/chunks/icon-B_S1_kDJ.js +0 -1
  109. package/dist/chunks/icon-CINf5Icb.js +0 -28
  110. package/dist/chunks/icon-button-BtE0-oCE.js +0 -1
  111. package/dist/chunks/icon-button-CACU21y5.js +0 -16
  112. package/dist/chunks/icon-button-D2STrB4d.js +0 -6
  113. package/dist/chunks/icon-button-D569kvcZ.js +0 -84
  114. package/dist/chunks/icon-indicator-BkILzP5o.js +0 -1
  115. package/dist/chunks/icon-indicator-D_IHkSon.js +0 -445
  116. package/dist/chunks/icon-loader-B9uu2SkP.js +0 -7
  117. package/dist/chunks/icon-loader-CZ8MQjNl.js +0 -1
  118. package/dist/chunks/icon-loader-utils-BKulYpY6.js +0 -110
  119. package/dist/chunks/icon-loader-utils-C-vWa1iy.js +0 -1
  120. package/dist/chunks/if-defined-C4rY5CqG.js +0 -1
  121. package/dist/chunks/if-defined-DvPh-nZx.js +0 -5
  122. package/dist/chunks/if-non-empty-CqihXhSU.js +0 -1
  123. package/dist/chunks/if-non-empty-DIcT03Pc.js +0 -5
  124. package/dist/chunks/inline-loading-BIB-coVZ.js +0 -83
  125. package/dist/chunks/inline-loading-C4MpPNzv.js +0 -12
  126. package/dist/chunks/link-Bz8knkhr.js +0 -1
  127. package/dist/chunks/link-CyrOt3Yx.js +0 -24
  128. package/dist/chunks/link-DlDoN1r0.js +0 -1
  129. package/dist/chunks/link-MrslkhR7.js +0 -106
  130. package/dist/chunks/lit-BNk7ncU9.js +0 -3
  131. package/dist/chunks/lit-uyM4-HrV.js +0 -552
  132. package/dist/chunks/loading-CUUY8ITP.js +0 -68
  133. package/dist/chunks/loading-CX_B-YYv.js +0 -1
  134. package/dist/chunks/loading-SDDHeWof.js +0 -1
  135. package/dist/chunks/loading-icon-BsInpAjb.js +0 -16
  136. package/dist/chunks/loading-icon-iCI-C5ZG.js +0 -24
  137. package/dist/chunks/loading-xKooWNUJ.js +0 -2
  138. package/dist/chunks/menu-D2kFhclQ.js +0 -56
  139. package/dist/chunks/menu-DG7s9yXJ.js +0 -682
  140. package/dist/chunks/modal-C2EEHjQh.js +0 -27
  141. package/dist/chunks/modal-DEGWE2iT.js +0 -414
  142. package/dist/chunks/multi-select-BXST526m.js +0 -63
  143. package/dist/chunks/multi-select-CgDCOBWa.js +0 -384
  144. package/dist/chunks/notification-BEvb6zBP.js +0 -89
  145. package/dist/chunks/notification-DLOgEfr6.js +0 -426
  146. package/dist/chunks/number-input-CRIgLD3k.js +0 -284
  147. package/dist/chunks/number-input-CiXkIGVz.js +0 -76
  148. package/dist/chunks/on-D2_IwJad.js +0 -8
  149. package/dist/chunks/on-_BJL2XbM.js +0 -1
  150. package/dist/chunks/overflow-menu-BSMy7pUY.js +0 -34
  151. package/dist/chunks/overflow-menu-CGghH3Mz.js +0 -387
  152. package/dist/chunks/pagination-4SuGaSx6.js +0 -77
  153. package/dist/chunks/pagination-D7VFRyN2.js +0 -293
  154. package/dist/chunks/password-input-Cx2ItLqG.js +0 -68
  155. package/dist/chunks/password-input-NoZg_DjL.js +0 -210
  156. package/dist/chunks/popover--wvkgqdv.js +0 -1
  157. package/dist/chunks/popover-Ca4f4ZCE.js +0 -6
  158. package/dist/chunks/popover-content-BOaLSQt3.js +0 -15
  159. package/dist/chunks/popover-content-Bi-ydBhZ.js +0 -277
  160. package/dist/chunks/progress-bar-BTHREDPK.js +0 -101
  161. package/dist/chunks/progress-bar-p0YwLsuh.js +0 -22
  162. package/dist/chunks/progress-indicator-BP8k-xTC.js +0 -252
  163. package/dist/chunks/progress-indicator-cr687P29.js +0 -35
  164. package/dist/chunks/radio-button-CNOPBUK8.js +0 -396
  165. package/dist/chunks/radio-button-CU2ngHxo.js +0 -44
  166. package/dist/chunks/radio-group-manager-iPCcbWB8.js +0 -60
  167. package/dist/chunks/radio-group-manager-zfU1GLIW.js +0 -1
  168. package/dist/chunks/register-BXKEXKsC.js +0 -15
  169. package/dist/chunks/register-Bx7SlevL.js +0 -8198
  170. package/dist/chunks/register-CnJjkv07.js +0 -1
  171. package/dist/chunks/register-DqgfpeXv.js +0 -1399
  172. package/dist/chunks/search-BYWQ80wI.js +0 -4
  173. package/dist/chunks/search-BgSG9LA9.js +0 -22
  174. package/dist/chunks/search-CET7sHGW.js +0 -173
  175. package/dist/chunks/search-CUuRRsTX.js +0 -31
  176. package/dist/chunks/select-BifhTIxt.js +0 -37
  177. package/dist/chunks/select-Dh4AFZ2v.js +0 -4
  178. package/dist/chunks/select-item-BvwJ4Wc-.js +0 -77
  179. package/dist/chunks/select-item-DLWdT1CE.js +0 -272
  180. package/dist/chunks/shared-enums-BdDASwq-.js +0 -1
  181. package/dist/chunks/shared-enums-Cd0vBQFM.js +0 -6
  182. package/dist/chunks/skeleton-placeholder-Czj5sAeI.js +0 -28
  183. package/dist/chunks/skeleton-placeholder-aS-woCl8.js +0 -1
  184. package/dist/chunks/skeleton-text-BIHdj7Jx.js +0 -1
  185. package/dist/chunks/skeleton-text-CZ2bSuDE.js +0 -6
  186. package/dist/chunks/skeleton-text-DJrow5mh.js +0 -1
  187. package/dist/chunks/skeleton-text-INjLvc2Y.js +0 -71
  188. package/dist/chunks/slider-CoHP_UJ2.js +0 -878
  189. package/dist/chunks/slider-DhIZP9Ms.js +0 -246
  190. package/dist/chunks/stack-C66k74Zo.js +0 -1
  191. package/dist/chunks/stack-vrK3hQYJ.js +0 -85
  192. package/dist/chunks/structured-list-BWjXHFbX.js +0 -19
  193. package/dist/chunks/structured-list-lqhD2RqL.js +0 -234
  194. package/dist/chunks/tabs-DixpRz83.js +0 -58
  195. package/dist/chunks/tabs-DkIGB3cC.js +0 -316
  196. package/dist/chunks/tag-DpezbQqm.js +0 -93
  197. package/dist/chunks/tag-rQOD2v2s.js +0 -412
  198. package/dist/chunks/text-input-BYjtsh0H.js +0 -26
  199. package/dist/chunks/text-input-C2jRG8Lb.js +0 -72
  200. package/dist/chunks/text-input-DvygxhCJ.js +0 -4
  201. package/dist/chunks/text-input-DzSNpORC.js +0 -309
  202. package/dist/chunks/textarea-BZ34-RaT.js +0 -190
  203. package/dist/chunks/textarea-Be3YTme6.js +0 -57
  204. package/dist/chunks/tile-CQ9nINGM.js +0 -524
  205. package/dist/chunks/tile-DNWy90OU.js +0 -74
  206. package/dist/chunks/time-picker-CJ_ONMZi.js +0 -267
  207. package/dist/chunks/time-picker-DK_Lu3AK.js +0 -52
  208. package/dist/chunks/toggle-BBdusHAx.js +0 -36
  209. package/dist/chunks/toggle-Bfx6cOUM.js +0 -156
  210. package/dist/chunks/toggle-tip-CkH7fFX4.js +0 -46
  211. package/dist/chunks/toggle-tip-DF_GKfoM.js +0 -169
  212. package/dist/chunks/tooltip-COwRDvmc.js +0 -85
  213. package/dist/chunks/tooltip-DbGsUOZ8.js +0 -23
  214. package/dist/chunks/tooltip-content-BDcgoT6r.js +0 -1
  215. package/dist/chunks/tooltip-content-CkxKIMDr.js +0 -116
  216. package/dist/chunks/tree-utils-AeNlEhIR.js +0 -1
  217. package/dist/chunks/tree-view-BmoD8n0Y.js +0 -292
  218. package/dist/chunks/tree-view-Drfa7DNm.js +0 -82
  219. package/dist/chunks/unsafe-html-BP-z2WTp.js +0 -26
  220. package/dist/chunks/unsafe-html-Dego4Lbw.js +0 -1
  221. package/dist/chunks/validity-CMW3OiFU.js +0 -31
  222. package/dist/chunks/validity-zT-XWh2t.js +0 -1
  223. package/dist/chunks/zoo-Bb5HHyrn.js +0 -721
  224. package/dist/chunks/zoo-C_CBOaHL.js +0 -52
@@ -0,0 +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",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;
@@ -1,4 +1,5 @@
1
- import { _ as __exportAll, a as isDefAndNotNull, m as toNumber, n as identity, o as isNumber, r as isArray, s as isString, u as pathOr } from "./component-library-registry-CJ1Yb_8E.js";
1
+ import { n as __exportAll } from "./component-library-registry-DB5UeqC2.js";
2
+ import { identity, isArray, isDefAndNotNull, isNumber, isString, pathOr, toNumber } from "badu";
2
3
  var utils_exports = /* @__PURE__ */ __exportAll({
3
4
  dateToZooyStdTimeString: () => dateToZooyStdTimeString,
4
5
  dtf: () => dtf,
@@ -0,0 +1 @@
1
+ const require_component_library_registry=require("./component-library-registry-BBQV6Kpv.js");let badu=require("badu");var utils_exports=require_component_library_registry.__exportAll({dateToZooyStdTimeString:()=>dateToZooyStdTimeString,dtf:()=>dtf,enableClass:()=>enableClass,evalModules:()=>evalModules,evalScripts:()=>evalScripts,formToJSON:()=>formToJSON,getElDataMap:()=>getElDataMap,getPos:()=>getPos,getValue:()=>getValue,handleTemplateProm:()=>handleTemplateProm,insertSiblingAfter:()=>insertSiblingAfter,isInPage:()=>isInPage,mapDataToEls:()=>mapDataToEls,parseDataPropKvDef:()=>parseDataPropKvDef,parseMap:()=>parseMap,parseMomentAgo:()=>parseMomentAgo,randomColour:()=>randomColour,removeNode:()=>removeNode,replaceNode:()=>replaceNode,splitScripts:()=>splitScripts,toggleClass:()=>toggleClass,totalHeight:()=>totalHeight,totalWidth:()=>totalWidth}),format=e=>{const t=Math.floor((new Date-e)/1e3),r=[{name:"year",seconds:31536e3},{name:"month",seconds:2592e3},{name:"week",seconds:604800},{name:"day",seconds:86400},{name:"hour",seconds:3600},{name:"minute",seconds:60},{name:"second",seconds:1}];if(t<0){const o=Math.abs(t);for(const n of r){const a=Math.floor(o/n.seconds);if(a>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(a,n.name)}return"just now"}for(const o of r){const n=Math.floor(t/o.seconds);if(n>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-n,o.name)}return"just now"},getInputChecked_=function(e){return e.checked?e.value:null},getSelectSingle_=function(e){const t=e.selectedIndex;return t>=0?e.options[t].value:null},getSelectMultiple_=function(e){const t=[];for(let r,o=0;r=e.options[o];o++)r.selected&&t.push(r.value);return t.length?t:null},getValue=function(e){const t=e.type;switch((0,badu.isString)(t)&&t.toLowerCase()){case"checkbox":case"radio":return getInputChecked_(e);case"select-one":return getSelectSingle_(e);case"select-multiple":return getSelectMultiple_(e);default:return e.value!==null&&e.value!==void 0?e.value:null}},formToJSON=e=>[...e].reduce((t,r)=>(t[r.name]=r.value,t),{}),replaceNode=(e,t)=>{const r=t.parentNode;r&&r.replaceChild(e,t)},removeNode=e=>e&&e.parentNode?e.parentNode.removeChild(e):null,insertSiblingAfter=(e,t)=>{t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling)},isInPage=e=>e===document.body?!1:document.body.contains(e),getPos=e=>[e.offsetLeft,e.offsetTop],randomColour=e=>[1,2,3].map(()=>Math.floor(Math.random()*256)+1).reduce((t,r)=>`${t}${r},`,"rgba(")+`${e||.5}`,totalWidth=e=>{const t=window.getComputedStyle(e),r=e.offsetWidth,o=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),a=parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth);return r+o-n+a},totalHeight=e=>{const t=window.getComputedStyle(e),r=e.offsetHeight,o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),n=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),a=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);return r+o-n+a},evalScripts=comp=>arr=>{arr&&Array.from(arr).forEach(s=>{(function(){eval(s.text)}).bind(comp)()})},evalModules=e=>t=>{t&&Array.from(t).forEach(r=>{(function(){const o=document.createElement("script");o.type="module",o.textContent=r.textContent;const n=e.getElement(),a=getElDataMap(r).zv_comp_access;a&&(n.zvComponent=e,n.classList.add(a)),n.appendChild(o)}).bind(e)()})},splitScripts=e=>{const t=new DOMParser().parseFromString(e,"text/html");return{html:t.body.firstElementChild,scripts:t.querySelectorAll('script:not([type="module"])'),modules:t.querySelectorAll('script[type="module"]')}},handleTemplateProm=e=>Promise.resolve(splitScripts(e)),enableClass=(e,t,r)=>{r?e.classList.add(t):e.classList.remove(t)},toggleClass=(e,t)=>{const r=!Array.from(e.classList).includes(t);return enableClass(e,t,r),r},getElDataMap=e=>e?Object.assign({},e.dataset||{}):{},dtFormatter={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},dFormatter={year:"numeric",month:"short",day:"numeric"},dtf=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),dateToZooyStdTimeString=e=>{const[{value:t},,{value:r},,{value:o},,{value:n},,{value:a},,{value:i},,]=dtf.formatToParts(e);return`${r} ${t} ${o} ${n}:${a}:${i}`},parseMomentAgo=(e,t="both",r=void 0)=>{let o=e;(0,badu.isNumber)(o)&&o<9466848e5?o=o*1e3:r&&(o=o+r);const n=new Date(o),a=format(n),i=dateToZooyStdTimeString(n);switch(t){case"time|ago":return`${i}|${a}`;case"ago":return`${a}`;case"datetime":case"time":return`${i}`;default:return`${a} (${i})`}},parseObfuscated=e=>{const r=(n=>a=>a<n.length-4)(e);return(n=>n.split("").map((a,i)=>r(i)?"*":a).join(""))(e)},parseMap=new Map().set(void 0,(e,t,r)=>(0,badu.identity)(e)).set("",(e,t,r)=>(0,badu.identity)(e)).set("class_update_only",(e,t,r)=>(0,badu.identity)(e)).set("frac_100",(e,t,r)=>Math.round(e*100*100)/100).set("date_and_time",(e,t,r)=>new Date(e).toLocaleString(void 0,dtFormatter)).set("date",(e,t,r)=>new Date(e).toLocaleString(void 0,dFormatter)).set("moment_ago",(e,t,r)=>parseMomentAgo(e,"both",r.zdd_date_tz||void 0)).set("moment_ago_only",(e,t,r)=>parseMomentAgo(e,"ago",r.zdd_date_tz||void 0)).set("moment_ago_datetime",(e,t,r)=>parseMomentAgo(e,"datetime",r.zdd_date_tz||void 0)).set("pretty-json",(e,t,r)=>JSON.stringify(e,null,4)).set("obfuscated",(e,t,r)=>parseObfuscated(e)).set("linear-progress",(e,t,r)=>{const o=(0,badu.toNumber)(r.zpmax),n=t.linProg;return o&&n&&(n.progress=e/o,e=void 0),e}),parseDataPropKvDef=e=>e.trim().split(",").map(t=>t.trim()).map(t=>{const[r,o]=t.split(":").map(n=>n.trim());return[r,o]}).filter(([t,r])=>t!==""&&r!==""),parseDataProps=(e,t)=>{const r=getElDataMap(e);return delete e.dataset.zoodatapropkv,parseDataPropKvDef(r.zoodatapropkv||"").forEach(([o,n])=>{e.dataset[o]=(0,badu.pathOr)(void 0,n.split("."))(t)}),e},mapDataToEls=(e,t,r=new Map,o=void 0)=>{if(!t)return;const n=new Map([...parseMap,...r]);[...e.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach(a=>{const i=getElDataMap(a),y=i.zdd||"",_=i.zdd_parse_as,S=i.zdd_render_effect||"",h=i.zdd_class_update,g=i.zdd_template_loop_index,b=i.zdd_units||"";let l=(0,badu.pathOr)(void 0,y.split("."))(t);if((0,badu.isDefAndNotNull)(l)&&(l=n.has(_)?n.get(_)(l,a,i):l),g&&(0,badu.isNumber)(o)&&(console.log("loopIndex: ",g," opt_loopIndex: ",o),g==="zero_indexed"?a.innerHTML=o:g==="one_indexed"?a.innerHTML=o+1:a.innerHTML=o),h){const[c,u,p]=h.split(":"),d=(0,badu.pathOr)(void 0,c.split("."))(t);if((0,badu.isDefAndNotNull)(d))switch(u){case"swap":{const m=/\{}/gi,v=p.replace(m,""),f=p.replace(m,d);a.classList.remove(...[...a.classList].filter(T=>T.includes(v))),a.classList.add(f);break}case"remove_on_data":a.classList.remove(p);break;case"choice_map":p.split("|").filter(m=>m!=="").forEach(m=>{const[v,f]=m.split(">");v===d+""?a.classList.add.apply(a.classList,f.split(".")):a.classList.remove.apply(a.classList,f.split("."))});break}}if(_==="templated-array"&&(0,badu.isArray)(l))if(l.length===0)a.classList.add("display__none");else{a.classList.remove("display__none"),l=l||[];const c=a.firstElementChild;c.classList.remove("display__none"),a.replaceChildren(...l.map((u,p)=>{const d=parseDataProps(c.cloneNode(!0),u);return mapDataToEls(d,u,void 0,p),d}))}else if((0,badu.isDefAndNotNull)(l))if(S==="typewriter"){let c=0;const u=l+b,p=5,d=()=>{c<u.length&&(a.innerHTML+=u.charAt(c),c++,setTimeout(d,p))};a.innerHTML="",d()}else a.innerHTML=l+b})},tree_utils_exports=require_component_library_registry.__exportAll({_openTreeFromNodeUp:()=>_openTreeFromNodeUp,toggleTree:()=>toggleTree,toggleTreeChildren:()=>toggleTreeChildren,treeNodeSelect:()=>treeNodeSelect}),needsToScroll=e=>{const t=e.getBoundingClientRect().bottom;return r=>r.getBoundingClientRect().bottom>t},treeNodeSelect=e=>t=>{const r=needsToScroll(e.getElement().querySelector(".zv_tree_container")),o=e.getElement().querySelectorAll(".tree-node");let n;[...o].forEach(a=>{enableClass(a,"mdc-deprecated-list-item--activated",a.id===`tree-node_${t}`),a.id===`tree-node_${t}`&&(n=a)}),n&&r(n)&&n.scrollIntoView(!1)},toggleTree=(e,t)=>{const r=t.getElement().querySelector(".children"),o=e.isOn,n=t.getElement().querySelectorAll(".children"),a=t.getElement().querySelectorAll(".zoo__reveal_icon");[...n].forEach(i=>enableClass(i,"zoo__tree-children__hidden",i!==r&&!o)),[...a].forEach(i=>enableClass(i,"zoo__icon_rotated",i!==r&&!o))},toggleTreeChildren=(e,t)=>{const r=t.trigger,o=r.getAttribute("data-child-id");toggleClass(e.getElement().querySelector(`#${o}`),"zoo__tree-children__hidden"),toggleClass(r,"zoo__icon_rotated")},_openTreeFromNodeUp=(e,t)=>{const r=t.parentElement;r.classList.contains("children")&&(enableClass(r,"zoo__tree-children__hidden",!1),_openTreeFromNodeUp(e,r))};Object.defineProperty(exports,"evalModules",{enumerable:!0,get:function(){return evalModules}});Object.defineProperty(exports,"evalScripts",{enumerable:!0,get:function(){return evalScripts}});Object.defineProperty(exports,"formToJSON",{enumerable:!0,get:function(){return formToJSON}});Object.defineProperty(exports,"getElDataMap",{enumerable:!0,get:function(){return getElDataMap}});Object.defineProperty(exports,"getPos",{enumerable:!0,get:function(){return getPos}});Object.defineProperty(exports,"handleTemplateProm",{enumerable:!0,get:function(){return handleTemplateProm}});Object.defineProperty(exports,"isInPage",{enumerable:!0,get:function(){return isInPage}});Object.defineProperty(exports,"removeNode",{enumerable:!0,get:function(){return removeNode}});Object.defineProperty(exports,"replaceNode",{enumerable:!0,get:function(){return replaceNode}});Object.defineProperty(exports,"splitScripts",{enumerable:!0,get:function(){return splitScripts}});Object.defineProperty(exports,"toggleTree",{enumerable:!0,get:function(){return toggleTree}});Object.defineProperty(exports,"toggleTreeChildren",{enumerable:!0,get:function(){return toggleTreeChildren}});Object.defineProperty(exports,"tree_utils_exports",{enumerable:!0,get:function(){return tree_utils_exports}});Object.defineProperty(exports,"utils_exports",{enumerable:!0,get:function(){return utils_exports}});
@@ -0,0 +1,52 @@
1
+ const A=require("./component-library-registry-BBQV6Kpv.js");let p=require("badu"),c=require("ramda"),o=require("lit");var T={json:t=>JSON.stringify(t,null,2),tpl:(t,r,e)=>{const i=e?.getAttribute("zoo-bind-attr-tpl")||e?.getAttribute("zoo-bind-tpl");if(!i)return t;try{return new Function("value","data",`return \`${i}\`;`)(t,r)}catch(n){return console.warn("[Binder] Invalid template:",i,n),t}}},w=class{#s;#t;#r;#e=null;#i;constructor(t,r,e,i={}){if(!r)throw new Error("Binder requires a URL");if(!e||!(e instanceof Element))throw new Error("Binder requires a valid rootEl Element");this.#s=t,this.#t=new URL(r,window.location.origin),this.#r=e,this.#i={...T,...i.formatters},i.urlParams?this.#a(i.urlParams):this.#n()}get url(){return this.#t}get data(){return this.#e}get limit(){return parseInt(this.#t.searchParams.get("limit")||"0",10)}get offset(){return parseInt(this.#t.searchParams.get("offset")||"0",10)}get isPaginated(){return(0,c.both)((0,c.has)("count"),(0,c.has)("results"))(this.#e)}#a(t){return Object.entries(t).forEach(([r,e])=>{if(!(0,p.isDefAndNotNull)(e)||e===""||Array.isArray(e)&&e.length<1){this.#t.searchParams.delete(r);return}if(Array.isArray(e)){this.#t.searchParams.set(r,e.join(","));return}this.#t.searchParams.set(r,e)}),this.#n(),this.#t}#n(){const t=this.#t.href.split(this.url.origin)[1].slice(1);this.#r.querySelectorAll("[zoo-bind-binderurl]").forEach(r=>{r.setAttribute("zoo-bind-binderurl",t)})}async fetchData(t={}){const r=await this.#s.user.fetchJson(this.#a(t).toString(),this.#s.abortController.signal);this.setData(r)}setData(t){this.#e=t,this.render()}render(){if(!(0,p.isDefAndNotNull)(this.#e)){console.warn("[Binder] No data to render");return}this.#n(),this.#o(this.#r,this.#e,0),this.#c()}#o(t,r,e=0,i={}){const n=i.removeAttributes??!1;t.querySelectorAll("[zoo-bind-attr]").forEach(s=>{s.closest("[zoo-template]")||(s.getAttribute("zoo-bind-attr").split(",").forEach(a=>{const[l,u]=a.split(":").map(f=>f.trim()),[m,d]=u.split("|").map(f=>f.trim());let h=this.#l(r,m,e);d&&this.#i[d]&&(h=this.#i[d](h,r,s)),(0,p.isDefAndNotNull)(h)&&s.setAttribute(l,h)}),n&&(s.removeAttribute("zoo-bind-attr"),s.removeAttribute("zoo-bind-attr-tpl")))}),t.querySelectorAll("[zoo-bind]").forEach(s=>{if(s.closest("[zoo-template]"))return;const[a,l]=s.getAttribute("zoo-bind").split("|").map(m=>m.trim());let u=this.#l(r,a,e);l&&this.#i[l]&&(u=this.#i[l](u,r,s)),s.textContent=u??"",n&&(s.removeAttribute("zoo-bind"),s.removeAttribute("zoo-bind-tpl"))})}#c(){this.#r.querySelectorAll("[zoo-template]").forEach(t=>{const r=t.getAttribute("zoo-template"),e=t.getAttribute("zoo-template-bind");if(!r){console.warn("[Binder] Consumer missing template ID",t);return}const i=this.#r.querySelector(`#${r}`);if(!i||i.tagName!=="TEMPLATE"){console.error(`[DataBinder] Template not found or invalid: ${r}`);return}const n=e?(0,c.path)(e.split("."),this.#e):this.#e;if(!n){console.warn(`[DataBinder] Data slice is undefined. Path: ${e}. Skipping render for this consumer.`);return}if(!Array.isArray(n)){console.error(`[DataBinder] Data slice is not an array. Path: ${e}`,n);return}t.innerHTML="",n.forEach((s,a)=>{const l=this.#u(i,s,a);t.appendChild(l)})})}#u(t,r,e){const i=t.content.cloneNode(!0);return this.#o(i,r,e,{removeAttributes:!0}),i}#l(t,r,e){const i={$index:()=>e,$index__paged:()=>this.offset+e,$index1:()=>e+1,$index1__paged:()=>this.offset+e+1};return i[r]?i[r]():(0,c.path)(r.split("."),t)}},g=new Map(Object.entries({event:"event",endpoint:"endpoint",href:"href",url:"url",target:"target","record-id":"recordId","zoo-sort-field":"sortField","zoo-view":"view","zoo-event":"event","zoo-href":"href"})),v=t=>{let r={};return Array.from(t.attributes).forEach(e=>{const i=e.name,n=e.value;g.has(i)?r[g.get(i)]=n:(i.startsWith("data-")||i.startsWith("zoo-"))&&(r=(0,c.assocPath)(i.split("-"),n,r))}),r},b=(t,r,e="event")=>t.getAttribute(r)||t.getAttribute(e),y=class extends o.LitElement{static properties={token:{type:String},prefix:{type:String},postfix:{type:String}};static styles=o.css`
2
+ :host {
3
+ display: inline-block;
4
+ }
5
+
6
+ .tag {
7
+ text-align: center;
8
+ display: inline-flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ line-height: initial;
12
+ width: max-content;
13
+ padding: .2em 1em;
14
+ border-radius: 1em;
15
+ font-size: var(--zoo-theme-chips-font-size, 0.75rem);
16
+ white-space: nowrap;
17
+ word-break: break-word;
18
+ box-sizing: border-box;
19
+ }
20
+ `;render(){const t=`${this.prefix??""}${this.token??"default"}${this.postfix??""}`;return o.html`
21
+ <span
22
+ class="tag"
23
+ style="
24
+ background-color: var(--zoo-tag-${t}-bg, var(--zoo-tag-default-bg, #9e9e9e));
25
+ color: var(--zoo-tag-${t}-fg, var(--zoo-tag-default-fg, #ffffff));
26
+ "
27
+ >
28
+ <slot></slot>
29
+ </span>
30
+ `}};customElements.get("zoo-tag")||customElements.define("zoo-tag",y);var _=t=>{const r=Math.floor((new Date-t)/1e3),e=[{name:"year",seconds:31536e3},{name:"month",seconds:2592e3},{name:"week",seconds:604800},{name:"day",seconds:86400},{name:"hour",seconds:3600},{name:"minute",seconds:60},{name:"second",seconds:1}];if(r<0){const i=Math.abs(r);for(const n of e){const s=Math.floor(i/n.seconds);if(s>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(s,n.name)}return"just now"}for(const i of e){const n=Math.floor(r/i.seconds);if(n>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-n,i.name)}return"just now"},k=t=>{const[{value:r},,{value:e},,{value:i},,{value:n},,{value:s},,{value:a}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(t);return`${e} ${r} ${i} ${n}:${s}:${a}`},E=t=>{const[{value:r},,{value:e},,{value:i}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit"}).formatToParts(t);return`${e} ${r} ${i}`},z=class extends o.LitElement{static properties={timestamp:{type:Number},kind:{type:String},concat:{type:String}};static styles=o.css`
31
+ :host {
32
+ display: inline;
33
+ }
34
+
35
+ .relative {
36
+ color: var(--zoo-timestamp-relative-color, inherit);
37
+ font-weight: var(--zoo-timestamp-relative-weight, inherit);
38
+ font-size: var(--zoo-timestamp-relative-size, inherit);
39
+ }
40
+
41
+ .static {
42
+ color: var(--zoo-timestamp-static-color, inherit);
43
+ font-weight: var(--zoo-timestamp-static-weight, inherit);
44
+ font-size: var(--zoo-timestamp-static-size, inherit);
45
+ }
46
+
47
+ .separator {
48
+ color: var(--zoo-timestamp-separator-color, inherit);
49
+ }
50
+ `;constructor(){super(),this.timestamp=Date.now(),this.kind="both",this.concat="r (s)",this._boundTickHandler=this._onTimeTick.bind(this),this._isListening=!1}_shouldListenToTicks(){return this.kind==="relative"||this.kind==="both"}connectedCallback(){super.connectedCallback(),this._updateTickListener()}disconnectedCallback(){this._removeTickListener(),super.disconnectedCallback()}updated(t){super.updated(t),t.has("kind")&&this._updateTickListener()}_updateTickListener(){const t=this._shouldListenToTicks();t&&!this._isListening?(document.addEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!0):!t&&this._isListening&&this._removeTickListener()}_removeTickListener(){this._isListening&&(document.removeEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!1)}_onTimeTick(){this.requestUpdate()}_parseTemplate(t){const r=[];let e=t;for(;e.length>0;){const i=e.indexOf("r"),n=[i,e.indexOf("s")].filter(s=>s!==-1).sort((s,a)=>s-a)[0];if(n===void 0){e.length>0&&r.push({type:"text",value:e});break}n>0&&r.push({type:"text",value:e.substring(0,n)}),n===i?r.push({type:"relative",value:""}):r.push({type:"static",value:""}),e=e.substring(n+1)}return r}_getFormattedParts(){let t=this.timestamp;t<9466848e5&&(t=t*1e3);const r=new Date(t),e=_(r),i=k(r),n=E(r);switch(this.kind){case"relative":return[{type:"relative",value:e}];case"datetime":return[{type:"static",value:i}];case"date":return[{type:"static",value:n}];case"both":return this._parseTemplate(this.concat).map(s=>s.type==="relative"?{type:"relative",value:e}:s.type==="static"?{type:"static",value:i}:s);default:return this._parseTemplate(this.concat).map(s=>s.type==="relative"?{type:"relative",value:e}:s.type==="static"?{type:"static",value:i}:s)}}render(){let t=this.timestamp;t<9466848e5&&(t=t*1e3);const r=new Date(t),e=this._getFormattedParts();return o.html`<time datetime="${r.toISOString()}">
51
+ ${e.map(i=>i.type==="relative"?o.html`<span class="relative">${i.value}</span>`:i.type==="static"?o.html`<span class="static">${i.value}</span>`:o.html`<span class="separator">${i.value}</span>`)}
52
+ </time>`}};customElements.get("zoo-timestamp")||customElements.define("zoo-timestamp",z);var $=A.__exportAll({ZooTag:()=>y,ZooTimestamp:()=>z,getEventAttribute:()=>b,getSemanticAttributes:()=>v});Object.defineProperty(exports,"Binder",{enumerable:!0,get:function(){return w}});Object.defineProperty(exports,"getEventAttribute",{enumerable:!0,get:function(){return b}});Object.defineProperty(exports,"getSemanticAttributes",{enumerable:!0,get:function(){return v}});Object.defineProperty(exports,"zoo_exports",{enumerable:!0,get:function(){return $}});
@@ -0,0 +1,390 @@
1
+ import { n as A } from "./component-library-registry-DB5UeqC2.js";
2
+ import { isDefAndNotNull as f } from "badu";
3
+ import { assocPath as w, both as k, has as p, path as v } from "ramda";
4
+ import { LitElement as b, css as y, html as c } from "lit";
5
+ var _ = {
6
+ json: (t) => JSON.stringify(t, null, 2),
7
+ tpl: (t, i, e) => {
8
+ const r = e?.getAttribute("zoo-bind-attr-tpl") || e?.getAttribute("zoo-bind-tpl");
9
+ if (!r) return t;
10
+ try {
11
+ return new Function("value", "data", `return \`${r}\`;`)(t, i);
12
+ } catch (a) {
13
+ return console.warn("[Binder] Invalid template:", r, a), t;
14
+ }
15
+ }
16
+ }, C = class {
17
+ #s;
18
+ #t;
19
+ #i;
20
+ #e = null;
21
+ #r;
22
+ constructor(t, i, e, r = {}) {
23
+ if (!i) throw new Error("Binder requires a URL");
24
+ if (!e || !(e instanceof Element)) throw new Error("Binder requires a valid rootEl Element");
25
+ this.#s = t, this.#t = new URL(i, window.location.origin), this.#i = e, this.#r = {
26
+ ..._,
27
+ ...r.formatters
28
+ }, r.urlParams ? this.#n(r.urlParams) : this.#a();
29
+ }
30
+ get url() {
31
+ return this.#t;
32
+ }
33
+ get data() {
34
+ return this.#e;
35
+ }
36
+ get limit() {
37
+ return parseInt(this.#t.searchParams.get("limit") || "0", 10);
38
+ }
39
+ get offset() {
40
+ return parseInt(this.#t.searchParams.get("offset") || "0", 10);
41
+ }
42
+ get isPaginated() {
43
+ return k(p("count"), p("results"))(this.#e);
44
+ }
45
+ #n(t) {
46
+ return Object.entries(t).forEach(([i, e]) => {
47
+ if (!f(e) || e === "" || Array.isArray(e) && e.length < 1) {
48
+ this.#t.searchParams.delete(i);
49
+ return;
50
+ }
51
+ if (Array.isArray(e)) {
52
+ this.#t.searchParams.set(i, e.join(","));
53
+ return;
54
+ }
55
+ this.#t.searchParams.set(i, e);
56
+ }), this.#a(), this.#t;
57
+ }
58
+ #a() {
59
+ const t = this.#t.href.split(this.url.origin)[1].slice(1);
60
+ this.#i.querySelectorAll("[zoo-bind-binderurl]").forEach((i) => {
61
+ i.setAttribute("zoo-bind-binderurl", t);
62
+ });
63
+ }
64
+ async fetchData(t = {}) {
65
+ const i = await this.#s.user.fetchJson(this.#n(t).toString(), this.#s.abortController.signal);
66
+ this.setData(i);
67
+ }
68
+ setData(t) {
69
+ this.#e = t, this.render();
70
+ }
71
+ render() {
72
+ if (!f(this.#e)) {
73
+ console.warn("[Binder] No data to render");
74
+ return;
75
+ }
76
+ this.#a(), this.#o(this.#i, this.#e, 0), this.#c();
77
+ }
78
+ #o(t, i, e = 0, r = {}) {
79
+ const a = r.removeAttributes ?? !1;
80
+ t.querySelectorAll("[zoo-bind-attr]").forEach((s) => {
81
+ s.closest("[zoo-template]") || (s.getAttribute("zoo-bind-attr").split(",").forEach((n) => {
82
+ const [o, l] = n.split(":").map((d) => d.trim()), [h, m] = l.split("|").map((d) => d.trim());
83
+ let u = this.#l(i, h, e);
84
+ m && this.#r[m] && (u = this.#r[m](u, i, s)), f(u) && s.setAttribute(o, u);
85
+ }), a && (s.removeAttribute("zoo-bind-attr"), s.removeAttribute("zoo-bind-attr-tpl")));
86
+ }), t.querySelectorAll("[zoo-bind]").forEach((s) => {
87
+ if (s.closest("[zoo-template]")) return;
88
+ const [n, o] = s.getAttribute("zoo-bind").split("|").map((h) => h.trim());
89
+ let l = this.#l(i, n, e);
90
+ o && this.#r[o] && (l = this.#r[o](l, i, s)), s.textContent = l ?? "", a && (s.removeAttribute("zoo-bind"), s.removeAttribute("zoo-bind-tpl"));
91
+ });
92
+ }
93
+ #c() {
94
+ this.#i.querySelectorAll("[zoo-template]").forEach((t) => {
95
+ const i = t.getAttribute("zoo-template"), e = t.getAttribute("zoo-template-bind");
96
+ if (!i) {
97
+ console.warn("[Binder] Consumer missing template ID", t);
98
+ return;
99
+ }
100
+ const r = this.#i.querySelector(`#${i}`);
101
+ if (!r || r.tagName !== "TEMPLATE") {
102
+ console.error(`[DataBinder] Template not found or invalid: ${i}`);
103
+ return;
104
+ }
105
+ const a = e ? v(e.split("."), this.#e) : this.#e;
106
+ if (!a) {
107
+ console.warn(`[DataBinder] Data slice is undefined. Path: ${e}. Skipping render for this consumer.`);
108
+ return;
109
+ }
110
+ if (!Array.isArray(a)) {
111
+ console.error(`[DataBinder] Data slice is not an array. Path: ${e}`, a);
112
+ return;
113
+ }
114
+ t.innerHTML = "", a.forEach((s, n) => {
115
+ const o = this.#u(r, s, n);
116
+ t.appendChild(o);
117
+ });
118
+ });
119
+ }
120
+ #u(t, i, e) {
121
+ const r = t.content.cloneNode(!0);
122
+ return this.#o(r, i, e, { removeAttributes: !0 }), r;
123
+ }
124
+ #l(t, i, e) {
125
+ const r = {
126
+ $index: () => e,
127
+ $index__paged: () => this.offset + e,
128
+ $index1: () => e + 1,
129
+ $index1__paged: () => this.offset + e + 1
130
+ };
131
+ return r[i] ? r[i]() : v(i.split("."), t);
132
+ }
133
+ }, g = new Map(Object.entries({
134
+ event: "event",
135
+ endpoint: "endpoint",
136
+ href: "href",
137
+ url: "url",
138
+ target: "target",
139
+ "record-id": "recordId",
140
+ "zoo-sort-field": "sortField",
141
+ "zoo-view": "view",
142
+ "zoo-event": "event",
143
+ "zoo-href": "href"
144
+ })), $ = (t) => {
145
+ let i = {};
146
+ return Array.from(t.attributes).forEach((e) => {
147
+ const r = e.name, a = e.value;
148
+ g.has(r) ? i[g.get(r)] = a : (r.startsWith("data-") || r.startsWith("zoo-")) && (i = w(r.split("-"), a, i));
149
+ }), i;
150
+ }, E = (t, i, e = "event") => t.getAttribute(i) || t.getAttribute(e), z = class extends b {
151
+ static properties = {
152
+ token: { type: String },
153
+ prefix: { type: String },
154
+ postfix: { type: String }
155
+ };
156
+ static styles = y`
157
+ :host {
158
+ display: inline-block;
159
+ }
160
+
161
+ .tag {
162
+ text-align: center;
163
+ display: inline-flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ line-height: initial;
167
+ width: max-content;
168
+ padding: .2em 1em;
169
+ border-radius: 1em;
170
+ font-size: var(--zoo-theme-chips-font-size, 0.75rem);
171
+ white-space: nowrap;
172
+ word-break: break-word;
173
+ box-sizing: border-box;
174
+ }
175
+ `;
176
+ render() {
177
+ const t = `${this.prefix ?? ""}${this.token ?? "default"}${this.postfix ?? ""}`;
178
+ return c`
179
+ <span
180
+ class="tag"
181
+ style="
182
+ background-color: var(--zoo-tag-${t}-bg, var(--zoo-tag-default-bg, #9e9e9e));
183
+ color: var(--zoo-tag-${t}-fg, var(--zoo-tag-default-fg, #ffffff));
184
+ "
185
+ >
186
+ <slot></slot>
187
+ </span>
188
+ `;
189
+ }
190
+ };
191
+ customElements.get("zoo-tag") || customElements.define("zoo-tag", z);
192
+ var L = (t) => {
193
+ const i = Math.floor((/* @__PURE__ */ new Date() - t) / 1e3), e = [
194
+ {
195
+ name: "year",
196
+ seconds: 31536e3
197
+ },
198
+ {
199
+ name: "month",
200
+ seconds: 2592e3
201
+ },
202
+ {
203
+ name: "week",
204
+ seconds: 604800
205
+ },
206
+ {
207
+ name: "day",
208
+ seconds: 86400
209
+ },
210
+ {
211
+ name: "hour",
212
+ seconds: 3600
213
+ },
214
+ {
215
+ name: "minute",
216
+ seconds: 60
217
+ },
218
+ {
219
+ name: "second",
220
+ seconds: 1
221
+ }
222
+ ];
223
+ if (i < 0) {
224
+ const r = Math.abs(i);
225
+ for (const a of e) {
226
+ const s = Math.floor(r / a.seconds);
227
+ if (s >= 1) return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(s, a.name);
228
+ }
229
+ return "just now";
230
+ }
231
+ for (const r of e) {
232
+ const a = Math.floor(i / r.seconds);
233
+ if (a >= 1) return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-a, r.name);
234
+ }
235
+ return "just now";
236
+ }, x = (t) => {
237
+ const [{ value: i }, , { value: e }, , { value: r }, , { value: a }, , { value: s }, , { value: n }] = new Intl.DateTimeFormat("en", {
238
+ day: "2-digit",
239
+ month: "short",
240
+ year: "2-digit",
241
+ hour: "2-digit",
242
+ minute: "2-digit",
243
+ second: "2-digit",
244
+ hourCycle: "h23"
245
+ }).formatToParts(t);
246
+ return `${e} ${i} ${r} ${a}:${s}:${n}`;
247
+ }, S = (t) => {
248
+ const [{ value: i }, , { value: e }, , { value: r }] = new Intl.DateTimeFormat("en", {
249
+ day: "2-digit",
250
+ month: "short",
251
+ year: "2-digit"
252
+ }).formatToParts(t);
253
+ return `${e} ${i} ${r}`;
254
+ }, T = class extends b {
255
+ static properties = {
256
+ timestamp: { type: Number },
257
+ kind: { type: String },
258
+ concat: { type: String }
259
+ };
260
+ static styles = y`
261
+ :host {
262
+ display: inline;
263
+ }
264
+
265
+ .relative {
266
+ color: var(--zoo-timestamp-relative-color, inherit);
267
+ font-weight: var(--zoo-timestamp-relative-weight, inherit);
268
+ font-size: var(--zoo-timestamp-relative-size, inherit);
269
+ }
270
+
271
+ .static {
272
+ color: var(--zoo-timestamp-static-color, inherit);
273
+ font-weight: var(--zoo-timestamp-static-weight, inherit);
274
+ font-size: var(--zoo-timestamp-static-size, inherit);
275
+ }
276
+
277
+ .separator {
278
+ color: var(--zoo-timestamp-separator-color, inherit);
279
+ }
280
+ `;
281
+ constructor() {
282
+ super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
283
+ }
284
+ _shouldListenToTicks() {
285
+ return this.kind === "relative" || this.kind === "both";
286
+ }
287
+ connectedCallback() {
288
+ super.connectedCallback(), this._updateTickListener();
289
+ }
290
+ disconnectedCallback() {
291
+ this._removeTickListener(), super.disconnectedCallback();
292
+ }
293
+ updated(t) {
294
+ super.updated(t), t.has("kind") && this._updateTickListener();
295
+ }
296
+ _updateTickListener() {
297
+ const t = this._shouldListenToTicks();
298
+ t && !this._isListening ? (document.addEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !0) : !t && this._isListening && this._removeTickListener();
299
+ }
300
+ _removeTickListener() {
301
+ this._isListening && (document.removeEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !1);
302
+ }
303
+ _onTimeTick() {
304
+ this.requestUpdate();
305
+ }
306
+ _parseTemplate(t) {
307
+ const i = [];
308
+ let e = t;
309
+ for (; e.length > 0; ) {
310
+ const r = e.indexOf("r"), a = [r, e.indexOf("s")].filter((s) => s !== -1).sort((s, n) => s - n)[0];
311
+ if (a === void 0) {
312
+ e.length > 0 && i.push({
313
+ type: "text",
314
+ value: e
315
+ });
316
+ break;
317
+ }
318
+ a > 0 && i.push({
319
+ type: "text",
320
+ value: e.substring(0, a)
321
+ }), a === r ? i.push({
322
+ type: "relative",
323
+ value: ""
324
+ }) : i.push({
325
+ type: "static",
326
+ value: ""
327
+ }), e = e.substring(a + 1);
328
+ }
329
+ return i;
330
+ }
331
+ _getFormattedParts() {
332
+ let t = this.timestamp;
333
+ t < 9466848e5 && (t = t * 1e3);
334
+ const i = new Date(t), e = L(i), r = x(i), a = S(i);
335
+ switch (this.kind) {
336
+ case "relative":
337
+ return [{
338
+ type: "relative",
339
+ value: e
340
+ }];
341
+ case "datetime":
342
+ return [{
343
+ type: "static",
344
+ value: r
345
+ }];
346
+ case "date":
347
+ return [{
348
+ type: "static",
349
+ value: a
350
+ }];
351
+ case "both":
352
+ return this._parseTemplate(this.concat).map((s) => s.type === "relative" ? {
353
+ type: "relative",
354
+ value: e
355
+ } : s.type === "static" ? {
356
+ type: "static",
357
+ value: r
358
+ } : s);
359
+ default:
360
+ return this._parseTemplate(this.concat).map((s) => s.type === "relative" ? {
361
+ type: "relative",
362
+ value: e
363
+ } : s.type === "static" ? {
364
+ type: "static",
365
+ value: r
366
+ } : s);
367
+ }
368
+ }
369
+ render() {
370
+ let t = this.timestamp;
371
+ t < 9466848e5 && (t = t * 1e3);
372
+ const i = new Date(t), e = this._getFormattedParts();
373
+ return c`<time datetime="${i.toISOString()}">
374
+ ${e.map((r) => r.type === "relative" ? c`<span class="relative">${r.value}</span>` : r.type === "static" ? c`<span class="static">${r.value}</span>` : c`<span class="separator">${r.value}</span>`)}
375
+ </time>`;
376
+ }
377
+ };
378
+ customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", T);
379
+ var F = /* @__PURE__ */ A({
380
+ ZooTag: () => z,
381
+ ZooTimestamp: () => T,
382
+ getEventAttribute: () => E,
383
+ getSemanticAttributes: () => $
384
+ });
385
+ export {
386
+ C as i,
387
+ E as n,
388
+ $ as r,
389
+ F as t
390
+ };