@trintel/zooy 1.0.14 → 1.0.20

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 (394) hide show
  1. package/dist/chunks/16-B2HVhDIW.js +1 -0
  2. package/dist/chunks/{16-Drl9-5Gn.js → 16-B9Ad4Fob.js} +2 -4
  3. package/dist/chunks/{16-CqC9427V.js → 16-BXsOcjPx.js} +2 -4
  4. package/dist/chunks/16-BZCBqUx6.js +1 -0
  5. package/dist/chunks/16-BmOXGjZf.js +1 -0
  6. package/dist/chunks/{16-BTonF5Je.js → 16-BsQdCz_w.js} +2 -4
  7. package/dist/chunks/16-C-Rp3Nso.js +1 -0
  8. package/dist/chunks/{16-BiShwKPX.js → 16-C36sVk5F.js} +2 -4
  9. package/dist/chunks/16-CZycT1I8.js +1 -0
  10. package/dist/chunks/16-Ce_hDgPW.js +1 -0
  11. package/dist/chunks/{16-CSWwhDUY.js → 16-CinLDpNC.js} +2 -4
  12. package/dist/chunks/16-Cj0hOjaI.js +1 -0
  13. package/dist/chunks/{16-8pr5mbIO.js → 16-Cx-PCMJJ.js} +2 -4
  14. package/dist/chunks/16-D8XFc44J.js +110 -0
  15. package/dist/chunks/16-DVx7Niko.js +33 -0
  16. package/dist/chunks/16-DZJZDJYY.js +1 -0
  17. package/dist/chunks/{16-BFJN6B6d.js → 16-DoCnqtvj.js} +4 -8
  18. package/dist/chunks/{16-CDRTWf-C.js → 16-DyCV3lkl.js} +2 -4
  19. package/dist/chunks/{16-D3Ol0pdg.js → 16-SwMpxJpB.js} +2 -4
  20. package/dist/chunks/16-jVjxC8Bu.js +1 -0
  21. package/dist/chunks/16-ma2Q_204.js +1 -0
  22. package/dist/chunks/16-qZ3FOIw0.js +1 -0
  23. package/dist/chunks/{20-CQLnFcRb.js → 20-BwzzGcZC.js} +27 -31
  24. package/dist/chunks/20-CqNSki3g.js +1 -0
  25. package/dist/chunks/accordion-0mybViUv.js +236 -0
  26. package/dist/chunks/accordion-CvcaulG8.js +45 -0
  27. package/dist/chunks/badge-indicator-BUdDkz6Z.js +18 -0
  28. package/dist/chunks/badge-indicator-DuYbJV5o.js +1 -0
  29. package/dist/chunks/breadcrumb-CYKgjbdB.js +19 -0
  30. package/dist/chunks/breadcrumb-DB0PkiBX.js +140 -0
  31. package/dist/chunks/button-1g5b3tWS.js +268 -0
  32. package/dist/chunks/button-BKj8189A.js +4 -0
  33. package/dist/chunks/button-DAOoyQ8b.js +67 -0
  34. package/dist/chunks/button-DfRkC-OR.js +72 -0
  35. package/dist/chunks/button-skeleton-C0mW3D7v.js +44 -0
  36. package/dist/chunks/button-skeleton-KFGdwtUH.js +21 -0
  37. package/dist/chunks/carbon-element-BsPGNbmz.js +1 -0
  38. package/dist/chunks/{carbon-element-DzDuXiyl.js → carbon-element-Z5iEnFdr.js} +4 -5
  39. package/dist/chunks/checkbox-CBD8Qmjx.js +37 -0
  40. package/dist/chunks/checkbox-CewERWBu.js +40 -0
  41. package/dist/chunks/checkbox-CxxD4wgP.js +176 -0
  42. package/dist/chunks/checkbox-DKS7fw29.js +168 -0
  43. package/dist/chunks/class-map-BwUbMyhc.js +1 -0
  44. package/dist/chunks/{class-map-CLDu36Gc.js → class-map-qeLb1IA_.js} +5 -10
  45. package/dist/chunks/code-snippet-BJhK27fG.js +205 -0
  46. package/dist/chunks/code-snippet-BUQFh_v7.js +53 -0
  47. package/dist/chunks/collection-helpers-DPVzwwb8.js +7 -0
  48. package/dist/chunks/collection-helpers-g7DrZSRQ.js +1 -0
  49. package/dist/chunks/combo-box-BCOUQHyG.js +39 -0
  50. package/dist/chunks/combo-box-Bms5blM6.js +325 -0
  51. package/dist/chunks/combo-button-BSBAvBIW.js +15 -0
  52. package/dist/chunks/combo-button-Bc3hx7VJ.js +92 -0
  53. package/dist/chunks/component-library-registry-CJ1Yb_8E.js +98 -0
  54. package/dist/chunks/component-library-registry-Co7WzTfw.js +1 -0
  55. package/dist/chunks/content-switcher-BuLZ3Aae.js +1 -0
  56. package/dist/chunks/content-switcher-DIODRHwc.js +2 -0
  57. package/dist/chunks/content-switcher-item-0YPDXW1z.js +27 -0
  58. package/dist/chunks/content-switcher-item-DkRD8k8n.js +272 -0
  59. package/dist/chunks/copy-button-XD4reiTK.js +121 -0
  60. package/dist/chunks/copy-button-eI9B8iKc.js +17 -0
  61. package/dist/chunks/data-table-BImLEoIA.js +1243 -0
  62. package/dist/chunks/data-table-YLNCQhJx.js +158 -0
  63. package/dist/chunks/date-picker-CWIAwkKj.js +66 -0
  64. package/dist/chunks/date-picker-CXjiOkZH.js +2167 -0
  65. package/dist/chunks/{settings-Bgpv8zuU.js → decorate-Cnz2C5jL.js} +2 -2
  66. package/dist/chunks/{settings-jvP7vP60.js → decorate-DT052P_1.js} +9 -3
  67. package/dist/chunks/decorators-CHZSYVOk.js +1 -0
  68. package/dist/chunks/decorators-CK8kfuyw.js +87 -0
  69. package/dist/chunks/deep-shadow-contains-BlQ_KSu4.js +15 -0
  70. package/dist/chunks/deep-shadow-contains-OTuAt1VE.js +1 -0
  71. package/dist/chunks/directive-CtTB8jL3.js +31 -0
  72. package/dist/chunks/directive-DWoJrOxt.js +1 -0
  73. package/dist/chunks/dropdown-Cg9JduA5.js +4 -0
  74. package/dist/chunks/dropdown-item-CYwutWei.js +677 -0
  75. package/dist/chunks/dropdown-item-H53zayYk.js +73 -0
  76. package/dist/chunks/dropdown-jdFaaXEa.js +32 -0
  77. package/dist/chunks/file-uploader-6FOP_GAh.js +79 -0
  78. package/dist/chunks/file-uploader-BTk1MqcJ.js +342 -0
  79. package/dist/chunks/floating-controller-BphaSUPY.js +1012 -0
  80. package/dist/chunks/floating-controller-C4ivnNvp.js +1 -0
  81. package/dist/chunks/focus-C1mbe9-i.js +1 -0
  82. package/dist/chunks/focus-Dpis0wA_.js +13 -0
  83. package/dist/chunks/{form-DpI-v6DA.js → form-BEmId1-D.js} +6 -6
  84. package/dist/chunks/form-BmSVyKnm.js +1 -0
  85. package/dist/chunks/form-DUzcwJO9.js +23 -0
  86. package/dist/chunks/form-crnrWPVH.js +3 -0
  87. package/dist/chunks/form-group-Dax3eYD4.js +43 -0
  88. package/dist/chunks/form-group-dIvuqjw2.js +12 -0
  89. package/dist/chunks/{index-BDgfSKzL.js → heading-BbB6mvMG.js} +24 -43
  90. package/dist/chunks/heading-UN9MO1TN.js +5 -0
  91. package/dist/chunks/host-listener-BBI7oAFw.js +37 -0
  92. package/dist/chunks/host-listener-BzjpIsFF.js +1 -0
  93. package/dist/chunks/host-listener-CtA1D-wt.js +1 -0
  94. package/dist/chunks/host-listener-DJEakRMM.js +17 -0
  95. package/dist/chunks/icon-B_S1_kDJ.js +1 -0
  96. package/dist/chunks/icon-CINf5Icb.js +28 -0
  97. package/dist/chunks/icon-button-BtE0-oCE.js +1 -0
  98. package/dist/chunks/icon-button-CACU21y5.js +16 -0
  99. package/dist/chunks/icon-button-D2STrB4d.js +6 -0
  100. package/dist/chunks/icon-button-D569kvcZ.js +84 -0
  101. package/dist/chunks/icon-indicator-BkILzP5o.js +1 -0
  102. package/dist/chunks/icon-indicator-D_IHkSon.js +445 -0
  103. package/dist/chunks/icon-loader-B9uu2SkP.js +7 -0
  104. package/dist/chunks/icon-loader-CZ8MQjNl.js +1 -0
  105. package/dist/chunks/{icon-loader-utils-wU7uJZWU.js → icon-loader-utils-BKulYpY6.js} +35 -42
  106. package/dist/chunks/icon-loader-utils-C-vWa1iy.js +1 -0
  107. package/dist/chunks/if-defined-C4rY5CqG.js +1 -0
  108. package/dist/chunks/if-defined-DvPh-nZx.js +5 -0
  109. package/dist/chunks/if-non-empty-CqihXhSU.js +1 -0
  110. package/dist/chunks/if-non-empty-DIcT03Pc.js +5 -0
  111. package/dist/chunks/inline-loading-BIB-coVZ.js +83 -0
  112. package/dist/chunks/inline-loading-C4MpPNzv.js +12 -0
  113. package/dist/chunks/link-Bz8knkhr.js +1 -0
  114. package/dist/chunks/link-CyrOt3Yx.js +24 -0
  115. package/dist/chunks/link-DlDoN1r0.js +1 -0
  116. package/dist/chunks/link-MrslkhR7.js +106 -0
  117. package/dist/chunks/lit-BNk7ncU9.js +3 -0
  118. package/dist/chunks/lit-uyM4-HrV.js +552 -0
  119. package/dist/chunks/loading-CUUY8ITP.js +68 -0
  120. package/dist/chunks/loading-CX_B-YYv.js +1 -0
  121. package/dist/chunks/loading-SDDHeWof.js +1 -0
  122. package/dist/chunks/loading-icon-BsInpAjb.js +16 -0
  123. package/dist/chunks/loading-icon-iCI-C5ZG.js +24 -0
  124. package/dist/chunks/loading-xKooWNUJ.js +2 -0
  125. package/dist/chunks/menu-D2kFhclQ.js +56 -0
  126. package/dist/chunks/menu-DG7s9yXJ.js +682 -0
  127. package/dist/chunks/modal-C2EEHjQh.js +27 -0
  128. package/dist/chunks/modal-DEGWE2iT.js +414 -0
  129. package/dist/chunks/multi-select-BXST526m.js +63 -0
  130. package/dist/chunks/multi-select-CgDCOBWa.js +384 -0
  131. package/dist/chunks/notification-BEvb6zBP.js +89 -0
  132. package/dist/chunks/notification-DLOgEfr6.js +426 -0
  133. package/dist/chunks/number-input-CRIgLD3k.js +284 -0
  134. package/dist/chunks/number-input-CiXkIGVz.js +76 -0
  135. package/dist/chunks/on-D2_IwJad.js +8 -0
  136. package/dist/chunks/on-_BJL2XbM.js +1 -0
  137. package/dist/chunks/overflow-menu-BSMy7pUY.js +34 -0
  138. package/dist/chunks/overflow-menu-CGghH3Mz.js +387 -0
  139. package/dist/chunks/pagination-4SuGaSx6.js +77 -0
  140. package/dist/chunks/pagination-D7VFRyN2.js +293 -0
  141. package/dist/chunks/password-input-Cx2ItLqG.js +68 -0
  142. package/dist/chunks/password-input-NoZg_DjL.js +210 -0
  143. package/dist/chunks/popover--wvkgqdv.js +1 -0
  144. package/dist/chunks/popover-Ca4f4ZCE.js +6 -0
  145. package/dist/chunks/popover-content-BOaLSQt3.js +15 -0
  146. package/dist/chunks/popover-content-Bi-ydBhZ.js +277 -0
  147. package/dist/chunks/{index-BHJC9GSR.js → progress-bar-BTHREDPK.js} +96 -17
  148. package/dist/chunks/progress-bar-p0YwLsuh.js +22 -0
  149. package/dist/chunks/progress-indicator-BP8k-xTC.js +252 -0
  150. package/dist/chunks/progress-indicator-cr687P29.js +35 -0
  151. package/dist/chunks/radio-button-CNOPBUK8.js +396 -0
  152. package/dist/chunks/radio-button-CU2ngHxo.js +44 -0
  153. package/dist/chunks/radio-group-manager-iPCcbWB8.js +60 -0
  154. package/dist/chunks/radio-group-manager-zfU1GLIW.js +1 -0
  155. package/dist/chunks/register-BXKEXKsC.js +15 -0
  156. package/dist/chunks/register-Bx7SlevL.js +8198 -0
  157. package/dist/chunks/register-CnJjkv07.js +1 -0
  158. package/dist/chunks/register-DqgfpeXv.js +1399 -0
  159. package/dist/chunks/search-BYWQ80wI.js +4 -0
  160. package/dist/chunks/search-BgSG9LA9.js +22 -0
  161. package/dist/chunks/search-CET7sHGW.js +173 -0
  162. package/dist/chunks/search-CUuRRsTX.js +31 -0
  163. package/dist/chunks/select-BifhTIxt.js +37 -0
  164. package/dist/chunks/select-Dh4AFZ2v.js +4 -0
  165. package/dist/chunks/select-item-BvwJ4Wc-.js +77 -0
  166. package/dist/chunks/select-item-DLWdT1CE.js +272 -0
  167. package/dist/chunks/shared-enums-BdDASwq-.js +1 -0
  168. package/dist/chunks/shared-enums-Cd0vBQFM.js +6 -0
  169. package/dist/chunks/{index-BL3nrhct.js → skeleton-placeholder-Czj5sAeI.js} +23 -25
  170. package/dist/chunks/{index-CTt8Y8HC.js → skeleton-placeholder-aS-woCl8.js} +1 -1
  171. package/dist/chunks/skeleton-text-BIHdj7Jx.js +1 -0
  172. package/dist/chunks/skeleton-text-CZ2bSuDE.js +6 -0
  173. package/dist/chunks/skeleton-text-DJrow5mh.js +1 -0
  174. package/dist/chunks/skeleton-text-INjLvc2Y.js +71 -0
  175. package/dist/chunks/slider-CoHP_UJ2.js +878 -0
  176. package/dist/chunks/slider-DhIZP9Ms.js +246 -0
  177. package/dist/chunks/stack-C66k74Zo.js +1 -0
  178. package/dist/chunks/stack-vrK3hQYJ.js +85 -0
  179. package/dist/chunks/structured-list-BWjXHFbX.js +19 -0
  180. package/dist/chunks/{index-CUhfQp9_.js → structured-list-lqhD2RqL.js} +140 -158
  181. package/dist/chunks/tabs-DixpRz83.js +58 -0
  182. package/dist/chunks/tabs-DkIGB3cC.js +316 -0
  183. package/dist/chunks/tag-DpezbQqm.js +93 -0
  184. package/dist/chunks/tag-rQOD2v2s.js +412 -0
  185. package/dist/chunks/text-input-BYjtsh0H.js +26 -0
  186. package/dist/chunks/text-input-C2jRG8Lb.js +72 -0
  187. package/dist/chunks/text-input-DvygxhCJ.js +4 -0
  188. package/dist/chunks/text-input-DzSNpORC.js +309 -0
  189. package/dist/chunks/textarea-BZ34-RaT.js +190 -0
  190. package/dist/chunks/textarea-Be3YTme6.js +57 -0
  191. package/dist/chunks/tile-CQ9nINGM.js +524 -0
  192. package/dist/chunks/tile-DNWy90OU.js +74 -0
  193. package/dist/chunks/time-picker-CJ_ONMZi.js +267 -0
  194. package/dist/chunks/time-picker-DK_Lu3AK.js +52 -0
  195. package/dist/chunks/toggle-BBdusHAx.js +36 -0
  196. package/dist/chunks/toggle-Bfx6cOUM.js +156 -0
  197. package/dist/chunks/toggle-tip-CkH7fFX4.js +46 -0
  198. package/dist/chunks/toggle-tip-DF_GKfoM.js +169 -0
  199. package/dist/chunks/tooltip-COwRDvmc.js +85 -0
  200. package/dist/chunks/tooltip-DbGsUOZ8.js +23 -0
  201. package/dist/chunks/tooltip-content-BDcgoT6r.js +1 -0
  202. package/dist/chunks/tooltip-content-CkxKIMDr.js +116 -0
  203. package/dist/chunks/tree-utils-AeNlEhIR.js +1 -0
  204. package/dist/chunks/tree-utils-D7kpr-Wj.js +266 -0
  205. package/dist/chunks/tree-view-BmoD8n0Y.js +292 -0
  206. package/dist/chunks/tree-view-Drfa7DNm.js +82 -0
  207. package/dist/chunks/unsafe-html-BP-z2WTp.js +26 -0
  208. package/dist/chunks/unsafe-html-Dego4Lbw.js +1 -0
  209. package/dist/chunks/validity-CMW3OiFU.js +31 -0
  210. package/dist/chunks/validity-zT-XWh2t.js +1 -0
  211. package/dist/chunks/zoo-Bb5HHyrn.js +721 -0
  212. package/dist/chunks/zoo-C_CBOaHL.js +52 -0
  213. package/dist/zooy.cjs.js +19 -1
  214. package/dist/zooy.es.js +1309 -20
  215. package/package.json +8 -6
  216. package/dist/chunks/16-30f5E9no.js +0 -1
  217. package/dist/chunks/16-4Ffg4DOO.js +0 -1
  218. package/dist/chunks/16-B56B50XT.js +0 -1
  219. package/dist/chunks/16-BXti8Tu-.js +0 -62
  220. package/dist/chunks/16-BwDdccyH.js +0 -33
  221. package/dist/chunks/16-C7Xs-wKv.js +0 -1
  222. package/dist/chunks/16-CMCRqVYz.js +0 -1
  223. package/dist/chunks/16-CpNRIuiB.js +0 -1
  224. package/dist/chunks/16-Cubm18Em.js +0 -1
  225. package/dist/chunks/16-DH311Of_.js +0 -1
  226. package/dist/chunks/16-Dlq3qxDh.js +0 -1
  227. package/dist/chunks/16-Dt4v0bcc.js +0 -1
  228. package/dist/chunks/16-DylBiJnm.js +0 -1
  229. package/dist/chunks/20-Df0dXwyx.js +0 -1
  230. package/dist/chunks/button-D2VKJsLS.js +0 -66
  231. package/dist/chunks/button-pZ-DRK6v.js +0 -272
  232. package/dist/chunks/button-skeleton-CDETU1qG.js +0 -21
  233. package/dist/chunks/button-skeleton-CtG4NQzT.js +0 -49
  234. package/dist/chunks/carbon-element-CbfPUYRT.js +0 -1
  235. package/dist/chunks/checkbox-CVge6cOk.js +0 -201
  236. package/dist/chunks/checkbox-DUGLQnd6.js +0 -40
  237. package/dist/chunks/class-map-C8RyF4hT.js +0 -5
  238. package/dist/chunks/collection-helpers-Bk68Vaau.js +0 -7
  239. package/dist/chunks/collection-helpers-afBvMQaC.js +0 -1
  240. package/dist/chunks/content-switcher-item-CA0doXHf.js +0 -351
  241. package/dist/chunks/content-switcher-item-DgEJ6RFq.js +0 -27
  242. package/dist/chunks/defs-C88lSWuJ.js +0 -1
  243. package/dist/chunks/defs-Do0OvCKd.js +0 -1165
  244. package/dist/chunks/directive-Dp4ZTz-F.js +0 -5
  245. package/dist/chunks/directive-kLG6oqUu.js +0 -27
  246. package/dist/chunks/dropdown-item-C6ff_rA-.js +0 -632
  247. package/dist/chunks/dropdown-item-DTnshNe4.js +0 -69
  248. package/dist/chunks/focus-B3iymVyL.js +0 -1
  249. package/dist/chunks/focus-WnKGH_xB.js +0 -20
  250. package/dist/chunks/form-D6Tce4-W.js +0 -1
  251. package/dist/chunks/host-listener-CN245INl.js +0 -37
  252. package/dist/chunks/host-listener-DD3oGxvg.js +0 -16
  253. package/dist/chunks/host-listener-gxrTpxgv.js +0 -1
  254. package/dist/chunks/host-listener-rUcT_LUW.js +0 -1
  255. package/dist/chunks/icon-loader-DdCPeV1F.js +0 -7
  256. package/dist/chunks/icon-loader-bqbv6v-z.js +0 -1
  257. package/dist/chunks/icon-loader-utils-BWrg3bpN.js +0 -5
  258. package/dist/chunks/if-defined-JokaXq_5.js +0 -5
  259. package/dist/chunks/if-defined-LYYEqErp.js +0 -10
  260. package/dist/chunks/if-non-empty-B3vx66n4.js +0 -5
  261. package/dist/chunks/if-non-empty-UE5WDWwQ.js +0 -1
  262. package/dist/chunks/index-0kDKmcUn.js +0 -77
  263. package/dist/chunks/index-2-nMkC0u.js +0 -8
  264. package/dist/chunks/index-3GQJ_7On.js +0 -243
  265. package/dist/chunks/index-7nNy5WEl.js +0 -15
  266. package/dist/chunks/index-9LzZzz4u.js +0 -19
  267. package/dist/chunks/index-B0ZKf4SU.js +0 -52
  268. package/dist/chunks/index-B3rHrWp1.js +0 -285
  269. package/dist/chunks/index-B76lqoqT.js +0 -22
  270. package/dist/chunks/index-BC4YWTSF.js +0 -368
  271. package/dist/chunks/index-BCzt9Ccn.js +0 -45
  272. package/dist/chunks/index-BGMe0w5_.js +0 -25
  273. package/dist/chunks/index-BL8bOR9n.js +0 -12
  274. package/dist/chunks/index-BNX9EJIE.js +0 -75
  275. package/dist/chunks/index-BRODR18b.js +0 -429
  276. package/dist/chunks/index-BRT0gqo3.js +0 -188
  277. package/dist/chunks/index-BWsnXW01.js +0 -81
  278. package/dist/chunks/index-BYHPRyAK.js +0 -17
  279. package/dist/chunks/index-BYeH-Lx8.js +0 -22
  280. package/dist/chunks/index-Bgmh4Nfq.js +0 -65
  281. package/dist/chunks/index-BiW01Ou8.js +0 -3
  282. package/dist/chunks/index-BjPqbngg.js +0 -161
  283. package/dist/chunks/index-BoCQVLwG.js +0 -79
  284. package/dist/chunks/index-BrjlYyR4.js +0 -78
  285. package/dist/chunks/index-Bumb78BV.js +0 -27
  286. package/dist/chunks/index-C21uRpcN.js +0 -49
  287. package/dist/chunks/index-C2valRve.js +0 -881
  288. package/dist/chunks/index-C3wd1Ce9.js +0 -37
  289. package/dist/chunks/index-C50tGv-j.js +0 -26
  290. package/dist/chunks/index-C5GJatuZ.js +0 -452
  291. package/dist/chunks/index-C5TJ62J9.js +0 -284
  292. package/dist/chunks/index-C5dTaeYU.js +0 -89
  293. package/dist/chunks/index-CH2IVG4V.js +0 -1
  294. package/dist/chunks/index-CIWTMX9s.js +0 -35
  295. package/dist/chunks/index-CIbCDWFV.js +0 -25
  296. package/dist/chunks/index-CPxaESxc.js +0 -424
  297. package/dist/chunks/index-CR49u8S9.js +0 -23
  298. package/dist/chunks/index-CTQAWlOg.js +0 -511
  299. package/dist/chunks/index-CaLO9pKf.js +0 -150
  300. package/dist/chunks/index-CiXoGI6W.js +0 -2340
  301. package/dist/chunks/index-CjEivsuj.js +0 -160
  302. package/dist/chunks/index-Cke1JFeD.js +0 -25
  303. package/dist/chunks/index-Cm-qH0_A.js +0 -1
  304. package/dist/chunks/index-CmqyRYtd.js +0 -1
  305. package/dist/chunks/index-CmxDyzAj.js +0 -62
  306. package/dist/chunks/index-CnQZDqa3.js +0 -21
  307. package/dist/chunks/index-Cpo2cg14.js +0 -12
  308. package/dist/chunks/index-CqV7rF6Y.js +0 -2
  309. package/dist/chunks/index-CsJ-eqZ9.js +0 -58
  310. package/dist/chunks/index-CvZ0FZoz.js +0 -1604
  311. package/dist/chunks/index-CyFniodw.js +0 -57
  312. package/dist/chunks/index-Cz0qsW9k.js +0 -455
  313. package/dist/chunks/index-D3bm4dv9.js +0 -121
  314. package/dist/chunks/index-D46OGW4a.js +0 -563
  315. package/dist/chunks/index-D5TR0TpO.js +0 -97
  316. package/dist/chunks/index-D5reIinO.js +0 -224
  317. package/dist/chunks/index-D79_j0Y6.js +0 -71
  318. package/dist/chunks/index-DDpWWnYg.js +0 -108
  319. package/dist/chunks/index-DFku2wwc.js +0 -103
  320. package/dist/chunks/index-DIXYEqKa.js +0 -111
  321. package/dist/chunks/index-DJ58_keq.js +0 -458
  322. package/dist/chunks/index-DKKcCZD0.js +0 -259
  323. package/dist/chunks/index-DLd78Rbz.js +0 -260
  324. package/dist/chunks/index-DRBWg6SP.js +0 -337
  325. package/dist/chunks/index-DUN06aMm.js +0 -4
  326. package/dist/chunks/index-DVIeirxu.js +0 -4
  327. package/dist/chunks/index-DVJk-q4a.js +0 -235
  328. package/dist/chunks/index-DYPDRQjH.js +0 -36
  329. package/dist/chunks/index-DYSNxsmk.js +0 -1
  330. package/dist/chunks/index-Dc46GN9v.js +0 -19
  331. package/dist/chunks/index-DiMhcmKq.js +0 -87
  332. package/dist/chunks/index-DlaJ2UYi.js +0 -46
  333. package/dist/chunks/index-DmgEkYDC.js +0 -4
  334. package/dist/chunks/index-DnIZrTPt.js +0 -1
  335. package/dist/chunks/index-Dnrd-ghp.js +0 -74
  336. package/dist/chunks/index-DoT9doqj.js +0 -9
  337. package/dist/chunks/index-DoiyAuJa.js +0 -1
  338. package/dist/chunks/index-DpqoWgT9.js +0 -150
  339. package/dist/chunks/index-DraQgvgl.js +0 -57
  340. package/dist/chunks/index-DsCjIWpO.js +0 -364
  341. package/dist/chunks/index-DsShxfRw.js +0 -45
  342. package/dist/chunks/index-DscKTLkM.js +0 -1
  343. package/dist/chunks/index-DvpeF28r.js +0 -44
  344. package/dist/chunks/index-Fd-LYjkR.js +0 -1
  345. package/dist/chunks/index-MzshInpG.js +0 -39
  346. package/dist/chunks/index-OboyKoLD.js +0 -381
  347. package/dist/chunks/index-QtI2aP7P.js +0 -88
  348. package/dist/chunks/index-SS-8a0z5.js +0 -76
  349. package/dist/chunks/index-Sc6xBZpS.js +0 -15
  350. package/dist/chunks/index-UfmYZ2gl.js +0 -25
  351. package/dist/chunks/index-XCgnYslF.js +0 -36
  352. package/dist/chunks/index-_8VNB8cM.js +0 -776
  353. package/dist/chunks/index-boHTic51.js +0 -406
  354. package/dist/chunks/index-cfYcnLla.js +0 -683
  355. package/dist/chunks/index-cxbnAO6M.js +0 -129
  356. package/dist/chunks/index-frG4A1ZV.js +0 -158
  357. package/dist/chunks/index-gXB8HHp-.js +0 -79
  358. package/dist/chunks/index-skQF78KL.js +0 -188
  359. package/dist/chunks/index-wCs-JduP.js +0 -295
  360. package/dist/chunks/index-yQy9Zqt6.js +0 -15
  361. package/dist/chunks/loading-icon-aUR93XFj.js +0 -16
  362. package/dist/chunks/loading-icon-kRHi53Yj.js +0 -24
  363. package/dist/chunks/main-C7DwFPRv.js +0 -4255
  364. package/dist/chunks/main-CBogFjAz.js +0 -87
  365. package/dist/chunks/on-BPhwbVf3.js +0 -10
  366. package/dist/chunks/on-XRofyGQh.js +0 -1
  367. package/dist/chunks/property-CsJ7ixLW.js +0 -5
  368. package/dist/chunks/property-DlFpsdD_.js +0 -36
  369. package/dist/chunks/query-CbRg6ZGy.js +0 -23
  370. package/dist/chunks/query-Dh8joWcT.js +0 -9
  371. package/dist/chunks/radio-group-manager-DBAEmhDM.js +0 -1
  372. package/dist/chunks/radio-group-manager-Du5wSOS1.js +0 -102
  373. package/dist/chunks/register-AR8jupzJ.js +0 -1
  374. package/dist/chunks/register-CWsYpCXE.js +0 -2157
  375. package/dist/chunks/register-CpwdnySd.js +0 -1678
  376. package/dist/chunks/register-D3mJ58Cv.js +0 -11035
  377. package/dist/chunks/search-Cftx2dVp.js +0 -241
  378. package/dist/chunks/search-CuOnNcnw.js +0 -31
  379. package/dist/chunks/select-item-BPKT7Wm1.js +0 -80
  380. package/dist/chunks/select-item-DENN36wG.js +0 -364
  381. package/dist/chunks/shared-enums-BJDDuJr7.js +0 -1
  382. package/dist/chunks/shared-enums-DALKjQ7e.js +0 -7
  383. package/dist/chunks/state-BUoEDghj.js +0 -12
  384. package/dist/chunks/state-C8_dQr4b.js +0 -5
  385. package/dist/chunks/text-input-CQrOXfMO.js +0 -372
  386. package/dist/chunks/text-input-CnlqMvsE.js +0 -68
  387. package/dist/chunks/tooltip-content-CKqz0OvQ.js +0 -3
  388. package/dist/chunks/tooltip-content-CLu411r7.js +0 -135
  389. package/dist/chunks/tslib.es6-B07k2eac.js +0 -1
  390. package/dist/chunks/tslib.es6-C5gLNDSD.js +0 -160
  391. package/dist/chunks/unsafe-html-BiLL5zaQ.js +0 -27
  392. package/dist/chunks/unsafe-html-CPchn7UI.js +0 -5
  393. package/dist/chunks/validity-BMLNCMmP.js +0 -1
  394. package/dist/chunks/validity-CTz7ivUd.js +0 -59
@@ -1,4255 +0,0 @@
1
- const numericString = "0123456789".split("");
2
- [...numericString];
3
- const alphaLower = "abcdefghijklmnopqrstuvwxyz".split(""), alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
4
- [...alphaLower, ...alphaUpper, ...numericString];
5
- (/* @__PURE__ */ new Map()).set("true", !0).set("false", !1);
6
- const compose = (...U) => (...w) => U.reduce((D, O) => (F) => D(O(F)))(...w), identity = (U) => U, whatType = (U) => typeof U, isDef = (U) => U !== void 0, isUndefined = (U) => U === void 0, isDefAndNotNull = (U) => U != null, isString = (U) => whatType(U) === "string", isNumber = (U) => whatType(U) === "number" && !Number.isNaN(
7
- /** @type number */
8
- U
9
- ), isObject = (U) => (U && typeof U == "object" && !(U instanceof Array) && !(U instanceof Set) && !(U instanceof Map) && !(U instanceof Date)) === !0, isArray = (U) => U instanceof Array, reverse = (U) => Array.from(U).reduce((w, D) => [D, ...w], []), toLowerCase = (U) => U.toLowerCase(), toString$1 = (U) => U + "", toNumber = (U) => +U;
10
- compose(toLowerCase, toString$1);
11
- const makeRandomString = () => {
12
- let U = 2147483648;
13
- return Math.floor(Math.random() * U).toString(36) + Math.abs(Math.floor(Math.random() * U) ^ Date.now()).toString(36);
14
- }, stripLeadingChar = (U) => (w) => w.startsWith(U) ? w.slice(U.length) : w, join = (U) => (w) => w.join(U);
15
- compose(join(""), reverse);
16
- const pathOr = (U, w) => (D) => {
17
- const O = w.reduce((F, q) => {
18
- try {
19
- return F[maybeNumber(q)];
20
- } catch {
21
- return;
22
- }
23
- }, D);
24
- return O === void 0 ? U : O;
25
- }, objToPaths = (U, w = [], D = []) => (Object.entries(U).forEach(([O, F]) => {
26
- isObject(F) ? objToPaths(F, [...w, O], D) : D.push([[...w, O], F]);
27
- }), D), randomId = (U) => {
28
- const w = makeRandomString();
29
- return U ? w.substr(0, U) : w;
30
- }, maybeNumber = (U) => {
31
- if (U === null || whatType(U) === "string" && U.length > 1 && U.startsWith("0") && !U.startsWith("0."))
32
- return U;
33
- const w = 1 * U;
34
- return w > Number.MAX_SAFE_INTEGER || Number.isNaN(w) ? U : w;
35
- };
36
- compose(toNumber, join(""), reverse, toString$1);
37
- class Evt extends EventTarget {
38
- /**
39
- * Set this to true to get some debug in the console.
40
- * @type {boolean}
41
- * @private
42
- */
43
- #t = !1;
44
- /**
45
- * True if this is disposed.
46
- * @type {boolean}
47
- * @private
48
- */
49
- #e = !1;
50
- /**
51
- * A map of listener targets to an object of zoo-event functions
52
- * When adding a listener, immediately also create the un-listen functions
53
- * and store those in an object keyed with the event.
54
- * Store these objects against the target in a map
55
- * @type {Map<!EventTarget, !Object<string, !Function>>}
56
- * @private
57
- */
58
- #s = /* @__PURE__ */ new Map();
59
- /**
60
- * A set of components that are currently listening to this component
61
- * @type {!Set<!EventTarget>}
62
- * @private
63
- */
64
- #r = /* @__PURE__ */ new Set();
65
- /**
66
- * A set of interval timers as defined by setInterval.
67
- * Use this to store the timers created particular to this component.
68
- * On destruction, these timers will be cleared.
69
- * @type {Set<any>}
70
- * @private
71
- */
72
- #n = /* @__PURE__ */ new Set();
73
- //--[ Static ]--
74
- /**
75
- * Creates a CustomEvent with the given type and data payload.
76
- * @param {string} event The event type
77
- * @param {*} data The data to attach to the event's detail property
78
- * @return {!CustomEvent} A new CustomEvent instance
79
- */
80
- static makeEvent(w, D) {
81
- return new CustomEvent(w, { detail: D });
82
- }
83
- /**
84
- * Sets debug mode for this component. When enabled, debug messages
85
- * will be logged to the console.
86
- * @param {boolean} bool True to enable debug mode, false to disable
87
- * @throws {Error} If the value is not a boolean
88
- */
89
- set debugMode(w) {
90
- if (typeof w != "boolean")
91
- throw new Error("This must be a boolean");
92
- this.#t = w;
93
- }
94
- get debugMode() {
95
- return this.#t;
96
- }
97
- /**
98
- * Returns whether this component has been disposed.
99
- * @return {boolean} True if disposed, false otherwise
100
- */
101
- get disposed() {
102
- return this.#e;
103
- }
104
- /**
105
- * Returns the map of targets this component is listening to.
106
- * @return {!Map<!EventTarget, !Object<string, !Function>>} Map of targets to their event handlers
107
- */
108
- get listeningTo() {
109
- return this.#s;
110
- }
111
- get isObservedBy() {
112
- return this.#r;
113
- }
114
- get activeIntervals() {
115
- return this.#n;
116
- }
117
- /**
118
- * Logs debug messages to the console if debug mode is enabled.
119
- * Automatically prepends the constructor name to the output.
120
- * @param {...*} s Arguments to log
121
- */
122
- debugMe(...w) {
123
- this.#t && console.log.apply(null, [this.constructor.name, "DEBUG:", ...w]);
124
- }
125
- //--[ Listeners and Listening ]--
126
- /**
127
- * @param {!EventTarget|!Evt} comp
128
- */
129
- isListenedToBy(w) {
130
- this.#r.add(w);
131
- }
132
- /**
133
- * WARNING! DO not use options={passive: true} here. It disallows us to
134
- * use preventDefault when we intercept the form, and that leads to a
135
- * general inability to POST forms.
136
- *
137
- * @param {!EventTarget|!Evt|!Node} target
138
- * @param {string} event
139
- * @param {!Function} action
140
- * @param {boolean|!Object} options
141
- */
142
- listen(w, D, O, F = !1) {
143
- w.addEventListener(D, O, F);
144
- const q = this.listeningTo.get(w) || {};
145
- q[D] = () => w.removeEventListener(D, O, F), this.listeningTo.set(w, q), isDef(w.isListenedToBy) && w.isListenedToBy(this);
146
- }
147
- /**
148
- * Remove self from all components tt are listening to me.
149
- */
150
- stopBeingListenedTo() {
151
- for (const w of this.isObservedBy)
152
- w.stopListeningTo(this), this.isObservedBy.delete(w);
153
- }
154
- /**
155
- * Stop listening to all events on target.
156
- * @param {!EventTarget|!Evt|!Node|undefined} target
157
- * @param {string=} opt_event
158
- */
159
- stopListeningTo(w, D) {
160
- w && this.listeningTo.has(w) && (isDef(w.isObservedBy) && w.isObservedBy.delete(this), isDef(D) ? (Object.entries(this.listeningTo.get(w)).forEach(([O, F]) => {
161
- O === D && F();
162
- }), Object.keys(this.listeningTo.get(w)).length || this.listeningTo.delete(w)) : (Object.values(this.listeningTo.get(w)).forEach((O) => O()), this.listeningTo.delete(w)));
163
- }
164
- /**
165
- * Removes all the event listeners that is managed by this
166
- * component.
167
- */
168
- removeAllListener() {
169
- for (const w of this.listeningTo.keys())
170
- this.stopListeningTo(w);
171
- }
172
- /**
173
- * Clears all active intervals created by this component.
174
- * Called automatically during disposal to prevent memory leaks.
175
- */
176
- clearAllIntervals() {
177
- for (const w of this.activeIntervals)
178
- clearInterval(w), this.activeIntervals.delete(w);
179
- }
180
- /**
181
- * Executes a function repeatedly at a specified interval.
182
- * The interval is tracked and will be automatically cleared on disposal.
183
- * @param {!Function} f The function to execute on each interval
184
- * @param {number} interval The interval in milliseconds
185
- */
186
- doOnBeat(w, D) {
187
- const O = setInterval(w, D);
188
- this.activeIntervals.add(O);
189
- }
190
- /**
191
- * Disposes of the component. Calls `exitDocument`, which is expected to
192
- * remove event handlers and clean up the component. Propagates the call to
193
- * the component's children, if any. Removes the component's DOM from the
194
- * document unless it was decorated.
195
- * @protected
196
- */
197
- disposeInternal() {
198
- this.stopBeingListenedTo(), this.removeAllListener(), this.clearAllIntervals(), this.#e = !0;
199
- }
200
- /**
201
- * Public method to dispose of this component. Calls disposeInternal()
202
- * to perform cleanup of event listeners, intervals, and observers.
203
- * After calling this method, the component should not be used.
204
- */
205
- dispose() {
206
- this.disposeInternal();
207
- }
208
- }
209
- class ZooyEventData {
210
- constructor(w, D) {
211
- this.value_ = w, this.data_ = D || {};
212
- }
213
- getValue() {
214
- return this.value_;
215
- }
216
- getData() {
217
- return this.data_;
218
- }
219
- }
220
- const UiEventType = {
221
- /**
222
- * Dispatched after the content from the template is in the DOM
223
- * and the in-line scripts from the AJAX call has been eval'd.
224
- */
225
- COMP: randomId(),
226
- COMP_DRAG_START: randomId(),
227
- COMP_DRAG_MOVE: randomId(),
228
- COMP_DRAG_END: randomId(),
229
- PANEL: randomId(),
230
- VIEW: randomId(),
231
- SPLIT: randomId(),
232
- SPLIT_WILL_OPEN: randomId(),
233
- SPLIT_DID_OPEN: randomId(),
234
- SPLIT_WILL_CLOSE: randomId(),
235
- SPLIT_DID_CLOSE: randomId(),
236
- SPLIT_TRANSITION_END: randomId(),
237
- READY: randomId(),
238
- PANEL_MINIMIZE: randomId(),
239
- FORM_SUBMIT_SUCCESS: randomId()
240
- }, format = (U) => {
241
- const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
242
- { name: "year", seconds: 31536e3 },
243
- { name: "month", seconds: 2592e3 },
244
- { name: "week", seconds: 604800 },
245
- { name: "day", seconds: 86400 },
246
- { name: "hour", seconds: 3600 },
247
- { name: "minute", seconds: 60 },
248
- { name: "second", seconds: 1 }
249
- ];
250
- if (D < 0) {
251
- const F = Math.abs(D);
252
- for (const q of O) {
253
- const W = Math.floor(F / q.seconds);
254
- if (W >= 1)
255
- return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
256
- }
257
- return "just now";
258
- }
259
- for (const F of O) {
260
- const q = Math.floor(D / F.seconds);
261
- if (q >= 1)
262
- return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
263
- }
264
- return "just now";
265
- }, getInputChecked_ = function(U) {
266
- return U.checked ? (
267
- /** @type {?} */
268
- U.value
269
- ) : null;
270
- }, getSelectSingle_ = function(U) {
271
- const w = (
272
- /** @type {!HTMLSelectElement} */
273
- U.selectedIndex
274
- );
275
- return w >= 0 ? (
276
- /** @type {!HTMLSelectElement} */
277
- U.options[w].value
278
- ) : null;
279
- }, getSelectMultiple_ = function(U) {
280
- const w = [];
281
- for (let D, O = 0; D = /** @type {!HTMLSelectElement} */
282
- U.options[O]; O++)
283
- D.selected && w.push(D.value);
284
- return w.length ? w : null;
285
- }, getValue = function(U) {
286
- const w = (
287
- /** @type {!HTMLInputElement} */
288
- U.type
289
- );
290
- switch (isString(w) && w.toLowerCase()) {
291
- case "checkbox":
292
- case "radio":
293
- return getInputChecked_(U);
294
- case "select-one":
295
- return getSelectSingle_(U);
296
- case "select-multiple":
297
- return getSelectMultiple_(U);
298
- default:
299
- return U.value !== null && U.value !== void 0 ? U.value : null;
300
- }
301
- }, formToJSON = (U) => [...U].reduce((w, D) => (w[D.name] = D.value, w), {}), replaceNode = (U, w) => {
302
- const D = w.parentNode;
303
- D && D.replaceChild(U, w);
304
- }, removeNode = (U) => U && U.parentNode ? U.parentNode.removeChild(U) : null, insertSiblingAfter = (U, w) => {
305
- w.parentNode && w.parentNode.insertBefore(U, w.nextSibling);
306
- }, isInPage = (U) => U === document.body ? !1 : document.body.contains(U), getPos = (U) => [U.offsetLeft, U.offsetTop], randomColour = (U) => [1, 2, 3].map(() => Math.floor(Math.random() * 256) + 1).reduce((w, D) => `${w}${D},`, "rgba(") + `${U || 0.5}`, totalWidth = (U) => {
307
- const w = window.getComputedStyle(U), D = U.offsetWidth, O = parseFloat(w.marginLeft) + parseFloat(w.marginRight), F = parseFloat(w.paddingLeft) + parseFloat(w.paddingRight), q = parseFloat(w.borderLeftWidth) + parseFloat(w.borderRightWidth);
308
- return D + O - F + q;
309
- }, totalHeight = (U) => {
310
- const w = window.getComputedStyle(U), D = U.offsetHeight, O = parseFloat(w.marginTop) + parseFloat(w.marginBottom), F = parseFloat(w.paddingTop) + parseFloat(w.paddingBottom), q = parseFloat(w.borderTopWidth) + parseFloat(w.borderBottomWidth);
311
- return D + O - F + q;
312
- }, evalScripts = (comp) => (arr) => {
313
- arr && Array.from(arr).forEach((s) => {
314
- (function() {
315
- eval(s.text);
316
- }).bind(comp)();
317
- });
318
- }, evalModules = (U) => (w) => {
319
- w && Array.from(w).forEach((D) => {
320
- (function() {
321
- const O = document.createElement("script");
322
- O.type = "module", O.textContent = D.textContent;
323
- const F = U.getElement(), q = getElDataMap(D).zv_comp_access;
324
- q && (F.zvComponent = U, F.classList.add(q)), F.appendChild(O);
325
- }).bind(U)();
326
- });
327
- }, splitScripts = (U) => {
328
- const D = new DOMParser().parseFromString(U, "text/html");
329
- return {
330
- html: D.body.firstElementChild,
331
- scripts: D.querySelectorAll('script:not([type="module"])'),
332
- modules: D.querySelectorAll('script[type="module"]')
333
- };
334
- }, handleTemplateProm = (U) => Promise.resolve(splitScripts(U)), enableClass = (U, w, D) => {
335
- D ? U.classList.add(w) : U.classList.remove(w);
336
- }, toggleClass = (U, w) => {
337
- const D = !Array.from(U.classList).includes(w);
338
- return enableClass(U, w, D), D;
339
- }, getElDataMap = (U) => U ? Object.assign({}, U.dataset || {}) : {}, dtFormatter = {
340
- year: "numeric",
341
- month: "short",
342
- day: "numeric",
343
- hour: "2-digit",
344
- minute: "2-digit",
345
- second: "2-digit"
346
- }, dFormatter = {
347
- year: "numeric",
348
- month: "short",
349
- day: "numeric"
350
- }, dtf = new Intl.DateTimeFormat("en", {
351
- day: "2-digit",
352
- month: "short",
353
- year: "2-digit",
354
- hour: "2-digit",
355
- minute: "2-digit",
356
- second: "2-digit",
357
- // hour12: false
358
- hourCycle: "h23"
359
- }), dateToZooyStdTimeString = (U) => {
360
- const [{ value: w }, , { value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, ,] = dtf.formatToParts(U);
361
- return `${D} ${w} ${O} ${F}:${q}:${W}`;
362
- }, parseMomentAgo = (U, w = "both", D = void 0) => {
363
- let O = U;
364
- isNumber(O) && O < 9466848e5 ? O = O * 1e3 : D && (O = O + D);
365
- const F = new Date(O), q = format(F), W = dateToZooyStdTimeString(F);
366
- switch (w) {
367
- case "time|ago":
368
- return `${W}|${q}`;
369
- case "ago":
370
- return `${q}`;
371
- case "datetime":
372
- case "time":
373
- return `${W}`;
374
- case "both":
375
- case "ago (time)":
376
- default:
377
- return `${q} (${W})`;
378
- }
379
- }, parseObfuscated = (U) => {
380
- const D = ((F) => (q) => q < F.length - 4)(U);
381
- return ((F) => F.split("").map((q, W) => D(W) ? "*" : q).join(""))(U);
382
- }, parseMap = (/* @__PURE__ */ new Map()).set(void 0, (U, w, D) => identity(U)).set("", (U, w, D) => identity(U)).set("class_update_only", (U, w, D) => identity(U)).set("frac_100", (U, w, D) => Math.round(U * 100 * 100) / 100).set("date_and_time", (U, w, D) => new Date(U).toLocaleString(void 0, dtFormatter)).set("date", (U, w, D) => new Date(U).toLocaleString(void 0, dFormatter)).set("moment_ago", (U, w, D) => parseMomentAgo(U, "both", D.zdd_date_tz || void 0)).set("moment_ago_only", (U, w, D) => parseMomentAgo(U, "ago", D.zdd_date_tz || void 0)).set("moment_ago_datetime", (U, w, D) => parseMomentAgo(U, "datetime", D.zdd_date_tz || void 0)).set("pretty-json", (U, w, D) => JSON.stringify(U, null, 4)).set("obfuscated", (U, w, D) => parseObfuscated(U)).set("linear-progress", (U, w, D) => {
383
- const O = toNumber(D.zpmax), F = w.linProg;
384
- return O && F && (F.progress = U / O, U = void 0), U;
385
- }), parseDataPropKvDef = (U) => U.trim().split(",").map((O) => O.trim()).map((O) => {
386
- const [F, q] = O.split(":").map((W) => W.trim());
387
- return [F, q];
388
- }).filter(([O, F]) => O !== "" && F !== ""), parseDataProps = (U, w) => {
389
- const D = getElDataMap(U);
390
- delete U.dataset.zoodatapropkv;
391
- const O = D.zoodatapropkv || "";
392
- return parseDataPropKvDef(O).forEach(([q, W]) => {
393
- U.dataset[q] = pathOr(void 0, W.split("."))(w);
394
- }), U;
395
- }, mapDataToEls = (U, w, D = /* @__PURE__ */ new Map(), O = void 0) => {
396
- if (!w)
397
- return;
398
- const F = new Map([...parseMap, ...D]);
399
- [...U.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach((q) => {
400
- const W = getElDataMap(q), Y = W.zdd || "", G = W.zdd_parse_as, K = W.zdd_render_effect || "", Q = W.zdd_class_update, tt = W.zdd_template_loop_index, J = W.zdd_units || "";
401
- let X = pathOr(void 0, Y.split("."))(w);
402
- if (isDefAndNotNull(X) && (X = F.has(G) ? F.get(G)(X, q, W) : X), tt && isNumber(O) && (console.log("loopIndex: ", tt, " opt_loopIndex: ", O), tt === "zero_indexed" ? q.innerHTML = O : tt === "one_indexed" ? q.innerHTML = O + 1 : q.innerHTML = O), Q) {
403
- const [Z, et, st] = Q.split(":"), rt = pathOr(void 0, Z.split("."))(w);
404
- if (isDefAndNotNull(rt))
405
- switch (et) {
406
- case "swap": {
407
- const nt = /\{}/gi, ot = st.replace(nt, ""), ct = st.replace(nt, rt);
408
- q.classList.remove(...[...q.classList].filter((ht) => ht.includes(ot))), q.classList.add(ct);
409
- break;
410
- }
411
- case "remove_on_data":
412
- q.classList.remove(st);
413
- break;
414
- case "choice_map":
415
- st.split("|").filter((nt) => nt !== "").forEach((nt) => {
416
- const [ot, ct] = nt.split(">");
417
- ot === rt + "" ? q.classList.add.apply(q.classList, ct.split(".")) : q.classList.remove.apply(q.classList, ct.split("."));
418
- });
419
- break;
420
- }
421
- }
422
- if (G === "templated-array" && isArray(X))
423
- if (X.length === 0)
424
- q.classList.add("display__none");
425
- else {
426
- q.classList.remove("display__none"), X = X || [];
427
- const Z = q.firstElementChild;
428
- Z.classList.remove("display__none"), q.replaceChildren(...X.map((et, st) => {
429
- const rt = Z.cloneNode(!0), nt = parseDataProps(rt, et);
430
- return mapDataToEls(nt, et, void 0, st), nt;
431
- }));
432
- }
433
- else if (isDefAndNotNull(X))
434
- if (K === "typewriter") {
435
- let Z = 0;
436
- const et = X + J, st = 5, rt = () => {
437
- Z < et.length && (q.innerHTML += et.charAt(Z), Z++, setTimeout(rt, st));
438
- };
439
- q.innerHTML = "", rt();
440
- } else
441
- q.innerHTML = X + J;
442
- });
443
- }, domUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
444
- __proto__: null,
445
- dateToZooyStdTimeString,
446
- dtf,
447
- enableClass,
448
- evalModules,
449
- evalScripts,
450
- formToJSON,
451
- getElDataMap,
452
- getPos,
453
- getValue,
454
- handleTemplateProm,
455
- insertSiblingAfter,
456
- isInPage,
457
- mapDataToEls,
458
- parseDataPropKvDef,
459
- parseMap,
460
- parseMomentAgo,
461
- randomColour,
462
- removeNode,
463
- replaceNode,
464
- splitScripts,
465
- toggleClass,
466
- totalHeight,
467
- totalWidth
468
- }, Symbol.toStringTag, { value: "Module" }));
469
- class ComponentLibraryRegistry {
470
- /**
471
- * Internal storage for registered component libraries.
472
- * @type {Map<string, {render: Function, cache: Map, config: Object}>}
473
- * @private
474
- */
475
- static #t = /* @__PURE__ */ new Map();
476
- /**
477
- * Registers a pluggable component library.
478
- *
479
- * @param {string} name - Library identifier (e.g., 'carbon', 'material')
480
- * @param {Object} library - Library configuration object
481
- * @param {Function} library.render - Main render function: async function(panel, cache)
482
- * @param {Function} [library.dispose] - Optional cleanup function: function(element)
483
- * @param {Object} [library.config] - Optional library-specific configuration
484
- *
485
- * @throws {Error} If library doesn't provide a render function
486
- *
487
- * @example
488
- * ComponentLibraryRegistry.register('carbon', {
489
- * render: async function(panel, cache) {
490
- * // Scan, load, and attach components
491
- * },
492
- * dispose: function(element) {
493
- * // Optional cleanup logic
494
- * },
495
- * config: { version: '2.0' }
496
- * });
497
- */
498
- static register(w, D) {
499
- if (!D.render)
500
- throw new Error(`Component library '${w}' must provide a render function`);
501
- this.#t.set(w, {
502
- ...D,
503
- // Preserve all library properties (utils, helpers, etc.)
504
- dispose: D.dispose || null,
505
- // Optional disposal function
506
- cache: /* @__PURE__ */ new Map(),
507
- // Each library gets its own import cache
508
- config: D.config || {}
509
- }), console.debug(`[ComponentLibraryRegistry] Registered: ${w}`);
510
- }
511
- /**
512
- * Gets a registered component library by name.
513
- *
514
- * @param {string} name - Library identifier
515
- * @returns {Object} Library object with render, cache, config
516
- * @throws {Error} If library is not registered
517
- */
518
- static get(w) {
519
- if (!this.#t.has(w)) {
520
- const D = Array.from(this.#t.keys()).join(", ");
521
- throw new Error(
522
- `Component library '${w}' is not registered. Available: ${D || "none"}`
523
- );
524
- }
525
- return this.#t.get(w);
526
- }
527
- /**
528
- * Checks if a component library is registered.
529
- *
530
- * @param {string} name - Library identifier
531
- * @returns {boolean} True if registered
532
- */
533
- static has(w) {
534
- return this.#t.has(w);
535
- }
536
- /**
537
- * Gets all registered library names.
538
- *
539
- * @returns {string[]} Array of registered library names
540
- */
541
- static getRegisteredLibraries() {
542
- return Array.from(this.#t.keys());
543
- }
544
- /**
545
- * Gets cache statistics for all registered component libraries.
546
- * Useful for debugging and monitoring.
547
- *
548
- * @returns {Object} Map of library name → cache stats
549
- */
550
- static getCacheStats() {
551
- const w = {};
552
- for (const [D, O] of this.#t.entries())
553
- w[D] = {
554
- cacheSize: O.cache.size,
555
- config: O.config
556
- };
557
- return w;
558
- }
559
- /**
560
- * Clears import caches for all component libraries.
561
- * Useful for development/hot-reload scenarios.
562
- */
563
- static clearAllCaches() {
564
- for (const [w, D] of this.#t.entries())
565
- D.cache.clear(), console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`);
566
- }
567
- /**
568
- * Clears cache for a specific library.
569
- *
570
- * @param {string} name - Library identifier
571
- * @throws {Error} If library is not registered
572
- */
573
- static clearCache(w) {
574
- this.get(w).cache.clear(), console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`);
575
- }
576
- /**
577
- * Unregisters a component library (primarily for testing).
578
- *
579
- * @param {string} name - Library identifier
580
- * @returns {boolean} True if library was unregistered, false if not found
581
- */
582
- static unregister(w) {
583
- return this.#t.delete(w);
584
- }
585
- /**
586
- * Unregisters all component libraries (primarily for testing).
587
- */
588
- static unregisterAll() {
589
- this.#t.clear();
590
- }
591
- }
592
- const ComponentError = {
593
- /**
594
- * Error when a method is not supported.
595
- */
596
- NOT_SUPPORTED: "Method not supported",
597
- /**
598
- * Error when the given element can not be decorated.
599
- */
600
- DECORATE_INVALID: "Invalid element to decorate",
601
- /**
602
- * Error when the component is already rendered and another render attempt is
603
- * made.
604
- */
605
- ALREADY_RENDERED: "Component already rendered",
606
- /**
607
- * Error when an already disposed component is attempted to be rendered.
608
- */
609
- ALREADY_DISPOSED: "Component already disposed",
610
- /**
611
- * Error when an attempt is made to set the parent of a component in a way
612
- * that would result in an inconsistent object graph.
613
- */
614
- PARENT_UNABLE_TO_BE_SET: "Unable to set parent component",
615
- /**
616
- * Error when an attempt is made to add a child component at an out-of-bounds
617
- * index. We don't support sparse child arrays.
618
- */
619
- CHILD_INDEX_OUT_OF_BOUNDS: "Child component index out of bounds",
620
- /**
621
- * Error when an attempt is made to remove a child component from a component
622
- * other than its parent.
623
- */
624
- NOT_OUR_CHILD: "Child is not in parent component",
625
- /**
626
- * Error when an operation requiring DOM interaction is made when the
627
- * component is not in the document
628
- */
629
- NOT_IN_DOCUMENT: "Operation not supported while component is not in document",
630
- /**
631
- * Error when an invalid component state is encountered.
632
- */
633
- STATE_INVALID: "Invalid component state"
634
- };
635
- class Component extends Evt {
636
- //--[ Static ]--
637
- /**
638
- * Returns the component event type code used for dispatching component events.
639
- * @return {string} The COMP event type
640
- */
641
- static compEventCode() {
642
- return UiEventType.COMP;
643
- }
644
- /**
645
- * Returns the component ready event type code.
646
- * @return {string} The READY event type
647
- */
648
- static compReadyCode() {
649
- return UiEventType.READY;
650
- }
651
- /**
652
- * Returns the component error enumeration object.
653
- * @return {!Object<string, string>} The ComponentError enum
654
- */
655
- static compErrors() {
656
- return ComponentError;
657
- }
658
- #t;
659
- #e;
660
- #s;
661
- #r;
662
- #n;
663
- #i;
664
- #o;
665
- #a;
666
- constructor() {
667
- super(), this.#t = () => (
668
- /** @type {!HTMLElement} */
669
- document.createElement("div")
670
- ), this.#e = !1, this.#s = void 0, this.#r = void 0, this.#n = void 0, this.#i = void 0, this.#o = /* @__PURE__ */ new Map(), this.outOfTreeElements = [], this.placeholderDom = void 0, this.#a = () => {
671
- };
672
- }
673
- //--[ Getters and Setters ]--
674
- /**
675
- * @param {Element|undefined} e
676
- */
677
- set target(w) {
678
- this.#n = w;
679
- }
680
- /**
681
- * @returns {Element|undefined}
682
- */
683
- get target() {
684
- return this.#n;
685
- }
686
- /**
687
- * Sets the model associated with the UI component.
688
- * @param {*} m
689
- */
690
- set model(w) {
691
- this.#r = w;
692
- }
693
- /**
694
- * Returns the model associated with the UI component.
695
- * @return {*}
696
- */
697
- get model() {
698
- return this.#r;
699
- }
700
- /**
701
- * @param {boolean} bool
702
- */
703
- set isInDocument(w) {
704
- this.#e = w;
705
- }
706
- /**
707
- * @return {boolean}
708
- */
709
- get isInDocument() {
710
- return this.#e;
711
- }
712
- /**
713
- * A function that makes a DOM element.
714
- * @param {!function():(!HTMLElement|!Element|!DocumentFragment)} func
715
- */
716
- set domFunc(w) {
717
- this.#t = w;
718
- }
719
- /**
720
- * @param {!Function} func A callback guaranteed to fire after the panels is
721
- * ready, and in the document, but before the
722
- * {@code UiEventType.READY} event is fired.
723
- */
724
- set readyFunc(w) {
725
- this.#a = w;
726
- }
727
- //--[ DOM Management ]--
728
- /**
729
- * Internal method to set the component's root element. Used primarily during
730
- * rendering and re-rendering operations.
731
- * @param {!Node} frag The DOM node to set as this component's element
732
- * @private
733
- */
734
- setElementInternal_(w) {
735
- this.#s = w;
736
- }
737
- /**
738
- * Gets the component's element.
739
- * @return {!HTMLElement|undefined} The element
740
- * for the component.
741
- */
742
- getElement() {
743
- return this.#s;
744
- }
745
- /**
746
- * Creates the initial DOM representation for the component. The default
747
- * implementation is to set this.element_ = div.
748
- */
749
- createDom() {
750
- this.#s = this.#t();
751
- }
752
- /**
753
- * Asserts that this component can be rendered asynchronously.
754
- * Throws an error if the component has already been disposed.
755
- * Used by async rendering methods to validate component state.
756
- * @throws {Error} If the component is already disposed
757
- */
758
- assertCanRenderAsync() {
759
- if (this.disposed)
760
- throw new Error(ComponentError.ALREADY_DISPOSED);
761
- }
762
- /**
763
- * Renders the component. If a parent element is supplied, the component's
764
- * element will be appended to it. If there is no optional parent element and
765
- * the element doesn't have a parentNode then it will be appended to the
766
- * document body.
767
- *
768
- * If this component has a parent component, and the parent component is
769
- * not in the document already, then this will not call `enterDocument`
770
- * on this component.
771
- *
772
- * Throws an Error if the component is already rendered.
773
- *
774
- * @param {Element=} opt_parentElement Optional parent element to render the
775
- * component into.
776
- */
777
- render(w) {
778
- this.render_(w);
779
- }
780
- /**
781
- * Renders the component. If a parent element is supplied, the component's
782
- * element will be appended to it. If there is no optional parent element and
783
- * the element doesn't have a parentNode then it will be appended to the
784
- * document body.
785
- *
786
- * If this component has a parent component, and the parent component is
787
- * not in the document already, then this will not call `enterDocument`
788
- * on this component.
789
- *
790
- * Throws an Error if the component is already rendered.
791
- *
792
- * @param {Element=} opt_target Optional parent element to render the
793
- * component into.
794
- * @private
795
- */
796
- render_(w) {
797
- if (this.disposed)
798
- throw new Error(ComponentError.ALREADY_DISPOSED);
799
- if (this.isInDocument)
800
- throw new Error(ComponentError.ALREADY_RENDERED);
801
- this.#s || this.createDom();
802
- const D = (
803
- /** @type {!Node} */
804
- this.#s
805
- );
806
- w && (this.#n = w), this.placeholderDom && removeNode(this.placeholderDom), this.#n ? isInPage(D) || this.#n.insertBefore(D, null) : isInPage(
807
- /** @type {!Node} */
808
- D
809
- ) || document.body.appendChild(D), (!this.#i || this.#i.isInDocument) && this.enterDocument();
810
- }
811
- //--[ Life-cycle ]--
812
- /**
813
- * @param {Node} el
814
- * @param {Node} targetParent
815
- */
816
- hoist(w, D = void 0) {
817
- D || (D = document.querySelector("body")), D.appendChild(w), this.outOfTreeElements.push(w);
818
- }
819
- /**
820
- * Executes the beforeReady callback function if one was set.
821
- * Called automatically during enterDocument, before the READY event is dispatched.
822
- * Allows components to perform final setup operations once they're in the DOM.
823
- */
824
- executeBeforeReady() {
825
- this.#a();
826
- }
827
- /**
828
- * Called when the component's element is known to be in the document. Anything
829
- * using document.getElementById etc. should be done at this stage.
830
- *
831
- * If the component contains child components, this call is propagated to its
832
- * children.
833
- */
834
- enterDocument() {
835
- this.disposed ? removeNode(this.getElement()) : (this.isInDocument = !0, [...this.#o.values()].forEach((w) => {
836
- !w.isInDocument && w.getElement() && w.enterDocument();
837
- }), this.executeBeforeReady(), this.dispatchCompEvent(UiEventType.READY));
838
- }
839
- /**
840
- * Called by dispose to clean up the elements and listeners created by a
841
- * component, or by a parent component/application who has removed the
842
- * component from the document but wants to reuse it later.
843
- *
844
- * If the component contains child components, this call is propagated to its
845
- * children.
846
- *
847
- * It should be possible for the component to be rendered again once this
848
- * method has been called.
849
- */
850
- exitDocument() {
851
- [...this.#o.values()].forEach((w) => {
852
- w.isInDocument && w.exitDocument();
853
- }), this.stopBeingListenedTo(), this.removeAllListener(), this.isInDocument = !1, removeNode(this.getElement()), this.placeholderDom && removeNode(this.placeholderDom);
854
- }
855
- /**
856
- * Disposes of the component. Calls `exitDocument`, which is expected to
857
- * remove event handlers and clean up the component. Propagates the call to
858
- * the component's children, if any. Removes the component's DOM from the
859
- * document unless it was decorated.
860
- * @protected
861
- */
862
- disposeInternal() {
863
- this.isInDocument && this.exitDocument(), this.#o && [...this.#o.values()].forEach((w) => w.disposeInternal()), this.outOfTreeElements.forEach(removeNode), this.#s && removeNode(this.#s), this.placeholderDom && removeNode(this.placeholderDom), this.#o = null, this.#s = void 0, this.#r = null, this.#i = null, super.disposeInternal();
864
- }
865
- /**
866
- * Disposes of the component and performs cleanup. Aborts any pending async
867
- * operations, asks registered component libraries to cleanup their components,
868
- * and calls the parent dispose method.
869
- * After calling this method, the component should not be used.
870
- */
871
- dispose() {
872
- this.abortController && this.abortController.abort();
873
- const w = this.getElement();
874
- if (w)
875
- for (const D of ComponentLibraryRegistry.getRegisteredLibraries())
876
- try {
877
- const O = ComponentLibraryRegistry.get(D);
878
- O.dispose && O.dispose(w);
879
- } catch (O) {
880
- console.debug(`[${D}] Cleanup error during component disposal (non-critical):`, O);
881
- }
882
- super.dispose();
883
- }
884
- //--[ Built in events ]--
885
- /**
886
- * Dispatches a {@code UiEventType.COMP} event.
887
- * A shorthand method to get panels to dispatch uniform events.
888
- * Views may listen just to this event, and act on the supplied value or
889
- * data payload.
890
- * Example:
891
- * b.listen(a, Component.compEventCode(), e => {
892
- * console.log('B got', Component.compEventCode(), e);
893
- * console.log('Value is', e.detail.getValue());
894
- * console.log('Data is', e.detail.getData());
895
- * });
896
- * @param {string|number} value
897
- * @param {(string|number|?Object)=} opt_data
898
- * @return {boolean} If anyone called preventDefault on the event object (or
899
- * if any of the handlers returns false this will also return false.
900
- */
901
- dispatchCompEvent(w, D) {
902
- const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.COMP, O);
903
- return this.dispatchEvent(F);
904
- }
905
- }
906
- const EV = {
907
- // Mouse events
908
- CLICK: "click",
909
- DBLCLICK: "dblclick",
910
- MOUSEDOWN: "mousedown",
911
- MOUSEUP: "mouseup",
912
- MOUSEMOVE: "mousemove",
913
- // Touch events
914
- // Note that other touch events exist, but we should follow the W3C list here.
915
- // http://www.w3.org/TR/touch-events/#list-of-touchevent-types
916
- TOUCHSTART: "touchstart",
917
- TOUCHMOVE: "touchmove",
918
- TOUCHEND: "touchend",
919
- // Form events
920
- SUBMIT: "submit",
921
- CHANGE: "change",
922
- INPUT: "input",
923
- INVALID: "invalid",
924
- // Drag and drop events
925
- DRAGSTART: "dragstart",
926
- DRAGEND: "dragend",
927
- DRAGOVER: "dragover",
928
- DRAGENTER: "dragenter",
929
- DRAGEXIT: "dragexit",
930
- DRAGLEAVE: "dragleave",
931
- DROP: "drop",
932
- // Transitions
933
- TRANSITIONEND: "transitionend"
934
- }, touchEvents = [EV.TOUCHMOVE, EV.TOUCHSTART, EV.TOUCHEND], isTouchEvent = (U) => touchEvents.includes(U.type), normalizeEvent = (U) => (isTouchEvent(U) && (U.clientX = U.targetTouches[0].clientX, U.clientY = U.targetTouches[0].clientY), U), dragStartListener = (U, w, D, O) => (F) => {
935
- F.preventDefault();
936
- const q = normalizeEvent(F), W = (
937
- /** @type {!HTMLElement} */
938
- q.currentTarget
939
- ), [Y, G] = getPos(W), K = q.clientX - Y, Q = q.clientY - G, tt = U(Y, G, K, Q, W), J = D(Y, G, K, Q, W), X = w(Y, G, K, Q, W);
940
- let Z = freeMoveListener(X, W, K, Q);
941
- ["x", "ew"].includes(O) ? Z = xMoveOnlyListener(X, W, K) : ["y", "ns"].includes(O) && (Z = yMoveOnlyListener(X, W, K, Q));
942
- let et = !1;
943
- const st = (nt) => {
944
- et = !0, Z(nt);
945
- }, rt = (nt) => {
946
- document.removeEventListener(EV.MOUSEMOVE, st, !0), document.removeEventListener(EV.TOUCHMOVE, st, !0), document.removeEventListener(EV.MOUSEUP, rt, !0), document.removeEventListener(EV.TOUCHEND, rt, !0), et && J(nt);
947
- };
948
- return document.addEventListener(EV.MOUSEUP, rt, !0), document.addEventListener(EV.TOUCHEND, rt, !0), document.addEventListener(EV.MOUSEMOVE, st, !0), document.addEventListener(EV.TOUCHMOVE, st, !0), tt(F), rt;
949
- }, freeMoveListener = (U, w, D, O) => (F) => {
950
- F.preventDefault();
951
- const q = normalizeEvent(F);
952
- w.style.left = `${q.clientX - D}px`, w.style.top = `${q.clientY - O}px`, U(q);
953
- }, xMoveOnlyListener = (U, w, D, O) => (F) => {
954
- F.preventDefault();
955
- const q = normalizeEvent(F);
956
- w.style.left = `${q.clientX - D}px`, U(q);
957
- }, yMoveOnlyListener = (U, w, D, O) => (F) => {
958
- F.preventDefault();
959
- const q = normalizeEvent(F);
960
- w.style.top = `${q.clientY - O}px`, U(q);
961
- }, makeEmitter = (U, w) => (D, O, F, q, W) => (Y) => {
962
- U.dispatchCompEvent(w, {
963
- component: U,
964
- browserEvent: Y,
965
- left: D,
966
- top: O,
967
- clientX: Y.clientX,
968
- clientY: Y.clientY,
969
- xOrg: F,
970
- yOrg: q,
971
- deltaX: Y.clientX - F - D,
972
- deltaY: Y.clientY - q - O,
973
- target: W
974
- });
975
- };
976
- class Dragger extends Component {
977
- #t;
978
- #e;
979
- #s;
980
- #r;
981
- /**
982
- * @param {string} freedom Restrict the directions in which the
983
- * dragger can be moved.
984
- */
985
- constructor(w = "xy") {
986
- super(), this.#t = ["x", "y", "xy", "ew", "ns"].includes(w.toLowerCase()) ? w.toLowerCase() : "xy", this.#e = void 0, this.#s = !0, this.#r = (D) => null;
987
- }
988
- /**
989
- * Cancels the current drag operation in progress, if any.
990
- * @param {!Event} event The event that triggered the cancel
991
- */
992
- cancelDrag(w) {
993
- this.#r(w);
994
- }
995
- //--[ Getters and Setters ]--
996
- /**
997
- * Sets the direction in which the component can be dragged.
998
- * Only 'x' or 'y' will lock the movements to those directions.
999
- * Anything else will be considered free movement
1000
- * @param {string} axis
1001
- */
1002
- set moveFreedom(w) {
1003
- this.#t = w, this.#s || (this.lock(), this.unlock());
1004
- }
1005
- /**
1006
- * Get the direction in which this component can move.
1007
- * @return {string}
1008
- */
1009
- get moveFreedom() {
1010
- return this.#t;
1011
- }
1012
- //--[ Override ]--
1013
- /**
1014
- * @inheritDoc
1015
- */
1016
- executeBeforeReady() {
1017
- this.unlock(), super.executeBeforeReady();
1018
- }
1019
- //--[ Dragger Specific ]--
1020
- /**
1021
- * Make the component draggable
1022
- */
1023
- unlock() {
1024
- const w = (D) => (O) => {
1025
- this.#r = D(O);
1026
- };
1027
- if (this.isInDocument && this.#s) {
1028
- const D = makeEmitter(this, UiEventType.COMP_DRAG_MOVE), O = makeEmitter(this, UiEventType.COMP_DRAG_START), F = makeEmitter(this, UiEventType.COMP_DRAG_END), q = dragStartListener(
1029
- O,
1030
- D,
1031
- F,
1032
- this.#t
1033
- );
1034
- this.#s = !1, this.#e = /** @type {!Node} */
1035
- this.#e || this.getElement(), this.listen(this.#e, EV.MOUSEDOWN, w(q)), this.listen(this.#e, EV.TOUCHSTART, q), this.#e.classList.remove("locked");
1036
- }
1037
- }
1038
- /**
1039
- * Lock the component in place.
1040
- * Removes all the listeners added when it was made draggable.
1041
- */
1042
- lock() {
1043
- this.stopListeningTo(this.#e, EV.MOUSEDOWN), this.stopListeningTo(this.#e, EV.TOUCHSTART), this.#s = !0, this.#e.classList.add("locked");
1044
- }
1045
- }
1046
- const splitRe_ = new RegExp(
1047
- "^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"
1048
- ), ComponentIndex = {
1049
- PATH: 5,
1050
- QUERY_DATA: 6
1051
- }, split = (U) => (
1052
- /** @type {!Array<string|undefined>} */
1053
- U.match(splitRe_)
1054
- ), decodeOrEmpty_ = (U, w) => U ? decodeURI(U.replace(/%25/g, "%2525")) : "", getPath = (U) => decodeOrEmpty_(split(U)[ComponentIndex.PATH]), getQueryData = (U) => decodeOrEmpty_(split(U)[ComponentIndex.QUERY_DATA]), objectToUrlParms = (U) => [...Object.entries(U)].map(
1055
- (w) => `${w[0]}=${w[1]}`
1056
- ).join("&"), isValidValue = (U) => U != null && U !== "", queryDataToMap = (U) => U.split("&").reduce((w, D) => {
1057
- const [O, F] = D.split("=");
1058
- return isValidValue(O) && isValidValue(F) && w.set(O, F), w;
1059
- }, /* @__PURE__ */ new Map()), uriUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1060
- __proto__: null,
1061
- getPath,
1062
- getQueryData,
1063
- objectToUrlParms,
1064
- queryDataToMap
1065
- }, Symbol.toStringTag, { value: "Module" })), stripLeadingSpace = stripLeadingChar(" "), stripLeadingSlash = stripLeadingChar("/"), getCookieByName = (U) => document.cookie.split(";").map((w) => w.split("=")).reduce((w, D) => w.set(stripLeadingSpace(D[0]), D[1]), /* @__PURE__ */ new Map()).get(U), spinner = (U) => {
1066
- let w = 0, D;
1067
- const O = (F) => {
1068
- const q = F > 0;
1069
- return q ? w += 1 : w -= 1, q ? w === 1 : w === 0;
1070
- };
1071
- return (F) => {
1072
- D = D || document.getElementById(U), D && O(F) && D.classList.toggle("viz", w > 0);
1073
- };
1074
- }, spin = spinner("the_loader"), startSpin = () => Promise.resolve(spin(1)), stopSpin = (U) => (spin(0), Promise.resolve(U)), checkStatus = (U) => U.ok ? Promise.resolve(U) : Promise.reject(new Error(`${U.url} ${U.status} (${U.statusText})`)), checkStatusTwo = (U) => (w) => {
1075
- if (w.type === "opaqueredirect" || w.redirected) {
1076
- const D = stripLeadingSlash(getPath(w.url));
1077
- U.setIsRedirected(!0, D), console.log("Redirect detected", D);
1078
- }
1079
- return checkStatus(w);
1080
- }, getJson = (U) => U.json(), getText = (U) => U.text().then(
1081
- (w) => Promise.resolve(w),
1082
- (w) => Promise.reject(new Error(`Could not get text from response: ${w}`))
1083
- ), getTextOrJson = (U) => U.headers.get("Content-Type") === "application/json" ? getJson(U) : getText(U), jsonInit = (U, w, D = "POST", O = void 0) => {
1084
- const F = new Headers();
1085
- F.append("Content-type", "application/json"), F.append("X-Requested-With", "XMLHttpRequest"), U && U !== "" && F.append("Authorization", `Bearer ${U}`);
1086
- const q = {
1087
- cache: "no-cache",
1088
- method: D,
1089
- headers: F,
1090
- credentials: "include",
1091
- body: JSON.stringify(w)
1092
- };
1093
- return O && (q.signal = O), q;
1094
- }, basicPutPostPatchInit = (U, w, D = !1, O = void 0) => {
1095
- const F = new Headers();
1096
- if (w && w !== "" && F.append("Authorization", `Bearer ${w}`), F.append("X-Requested-With", "XMLHttpRequest"), D) {
1097
- const W = getCookieByName("csrftoken");
1098
- W && D && F.append("X-CSRFToken", W);
1099
- }
1100
- const q = {
1101
- cache: "no-cache",
1102
- method: U,
1103
- headers: F,
1104
- redirect: "follow",
1105
- // This is anyway the default.
1106
- credentials: "include"
1107
- };
1108
- return O && (q.signal = O), q;
1109
- }, formPostInit = (U, w, D = void 0) => {
1110
- const F = basicPutPostPatchInit("POST", U, !1, D);
1111
- return F.body = new FormData(w.formEl), F;
1112
- }, basicGetInit = (U, w = void 0) => {
1113
- const D = new Headers();
1114
- D.append("Authorization", `Bearer ${U}`), D.append("X-Requested-With", "XMLHttpRequest");
1115
- const O = {
1116
- cache: "no-cache",
1117
- headers: D,
1118
- credentials: "include"
1119
- };
1120
- return w && (O.signal = w), O;
1121
- }, putPostPatchNobody = (U, w) => {
1122
- const D = new Request(U);
1123
- return fetch(D, w).then(checkStatus).then(getText);
1124
- }, genCatchClause = (U, w = void 0) => (D) => (stopSpin("").then(identity), D.name === "AbortError" ? console.info(U, "ABORTED!") : console.error(U, D), w);
1125
- class UserManager {
1126
- /**
1127
- * @param {!Object=} opt_data
1128
- */
1129
- constructor(w) {
1130
- this.user_ = {}, this.jwt = "", w && this.updateProfileFromJwt(w).then(() => {
1131
- });
1132
- }
1133
- /**
1134
- * @param {Object} data
1135
- * @param {boolean=} opt_onlyIfNoneExists
1136
- * @return {Promise}
1137
- * @private
1138
- */
1139
- updateProfileFromJwt(w, D = !1) {
1140
- return D && this.jwt !== "" ? Promise.resolve("User Profile Already exists") : w.non_field_errors ? Promise.reject(new Error(`JWT ${w.non_field_errors}`)) : (this.updateToken(w.token), this.updateProfile(w.user), Promise.resolve("User Profile Updated"));
1141
- }
1142
- /**
1143
- * @param {UserLikeType} data
1144
- */
1145
- updateProfile(w) {
1146
- this.user_ = w;
1147
- }
1148
- /**
1149
- * @param {string} t
1150
- */
1151
- updateToken(w) {
1152
- this.jwt = w;
1153
- }
1154
- /**
1155
- * @return {number|undefined}
1156
- */
1157
- get id() {
1158
- return this.user_.id;
1159
- }
1160
- /**
1161
- * @return {string|undefined}
1162
- */
1163
- get name() {
1164
- return this.user_.name;
1165
- }
1166
- /**
1167
- * @return {string|undefined}
1168
- */
1169
- get surname() {
1170
- return this.user_.surname;
1171
- }
1172
- /**
1173
- * @return {string|undefined}
1174
- */
1175
- get salutation() {
1176
- let w = this.name;
1177
- const D = this.surname;
1178
- return D && (w = w + " " + D), w;
1179
- }
1180
- /**
1181
- * @param {FormPanel} formPanel
1182
- * @return {Promise}
1183
- */
1184
- formSubmit(w) {
1185
- const D = new Request(w.uri.toString()), O = w.processSubmitReply.bind(w), F = genCatchClause("Form submit error");
1186
- return startSpin().then(() => fetch(D, formPostInit(
1187
- this.jwt,
1188
- w,
1189
- w.abortController.signal
1190
- ))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(O).catch(F);
1191
- }
1192
- /**
1193
- * @param {string} uri
1194
- * @param {Boolean} useDocumentCookies
1195
- * @param {AbortSignal|undefined} signal
1196
- * @return {Promise}
1197
- */
1198
- putNoBody(w, D = void 0, O = !1) {
1199
- const F = genCatchClause("putNobody error"), q = basicPutPostPatchInit(
1200
- "PUT",
1201
- this.jwt,
1202
- O,
1203
- D
1204
- );
1205
- return putPostPatchNobody(w, q).catch(F);
1206
- }
1207
- /**
1208
- * @param {string} uri
1209
- * @param {AbortSignal|undefined} signal
1210
- * @return {Promise}
1211
- */
1212
- fetch(w, D = void 0) {
1213
- const O = new Request(w.toString()), F = genCatchClause(`UMan Text GET Fetch: ${w}`);
1214
- return startSpin().then(() => fetch(O, basicGetInit(this.jwt, D))).then(checkStatus).then(stopSpin).then(getText).catch(F);
1215
- }
1216
- /**
1217
- * Use this if you want to directly get a parsed template that does not go
1218
- * through panel logic.
1219
- * @param {string} uri
1220
- * @param {AbortSignal|undefined} signal
1221
- * @return {Promise}
1222
- */
1223
- fetchAndSplit(w, D = void 0) {
1224
- const O = genCatchClause(`fetchAndSplit: ${w}`);
1225
- return this.fetch(w, D).then(handleTemplateProm).catch(O);
1226
- }
1227
- /**
1228
- * @param {string} uri
1229
- * @param {AbortSignal|undefined} signal
1230
- * @return {Promise}
1231
- */
1232
- async fetchJson(w, D = void 0, O = void 0) {
1233
- const F = new Request(w.toString()), q = genCatchClause(`fetchJson: ${w}`, O), W = basicGetInit(this.jwt, D);
1234
- await startSpin();
1235
- let Y = {};
1236
- try {
1237
- Y = await (await fetch(F, W)).json();
1238
- } catch (G) {
1239
- return q(G);
1240
- }
1241
- return await stopSpin(), Y;
1242
- }
1243
- /**
1244
- * @param {string} uri
1245
- * @param {Object} payload
1246
- * @param {AbortSignal|undefined} signal
1247
- * @return {Promise}
1248
- */
1249
- patchJson(w, D, O = void 0) {
1250
- const F = new Request(w.toString()), q = genCatchClause(`patchJson: ${w}`), W = jsonInit(this.jwt, D, "PATCH", O);
1251
- return fetch(F, W).then(checkStatus).then(getJson).catch(q);
1252
- }
1253
- /**
1254
- * @param {string} uri
1255
- * @param {Object} payload
1256
- * @param {AbortSignal|undefined} signal
1257
- * @return {Promise}
1258
- */
1259
- postJson(w, D, O = void 0) {
1260
- const F = new Request(w.toString()), q = genCatchClause(`postJson: ${w}`), W = jsonInit(this.jwt, D, "POST", O);
1261
- return fetch(F, W).then(checkStatus).then(getJson).catch(q);
1262
- }
1263
- /**
1264
- * @param {string} uri
1265
- * @param {Object} payload
1266
- * @param {AbortSignal|undefined} signal
1267
- * @return {Promise}
1268
- */
1269
- putJson(w, D, O = void 0) {
1270
- const F = new Request(w.toString()), q = genCatchClause(`putJson: ${w}`), W = jsonInit(this.jwt, D, "PUT", O);
1271
- return fetch(F, W).then(checkStatus).then(getJson).catch(q);
1272
- }
1273
- /**
1274
- * @param {string} uri
1275
- * @param {Object} payload
1276
- * @param {AbortSignal|undefined} signal
1277
- * @return {Promise}
1278
- */
1279
- delJson(w, D, O = void 0) {
1280
- const F = new Request(w.toString()), q = genCatchClause(`delJson: ${w}`), W = jsonInit(this.jwt, D, "DELETE", O);
1281
- return fetch(F, W).then(checkStatus).then(getJson).catch(q);
1282
- }
1283
- }
1284
- class Panel extends Component {
1285
- /**
1286
- * Returns the panel event type code used for dispatching panel events.
1287
- * @return {string} The PANEL event type
1288
- */
1289
- static panelEventCode() {
1290
- return UiEventType.PANEL;
1291
- }
1292
- /**
1293
- * Returns the component ready event type code.
1294
- * @return {string} The READY event type
1295
- */
1296
- static compReadyCode() {
1297
- return UiEventType.READY;
1298
- }
1299
- /**
1300
- * Creates a new Panel instance.
1301
- * @param {string=} uri Optional URI for fetching panel content
1302
- */
1303
- constructor(w) {
1304
- super(), this.qParamMap_ = /* @__PURE__ */ new Map(), this.uri_ = "", w && this.parseUri(w), this.evalScripts = evalScripts(this), this.evalModules = evalModules(this), this.redirected = !1, this.responseObject = { html: null, scripts: null }, this.user_ = void 0, "AbortController" in window ? this.abortController = new AbortController() : this.abortController = {
1305
- signal: void 0,
1306
- abort: () => {
1307
- }
1308
- }, this.listMap = /* @__PURE__ */ new Map();
1309
- }
1310
- //--[ Getters and Setters ]--
1311
- get uri() {
1312
- const w = this.qParamMap_.size > 0 ? "?" + objectToUrlParms(Object.fromEntries(this.qParamMap_)) : "";
1313
- return this.uri_ + w;
1314
- }
1315
- /**
1316
- * @param {!UserManager} user
1317
- */
1318
- set user(w) {
1319
- this.user_ = w;
1320
- }
1321
- /**
1322
- * @return {!UserManager}
1323
- */
1324
- get user() {
1325
- return this.user_ || (this.user_ = new UserManager()), this.user_;
1326
- }
1327
- /**
1328
- * Parses a URI into its path and query parameters. Updates the panel's
1329
- * internal URI and query parameter map.
1330
- * @param {string} uri The URI to parse
1331
- */
1332
- parseUri(w) {
1333
- this.uri_ = getPath(w), this.qParamMap_ = queryDataToMap(getQueryData(w));
1334
- }
1335
- /**
1336
- * Adds or updates a query parameter in the panel's query parameter map.
1337
- * @param {string} k The parameter key
1338
- * @param {string} v The parameter value
1339
- */
1340
- addToQParams(w, D) {
1341
- this.qParamMap_.set(w, D);
1342
- }
1343
- /**
1344
- * Removes a query parameter from the panel's query parameter map.
1345
- * @param {string} k The parameter key to remove
1346
- */
1347
- removeFromQParams(w) {
1348
- this.qParamMap_.delete(w);
1349
- }
1350
- /**
1351
- * Clears all query parameters from the panel's query parameter map.
1352
- */
1353
- clearQParams() {
1354
- this.qParamMap_.clear();
1355
- }
1356
- //--[ Carbon Component Access ]-----
1357
- /**
1358
- * Gets all Carbon components of a specific type in this panel.
1359
- * Components are scanned and stored during Carbon library initialization.
1360
- * @param {string} selector - Carbon component selector (e.g., 'cds-table', 'cds-button')
1361
- * @return {Element[]} Array of matching elements, or empty array if none found
1362
- * @example
1363
- * const tables = this.getCarbonComponents('cds-table');
1364
- * const buttons = this.getCarbonComponents('cds-button');
1365
- */
1366
- getCarbonComponents(w) {
1367
- return this.carbonComponents?.get(w) || [];
1368
- }
1369
- /**
1370
- * Gets a single Carbon component by its ID.
1371
- * Searches across all Carbon component types stored in this panel.
1372
- * @param {string} id - The element ID to search for
1373
- * @return {Element|undefined} The matching element, or undefined if not found
1374
- * @example
1375
- * const table = this.getCarbonComponentById('companies-table');
1376
- */
1377
- getCarbonComponentById(w) {
1378
- if (this.carbonComponents)
1379
- for (const D of this.carbonComponents.values()) {
1380
- const O = D.find((F) => F.id === w);
1381
- if (O)
1382
- return O;
1383
- }
1384
- }
1385
- //--[ Template Render ]-----
1386
- /**
1387
- * Temporarily render placeholder DOM
1388
- * @param {Node!} placeholder
1389
- */
1390
- renderPlaceHolder(w) {
1391
- this.target && (this.placeholderDom = w, this.target.insertBefore(this.placeholderDom, null));
1392
- }
1393
- /**
1394
- * Expects HTML data from a call to the back.
1395
- * @param {Function=} opt_callback An optional callback to call before
1396
- * rendering the panel. This is useful for when you only want to attach the
1397
- * new panel to the view right before you render it - meaning the existing
1398
- * panel stays in place on the DOM for the duration of the fetch call.
1399
- * @return {Promise} Returns a promise with this panel as value.
1400
- */
1401
- renderWithTemplate(w) {
1402
- const D = this.user;
1403
- return D ? D.fetch(this.uri, this.abortController.signal).then((O) => (this.assertCanRenderAsync(), w && w(this), this.onRenderWithTemplateReply(O).catch((F) => {
1404
- F.message !== Component.compErrors().ALREADY_DISPOSED && console.error("RenderWithTemplate Err:", F);
1405
- }), this)).catch((O) => {
1406
- throw console.error("Panel.renderWithTemplate fetch failed:", O), O;
1407
- }) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"));
1408
- }
1409
- /**
1410
- * @param {string} s
1411
- * @private
1412
- * @return {Promise}
1413
- */
1414
- onRenderWithTemplateReply(w) {
1415
- return this.responseObject = splitScripts(w), this.domFunc = () => (
1416
- /** @type {!Element} */
1417
- this.responseObject.html
1418
- ), this.render(), Promise.resolve(this);
1419
- }
1420
- /**
1421
- * Partially replace panel's content.
1422
- * If an ID query selector (#something) is passed in, then that single node is replaced
1423
- * in the panel DOM with the single node in the content DOM
1424
- *
1425
- * If a class query selector (.some_class) is passed in, all elements in the
1426
- * panel's dom with that class is replaced with the matching
1427
- * element ID in the content DOM matching the target DOMs element IDs
1428
- *
1429
- * NOTE: For the spot replacement to work, you need both the classname
1430
- * and a unique element ID on the element you intend to replace.
1431
- *
1432
- * NOTE: Top level replacements will clobber child replacements.
1433
- *
1434
- * @param content
1435
- * @param qs
1436
- */
1437
- onReplacePartialDom(w, D) {
1438
- const O = this.getElement();
1439
- if (isUndefined(O))
1440
- return;
1441
- const F = w.html;
1442
- if (D.startsWith("."))
1443
- [...O.querySelectorAll(D)].filter((q) => isDefAndNotNull(q.id)).map((q) => [q, F.querySelector(`#${q.id}`)]).filter(([q, W]) => isDefAndNotNull(W)).forEach(([q, W]) => {
1444
- q.parentNode.replaceChild(W, q), this.parseContent(W);
1445
- });
1446
- else if (D.startsWith("#")) {
1447
- const q = F.querySelector(D), W = O.querySelector(D);
1448
- W.parentNode.replaceChild(q, W), this.parseContent(q);
1449
- }
1450
- this.evalScripts(w.scripts), this.evalModules(w.modules);
1451
- }
1452
- //--[ JSON Render ]-----
1453
- /**
1454
- * Equivalent to the @code{renderWithTemplate} method in that it is guaranteed
1455
- * that a reply from the callback is received before @code{render} is called.
1456
- * @param {function(Object, !Panel)} opt_callback The callback function
1457
- * that will receive the reply event.
1458
- */
1459
- renderWithJSON(w) {
1460
- return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((O) => {
1461
- this.assertCanRenderAsync(), w && w(O, this), this.onRenderWithJSON(O).then(identity);
1462
- }).catch((O) => {
1463
- throw console.error("Panel.renderWithJSON fetch failed:", O), O;
1464
- }) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"));
1465
- }
1466
- /**
1467
- * On reply from a GET call to the panel URI
1468
- * @param {Object} _json The callback function
1469
- * that will receive the reply event.
1470
- * @return {Promise}
1471
- */
1472
- onRenderWithJSON(w) {
1473
- return Promise.resolve(this);
1474
- }
1475
- /**
1476
- * @param {Element} _el
1477
- * @param {Object} _elDataMap
1478
- * @param {Object} _json
1479
- */
1480
- onAsyncJsonReply(w, D, O) {
1481
- }
1482
- /**
1483
- * Called on each async HTML response, after the content is in the DOM
1484
- * and rendered.
1485
- * @param {Element} _el
1486
- * @param {Object} _elDataMap
1487
- */
1488
- onAsyncHtmlReply(w, D) {
1489
- }
1490
- /**
1491
- * Hook method called when the view broadcasts data to all its panels.
1492
- * Override this method to handle broadcasted data in subclasses.
1493
- * @param {*} _data The data broadcast from the view
1494
- */
1495
- onViewDataBroadcast(w) {
1496
- }
1497
- //--[ JSON Render ]-----
1498
- /**
1499
- * @param {Element} panel
1500
- */
1501
- parseContent(w) {
1502
- if (this.debugMe("Enable interactions. Panel:", w), typeof window.customElements < "u" && ComponentLibraryRegistry.has("carbon")) {
1503
- const J = ComponentLibraryRegistry.get("carbon");
1504
- J.render.call(this, w, J.cache).catch((X) => console.error("[Zooy] Carbon initialization failed:", X));
1505
- }
1506
- if (ComponentLibraryRegistry.has("mdc")) {
1507
- const J = ComponentLibraryRegistry.get("mdc");
1508
- J.render.call(this, w, J.cache);
1509
- }
1510
- w.classList.contains("zoo__modal-base") && w.classList.contains("close_on_click") && this.listen(w, EV.CLICK, (J) => {
1511
- J.target === w && this.dispatchPanelEvent("destroy_me");
1512
- }), [...w.querySelectorAll(
1513
- ".zoo__button:not(.external):not(.mdc-data-table__row)"
1514
- )].forEach((J) => {
1515
- this.listen(J, EV.CLICK, (X) => {
1516
- X.stopPropagation();
1517
- const Z = X.currentTarget, et = getElDataMap(Z);
1518
- this.dispatchPanelEvent(et.zv, Object.assign({
1519
- orgEvt: X,
1520
- trigger: Z,
1521
- href: Z.href || et.href
1522
- }, et));
1523
- });
1524
- }), [...w.querySelectorAll("[href]:not(.external)")].forEach((J) => {
1525
- this.listen(J, EV.CLICK, (X) => {
1526
- const Z = X.currentTarget;
1527
- X.preventDefault(), X.stopPropagation();
1528
- const et = getElDataMap(Z), st = et.zv || "href";
1529
- this.dispatchPanelEvent(st, Object.assign({
1530
- orgEvt: X,
1531
- trigger: X.target,
1532
- href: Z.href || et.href
1533
- }, et));
1534
- });
1535
- }), [...w.querySelectorAll("form.intercept_submit")].forEach((J) => {
1536
- J.noValidate = !0, this.listen(J, EV.SUBMIT, (X) => {
1537
- X.preventDefault(), X.stopPropagation();
1538
- const Z = getElDataMap(J), et = formToJSON(J.elements);
1539
- this.dispatchPanelEvent(Z.zv, Object.assign({
1540
- orgEvt: X,
1541
- trigger: X.target,
1542
- formData: et,
1543
- href: Z.href
1544
- }, Z));
1545
- });
1546
- }), [...w.querySelectorAll(".zoo__toggle_class_driver")].forEach(
1547
- (J) => {
1548
- const X = getElDataMap(J), Z = X.toggle_class_target_id, et = X.toggle_class, st = w.querySelector(`#${Z}`);
1549
- st && et && J.addEventListener(EV.CLICK, (rt) => {
1550
- rt.stopPropagation(), st.classList.toggle(et);
1551
- });
1552
- }
1553
- );
1554
- const D = Array.from(w.querySelectorAll(".folder_drop_zone")), O = Array.from(w.querySelectorAll("[draggable]")), F = (J) => {
1555
- J.preventDefault(), J.target.classList.add("drag_over");
1556
- }, q = (J) => {
1557
- J.preventDefault();
1558
- }, W = (J) => {
1559
- J.preventDefault(), J.target.classList.remove("drag_over");
1560
- }, Y = (J) => {
1561
- J.preventDefault(), J.target.classList.remove("drag_over");
1562
- }, G = (J) => {
1563
- J.preventDefault(), J.target.classList.remove("drag_over");
1564
- }, K = (J) => {
1565
- J.dataTransfer.dropEffect = "move";
1566
- const X = getElDataMap(J.target);
1567
- J.dataTransfer.setData("text/plain", JSON.stringify(X)), J.target.classList.add("drag_in_progress");
1568
- }, Q = (J) => {
1569
- J.target.classList.remove("drag_in_progress");
1570
- }, tt = (J) => {
1571
- G(J), J.stopPropagation();
1572
- const X = JSON.parse(J.dataTransfer.getData("text/plain")), Z = getElDataMap(J.target);
1573
- return this.dispatchPanelEvent("drop_on", {
1574
- custom: { on: Z, from: X }
1575
- }), !1;
1576
- };
1577
- D.forEach((J) => {
1578
- this.listen(J, EV.DRAGOVER, q), this.listen(J, EV.DRAGENTER, F), this.listen(J, EV.DRAGEXIT, Y), this.listen(J, EV.DRAGLEAVE, W), this.listen(J, EV.DROP, tt);
1579
- }), O.forEach((J) => {
1580
- this.listen(J, EV.DRAGSTART, K), this.listen(J, EV.DRAGEND, Q);
1581
- }), [...w.querySelectorAll(".zoo_async_json")].forEach((J) => {
1582
- const X = getElDataMap(J), Z = X.href, et = this.onAsyncJsonReply.bind(this, J, X);
1583
- this.user.fetchJson(Z, this.abortController.signal).then(et);
1584
- const st = X.z_json_reusable;
1585
- st && (this.jsonCallFuncs = this.jsonCallFuncs || {}, this.jsonCallFuncs[st] = () => {
1586
- this.user.fetchJson(Z, this.abortController.signal).then(et);
1587
- });
1588
- const rt = toNumber(X.z_interval);
1589
- isNumber(rt) && this.doOnBeat(() => {
1590
- this.user.fetchJson(Z, this.abortController.signal).then(et);
1591
- }, rt * 60 * 1e3);
1592
- }), [...w.querySelectorAll(".zoo_async_html")].forEach(
1593
- /**
1594
- * @param {Element} el
1595
- */
1596
- (J) => {
1597
- const X = getElDataMap(J), Z = X.href;
1598
- this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
1599
- J.appendChild(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules), this.onAsyncHtmlReply(J, X);
1600
- });
1601
- const et = toNumber(X.z_interval);
1602
- isNumber(et) && this.doOnBeat(() => {
1603
- this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
1604
- J.replaceChildren(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules);
1605
- });
1606
- }, et * 60 * 1e3);
1607
- }
1608
- );
1609
- }
1610
- /**
1611
- * @inheritDoc
1612
- * Called when the panel enters the document. Parses content to enable
1613
- * Material Design Components, executes scripts and modules, then dispatches
1614
- * the READY event.
1615
- */
1616
- enterDocument() {
1617
- const w = this.getElement();
1618
- this.parseContent(w), this.evalScripts(this.responseObject.scripts), this.evalModules(this.responseObject.modules), super.enterDocument();
1619
- }
1620
- /**
1621
- * @inheritDoc
1622
- * Called when the panel exits the document. Aborts any pending async
1623
- * operations and performs cleanup.
1624
- */
1625
- exitDocument() {
1626
- this.abortController.abort(), super.exitDocument();
1627
- }
1628
- /**
1629
- * @param {boolean} bool
1630
- * @param {?string} url
1631
- */
1632
- setIsRedirected(w, D) {
1633
- this.redirected = w, this.redirected && D && (this.uri_ = D);
1634
- }
1635
- //--[ Built in events ]--
1636
- /**
1637
- * Dispatches a @code{UiEventType.PANEL} event.
1638
- * A shorthand method to get panels to dispatch uniform events.
1639
- * Views may listen just to this event, and act on the supplied value or
1640
- * data payload.
1641
- * @example
1642
- * b.listen(a, Panel.panelEventCode(), e => {
1643
- * console.log('B got', Panel.panelEventCode(), e);
1644
- * console.log('Value is', e.detail.getValue());
1645
- * console.log('Data is', e.detail.getData());
1646
- * });
1647
- * @param {string|number} value
1648
- * @param {(string|number|?Object)=} opt_data
1649
- * @return {boolean} If anyone called preventDefault on the event object
1650
- * or if any of the handlers returns false this will also return false.
1651
- */
1652
- dispatchPanelEvent(w, D) {
1653
- const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.PANEL, O);
1654
- return this.debugMe(`PANEL EVENT FIRED:
1655
- value:${w}
1656
- data:${D}`), this.dispatchEvent(F);
1657
- }
1658
- }
1659
- class FormPanel extends Panel {
1660
- /**
1661
- * @type {?HTMLFormElement}
1662
- * @private
1663
- */
1664
- #t = null;
1665
- /**
1666
- * Map of form fields to their error message DOM elements
1667
- * @type {!Map<HTMLInputElement, Element>}
1668
- * @private
1669
- */
1670
- #e = /* @__PURE__ */ new Map();
1671
- #s = !0;
1672
- /**
1673
- * Creates a new FormPanel instance.
1674
- * @param {string=} uri Optional URI for fetching form content
1675
- * @param {boolean} intercept If false, we do not try and intercept the forms
1676
- */
1677
- constructor(w, D = !0) {
1678
- super(w), this.#s = D, this.onSubmitSucFunc = (O, F) => null;
1679
- }
1680
- /**
1681
- * Gets the form element managed by this panel.
1682
- * @return {?HTMLFormElement} The form element, or null if not found
1683
- */
1684
- get formEl() {
1685
- return this.#t;
1686
- }
1687
- /**
1688
- * @inheritDoc
1689
- * Called when the form panel enters the document. Identifies the form element
1690
- * and sets up submission interception and field error handling.
1691
- */
1692
- enterDocument() {
1693
- super.enterDocument(), this.formIdElementToForm_();
1694
- }
1695
- /**
1696
- * Internal method to identify the form element and set up interception.
1697
- * @private
1698
- */
1699
- formIdElementToForm_() {
1700
- this.#t = this.getFormFromId(), this.#t && (this.#a(this.#t), this.#r());
1701
- }
1702
- /**
1703
- * @param {string=} string The id of the form we want to sterilise.
1704
- * @return {?HTMLFormElement}
1705
- */
1706
- getFormFromId(w) {
1707
- let D = null, O = this.getElement().querySelector("form");
1708
- return w && (O = document.getElementById(
1709
- /** @type {string} */
1710
- w
1711
- ) || O), O && O.tagName.toLowerCase() === "form" && (D = /** @type {HTMLFormElement} */
1712
- O), D;
1713
- }
1714
- //--[ Field Validation Methods ]--
1715
- /**
1716
- * Initializes field validation. Sets up event listeners on the form
1717
- * for change, input, and invalid events.
1718
- * @private
1719
- */
1720
- #r() {
1721
- this.#t && (this.listen(this.#t, EV.CHANGE, (w) => {
1722
- this.#o(w);
1723
- }, { passive: !0 }), this.listen(this.#t, EV.INPUT, (w) => {
1724
- this.clearAllValidationErrors(), this.#o(w);
1725
- }), this.listen(this.#t, EV.INVALID, (w) => {
1726
- w.preventDefault();
1727
- const D = (
1728
- /** @type {HTMLInputElement} */
1729
- w.target
1730
- );
1731
- this.#i(D), this.displayFieldError(D);
1732
- }, { passive: !0 }));
1733
- }
1734
- /**
1735
- * Checks all form fields for validity. Returns true if all fields are valid.
1736
- * Displays error messages for any invalid fields.
1737
- * @return {boolean} True if all fields are valid, false otherwise
1738
- */
1739
- checkAllFields() {
1740
- const w = [...this.#t.elements].map((D) => [this.#n(D), D]).filter((D) => !D[0]);
1741
- return w.forEach((D) => this.displayFieldError(D[1])), w.length === 0;
1742
- }
1743
- /**
1744
- * Clear all existing validation errors
1745
- */
1746
- clearAllValidationErrors() {
1747
- [...this.#t ? this.#t.elements : []].forEach((O) => this.#i(O)), [...this.#t.querySelectorAll(".non-field-errors")].forEach((O) => O.classList.remove("alert-error"));
1748
- }
1749
- /**
1750
- * Format the message dom object and insert it into the DOM
1751
- * @param {HTMLInputElement} field The field after which the alert will be inserted.
1752
- * @param {string} msg The message in the alert.
1753
- * @param {string} _css A CSS class name to add to the alert div.
1754
- * @private
1755
- */
1756
- displayAlert_(w, D, O) {
1757
- const F = document.getElementById(`${w.id}-helper-text`) || document.createElement("p");
1758
- F.textContent = D, this.#e.set(w, F);
1759
- }
1760
- /**
1761
- * Check validation for a single field
1762
- * @param {HTMLInputElement} field
1763
- * @return {boolean} True if field is valid
1764
- * @private
1765
- */
1766
- #n(w) {
1767
- this.#i(w);
1768
- let D = !w.willValidate;
1769
- return w.willValidate && (D = w.checkValidity()), D;
1770
- }
1771
- /**
1772
- * Clear alert for a single field
1773
- * @param {HTMLInputElement} field
1774
- * @private
1775
- */
1776
- #i(w) {
1777
- w.classList.remove("error"), this.#e.has(w) && (this.#e.get(w).textContent = ""), this.#e.delete(w);
1778
- }
1779
- /**
1780
- * Display the given error message on the given form field.
1781
- * @param {HTMLInputElement} field
1782
- * @param {string=} opt_msg
1783
- */
1784
- displayFieldError(w, D) {
1785
- const O = D || w.validationMessage;
1786
- w.classList.add("error"), this.displayAlert_(w, O, "alert-error");
1787
- }
1788
- /**
1789
- * Display the given success message on the given form field.
1790
- * @param {HTMLInputElement} field
1791
- * @param {string} message
1792
- */
1793
- displayFieldSuccess(w, D) {
1794
- this.displayAlert_(w, D, "alert-success");
1795
- }
1796
- /**
1797
- * Display the given information message on the given form field.
1798
- * @param {HTMLInputElement} field
1799
- * @param {string} message
1800
- */
1801
- displayFieldInfo(w, D) {
1802
- this.displayAlert_(w, D, "alert-info");
1803
- }
1804
- /**
1805
- * Validate field on change event
1806
- * @param {Event} e
1807
- * @private
1808
- */
1809
- #o(w) {
1810
- this.#n(
1811
- /** @type {HTMLInputElement} */
1812
- w.target
1813
- );
1814
- }
1815
- /**
1816
- * Given a form id, get the form, and intercept and sterilise its submit.
1817
- * Forms that passed through here will not be able to be submitted with a
1818
- * normal submit button anymore, but built in HTML5 Constraint Validation
1819
- * will still function on the form. This way, we can still have a button with
1820
- * type="submit", which will trigger the validation, and we can submit
1821
- * valid forms with xhrio which allows us to add callbacks to them.
1822
- *
1823
- * @param {HTMLFormElement} form The form we want to sterilise.
1824
- * @return {HTMLFormElement}
1825
- */
1826
- #a(w) {
1827
- if (w && this.#s) {
1828
- w.noValidate = !0;
1829
- const D = this.user;
1830
- this.listen(w, EV.SUBMIT, (O) => {
1831
- O.preventDefault(), this.debugMe("Intercepted from SUBMIT"), this.checkAllFields() && D && D.formSubmit(this);
1832
- });
1833
- }
1834
- return w;
1835
- }
1836
- //--[ Round Trip ]--
1837
- /**
1838
- * @param {function(!FormPanel, (string|!ServerFormSuccessJsonType)=): (?|null|Promise<?>)} func
1839
- */
1840
- onSubmitSuccess(w) {
1841
- this.onSubmitSucFunc = w;
1842
- }
1843
- /**
1844
- * Given a 'fetch' reply, replace the form.
1845
- * This simply replaced the form element with what came back from the server
1846
- * and re-reads the scripts.
1847
- * @param {string} reply
1848
- */
1849
- replaceForm(w) {
1850
- if (this.responseObject = splitScripts(w), this.responseObject.html) {
1851
- if (this.redirected) {
1852
- this.removeAllListener();
1853
- const D = this.getElement(), O = D.parentNode;
1854
- this.setElementInternal_(this.responseObject.html), O.replaceChild(this.getElement(), D);
1855
- } else {
1856
- const D = (
1857
- /** @type {!Element} */
1858
- this.responseObject.html.querySelector("form")
1859
- );
1860
- D && replaceNode(D, this.#t);
1861
- const O = (
1862
- /** @type {!Element} */
1863
- this.responseObject.html.querySelector('button[type="submit"]')
1864
- ), F = (
1865
- /** @type {!Element} */
1866
- this.getElement().querySelector('button[type="submit"]')
1867
- );
1868
- O && F && replaceNode(O, F);
1869
- }
1870
- this.enterDocument();
1871
- }
1872
- }
1873
- /**
1874
- * Expects HTML data from a call to the back.
1875
- * @return {Promise} Returns a promise with this panel as value.
1876
- */
1877
- refreshFromFromServer() {
1878
- const w = this.user, D = this.uri;
1879
- return w ? w.fetch(D, this.abortController.signal).then(
1880
- (O) => this.replaceForm(O)
1881
- ) : Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"));
1882
- }
1883
- /**
1884
- * @param {string} reply
1885
- * @return {Promise}
1886
- */
1887
- processSubmitReply(w) {
1888
- this.clearAllValidationErrors();
1889
- let D = !1;
1890
- if (whatType(w) === "object" && w.success)
1891
- return Promise.resolve(this).then(() => {
1892
- this.onSubmitSucFunc(this, w), this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS);
1893
- });
1894
- if (w === "success" ? (this.debugMe(`
1895
- 1.REDIRECTED: ${this.redirected}
1896
- REPLY: ${w}`), D = !0) : w === `redirected_success
1897
- ` ? (this.debugMe(`
1898
- 2.REDIRECTED: ${this.redirected}
1899
- REPLY: ${w}`), D = !0, this.redirected = !1) : (this.debugMe(`
1900
- 3.REDIRECTED: ${this.redirected}
1901
- REPLY: Some form HTML`), this.replaceForm(w)), D && this.redirected)
1902
- return this.debugMe(`
1903
- 4.REDIRECTED: ${this.redirected}
1904
- SUCCESS: ${D}`), this.redirected = !1, Promise.resolve(this);
1905
- if (D)
1906
- return this.debugMe(`
1907
- 5.REDIRECTED: ${this.redirected}
1908
- SUCCESS: ${D}`), Promise.resolve(this).then(() => {
1909
- this.onSubmitSucFunc(this), this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS);
1910
- });
1911
- this.debugMe(`
1912
- 6.REDIRECTED: ${this.redirected}
1913
- SUCCESS: ${D}`);
1914
- }
1915
- }
1916
- class Split extends Component {
1917
- /**
1918
- * Returns the split event type code used for dispatching split events.
1919
- * @return {string} The SPLIT event type
1920
- */
1921
- static splitEventCode() {
1922
- return UiEventType.SPLIT;
1923
- }
1924
- /**
1925
- * Creates a new Split component instance. Initializes nest tracking and
1926
- * callback management.
1927
- */
1928
- constructor() {
1929
- super(), this.dragImage_ = document.createElement("canvas"), this.nestMap_ = /* @__PURE__ */ new Map(), this.nestCallbackMap_ = /* @__PURE__ */ new Map(), this.splitNests_ = /* @__PURE__ */ new Set();
1930
- }
1931
- /**
1932
- * Returns all nest entries (name and config object) that have a valid element.
1933
- * @return {!Array<!Array<string, !Object>>} Array of [nestName, nestConfig] pairs
1934
- */
1935
- get nests() {
1936
- return [...this.nestMap_.entries()].filter(([w, { nestEl: D }]) => D);
1937
- }
1938
- /**
1939
- * Gets the nest element for a given nest name.
1940
- * @param {string} nestName The nest name to look up
1941
- * @return {!Element | undefined} The nest element, or undefined if not found
1942
- */
1943
- getNest(w) {
1944
- return this.nestMap_.get(w)?.nestEl;
1945
- }
1946
- /**
1947
- * Returns the names of all nests that haven't been further split.
1948
- * @return {!Array<string>} Array of nest names
1949
- */
1950
- get nestNames() {
1951
- return [...this.nestMap_.entries()].filter(([w, D]) => !this.splitNests_.has(D)).map(([w]) => w);
1952
- }
1953
- /**
1954
- * Closes and locks all nests in this split component.
1955
- * @param {!Function=} callback Callback to execute after each nest closes
1956
- * @param {boolean=} opt_skipAni If true, skips animation
1957
- */
1958
- closeAndLockAll(w = identity, D = !1) {
1959
- this.nestNames.forEach((O) => this.closeAndLock(O, w, D));
1960
- }
1961
- /**
1962
- * Opens and unlocks all nests in this split component.
1963
- * @param {!Function=} callback Callback to execute after each nest opens
1964
- * @param {boolean=} opt_skipAni If true, skips animation
1965
- */
1966
- openAndUnlockAll(w = identity, D = !1) {
1967
- this.nestNames.forEach((O) => this.openAndUnlock(O, w, D));
1968
- }
1969
- // ---------------------------------------------------------------------------
1970
- /**
1971
- * Lock a dragger. Removes the listeners that make it draggable.
1972
- * Adds the 'locked' class to the element.
1973
- * Sets the element's "display" style to none.
1974
- * Even though all these operations are performed on the the dragger, access
1975
- * is vai the nest name - for consistency with the rest of the API.
1976
- * @param {string} nestName Nest name
1977
- */
1978
- lock(w) {
1979
- const { dragEl: D } = this.nestMap_.get(w);
1980
- D.classList.add("locked");
1981
- }
1982
- /**
1983
- * The reverse of a lock. Removes the classes added by <@code>lock</> and
1984
- * restores the draggable listeners.
1985
- * Even though all these operations are performed on the the dragger, access
1986
- * is vai the nest name - for consistency with the rest of the API.
1987
- * @param {string} nestName Nest name
1988
- */
1989
- unlock(w) {
1990
- const { dragEl: D } = this.nestMap_.get(w);
1991
- D.classList.remove("locked");
1992
- }
1993
- /**
1994
- * Resize a nest.
1995
- * @param {string} nestName Nest name
1996
- * @param {number} size The required size of the resulting move.
1997
- * @param {Function?} callback A callback function to call once
1998
- * the resize completed.
1999
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2000
- * simply affected directly.
2001
- */
2002
- resize(w, D, O = identity, F = !1) {
2003
- const { sizeNow: q, nestEl: W, canResize: Y } = this.nestMap_.get(w);
2004
- Y && (F || q === D ? (W.classList.remove("animated"), W.style.flexBasis = `${D}px`, this.nestMap_.get(w).sizeNow = D, O()) : (W.classList.add("animated"), this.nestCallbackMap_.set(w, () => {
2005
- W.classList.remove("animated"), this.nestMap_.get(w).sizeNow = D, O();
2006
- }), W.style.flexBasis = `${D}px`));
2007
- }
2008
- /**
2009
- * Close the nest and lock it. See <@code>lock</>
2010
- * @param {string} nestName Nest name
2011
- * @param {Function?} callback A callback function to call once
2012
- * the resize completed.
2013
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2014
- * simply affected directly.
2015
- */
2016
- closeAndLock(w, D = identity, O = !1) {
2017
- const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
2018
- if (!W)
2019
- return;
2020
- const Y = () => {
2021
- q.classList.add("locked", "closed"), F.classList.add("closed"), D();
2022
- };
2023
- this.resize(w, 0, Y, O);
2024
- }
2025
- closeAndUnlock(w, D = identity, O = !1) {
2026
- const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
2027
- if (!W)
2028
- return;
2029
- const Y = () => {
2030
- F.classList.remove("closed"), q.classList.remove("closed", "locked"), q.classList.add("collapsed"), D();
2031
- };
2032
- this.resize(w, 0, Y, O);
2033
- }
2034
- /**
2035
- * Open a closed and locked nest. Simply a convenience method to combine
2036
- * the unlock and resize steps.
2037
- * @param {string} nestName Nest name
2038
- * @param {number?} size The required size of the resulting move.
2039
- * @param {Function?} callback A callback function to call once
2040
- * the resize completed.
2041
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2042
- * simply affected directly.
2043
- */
2044
- openAndUnlock(w, D, O, F = !1) {
2045
- const {
2046
- nestEl: q,
2047
- dragEl: W,
2048
- defSize: Y,
2049
- lastSize: G,
2050
- canResize: K
2051
- } = this.nestMap_.get(w);
2052
- if (!K)
2053
- return;
2054
- const Q = D || G || Y;
2055
- q.classList.remove("closed"), W.classList.remove("closed", "locked", "collapsed"), setTimeout(() => {
2056
- this.resize(w, Q, O, F);
2057
- }, 50);
2058
- }
2059
- /**
2060
- * Open a closed and locked nest. Keep the nest locked.
2061
- * @param {string} nestName Nest name
2062
- * @param {number?} size The required size of the resulting move.
2063
- * @param {Function?} callback A callback function to call once
2064
- * the resize completed.
2065
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2066
- * simply affected directly.
2067
- */
2068
- openAndLock(w, D, O, F = !1) {
2069
- const {
2070
- nestEl: q,
2071
- dragEl: W,
2072
- defSize: Y,
2073
- lastSize: G,
2074
- canResize: K
2075
- } = this.nestMap_.get(w);
2076
- if (!K)
2077
- return;
2078
- const Q = D || G || Y;
2079
- q.classList.remove("closed"), W.classList.remove("closed", "collapsed"), setTimeout(() => {
2080
- this.resize(w, Q, O, F);
2081
- }, 50);
2082
- }
2083
- /**
2084
- * Close nest. Move it out the way, but continue to make it draggable;
2085
- * to the nest and dragger.
2086
- * @param {string} nestName Nest name
2087
- * @param {Function|undefined} callback A callback function to call once
2088
- * the resize completed.
2089
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2090
- * simply affected directly.
2091
- */
2092
- close(w, D = identity, O = !1) {
2093
- const { dragEl: F, canResize: q, nestEl: W } = this.nestMap_.get(w);
2094
- if (!q)
2095
- return;
2096
- this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE, { nestName: w, nestEl: W });
2097
- const Y = () => {
2098
- F.classList.add("collapsed"), this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE, { nestName: w, nestEl: W }), D();
2099
- };
2100
- this.resize(w, 0, Y, O);
2101
- }
2102
- /**
2103
- * Open the nest ignoring its current locked state.
2104
- * @param {string} nestName Nest name
2105
- * @param {Function|undefined} callback A callback function to call once
2106
- * the resize completed.
2107
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2108
- * simply affected directly.
2109
- */
2110
- open(w, D = identity, O = !1) {
2111
- const { defSize: F, lastSize: q, dragEl: W, canResize: Y, nestEl: G } = this.nestMap_.get(w);
2112
- if (!Y)
2113
- return;
2114
- this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN, { nestName: w, nestEl: G }), W.classList.remove("collapsed", "closed");
2115
- const K = q || F, Q = () => {
2116
- this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN, { nestName: w, nestEl: G }), D();
2117
- };
2118
- this.resize(w, K, Q, O);
2119
- }
2120
- /**
2121
- * Close the nest ignoring its current locked state.
2122
- * @param {string} nestName Nest name
2123
- * @param {Function|undefined} callback A callback function to call once
2124
- * the resize completed.
2125
- * @param {boolean?} opt_skipAni When true, the resize won't be animated, but
2126
- * simply affected directly.
2127
- */
2128
- toggle(w, D, O = !1) {
2129
- this.nestMap_.get(w).sizeNow === 0 ? this.open(w, D, O) : this.close(w, D, O);
2130
- }
2131
- //----------------------------------------------------------------------------
2132
- /**
2133
- * Split an element into parts, each separated by a dragger component.
2134
- * The split creates 3 new elements inside root element. Thus it is not
2135
- * truly splitting the reference element, but rather overlaying the
2136
- * split functionality over the reference element.
2137
- * A split can be either horizontal - called "EW" (east-west) or
2138
- * vertical - called "NS" (north-south).
2139
- * By convention the new elements created are called 'nests', and are named
2140
- * in order "A", "B" and "C" respectively.
2141
- * For EW splits the we name from left to right:
2142
- * A B C
2143
- * For NS splits we name from top to bottom:
2144
- * A
2145
- * B
2146
- * C
2147
- * Each newly created nest is a valid root for further splitting.
2148
- * When a nest is split, the resultant nests names are prepended with the
2149
- * name of the root nest that was split.
2150
- * Example: If nest C is split, the resultant nests are named CA, CB, and CC.
2151
- * When one of these (for example CA) is split further, the pattern continues
2152
- * with the resulting nests being CAA, CAB, CAC etc.
2153
- * @param {Element=} opt_el The element to split. If not given, the
2154
- * components own element is used. Else, the element is checked to be
2155
- * a member of this split-group, and if so, is split.
2156
- * @param {?string} orientation Only 'EW' or 'NS'. Defaults to 'EW'
2157
- * @param {?number} defSizeA Default size of the 'A' nest.
2158
- * @param {?number} defSizeC Default size of the 'C' nest. The 'B' nest gets the
2159
- * remainder of the 'A' and 'C' nests, and can not be set directly.
2160
- * @param {?Array<string>} classArrA Extra class names to be added to this nest
2161
- * @param {?Array<string>} classArrB Extra class names to be added to this nest
2162
- * @param {?Array<string>} classArrC Extra class names to be added to this nest
2163
- * @param {?Array<string>} classArrDragger Extra classes for the dragger element
2164
- * @param {?Array<string>} classArrGrabber Extra classes for the grabber element
2165
- */
2166
- addSplit(w = void 0, D = "EW", O = 100, F = 100, q = [], W = [], Y = [], G = [], K = []) {
2167
- const Q = w || this.getElement();
2168
- if (this.splitNests_.has(Q))
2169
- return ["Already used!", Q];
2170
- convertElToSplit(Q, D), this.splitNests_.add(Q);
2171
- let tt = "";
2172
- if (w) {
2173
- const it = [...this.nestMap_.entries()].find(([at, { nestEl: lt }]) => lt === w);
2174
- if (it)
2175
- tt = it[0];
2176
- else
2177
- return ["Element not managed by this component", w];
2178
- }
2179
- const J = `${tt}A`, X = makeOuterNest(O, ["zoo_nest__A", J, ...q]), Z = new Dragger(D);
2180
- Z.domFunc = makeDraggerEl([`zoo_drag_${J}`, ...G], K), Z.render(Q), this.nestMap_.set(J, {
2181
- side: "A",
2182
- nestEl: X,
2183
- dragger: Z,
2184
- dragEl: Z.getElement(),
2185
- defSize: O,
2186
- sizeNow: -1,
2187
- canResize: !0
2188
- });
2189
- const et = `${tt}B`, st = makeInnerNest(["zoo_nest__B", et, ...W]);
2190
- this.nestMap_.set(et, { nestEl: st, canResize: !1 });
2191
- const rt = `${tt}C`, nt = new Dragger(D);
2192
- nt.domFunc = makeDraggerEl([`zoo_drag_${rt}`, ...G], K), nt.render(Q);
2193
- const ot = makeOuterNest(F, ["zoo_nest__C", rt, ...Y]);
2194
- this.nestMap_.set(rt, {
2195
- side: "C",
2196
- nestEl: ot,
2197
- dragger: nt,
2198
- dragEl: nt.getElement(),
2199
- defSize: F,
2200
- sizeNow: -1,
2201
- canResize: !0
2202
- }), [X, Z.getElement(), st, nt.getElement(), ot].forEach((it) => Q.appendChild(it));
2203
- let ct = 0;
2204
- const ht = (it, at, lt, ft) => {
2205
- let ut;
2206
- const dt = it === "NS" ? "height" : "width", gt = it === "NS" ? "deltaY" : "deltaX";
2207
- return (pt) => {
2208
- switch (pt.detail.value_) {
2209
- case UiEventType.COMP_DRAG_START:
2210
- ut = at.getBoundingClientRect()[dt], ct = st.getBoundingClientRect()[dt] + ut, this.nestMap_.get(lt).dragEl.classList.remove("collapsed");
2211
- break;
2212
- case UiEventType.COMP_DRAG_MOVE: {
2213
- const mt = Math.min(ct, ut + ft * pt.detail.data_[gt]);
2214
- this.nestMap_.get(lt).lastSize = mt, at.style.flexBasis = mt + "px";
2215
- break;
2216
- }
2217
- case UiEventType.COMP_DRAG_END:
2218
- this.dispatchSplitEvent(UiEventType.COMP_DRAG_END, this.nestMap_.get(lt));
2219
- break;
2220
- }
2221
- };
2222
- };
2223
- this.listen(Z, Component.compEventCode(), ht(D, X, J, 1)), this.listen(nt, Component.compEventCode(), ht(D, ot, rt, -1)), this.listen(Z.getElement(), EV.DBLCLICK, () => this.toggle(J)), this.listen(nt.getElement(), EV.DBLCLICK, () => this.toggle(rt)), this.listen(Z.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(J)), this.listen(nt.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(rt)), this.listen(X, EV.TRANSITIONEND, (it) => {
2224
- if (it.propertyName === "flex-basis" && it.target === X) {
2225
- const at = this.nestCallbackMap_.get(J);
2226
- this.nestCallbackMap_.delete(J), at && at(), this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END, this.nestMap_.get(J));
2227
- }
2228
- }), this.listen(ot, EV.TRANSITIONEND, (it) => {
2229
- if (it.propertyName === "flex-basis" && it.target === ot) {
2230
- const at = this.nestCallbackMap_.get(rt);
2231
- this.nestCallbackMap_.delete(rt), at && at(), this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END, this.nestMap_.get(rt));
2232
- }
2233
- });
2234
- }
2235
- //--[ Built in events ]--
2236
- /**
2237
- * Dispatches a {@code UiEventType.SPLIT} event.
2238
- * Views may listen just to this event, and act on the supplied value or
2239
- * data payload.
2240
- * @param {string|number} value
2241
- * @param {(string|number|?Object)=} opt_data
2242
- * @return {boolean} If anyone called preventDefault on the event object (or
2243
- * if any of the handlers returns false this will also return false.
2244
- */
2245
- dispatchSplitEvent(w, D) {
2246
- const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.SPLIT, O);
2247
- return this.dispatchEvent(F);
2248
- }
2249
- }
2250
- const convertElToSplit = (U, w) => (U.classList.add("zoo_split", `zoo_split__${w.toLowerCase()}`), U), makeOuterNest = (U, w = []) => {
2251
- const D = document.createElement("div");
2252
- return D.setAttribute("id", randomId(7)), D.classList.add("zoo_nest", "zoo_nest__outer", ...w), D.style.flexBasis = U + "px", D;
2253
- }, makeInnerNest = (U = []) => {
2254
- const w = document.createElement("div");
2255
- return w.setAttribute("id", randomId(7)), w.classList.add("zoo_nest", "zoo_nest__inner", ...U), w;
2256
- }, makeDraggerEl = (U = [], w = []) => () => {
2257
- const D = document.createElement("div");
2258
- D.setAttribute("id", randomId(7)), D.classList.add("zoo_dragger", ...U);
2259
- const O = document.createElement("div");
2260
- return O.classList.add("zoo_grabber", ...w), D.appendChild(O), D;
2261
- }, needsToScroll = (U) => {
2262
- const D = U.getBoundingClientRect().bottom;
2263
- return (O) => O.getBoundingClientRect().bottom > D;
2264
- }, treeNodeSelect = (U) => (w) => {
2265
- const D = U.getElement().querySelector(".zv_tree_container"), O = needsToScroll(D), F = U.getElement().querySelectorAll(".tree-node");
2266
- let q;
2267
- [...F].forEach((W) => {
2268
- enableClass(W, "mdc-deprecated-list-item--activated", W.id === `tree-node_${w}`), W.id === `tree-node_${w}` && (q = W);
2269
- }), q && O(q) && q.scrollIntoView(!1);
2270
- }, toggleTree = (U, w) => {
2271
- const D = w.getElement().querySelector(".children"), O = (
2272
- /**@type {boolean} */
2273
- U.isOn
2274
- ), F = w.getElement().querySelectorAll(".children"), q = w.getElement().querySelectorAll(".zoo__reveal_icon");
2275
- [...F].forEach((W) => enableClass(
2276
- W,
2277
- "zoo__tree-children__hidden",
2278
- W !== D && !O
2279
- )), [...q].forEach((W) => enableClass(
2280
- W,
2281
- "zoo__icon_rotated",
2282
- W !== D && !O
2283
- ));
2284
- }, toggleTreeChildren = (U, w) => {
2285
- const D = w.trigger, O = D.getAttribute("data-child-id"), F = U.getElement().querySelector(`#${O}`);
2286
- toggleClass(F, "zoo__tree-children__hidden"), toggleClass(D, "zoo__icon_rotated");
2287
- }, _openTreeFromNodeUp = (U, w) => {
2288
- const D = w.parentElement;
2289
- D.classList.contains("children") && (enableClass(D, "zoo__tree-children__hidden", !1), _openTreeFromNodeUp(U, D));
2290
- }, treeUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2291
- __proto__: null,
2292
- _openTreeFromNodeUp,
2293
- toggleTree,
2294
- toggleTreeChildren,
2295
- treeNodeSelect
2296
- }, Symbol.toStringTag, { value: "Module" })), MdcTreeHandlers = {
2297
- /**
2298
- * Toggle the entire tree open or closed.
2299
- * First level children remain open for better UX.
2300
- *
2301
- * @param {Object} eventData - Event data with isOn boolean
2302
- * @param {Panel} ePanel - The panel containing the tree
2303
- */
2304
- toggle_tree: function(U, w) {
2305
- toggleTree(U, w);
2306
- },
2307
- /**
2308
- * Toggle children visibility for a specific tree node.
2309
- *
2310
- * @param {Object} eventData - Event data with trigger element
2311
- * @param {Panel} ePanel - The panel containing the tree
2312
- */
2313
- "tree_toggle-children": function(U, w) {
2314
- toggleTreeChildren(w, U);
2315
- }
2316
- }, SearchHandlers = {
2317
- /**
2318
- * Perform search with query string construction.
2319
- * Builds href with search query and additional query parameters.
2320
- *
2321
- * @param {Object} eventData - Event data with href, formData.q, and targetval
2322
- * @param {Panel} ePanel - The panel to update
2323
- */
2324
- search: function(U, w) {
2325
- let D = `${U.href}`;
2326
- const O = U.formData.q, F = U.targetval;
2327
- if (O !== "" && (D = `${D}?q=${O}`), F !== "") {
2328
- let q = F;
2329
- F.includes("page=") && (q = F.split("&").filter((W) => !W.includes("page=")).join("&")), D = O !== "" ? `${D}&${q}` : `${D}?${q}`;
2330
- }
2331
- this.user.fetchAndSplit(D, w.abortController.signal).then(
2332
- (q) => w.onReplacePartialDom(q, U.zvptarget)
2333
- );
2334
- },
2335
- /**
2336
- * Reset search form and query parameters.
2337
- * Clears the 'q' field in the closest form and removes 'q' from query params.
2338
- *
2339
- * @param {Object} eventData - Event data with trigger element
2340
- * @param {Panel} ePanel - The panel to update
2341
- */
2342
- reset_search: function(U, w) {
2343
- const D = U.trigger.closest("form");
2344
- w.removeFromQParams("q"), D.elements.q.value = "", D.dispatchEvent(new Event("submit"));
2345
- }
2346
- }, QueryParamHandlers = {
2347
- /**
2348
- * Handle pagination by fetching content with query parameters.
2349
- *
2350
- * @param {Object} eventData - Event data with href and targetval for pagination
2351
- * @param {Panel} ePanel - The panel to update
2352
- */
2353
- paginate: function(U, w) {
2354
- const D = `${U.href}?${U.targetval}`;
2355
- this.user.fetchAndSplit(D, w.abortController.signal).then(
2356
- (O) => w.onReplacePartialDom(O, U.zvptarget)
2357
- );
2358
- },
2359
- /**
2360
- * Handle list filtering with query parameters.
2361
- *
2362
- * @param {Object} eventData - Event data with href and targetval for filtering
2363
- * @param {Panel} ePanel - The panel to update
2364
- */
2365
- list_filter: function(U, w) {
2366
- const D = `${U.href}?${U.targetval}`;
2367
- this.user.fetchAndSplit(D, w.abortController.signal).then(
2368
- (O) => w.onReplacePartialDom(O, U.zvptarget)
2369
- );
2370
- }
2371
- }, handlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2372
- __proto__: null,
2373
- MdcTreeHandlers,
2374
- QueryParamHandlers,
2375
- SearchHandlers
2376
- }, Symbol.toStringTag, { value: "Module" }));
2377
- class View extends Evt {
2378
- #t = void 0;
2379
- #e = void 0;
2380
- #s = {};
2381
- //--[ Static ]--
2382
- /**
2383
- * Returns the view event type code used for dispatching view events.
2384
- * @return {string} The VIEW event type
2385
- */
2386
- static viewEventCode() {
2387
- return UiEventType.VIEW;
2388
- }
2389
- /**
2390
- * Creates a new View instance. Initializes panel management, event handling,
2391
- * and metadata storage.
2392
- */
2393
- constructor() {
2394
- super(), this.panelMap = /* @__PURE__ */ new Map(), this.user_ = void 0, this.split_ = void 0, this.panelEventMap_ = this.initPanelEventsInternal_(), this.switchViewMap_ = /* @__PURE__ */ new Map(), this.metaData_ = /* @__PURE__ */ new Map();
2395
- }
2396
- set recordHistory(w) {
2397
- this.#e = w;
2398
- }
2399
- get recordHistory() {
2400
- return this.#e;
2401
- }
2402
- set registerViewConstructor(w) {
2403
- this.#t = w;
2404
- }
2405
- get registerViewConstructor() {
2406
- return this.#t;
2407
- }
2408
- set utils(w) {
2409
- this.#s = w;
2410
- }
2411
- get utils() {
2412
- return this.#s;
2413
- }
2414
- set split(w) {
2415
- this.split_ = w, this.listen(this.split_, UiEventType.SPLIT, (D) => {
2416
- const O = D.detail.getValue(), F = D.detail.getData();
2417
- switch (O) {
2418
- case UiEventType.SPLIT_WILL_OPEN:
2419
- this.onSplitWillOpen(F);
2420
- break;
2421
- case UiEventType.SPLIT_WILL_CLOSE:
2422
- this.onSplitWillClose(F);
2423
- break;
2424
- case UiEventType.SPLIT_DID_CLOSE:
2425
- this.onSplitDidClose(F);
2426
- break;
2427
- case UiEventType.SPLIT_DID_OPEN:
2428
- this.onSplitDidOpen(F);
2429
- break;
2430
- case UiEventType.SPLIT_TRANSITION_END:
2431
- break;
2432
- }
2433
- });
2434
- }
2435
- get split() {
2436
- if (!this.split_)
2437
- throw new Error("No SPLIT component available");
2438
- return this.split_;
2439
- }
2440
- /**
2441
- * @param {!UserManager} user
2442
- */
2443
- set user(w) {
2444
- this.user_ = w, this.panelMap.forEach((D) => D.user = w);
2445
- }
2446
- /**
2447
- * @return {!UserManager}
2448
- */
2449
- get user() {
2450
- return this.user_ || (this.user_ = new UserManager()), this.user_;
2451
- }
2452
- /**
2453
- * Render each of the panels in this view.
2454
- */
2455
- render() {
2456
- this.initPanelEvents(), this.preRender(), this.configurePanels(), this.displayPanels(), this.postRender();
2457
- }
2458
- /**
2459
- * Placeholder for subclasses to add panel event functions.
2460
- */
2461
- initPanelEvents() {
2462
- }
2463
- /**
2464
- * Run before the render.
2465
- */
2466
- preRender() {
2467
- }
2468
- /**
2469
- * Placeholder for panel configuration functionality;
2470
- */
2471
- configurePanels() {
2472
- }
2473
- /**
2474
- * Placeholder for panel display functionality;
2475
- */
2476
- displayPanels() {
2477
- }
2478
- /**
2479
- * Placeholder for post render functionality.
2480
- */
2481
- postRender() {
2482
- }
2483
- /**
2484
- * @inheritDoc
2485
- */
2486
- dispose() {
2487
- [...this.panelMap.values()].forEach((w) => w.dispose()), super.dispose();
2488
- }
2489
- /**
2490
- * Add a panel as a child of the view.
2491
- * @param {string} name The name of the panel - used as a key in the panel map.
2492
- * @param {!Panel} panel The panel itself.
2493
- */
2494
- addPanelToView(w, D) {
2495
- D.user = this.user, this.removePanelByName(w), this.panelMap.set(w, D), this.listen(D, Panel.panelEventCode(), this.onPanelEvent.bind(this));
2496
- }
2497
- /**
2498
- * Remove a panel from the view by name.
2499
- * @param {string} name The name of the panel - used as a key in the panel map.
2500
- */
2501
- removePanelByName(w) {
2502
- this.panelMap.has(w) && this.panelMap.get(w).dispose();
2503
- }
2504
- /**
2505
- * @param {Panel} panel
2506
- */
2507
- removePanel(w) {
2508
- const [D, O] = [...this.panelMap.entries()].find(([F, q]) => q === w);
2509
- D && O && (O.dispose(), this.panelMap.delete(D));
2510
- }
2511
- /**
2512
- * @param {string} name
2513
- * @return {Panel|undefined}
2514
- */
2515
- getPanelByName(w) {
2516
- return this.panelMap.get(w);
2517
- }
2518
- /**
2519
- * Broadcasts data to all panels in this view. Each panel receives the data
2520
- * via its onViewDataBroadcast method.
2521
- * @param {*} data The data to broadcast to all panels
2522
- */
2523
- broadcastToPanels(w) {
2524
- [...this.panelMap.values()].forEach((D) => D.onViewDataBroadcast(w));
2525
- }
2526
- /**
2527
- * Initializes the internal panel event map with default event handlers.
2528
- * Sets up handlers for panel lifecycle and view coordination.
2529
- *
2530
- * Note: This method also registers application-specific handlers (search,
2531
- * pagination, etc.) for backwards compatibility. These will be removed in
2532
- * a future version - applications should explicitly register handlers they need.
2533
- *
2534
- * @return {!Map<string, !Function>} Map of event names to handler functions
2535
- * @private
2536
- */
2537
- initPanelEventsInternal_() {
2538
- const w = /* @__PURE__ */ new Map();
2539
- return w.set("destroy_me", (D, O) => {
2540
- this.removePanel(O);
2541
- }), w.set("switch_view", (D, O) => {
2542
- this.debugMe("switch_view received: eventData", D);
2543
- const F = D.view;
2544
- this.switchViewMap_.has(F) ? this.switchViewMap_.get(F)(D, O) : this.debugMe("NO VIEW FOUND FOR:", F, this.switchViewMap_);
2545
- }), Object.entries({
2546
- ...SearchHandlers,
2547
- ...QueryParamHandlers
2548
- }).forEach(([D, O]) => {
2549
- w.set(D, O.bind(this));
2550
- }), w;
2551
- }
2552
- /**
2553
- * Maps a panel event name to a handler function. Allows dynamic registration
2554
- * of custom panel event handlers at runtime.
2555
- * @param {string} s The event name to map
2556
- * @param {!Function} func The handler function that receives (eventData, ePanel)
2557
- */
2558
- mapPanEv(w, D) {
2559
- this.panelEventMap_.set(w, D);
2560
- }
2561
- /**
2562
- * A map of string to function where the function receives an object and
2563
- * a panel.
2564
- * @param {string} s
2565
- * @param {function(
2566
- * {view:string, pk:string, emit:string, href:string}, Panel):?} func
2567
- */
2568
- mapSwitchView(w, D) {
2569
- this.switchViewMap_.set(w, D);
2570
- }
2571
- /**
2572
- * @param {!CustomEvent} e
2573
- */
2574
- onPanelEvent(w) {
2575
- let D = w.detail.getValue();
2576
- const O = w.detail.getData();
2577
- D.startsWith("switch_view:") && (O.view = D.split(":")[1], D = "switch_view");
2578
- const F = (
2579
- /** @type {Panel} */
2580
- w.target
2581
- );
2582
- this.panelEventMap_.has(D) ? this.panelEventMap_.get(D)(O, F) : this.debugMe(`NO EVENT MATCH - This usually you are missing
2583
- a "mapPanEv(${D} ..." statement in your panel JS
2584
- or you have a "event='${D}'" attribute in your panel HTML`, {
2585
- event: w,
2586
- eventValue: D,
2587
- eventData: O,
2588
- panel: F.constructor.name
2589
- });
2590
- }
2591
- //--[ Split Events ]--
2592
- /**
2593
- * Triggered before a split will open.
2594
- *
2595
- * @param {{nestName: !string, nestEl:!HTMLElement}} _data
2596
- */
2597
- onSplitWillOpen(w) {
2598
- }
2599
- /**
2600
- * Triggered before a split will close.
2601
- *
2602
- * @param {{nestName: !string, nestEl:!HTMLElement}} _data
2603
- */
2604
- onSplitWillClose(w) {
2605
- }
2606
- /**
2607
- * Triggered after a split closed.
2608
- *
2609
- * @param {{nestName: !string, nestEl:!HTMLElement}} _data
2610
- */
2611
- onSplitDidClose(w) {
2612
- }
2613
- /**
2614
- * Triggered after a split opened.
2615
- *
2616
- * @param {{nestName: !string, nestEl:!HTMLElement}} _data
2617
- */
2618
- onSplitDidOpen(w) {
2619
- }
2620
- //--[ Built in events ]--
2621
- /**
2622
- * Dispatches a {@code UiEventType.VIEW} event.
2623
- * A shorthand method to get panels to dispatch uniform events.
2624
- * Views may listen just to this event, and act on the supplied value or
2625
- * data payload.
2626
- * Example:
2627
- * b.listen(a, Component.compEventCode(), e => {
2628
- * console.log('B got', Component.compEventCode(), e);
2629
- * console.log('Value is', e.detail.getValue());
2630
- * console.log('Data is', e.detail.getData());
2631
- * });
2632
- * @param {string|number} value
2633
- * @param {(string|number|?Object)=} opt_data
2634
- * @return {boolean} If anyone called preventDefault on the event object (or
2635
- * if any of the handlers returns false this will also return false.
2636
- */
2637
- dispatchViewEvent(w, D) {
2638
- const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.VIEW, O);
2639
- return this.dispatchEvent(F);
2640
- }
2641
- //--[ Meta Data ]--
2642
- /**
2643
- * Returns the metadata map associated with this view.
2644
- * @return {!Map<string, *>} The metadata map
2645
- */
2646
- get metaData() {
2647
- return this.metaData_;
2648
- }
2649
- /**
2650
- * Sets a metadata key-value pair for this view.
2651
- * @param {string} k The metadata key
2652
- * @param {*} v The metadata value
2653
- * @return {!Map<string, *>} The updated metadata map
2654
- */
2655
- setMetaData(w, D) {
2656
- return this.metaData_.set(w, D), this.metaData;
2657
- }
2658
- /**
2659
- * Retrieves a metadata value by key.
2660
- * @param {string} k The metadata key
2661
- * @return {*} The metadata value, or undefined if not found
2662
- */
2663
- getMetaData(w) {
2664
- return this.metaData_.get(w);
2665
- }
2666
- /**
2667
- * Checks if a metadata key exists.
2668
- * @param {string} k The metadata key
2669
- * @return {boolean} True if the key exists, false otherwise
2670
- */
2671
- hasMetaData(w) {
2672
- return this.metaData_.has(w);
2673
- }
2674
- }
2675
- function _isPlaceholder(U) {
2676
- return U != null && typeof U == "object" && U["@@functional/placeholder"] === !0;
2677
- }
2678
- function _curry1(U) {
2679
- return function w(D) {
2680
- return arguments.length === 0 || _isPlaceholder(D) ? w : U.apply(this, arguments);
2681
- };
2682
- }
2683
- function _curry2(U) {
2684
- return function w(D, O) {
2685
- switch (arguments.length) {
2686
- case 0:
2687
- return w;
2688
- case 1:
2689
- return _isPlaceholder(D) ? w : _curry1(function(F) {
2690
- return U(D, F);
2691
- });
2692
- default:
2693
- return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry1(function(F) {
2694
- return U(F, O);
2695
- }) : _isPlaceholder(O) ? _curry1(function(F) {
2696
- return U(D, F);
2697
- }) : U(D, O);
2698
- }
2699
- };
2700
- }
2701
- function _concat(U, w) {
2702
- U = U || [], w = w || [];
2703
- var D, O = U.length, F = w.length, q = [];
2704
- for (D = 0; D < O; )
2705
- q[q.length] = U[D], D += 1;
2706
- for (D = 0; D < F; )
2707
- q[q.length] = w[D], D += 1;
2708
- return q;
2709
- }
2710
- function _arity(U, w) {
2711
- switch (U) {
2712
- case 0:
2713
- return function() {
2714
- return w.apply(this, arguments);
2715
- };
2716
- case 1:
2717
- return function(D) {
2718
- return w.apply(this, arguments);
2719
- };
2720
- case 2:
2721
- return function(D, O) {
2722
- return w.apply(this, arguments);
2723
- };
2724
- case 3:
2725
- return function(D, O, F) {
2726
- return w.apply(this, arguments);
2727
- };
2728
- case 4:
2729
- return function(D, O, F, q) {
2730
- return w.apply(this, arguments);
2731
- };
2732
- case 5:
2733
- return function(D, O, F, q, W) {
2734
- return w.apply(this, arguments);
2735
- };
2736
- case 6:
2737
- return function(D, O, F, q, W, Y) {
2738
- return w.apply(this, arguments);
2739
- };
2740
- case 7:
2741
- return function(D, O, F, q, W, Y, G) {
2742
- return w.apply(this, arguments);
2743
- };
2744
- case 8:
2745
- return function(D, O, F, q, W, Y, G, K) {
2746
- return w.apply(this, arguments);
2747
- };
2748
- case 9:
2749
- return function(D, O, F, q, W, Y, G, K, Q) {
2750
- return w.apply(this, arguments);
2751
- };
2752
- case 10:
2753
- return function(D, O, F, q, W, Y, G, K, Q, tt) {
2754
- return w.apply(this, arguments);
2755
- };
2756
- default:
2757
- throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
2758
- }
2759
- }
2760
- function _curryN(U, w, D) {
2761
- return function() {
2762
- for (var O = [], F = 0, q = U, W = 0, Y = !1; W < w.length || F < arguments.length; ) {
2763
- var G;
2764
- W < w.length && (!_isPlaceholder(w[W]) || F >= arguments.length) ? G = w[W] : (G = arguments[F], F += 1), O[W] = G, _isPlaceholder(G) ? Y = !0 : q -= 1, W += 1;
2765
- }
2766
- return !Y && q <= 0 ? D.apply(this, O) : _arity(Math.max(0, q), _curryN(U, O, D));
2767
- };
2768
- }
2769
- var curryN = /* @__PURE__ */ _curry2(function U(w, D) {
2770
- return w === 1 ? _curry1(D) : _arity(w, _curryN(w, [], D));
2771
- });
2772
- function _curry3(U) {
2773
- return function w(D, O, F) {
2774
- switch (arguments.length) {
2775
- case 0:
2776
- return w;
2777
- case 1:
2778
- return _isPlaceholder(D) ? w : _curry2(function(q, W) {
2779
- return U(D, q, W);
2780
- });
2781
- case 2:
2782
- return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry2(function(q, W) {
2783
- return U(q, O, W);
2784
- }) : _isPlaceholder(O) ? _curry2(function(q, W) {
2785
- return U(D, q, W);
2786
- }) : _curry1(function(q) {
2787
- return U(D, O, q);
2788
- });
2789
- default:
2790
- return _isPlaceholder(D) && _isPlaceholder(O) && _isPlaceholder(F) ? w : _isPlaceholder(D) && _isPlaceholder(O) ? _curry2(function(q, W) {
2791
- return U(q, W, F);
2792
- }) : _isPlaceholder(D) && _isPlaceholder(F) ? _curry2(function(q, W) {
2793
- return U(q, O, W);
2794
- }) : _isPlaceholder(O) && _isPlaceholder(F) ? _curry2(function(q, W) {
2795
- return U(D, q, W);
2796
- }) : _isPlaceholder(D) ? _curry1(function(q) {
2797
- return U(q, O, F);
2798
- }) : _isPlaceholder(O) ? _curry1(function(q) {
2799
- return U(D, q, F);
2800
- }) : _isPlaceholder(F) ? _curry1(function(q) {
2801
- return U(D, O, q);
2802
- }) : U(D, O, F);
2803
- }
2804
- };
2805
- }
2806
- const _isArray = Array.isArray || function U(w) {
2807
- return w != null && w.length >= 0 && Object.prototype.toString.call(w) === "[object Array]";
2808
- };
2809
- function _isTransformer(U) {
2810
- return U != null && typeof U["@@transducer/step"] == "function";
2811
- }
2812
- function _dispatchable(U, w, D) {
2813
- return function() {
2814
- if (arguments.length === 0)
2815
- return D();
2816
- var O = arguments[arguments.length - 1];
2817
- if (!_isArray(O)) {
2818
- for (var F = 0; F < U.length; ) {
2819
- if (typeof O[U[F]] == "function")
2820
- return O[U[F]].apply(O, Array.prototype.slice.call(arguments, 0, -1));
2821
- F += 1;
2822
- }
2823
- if (_isTransformer(O)) {
2824
- var q = w.apply(null, Array.prototype.slice.call(arguments, 0, -1));
2825
- return q(O);
2826
- }
2827
- }
2828
- return D.apply(this, arguments);
2829
- };
2830
- }
2831
- const _xfBase = {
2832
- init: function() {
2833
- return this.xf["@@transducer/init"]();
2834
- },
2835
- result: function(U) {
2836
- return this.xf["@@transducer/result"](U);
2837
- }
2838
- };
2839
- function _has(U, w) {
2840
- return Object.prototype.hasOwnProperty.call(w, U);
2841
- }
2842
- var toString = Object.prototype.toString, _isArguments = /* @__PURE__ */ (function() {
2843
- return toString.call(arguments) === "[object Arguments]" ? function(w) {
2844
- return toString.call(w) === "[object Arguments]";
2845
- } : function(w) {
2846
- return _has("callee", w);
2847
- };
2848
- })(), hasEnumBug = !/* @__PURE__ */ {
2849
- toString: null
2850
- }.propertyIsEnumerable("toString"), nonEnumerableProps = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], hasArgsEnumBug = /* @__PURE__ */ (function() {
2851
- return arguments.propertyIsEnumerable("length");
2852
- })(), contains = function U(w, D) {
2853
- for (var O = 0; O < w.length; ) {
2854
- if (w[O] === D)
2855
- return !0;
2856
- O += 1;
2857
- }
2858
- return !1;
2859
- }, keys = /* @__PURE__ */ _curry1(typeof Object.keys == "function" && !hasArgsEnumBug ? function U(w) {
2860
- return Object(w) !== w ? [] : Object.keys(w);
2861
- } : function U(w) {
2862
- if (Object(w) !== w)
2863
- return [];
2864
- var D, O, F = [], q = hasArgsEnumBug && _isArguments(w);
2865
- for (D in w)
2866
- _has(D, w) && (!q || D !== "length") && (F[F.length] = D);
2867
- if (hasEnumBug)
2868
- for (O = nonEnumerableProps.length - 1; O >= 0; )
2869
- D = nonEnumerableProps[O], _has(D, w) && !contains(F, D) && (F[F.length] = D), O -= 1;
2870
- return F;
2871
- });
2872
- function _map(U, w) {
2873
- for (var D = 0, O = w.length, F = Array(O); D < O; )
2874
- F[D] = U(w[D]), D += 1;
2875
- return F;
2876
- }
2877
- function _arrayReduce(U, w, D) {
2878
- for (var O = 0, F = D.length; O < F; )
2879
- w = U(w, D[O]), O += 1;
2880
- return w;
2881
- }
2882
- var XMap = /* @__PURE__ */ (function() {
2883
- function U(w, D) {
2884
- this.xf = D, this.f = w;
2885
- }
2886
- return U.prototype["@@transducer/init"] = _xfBase.init, U.prototype["@@transducer/result"] = _xfBase.result, U.prototype["@@transducer/step"] = function(w, D) {
2887
- return this.xf["@@transducer/step"](w, this.f(D));
2888
- }, U;
2889
- })(), _xmap = function U(w) {
2890
- return function(D) {
2891
- return new XMap(w, D);
2892
- };
2893
- }, map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function U(w, D) {
2894
- switch (Object.prototype.toString.call(D)) {
2895
- case "[object Function]":
2896
- return curryN(D.length, function() {
2897
- return w.call(this, D.apply(this, arguments));
2898
- });
2899
- case "[object Object]":
2900
- return _arrayReduce(function(O, F) {
2901
- return O[F] = w(D[F]), O;
2902
- }, {}, keys(D));
2903
- default:
2904
- return _map(w, D);
2905
- }
2906
- }));
2907
- const _isInteger = Number.isInteger || function U(w) {
2908
- return w << 0 === w;
2909
- };
2910
- function _nth(U, w) {
2911
- var D = U < 0 ? w.length + U : U;
2912
- return w[D];
2913
- }
2914
- function _prop(U, w) {
2915
- if (w != null)
2916
- return _isInteger(U) ? _nth(U, w) : w[U];
2917
- }
2918
- function _isString(U) {
2919
- return Object.prototype.toString.call(U) === "[object String]";
2920
- }
2921
- var _isArrayLike = /* @__PURE__ */ _curry1(function U(w) {
2922
- return _isArray(w) ? !0 : !w || typeof w != "object" || _isString(w) ? !1 : w.length === 0 ? !0 : w.length > 0 ? w.hasOwnProperty(0) && w.hasOwnProperty(w.length - 1) : !1;
2923
- }), symIterator = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
2924
- function _createReduce(U, w, D) {
2925
- return function(F, q, W) {
2926
- if (_isArrayLike(W))
2927
- return U(F, q, W);
2928
- if (W == null)
2929
- return q;
2930
- if (typeof W["fantasy-land/reduce"] == "function")
2931
- return w(F, q, W, "fantasy-land/reduce");
2932
- if (W[symIterator] != null)
2933
- return D(F, q, W[symIterator]());
2934
- if (typeof W.next == "function")
2935
- return D(F, q, W);
2936
- if (typeof W.reduce == "function")
2937
- return w(F, q, W, "reduce");
2938
- throw new TypeError("reduce: list must be array or iterable");
2939
- };
2940
- }
2941
- var and = /* @__PURE__ */ _curry2(function U(w, D) {
2942
- return w && D;
2943
- });
2944
- function _iterableReduce(U, w, D) {
2945
- for (var O = D.next(); !O.done; )
2946
- w = U(w, O.value), O = D.next();
2947
- return w;
2948
- }
2949
- function _methodReduce(U, w, D, O) {
2950
- return D[O](U, w);
2951
- }
2952
- var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce), ap = /* @__PURE__ */ _curry2(function U(w, D) {
2953
- return typeof D["fantasy-land/ap"] == "function" ? D["fantasy-land/ap"](w) : typeof w.ap == "function" ? w.ap(D) : typeof w == "function" ? function(O) {
2954
- return w(O)(D(O));
2955
- } : _reduce(function(O, F) {
2956
- return _concat(O, map(F, D));
2957
- }, [], w);
2958
- });
2959
- function _assoc(U, w, D) {
2960
- if (_isInteger(U) && _isArray(D)) {
2961
- var O = U < 0 ? D.length + U : U, F = [].concat(D);
2962
- return F[O] = w, F;
2963
- }
2964
- var q = {};
2965
- for (var W in D)
2966
- q[W] = D[W];
2967
- return q[U] = w, q;
2968
- }
2969
- var isNil = /* @__PURE__ */ _curry1(function U(w) {
2970
- return w == null;
2971
- }), assocPath = /* @__PURE__ */ _curry3(function U(w, D, O) {
2972
- if (w.length === 0)
2973
- return D;
2974
- var F = w[0];
2975
- if (w.length > 1) {
2976
- var q = _prop(F, O);
2977
- (isNil(q) || typeof q != "object") && (q = _isInteger(w[1]) ? [] : {}), D = U(Array.prototype.slice.call(w, 1), D, q);
2978
- }
2979
- return _assoc(F, D, O);
2980
- });
2981
- function _isFunction(U) {
2982
- var w = Object.prototype.toString.call(U);
2983
- return w === "[object Function]" || w === "[object AsyncFunction]" || w === "[object GeneratorFunction]" || w === "[object AsyncGeneratorFunction]";
2984
- }
2985
- var liftN = /* @__PURE__ */ _curry2(function U(w, D) {
2986
- var O = curryN(w, D);
2987
- return curryN(w, function() {
2988
- return _arrayReduce(ap, map(O, arguments[0]), Array.prototype.slice.call(arguments, 1));
2989
- });
2990
- }), lift = /* @__PURE__ */ _curry1(function U(w) {
2991
- return liftN(w.length, w);
2992
- }), both = /* @__PURE__ */ _curry2(function U(w, D) {
2993
- return _isFunction(w) ? function() {
2994
- return w.apply(this, arguments) && D.apply(this, arguments);
2995
- } : lift(and)(w, D);
2996
- }), hasPath = /* @__PURE__ */ _curry2(function U(w, D) {
2997
- if (w.length === 0 || isNil(D))
2998
- return !1;
2999
- for (var O = D, F = 0; F < w.length; )
3000
- if (!isNil(O) && _has(w[F], O))
3001
- O = O[w[F]], F += 1;
3002
- else
3003
- return !1;
3004
- return !0;
3005
- }), has = /* @__PURE__ */ _curry2(function U(w, D) {
3006
- return hasPath([w], D);
3007
- });
3008
- function _objectAssign(U) {
3009
- if (U == null)
3010
- throw new TypeError("Cannot convert undefined or null to object");
3011
- for (var w = Object(U), D = 1, O = arguments.length; D < O; ) {
3012
- var F = arguments[D];
3013
- if (F != null)
3014
- for (var q in F)
3015
- _has(q, F) && (w[q] = F[q]);
3016
- D += 1;
3017
- }
3018
- return w;
3019
- }
3020
- const _objectAssign$1 = typeof Object.assign == "function" ? Object.assign : _objectAssign;
3021
- function _path(U, w) {
3022
- for (var D = w, O = 0; O < U.length; O += 1) {
3023
- if (D == null)
3024
- return;
3025
- var F = U[O];
3026
- _isInteger(F) ? D = _nth(F, D) : D = D[F];
3027
- }
3028
- return D;
3029
- }
3030
- var mergeRight = /* @__PURE__ */ _curry2(function U(w, D) {
3031
- return _objectAssign$1({}, w, D);
3032
- }), path = /* @__PURE__ */ _curry2(_path);
3033
- class Conductor extends Evt {
3034
- #t = /* @__PURE__ */ new Map();
3035
- #e = null;
3036
- /**
3037
- * @type {!UserManager|undefined}
3038
- * @private
3039
- */
3040
- #s = void 0;
3041
- #r = void 0;
3042
- #n = /* @__PURE__ */ new Map();
3043
- /**
3044
- * This is a userspace map where consuming applications can register shared functions
3045
- * that are available to all views and panels.
3046
- * @type {{}}
3047
- */
3048
- #i = {};
3049
- /**
3050
- * Creates a new Conductor instance. Sets up browser history listening
3051
- * and initializes view event handling.
3052
- */
3053
- constructor() {
3054
- super(), this.#n = this.#o(), window.addEventListener("popstate", (w) => {
3055
- w.state !== null && this.navTo(w.state);
3056
- }), this.doOnBeat(() => {
3057
- document.dispatchEvent(new CustomEvent("zoo-tick-60", {
3058
- detail: { timestamp: Date.now() }
3059
- }));
3060
- }, 6e4);
3061
- }
3062
- set split(w) {
3063
- this.#r = w;
3064
- }
3065
- get split() {
3066
- if (!this.#r)
3067
- throw new Error("No SPLIT component available");
3068
- return this.#r;
3069
- }
3070
- /**
3071
- * @param {!UserManager} user
3072
- */
3073
- set user(w) {
3074
- this.#s = w, this.#e && (this.#e.user = this.user);
3075
- }
3076
- /**
3077
- * @return {!UserManager}
3078
- */
3079
- get user() {
3080
- return this.#s || (this.#s = new UserManager()), this.#s;
3081
- }
3082
- get utils() {
3083
- return this.#i;
3084
- }
3085
- /**
3086
- * Register utility functions that will be made available to all views.
3087
- * @Example:
3088
- * const myUtil = () => {console.log("hello")};
3089
- * c.registerUtil({myUtil});
3090
- *
3091
- * // Elsewhere in the panel or view code:
3092
- * view.utils.myUtil(); // Prints "hello"
3093
- * @param obj
3094
- */
3095
- registerUtil(w) {
3096
- this.#i = mergeRight(this.#i, w);
3097
- }
3098
- /**
3099
- * Initializes the internal view event map with default event handlers.
3100
- * Sets up handlers for common view events like 'switch_view'.
3101
- * @return {!Map<string, !Function>} Map of event names to handler functions
3102
- * @private
3103
- */
3104
- #o() {
3105
- return (/* @__PURE__ */ new Map()).set("switch_view", (w, D) => {
3106
- if (this.#t.has(w.view)) {
3107
- const O = this.#t.get(w.view)(
3108
- w.pk || w.recordId,
3109
- w
3110
- );
3111
- this.switchView(O);
3112
- }
3113
- });
3114
- }
3115
- /**
3116
- * Maps a view event name to a handler function. Allows dynamic registration
3117
- * of custom view event handlers at runtime.
3118
- * @param {string} s The event name to map
3119
- * @param {!Function} func The handler function that receives (eventData, eView)
3120
- */
3121
- mapViewEv(w, D) {
3122
- this.#n.set(w, D);
3123
- }
3124
- /**
3125
- * Registers a view constructor function that can be used to create instances
3126
- * of a specific view type.
3127
- * @param {string} s The view type identifier
3128
- * @param {!Function} f Constructor function that receives (pk, data) and returns a View
3129
- */
3130
- registerViewConstructor(w, D) {
3131
- this.#t.set(w, D);
3132
- }
3133
- /**
3134
- * @param {!CustomEvent} e Event object.
3135
- */
3136
- onViewEvent(w) {
3137
- const D = w.detail.getValue(), O = w.detail.getData(), F = (
3138
- /** @type {Panel} */
3139
- w.target
3140
- );
3141
- this.#n.has(D) ? this.#n.get(D)(O, F) : console.warn("Unhandled VIEW Event:", w, D, O, F);
3142
- }
3143
- /**
3144
- * Make the given view active.
3145
- * @param {!View} view
3146
- */
3147
- setActiveView(w) {
3148
- this.#e && (this.stopListeningTo(this.#e), this.#e.dispose(), this.#e = null), this.#e = w, this.#e.render();
3149
- }
3150
- /**
3151
- * @param {!View} view
3152
- * @returns {!View}
3153
- */
3154
- initView(w) {
3155
- return w.user = this.user, w.split = this.split, w.utils = this.utils, w.recordHistory = this.recordHistory.bind(this), w.registerViewConstructor = this.registerViewConstructor.bind(this), this.listen(w, View.viewEventCode(), this.onViewEvent.bind(this)), w;
3156
- }
3157
- //--[ Views Utilities ]--
3158
- /**
3159
- * @param {!View} view The view we want active.
3160
- */
3161
- switchView(w) {
3162
- this.setActiveView(this.initView(w));
3163
- }
3164
- //--[ History and Navigation ]--
3165
- /**
3166
- * Records the given item in browser history. If item.init is true, replaces
3167
- * the current history state. Otherwise, pushes a new history state unless
3168
- * item.history is true.
3169
- * @param {!Object} item The history item containing view state
3170
- */
3171
- recordHistory(w) {
3172
- this.debugMe("HISTORY", w), w.init ? history.replaceState(w, "", document.location.href) : w.history || history.pushState(w, "", null);
3173
- }
3174
- /**
3175
- * Navigates to a specific view based on the history item. Attempts to use
3176
- * the active view's switchViewMap first, falling back to registered view
3177
- * constructors if needed.
3178
- * @param {!Object} item History item containing {view, pk, ...} properties
3179
- */
3180
- navTo = (w) => {
3181
- w.history = !0;
3182
- const D = w.view, O = this.#e;
3183
- if (O.switchViewMap_.has(D))
3184
- this.debugMe("NAV:VIEW:MAP", w), O.switchViewMap_.get(D)(w);
3185
- else if (this.#t.has(D)) {
3186
- const F = this.#t.get(D)(w.pk, w);
3187
- this.debugMe("NAV:NEW:VIEW", w), this.switchView(F);
3188
- }
3189
- };
3190
- }
3191
- const DEFAULT_FORMATTERS = {
3192
- /**
3193
- * Format as JSON (useful for debugging)
3194
- */
3195
- json: (U) => JSON.stringify(U, null, 2),
3196
- /**
3197
- * Template string interpolation formatter
3198
- * Evaluates a template string with access to 'value' and 'data'
3199
- * @example:
3200
- * <!-- Simple value interpolation -->
3201
- * <img zoo-bind-attr="src:mno_id|tpl"
3202
- * zoo-bind-attr-tpl="/static/dist/img/networks/${value}.png">
3203
- *
3204
- * <!-- Access to nested data -->
3205
- * <img zoo-bind-attr="src:mno_id|tpl"
3206
- * zoo-bind-attr-tpl="/static/dist/img/${data.region}/networks/${value}.png">
3207
- *
3208
- * <!-- Conditional logic -->
3209
- * <span zoo-bind-attr="class:status|tpl"
3210
- * zoo-bind-attr-tpl="status-${value === 'active' ? 'good' : 'bad'}">
3211
- *
3212
- * <!-- Even expressions -->
3213
- * <span zoo-bind="price|tpl"
3214
- * zoo-bind-tpl="$${(value / 100).toFixed(2)}">
3215
- */
3216
- tpl: (U, w, D) => {
3217
- const O = D?.getAttribute("zoo-bind-attr-tpl") || D?.getAttribute("zoo-bind-tpl");
3218
- if (!O) return U;
3219
- try {
3220
- return new Function("value", "data", `return \`${O}\`;`)(U, w);
3221
- } catch (F) {
3222
- return console.warn("[Binder] Invalid template:", O, F), U;
3223
- }
3224
- }
3225
- };
3226
- class Binder {
3227
- #t;
3228
- #e;
3229
- #s;
3230
- #r = null;
3231
- #n;
3232
- /**
3233
- * Creates a new Binder instance.
3234
- *
3235
- * @param {zooy.Panel} panel
3236
- * @param {string} url - API endpoint URL
3237
- * @param {Element} rootEl - Root element to walk for bindings
3238
- * @param options
3239
- * @param {Object<string, string|number>} [options.urlParams] - Configuration options
3240
- * @param {Object<string, Function>} [options.formatters] - Custom formatters
3241
- * @throws {Error} If url or rootEl is missing/invalid
3242
- */
3243
- constructor(w, D, O, F = {}) {
3244
- if (!D)
3245
- throw new Error("Binder requires a URL");
3246
- if (!O || !(O instanceof Element))
3247
- throw new Error("Binder requires a valid rootEl Element");
3248
- this.#t = w, this.#e = new URL(D, window.location.origin), this.#s = O, this.#n = { ...DEFAULT_FORMATTERS, ...F.formatters }, F.urlParams ? this.#i(F.urlParams) : this.#o();
3249
- }
3250
- get url() {
3251
- return this.#e;
3252
- }
3253
- get data() {
3254
- return this.#r;
3255
- }
3256
- get limit() {
3257
- return parseInt(this.#e.searchParams.get("limit") || "0", 10);
3258
- }
3259
- get offset() {
3260
- return parseInt(this.#e.searchParams.get("offset") || "0", 10);
3261
- }
3262
- get isPaginated() {
3263
- return both(has("count"), has("results"))(this.#r);
3264
- }
3265
- #i(w) {
3266
- return Object.entries(w).forEach(([D, O]) => {
3267
- if (!isDefAndNotNull(O) || O === "" || Array.isArray(O) && O.length < 1) {
3268
- this.#e.searchParams.delete(D);
3269
- return;
3270
- }
3271
- if (Array.isArray(O)) {
3272
- this.#e.searchParams.set(D, O.join(","));
3273
- return;
3274
- }
3275
- this.#e.searchParams.set(D, O);
3276
- }), this.#o(), this.#e;
3277
- }
3278
- /**
3279
- * Updates all elements with zoo-bind-binderurl attribute to have the current
3280
- * URL path and query string as the attribute value. This allows elements to
3281
- * dynamically reflect the binder's URL when it changes.
3282
- * @private
3283
- */
3284
- #o() {
3285
- const w = this.#e.href.split(this.url.origin)[1].slice(1);
3286
- this.#s.querySelectorAll("[zoo-bind-binderurl]").forEach((D) => {
3287
- D.setAttribute("zoo-bind-binderurl", w);
3288
- });
3289
- }
3290
- /**
3291
- * Fetches data from the configured URL with optional query parameters.
3292
- * Data is automatically bound to the DOM via setData() after fetch completes.
3293
- *
3294
- * @param {Object} [urlParams={}] - Query parameters to append to URL (e.g., {limit: 25, offset: 0, ordering: 'name'})
3295
- * @return {Promise<void>}
3296
- * @throws {Error} If fetch fails or response is invalid
3297
- */
3298
- async fetchData(w = {}) {
3299
- const D = await this.#t.user.fetchJson(
3300
- this.#i(w).toString(),
3301
- this.#t.abortController.signal
3302
- );
3303
- this.setData(D);
3304
- }
3305
- /**
3306
- * Sets data directly without fetching from URL.
3307
- * This is the convergence point for all data updates (from fetchData() or external sources).
3308
- *
3309
- * Behavior:
3310
- * - Stores full JSON object (not just arrays)
3311
- * - Calls render() to update the DOM
3312
- * - render() extracts appropriate slices for each consumer
3313
- *
3314
- * @param {Object} data - Full JSON response object
3315
- */
3316
- setData(w) {
3317
- this.#r = w, this.render();
3318
- }
3319
- /**
3320
- * Renders data by walking the rootEl element and processing all bindings.
3321
- *
3322
- * Supports two binding patterns:
3323
- * 1. Simple property binding - Direct zoo-bind attributes on elements (no templates)
3324
- * 2. Template rendering - Elements with zoo-template duplicate for arrays
3325
- *
3326
- * Algorithm:
3327
- * 1. Process simple bindings (zoo-bind, zoo-bind-attr outside template consumers)
3328
- * 2. Process template consumers (elements with zoo-template attribute)
3329
- * - Get template ID and optional zoo-template-bind
3330
- * - Extract data slice using Ramda's R.path()
3331
- * - Clear consumer and clone template for each item
3332
- *
3333
- * Multiple consumers can exist in the same rootEl, each rendering different slices
3334
- * of the same JSON response (e.g., results, metadata, alerts).
3335
- */
3336
- render() {
3337
- if (!isDefAndNotNull(this.#r)) {
3338
- console.warn("[Binder] No data to render");
3339
- return;
3340
- }
3341
- this.#o(), this.#a(this.#s, this.#r, 0), this.#l();
3342
- }
3343
- /**
3344
- * Renders simple property bindings directly to existing elements.
3345
- * Processes zoo-bind-attr, zoo-bind, and conditional rendering attributes.
3346
- *
3347
- * This method is reusable and can be called with different elements and data objects.
3348
- * Used for both rootEl-level simple bindings and template item rendering.
3349
- *
3350
- * @param {Element|DocumentFragment} element - Root element to search for bindings
3351
- * @param {Object} data - Data object to bind
3352
- * @param {number} [index=0] - Current index (for $index and $index1 special variables)
3353
- * @param {Object} [options={}] - Rendering options
3354
- * @param {boolean} [options.removeOnCondition=false] - Remove elements on failed conditions (vs hiding with display:none)
3355
- * @param {boolean} [options.removeAttributes=false] - Remove binding attributes after processing (vs keeping for re-render)
3356
- * @private
3357
- */
3358
- #a(w, D, O = 0, F = {}) {
3359
- const q = F.removeAttributes ?? !1;
3360
- w.querySelectorAll("[zoo-bind-attr]").forEach((W) => {
3361
- if (W.closest("[zoo-template]")) return;
3362
- W.getAttribute("zoo-bind-attr").split(",").forEach((G) => {
3363
- const [K, Q] = G.split(":").map((Z) => Z.trim()), [tt, J] = Q.split("|").map((Z) => Z.trim());
3364
- let X = this.#c(D, tt, O);
3365
- J && this.#n[J] && (X = this.#n[J](X, D, W)), isDefAndNotNull(X) && W.setAttribute(K, X);
3366
- }), q && (W.removeAttribute("zoo-bind-attr"), W.removeAttribute("zoo-bind-attr-tpl"));
3367
- }), w.querySelectorAll("[zoo-bind]").forEach((W) => {
3368
- if (W.closest("[zoo-template]")) return;
3369
- const Y = W.getAttribute("zoo-bind"), [G, K] = Y.split("|").map((tt) => tt.trim());
3370
- let Q = this.#c(D, G, O);
3371
- K && this.#n[K] && (Q = this.#n[K](Q, D, W)), W.textContent = Q ?? "", q && (W.removeAttribute("zoo-bind"), W.removeAttribute("zoo-bind-tpl"));
3372
- });
3373
- }
3374
- /**
3375
- * Renders template consumers by duplicating templates for array data.
3376
- *
3377
- * @private
3378
- */
3379
- #l() {
3380
- this.#s.querySelectorAll("[zoo-template]").forEach((D) => {
3381
- const O = D.getAttribute("zoo-template"), F = D.getAttribute("zoo-template-bind");
3382
- if (!O) {
3383
- console.warn("[Binder] Consumer missing template ID", D);
3384
- return;
3385
- }
3386
- const q = this.#s.querySelector(`#${O}`);
3387
- if (!q || q.tagName !== "TEMPLATE") {
3388
- console.error(`[DataBinder] Template not found or invalid: ${O}`);
3389
- return;
3390
- }
3391
- const W = F ? path(F.split("."), this.#r) : this.#r;
3392
- if (!W) {
3393
- console.warn(`[DataBinder] Data slice is undefined. Path: ${F}. Skipping render for this consumer.`);
3394
- return;
3395
- }
3396
- if (!Array.isArray(W)) {
3397
- console.error(`[DataBinder] Data slice is not an array. Path: ${F}`, W);
3398
- return;
3399
- }
3400
- D.innerHTML = "", W.forEach((Y, G) => {
3401
- const K = this.#h(q, Y, G);
3402
- D.appendChild(K);
3403
- });
3404
- });
3405
- }
3406
- /**
3407
- * Renders a single item from a template.
3408
- * Uses the unified rendering method with options for template-specific behavior.
3409
- *
3410
- * @param {HTMLTemplateElement} template - Template element
3411
- * @param {Object} item - Data object
3412
- * @param {number} index - Item index in array
3413
- * @return {DocumentFragment} Rendered template clone
3414
- * @private
3415
- */
3416
- #h(w, D, O) {
3417
- const F = w.content.cloneNode(!0);
3418
- return this.#a(F, D, O, {
3419
- removeAttributes: !0
3420
- }), F;
3421
- }
3422
- /**
3423
- * Gets a value from an object using dot notation.
3424
- *
3425
- * Special Variables:
3426
- * - $index: 0-based row number (within current page)
3427
- * - $index1: 1-based row number (within current page)
3428
- * - $index__paged: 0-based row number (accounts for pagination offset)
3429
- * - $index1__paged: 1-based row number (accounts for pagination offset)
3430
- *
3431
- * @param {Object} obj - Object to query
3432
- * @param {string} pathString - Dot-separated path (e.g., "profile.name") or special variable ($index, $index1, $index__paged, $index1__paged)
3433
- * @param {number} index - Item index in current data array (0-based)
3434
- * @return {*} The value, or undefined if not found
3435
- * @private
3436
- */
3437
- #c(w, D, O) {
3438
- const F = {
3439
- $index: () => O,
3440
- $index__paged: () => this.offset + O,
3441
- $index1: () => O + 1,
3442
- $index1__paged: () => this.offset + O + 1
3443
- };
3444
- return F[D] ? F[D]() : path(D.split("."), w);
3445
- }
3446
- }
3447
- const SEMANTIC_ATTRS = new Map(Object.entries({
3448
- event: "event",
3449
- endpoint: "endpoint",
3450
- href: "href",
3451
- url: "url",
3452
- target: "target",
3453
- "record-id": "recordId",
3454
- "zoo-sort-field": "sortField",
3455
- "zoo-view": "view",
3456
- "zoo-event": "event",
3457
- "zoo-href": "href"
3458
- })), getSemanticAttributes = (U) => {
3459
- let w = {};
3460
- return Array.from(U.attributes).forEach((D) => {
3461
- const O = D.name, F = D.value;
3462
- SEMANTIC_ATTRS.has(O) ? w[SEMANTIC_ATTRS.get(O)] = F : (O.startsWith("data-") || O.startsWith("zoo-")) && (w = assocPath(O.split("-"), F, w));
3463
- }), w;
3464
- }, getEventAttribute = (U, w, D = "event") => U.getAttribute(w) || U.getAttribute(D);
3465
- /**
3466
- * @license
3467
- * Copyright 2019 Google LLC
3468
- * SPDX-License-Identifier: BSD-3-Clause
3469
- */
3470
- const t$1 = globalThis, e$2 = t$1.ShadowRoot && (t$1.ShadyCSS === void 0 || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap();
3471
- let n$2 = class {
3472
- constructor(w, D, O) {
3473
- if (this._$cssResult$ = !0, O !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
3474
- this.cssText = w, this.t = D;
3475
- }
3476
- get styleSheet() {
3477
- let w = this.o;
3478
- const D = this.t;
3479
- if (e$2 && w === void 0) {
3480
- const O = D !== void 0 && D.length === 1;
3481
- O && (w = o$3.get(D)), w === void 0 && ((this.o = w = new CSSStyleSheet()).replaceSync(this.cssText), O && o$3.set(D, w));
3482
- }
3483
- return w;
3484
- }
3485
- toString() {
3486
- return this.cssText;
3487
- }
3488
- };
3489
- const r$2 = (U) => new n$2(typeof U == "string" ? U : U + "", void 0, s$2), i$3 = (U, ...w) => {
3490
- const D = U.length === 1 ? U[0] : w.reduce(((O, F, q) => O + ((W) => {
3491
- if (W._$cssResult$ === !0) return W.cssText;
3492
- if (typeof W == "number") return W;
3493
- throw Error("Value passed to 'css' function must be a 'css' function result: " + W + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
3494
- })(F) + U[q + 1]), U[0]);
3495
- return new n$2(D, U, s$2);
3496
- }, S$1 = (U, w) => {
3497
- if (e$2) U.adoptedStyleSheets = w.map(((D) => D instanceof CSSStyleSheet ? D : D.styleSheet));
3498
- else for (const D of w) {
3499
- const O = document.createElement("style"), F = t$1.litNonce;
3500
- F !== void 0 && O.setAttribute("nonce", F), O.textContent = D.cssText, U.appendChild(O);
3501
- }
3502
- }, c$2 = e$2 ? (U) => U : (U) => U instanceof CSSStyleSheet ? ((w) => {
3503
- let D = "";
3504
- for (const O of w.cssRules) D += O.cssText;
3505
- return r$2(D);
3506
- })(U) : U;
3507
- /**
3508
- * @license
3509
- * Copyright 2017 Google LLC
3510
- * SPDX-License-Identifier: BSD-3-Clause
3511
- */
3512
- const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (U, w) => U, u$1 = { toAttribute(U, w) {
3513
- switch (w) {
3514
- case Boolean:
3515
- U = U ? l$1 : null;
3516
- break;
3517
- case Object:
3518
- case Array:
3519
- U = U == null ? U : JSON.stringify(U);
3520
- }
3521
- return U;
3522
- }, fromAttribute(U, w) {
3523
- let D = U;
3524
- switch (w) {
3525
- case Boolean:
3526
- D = U !== null;
3527
- break;
3528
- case Number:
3529
- D = U === null ? null : Number(U);
3530
- break;
3531
- case Object:
3532
- case Array:
3533
- try {
3534
- D = JSON.parse(U);
3535
- } catch {
3536
- D = null;
3537
- }
3538
- }
3539
- return D;
3540
- } }, f$1 = (U, w) => !i$2(U, w), b$1 = { attribute: !0, type: String, converter: u$1, reflect: !1, useDefault: !1, hasChanged: f$1 };
3541
- Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
3542
- let y$1 = class extends HTMLElement {
3543
- static addInitializer(w) {
3544
- this._$Ei(), (this.l ??= []).push(w);
3545
- }
3546
- static get observedAttributes() {
3547
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
3548
- }
3549
- static createProperty(w, D = b$1) {
3550
- if (D.state && (D.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(w) && ((D = Object.create(D)).wrapped = !0), this.elementProperties.set(w, D), !D.noAccessor) {
3551
- const O = Symbol(), F = this.getPropertyDescriptor(w, O, D);
3552
- F !== void 0 && e$1(this.prototype, w, F);
3553
- }
3554
- }
3555
- static getPropertyDescriptor(w, D, O) {
3556
- const { get: F, set: q } = h$1(this.prototype, w) ?? { get() {
3557
- return this[D];
3558
- }, set(W) {
3559
- this[D] = W;
3560
- } };
3561
- return { get: F, set(W) {
3562
- const Y = F?.call(this);
3563
- q?.call(this, W), this.requestUpdate(w, Y, O);
3564
- }, configurable: !0, enumerable: !0 };
3565
- }
3566
- static getPropertyOptions(w) {
3567
- return this.elementProperties.get(w) ?? b$1;
3568
- }
3569
- static _$Ei() {
3570
- if (this.hasOwnProperty(d$1("elementProperties"))) return;
3571
- const w = n$1(this);
3572
- w.finalize(), w.l !== void 0 && (this.l = [...w.l]), this.elementProperties = new Map(w.elementProperties);
3573
- }
3574
- static finalize() {
3575
- if (this.hasOwnProperty(d$1("finalized"))) return;
3576
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
3577
- const D = this.properties, O = [...r$1(D), ...o$2(D)];
3578
- for (const F of O) this.createProperty(F, D[F]);
3579
- }
3580
- const w = this[Symbol.metadata];
3581
- if (w !== null) {
3582
- const D = litPropertyMetadata.get(w);
3583
- if (D !== void 0) for (const [O, F] of D) this.elementProperties.set(O, F);
3584
- }
3585
- this._$Eh = /* @__PURE__ */ new Map();
3586
- for (const [D, O] of this.elementProperties) {
3587
- const F = this._$Eu(D, O);
3588
- F !== void 0 && this._$Eh.set(F, D);
3589
- }
3590
- this.elementStyles = this.finalizeStyles(this.styles);
3591
- }
3592
- static finalizeStyles(w) {
3593
- const D = [];
3594
- if (Array.isArray(w)) {
3595
- const O = new Set(w.flat(1 / 0).reverse());
3596
- for (const F of O) D.unshift(c$2(F));
3597
- } else w !== void 0 && D.push(c$2(w));
3598
- return D;
3599
- }
3600
- static _$Eu(w, D) {
3601
- const O = D.attribute;
3602
- return O === !1 ? void 0 : typeof O == "string" ? O : typeof w == "string" ? w.toLowerCase() : void 0;
3603
- }
3604
- constructor() {
3605
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
3606
- }
3607
- _$Ev() {
3608
- this._$ES = new Promise(((w) => this.enableUpdating = w)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((w) => w(this)));
3609
- }
3610
- addController(w) {
3611
- (this._$EO ??= /* @__PURE__ */ new Set()).add(w), this.renderRoot !== void 0 && this.isConnected && w.hostConnected?.();
3612
- }
3613
- removeController(w) {
3614
- this._$EO?.delete(w);
3615
- }
3616
- _$E_() {
3617
- const w = /* @__PURE__ */ new Map(), D = this.constructor.elementProperties;
3618
- for (const O of D.keys()) this.hasOwnProperty(O) && (w.set(O, this[O]), delete this[O]);
3619
- w.size > 0 && (this._$Ep = w);
3620
- }
3621
- createRenderRoot() {
3622
- const w = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
3623
- return S$1(w, this.constructor.elementStyles), w;
3624
- }
3625
- connectedCallback() {
3626
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((w) => w.hostConnected?.()));
3627
- }
3628
- enableUpdating(w) {
3629
- }
3630
- disconnectedCallback() {
3631
- this._$EO?.forEach(((w) => w.hostDisconnected?.()));
3632
- }
3633
- attributeChangedCallback(w, D, O) {
3634
- this._$AK(w, O);
3635
- }
3636
- _$ET(w, D) {
3637
- const O = this.constructor.elementProperties.get(w), F = this.constructor._$Eu(w, O);
3638
- if (F !== void 0 && O.reflect === !0) {
3639
- const q = (O.converter?.toAttribute !== void 0 ? O.converter : u$1).toAttribute(D, O.type);
3640
- this._$Em = w, q == null ? this.removeAttribute(F) : this.setAttribute(F, q), this._$Em = null;
3641
- }
3642
- }
3643
- _$AK(w, D) {
3644
- const O = this.constructor, F = O._$Eh.get(w);
3645
- if (F !== void 0 && this._$Em !== F) {
3646
- const q = O.getPropertyOptions(F), W = typeof q.converter == "function" ? { fromAttribute: q.converter } : q.converter?.fromAttribute !== void 0 ? q.converter : u$1;
3647
- this._$Em = F;
3648
- const Y = W.fromAttribute(D, q.type);
3649
- this[F] = Y ?? this._$Ej?.get(F) ?? Y, this._$Em = null;
3650
- }
3651
- }
3652
- requestUpdate(w, D, O) {
3653
- if (w !== void 0) {
3654
- const F = this.constructor, q = this[w];
3655
- if (O ??= F.getPropertyOptions(w), !((O.hasChanged ?? f$1)(q, D) || O.useDefault && O.reflect && q === this._$Ej?.get(w) && !this.hasAttribute(F._$Eu(w, O)))) return;
3656
- this.C(w, D, O);
3657
- }
3658
- this.isUpdatePending === !1 && (this._$ES = this._$EP());
3659
- }
3660
- C(w, D, { useDefault: O, reflect: F, wrapped: q }, W) {
3661
- O && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(w) && (this._$Ej.set(w, W ?? D ?? this[w]), q !== !0 || W !== void 0) || (this._$AL.has(w) || (this.hasUpdated || O || (D = void 0), this._$AL.set(w, D)), F === !0 && this._$Em !== w && (this._$Eq ??= /* @__PURE__ */ new Set()).add(w));
3662
- }
3663
- async _$EP() {
3664
- this.isUpdatePending = !0;
3665
- try {
3666
- await this._$ES;
3667
- } catch (D) {
3668
- Promise.reject(D);
3669
- }
3670
- const w = this.scheduleUpdate();
3671
- return w != null && await w, !this.isUpdatePending;
3672
- }
3673
- scheduleUpdate() {
3674
- return this.performUpdate();
3675
- }
3676
- performUpdate() {
3677
- if (!this.isUpdatePending) return;
3678
- if (!this.hasUpdated) {
3679
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
3680
- for (const [F, q] of this._$Ep) this[F] = q;
3681
- this._$Ep = void 0;
3682
- }
3683
- const O = this.constructor.elementProperties;
3684
- if (O.size > 0) for (const [F, q] of O) {
3685
- const { wrapped: W } = q, Y = this[F];
3686
- W !== !0 || this._$AL.has(F) || Y === void 0 || this.C(F, void 0, q, Y);
3687
- }
3688
- }
3689
- let w = !1;
3690
- const D = this._$AL;
3691
- try {
3692
- w = this.shouldUpdate(D), w ? (this.willUpdate(D), this._$EO?.forEach(((O) => O.hostUpdate?.())), this.update(D)) : this._$EM();
3693
- } catch (O) {
3694
- throw w = !1, this._$EM(), O;
3695
- }
3696
- w && this._$AE(D);
3697
- }
3698
- willUpdate(w) {
3699
- }
3700
- _$AE(w) {
3701
- this._$EO?.forEach(((D) => D.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(w)), this.updated(w);
3702
- }
3703
- _$EM() {
3704
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
3705
- }
3706
- get updateComplete() {
3707
- return this.getUpdateComplete();
3708
- }
3709
- getUpdateComplete() {
3710
- return this._$ES;
3711
- }
3712
- shouldUpdate(w) {
3713
- return !0;
3714
- }
3715
- update(w) {
3716
- this._$Eq &&= this._$Eq.forEach(((D) => this._$ET(D, this[D]))), this._$EM();
3717
- }
3718
- updated(w) {
3719
- }
3720
- firstUpdated(w) {
3721
- }
3722
- };
3723
- y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ??= []).push("2.1.1");
3724
- /**
3725
- * @license
3726
- * Copyright 2017 Google LLC
3727
- * SPDX-License-Identifier: BSD-3-Clause
3728
- */
3729
- const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (U) => U }) : void 0, e = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$1 = "?" + h, n = `<${o$1}>`, r = document, l = () => r.createComment(""), c = (U) => U === null || typeof U != "object" && typeof U != "function", a = Array.isArray, u = (U) => a(U) || typeof U?.[Symbol.iterator] == "function", d = `[
3730
- \f\r]`, f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
3731
- \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (U) => (w, ...D) => ({ _$litType$: U, strings: w, values: D }), x = y(1), b = y(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129);
3732
- function P(U, w) {
3733
- if (!a(U) || !U.hasOwnProperty("raw")) throw Error("invalid template strings array");
3734
- return s$1 !== void 0 ? s$1.createHTML(w) : w;
3735
- }
3736
- const V = (U, w) => {
3737
- const D = U.length - 1, O = [];
3738
- let F, q = w === 2 ? "<svg>" : w === 3 ? "<math>" : "", W = f;
3739
- for (let Y = 0; Y < D; Y++) {
3740
- const G = U[Y];
3741
- let K, Q, tt = -1, J = 0;
3742
- for (; J < G.length && (W.lastIndex = J, Q = W.exec(G), Q !== null); ) J = W.lastIndex, W === f ? Q[1] === "!--" ? W = v : Q[1] !== void 0 ? W = _ : Q[2] !== void 0 ? ($.test(Q[2]) && (F = RegExp("</" + Q[2], "g")), W = m) : Q[3] !== void 0 && (W = m) : W === m ? Q[0] === ">" ? (W = F ?? f, tt = -1) : Q[1] === void 0 ? tt = -2 : (tt = W.lastIndex - Q[2].length, K = Q[1], W = Q[3] === void 0 ? m : Q[3] === '"' ? g : p) : W === g || W === p ? W = m : W === v || W === _ ? W = f : (W = m, F = void 0);
3743
- const X = W === m && U[Y + 1].startsWith("/>") ? " " : "";
3744
- q += W === f ? G + n : tt >= 0 ? (O.push(K), G.slice(0, tt) + e + G.slice(tt) + h + X) : G + h + (tt === -2 ? Y : X);
3745
- }
3746
- return [P(U, q + (U[D] || "<?>") + (w === 2 ? "</svg>" : w === 3 ? "</math>" : "")), O];
3747
- };
3748
- class N {
3749
- constructor({ strings: w, _$litType$: D }, O) {
3750
- let F;
3751
- this.parts = [];
3752
- let q = 0, W = 0;
3753
- const Y = w.length - 1, G = this.parts, [K, Q] = V(w, D);
3754
- if (this.el = N.createElement(K, O), C.currentNode = this.el.content, D === 2 || D === 3) {
3755
- const tt = this.el.content.firstChild;
3756
- tt.replaceWith(...tt.childNodes);
3757
- }
3758
- for (; (F = C.nextNode()) !== null && G.length < Y; ) {
3759
- if (F.nodeType === 1) {
3760
- if (F.hasAttributes()) for (const tt of F.getAttributeNames()) if (tt.endsWith(e)) {
3761
- const J = Q[W++], X = F.getAttribute(tt).split(h), Z = /([.?@])?(.*)/.exec(J);
3762
- G.push({ type: 1, index: q, name: Z[2], strings: X, ctor: Z[1] === "." ? H : Z[1] === "?" ? I : Z[1] === "@" ? L : k }), F.removeAttribute(tt);
3763
- } else tt.startsWith(h) && (G.push({ type: 6, index: q }), F.removeAttribute(tt));
3764
- if ($.test(F.tagName)) {
3765
- const tt = F.textContent.split(h), J = tt.length - 1;
3766
- if (J > 0) {
3767
- F.textContent = i$1 ? i$1.emptyScript : "";
3768
- for (let X = 0; X < J; X++) F.append(tt[X], l()), C.nextNode(), G.push({ type: 2, index: ++q });
3769
- F.append(tt[J], l());
3770
- }
3771
- }
3772
- } else if (F.nodeType === 8) if (F.data === o$1) G.push({ type: 2, index: q });
3773
- else {
3774
- let tt = -1;
3775
- for (; (tt = F.data.indexOf(h, tt + 1)) !== -1; ) G.push({ type: 7, index: q }), tt += h.length - 1;
3776
- }
3777
- q++;
3778
- }
3779
- }
3780
- static createElement(w, D) {
3781
- const O = r.createElement("template");
3782
- return O.innerHTML = w, O;
3783
- }
3784
- }
3785
- function S(U, w, D = U, O) {
3786
- if (w === T) return w;
3787
- let F = O !== void 0 ? D._$Co?.[O] : D._$Cl;
3788
- const q = c(w) ? void 0 : w._$litDirective$;
3789
- return F?.constructor !== q && (F?._$AO?.(!1), q === void 0 ? F = void 0 : (F = new q(U), F._$AT(U, D, O)), O !== void 0 ? (D._$Co ??= [])[O] = F : D._$Cl = F), F !== void 0 && (w = S(U, F._$AS(U, w.values), F, O)), w;
3790
- }
3791
- class M {
3792
- constructor(w, D) {
3793
- this._$AV = [], this._$AN = void 0, this._$AD = w, this._$AM = D;
3794
- }
3795
- get parentNode() {
3796
- return this._$AM.parentNode;
3797
- }
3798
- get _$AU() {
3799
- return this._$AM._$AU;
3800
- }
3801
- u(w) {
3802
- const { el: { content: D }, parts: O } = this._$AD, F = (w?.creationScope ?? r).importNode(D, !0);
3803
- C.currentNode = F;
3804
- let q = C.nextNode(), W = 0, Y = 0, G = O[0];
3805
- for (; G !== void 0; ) {
3806
- if (W === G.index) {
3807
- let K;
3808
- G.type === 2 ? K = new R(q, q.nextSibling, this, w) : G.type === 1 ? K = new G.ctor(q, G.name, G.strings, this, w) : G.type === 6 && (K = new z(q, this, w)), this._$AV.push(K), G = O[++Y];
3809
- }
3810
- W !== G?.index && (q = C.nextNode(), W++);
3811
- }
3812
- return C.currentNode = r, F;
3813
- }
3814
- p(w) {
3815
- let D = 0;
3816
- for (const O of this._$AV) O !== void 0 && (O.strings !== void 0 ? (O._$AI(w, O, D), D += O.strings.length - 2) : O._$AI(w[D])), D++;
3817
- }
3818
- }
3819
- class R {
3820
- get _$AU() {
3821
- return this._$AM?._$AU ?? this._$Cv;
3822
- }
3823
- constructor(w, D, O, F) {
3824
- this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = w, this._$AB = D, this._$AM = O, this.options = F, this._$Cv = F?.isConnected ?? !0;
3825
- }
3826
- get parentNode() {
3827
- let w = this._$AA.parentNode;
3828
- const D = this._$AM;
3829
- return D !== void 0 && w?.nodeType === 11 && (w = D.parentNode), w;
3830
- }
3831
- get startNode() {
3832
- return this._$AA;
3833
- }
3834
- get endNode() {
3835
- return this._$AB;
3836
- }
3837
- _$AI(w, D = this) {
3838
- w = S(this, w, D), c(w) ? w === E || w == null || w === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : w !== this._$AH && w !== T && this._(w) : w._$litType$ !== void 0 ? this.$(w) : w.nodeType !== void 0 ? this.T(w) : u(w) ? this.k(w) : this._(w);
3839
- }
3840
- O(w) {
3841
- return this._$AA.parentNode.insertBefore(w, this._$AB);
3842
- }
3843
- T(w) {
3844
- this._$AH !== w && (this._$AR(), this._$AH = this.O(w));
3845
- }
3846
- _(w) {
3847
- this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = w : this.T(r.createTextNode(w)), this._$AH = w;
3848
- }
3849
- $(w) {
3850
- const { values: D, _$litType$: O } = w, F = typeof O == "number" ? this._$AC(w) : (O.el === void 0 && (O.el = N.createElement(P(O.h, O.h[0]), this.options)), O);
3851
- if (this._$AH?._$AD === F) this._$AH.p(D);
3852
- else {
3853
- const q = new M(F, this), W = q.u(this.options);
3854
- q.p(D), this.T(W), this._$AH = q;
3855
- }
3856
- }
3857
- _$AC(w) {
3858
- let D = A.get(w.strings);
3859
- return D === void 0 && A.set(w.strings, D = new N(w)), D;
3860
- }
3861
- k(w) {
3862
- a(this._$AH) || (this._$AH = [], this._$AR());
3863
- const D = this._$AH;
3864
- let O, F = 0;
3865
- for (const q of w) F === D.length ? D.push(O = new R(this.O(l()), this.O(l()), this, this.options)) : O = D[F], O._$AI(q), F++;
3866
- F < D.length && (this._$AR(O && O._$AB.nextSibling, F), D.length = F);
3867
- }
3868
- _$AR(w = this._$AA.nextSibling, D) {
3869
- for (this._$AP?.(!1, !0, D); w !== this._$AB; ) {
3870
- const O = w.nextSibling;
3871
- w.remove(), w = O;
3872
- }
3873
- }
3874
- setConnected(w) {
3875
- this._$AM === void 0 && (this._$Cv = w, this._$AP?.(w));
3876
- }
3877
- }
3878
- class k {
3879
- get tagName() {
3880
- return this.element.tagName;
3881
- }
3882
- get _$AU() {
3883
- return this._$AM._$AU;
3884
- }
3885
- constructor(w, D, O, F, q) {
3886
- this.type = 1, this._$AH = E, this._$AN = void 0, this.element = w, this.name = D, this._$AM = F, this.options = q, O.length > 2 || O[0] !== "" || O[1] !== "" ? (this._$AH = Array(O.length - 1).fill(new String()), this.strings = O) : this._$AH = E;
3887
- }
3888
- _$AI(w, D = this, O, F) {
3889
- const q = this.strings;
3890
- let W = !1;
3891
- if (q === void 0) w = S(this, w, D, 0), W = !c(w) || w !== this._$AH && w !== T, W && (this._$AH = w);
3892
- else {
3893
- const Y = w;
3894
- let G, K;
3895
- for (w = q[0], G = 0; G < q.length - 1; G++) K = S(this, Y[O + G], D, G), K === T && (K = this._$AH[G]), W ||= !c(K) || K !== this._$AH[G], K === E ? w = E : w !== E && (w += (K ?? "") + q[G + 1]), this._$AH[G] = K;
3896
- }
3897
- W && !F && this.j(w);
3898
- }
3899
- j(w) {
3900
- w === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, w ?? "");
3901
- }
3902
- }
3903
- class H extends k {
3904
- constructor() {
3905
- super(...arguments), this.type = 3;
3906
- }
3907
- j(w) {
3908
- this.element[this.name] = w === E ? void 0 : w;
3909
- }
3910
- }
3911
- class I extends k {
3912
- constructor() {
3913
- super(...arguments), this.type = 4;
3914
- }
3915
- j(w) {
3916
- this.element.toggleAttribute(this.name, !!w && w !== E);
3917
- }
3918
- }
3919
- class L extends k {
3920
- constructor(w, D, O, F, q) {
3921
- super(w, D, O, F, q), this.type = 5;
3922
- }
3923
- _$AI(w, D = this) {
3924
- if ((w = S(this, w, D, 0) ?? E) === T) return;
3925
- const O = this._$AH, F = w === E && O !== E || w.capture !== O.capture || w.once !== O.once || w.passive !== O.passive, q = w !== E && (O === E || F);
3926
- F && this.element.removeEventListener(this.name, this, O), q && this.element.addEventListener(this.name, this, w), this._$AH = w;
3927
- }
3928
- handleEvent(w) {
3929
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, w) : this._$AH.handleEvent(w);
3930
- }
3931
- }
3932
- class z {
3933
- constructor(w, D, O) {
3934
- this.element = w, this.type = 6, this._$AN = void 0, this._$AM = D, this.options = O;
3935
- }
3936
- get _$AU() {
3937
- return this._$AM._$AU;
3938
- }
3939
- _$AI(w) {
3940
- S(this, w);
3941
- }
3942
- }
3943
- const j = t.litHtmlPolyfillSupport;
3944
- j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1");
3945
- const B = (U, w, D) => {
3946
- const O = D?.renderBefore ?? w;
3947
- let F = O._$litPart$;
3948
- if (F === void 0) {
3949
- const q = D?.renderBefore ?? null;
3950
- O._$litPart$ = F = new R(w.insertBefore(l(), q), q, void 0, D ?? {});
3951
- }
3952
- return F._$AI(U), F;
3953
- };
3954
- /**
3955
- * @license
3956
- * Copyright 2017 Google LLC
3957
- * SPDX-License-Identifier: BSD-3-Clause
3958
- */
3959
- const s = globalThis;
3960
- class i extends y$1 {
3961
- constructor() {
3962
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
3963
- }
3964
- createRenderRoot() {
3965
- const w = super.createRenderRoot();
3966
- return this.renderOptions.renderBefore ??= w.firstChild, w;
3967
- }
3968
- update(w) {
3969
- const D = this.render();
3970
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(w), this._$Do = B(D, this.renderRoot, this.renderOptions);
3971
- }
3972
- connectedCallback() {
3973
- super.connectedCallback(), this._$Do?.setConnected(!0);
3974
- }
3975
- disconnectedCallback() {
3976
- super.disconnectedCallback(), this._$Do?.setConnected(!1);
3977
- }
3978
- render() {
3979
- return T;
3980
- }
3981
- }
3982
- i._$litElement$ = !0, i.finalized = !0, s.litElementHydrateSupport?.({ LitElement: i });
3983
- const o = s.litElementPolyfillSupport;
3984
- o?.({ LitElement: i });
3985
- (s.litElementVersions ??= []).push("4.2.1");
3986
- class ZooTag extends i {
3987
- static properties = {
3988
- token: { type: String },
3989
- prefix: { type: String },
3990
- postfix: { type: String }
3991
- };
3992
- static styles = i$3`
3993
- :host {
3994
- display: inline-block;
3995
- }
3996
-
3997
- .tag {
3998
- text-align: center;
3999
- display: inline-flex;
4000
- align-items: center;
4001
- justify-content: center;
4002
- line-height: initial;
4003
- width: max-content;
4004
- padding: .2em 1em;
4005
- border-radius: 1em;
4006
- font-size: var(--zoo-theme-chips-font-size, 0.75rem);
4007
- white-space: nowrap;
4008
- word-break: break-word;
4009
- box-sizing: border-box;
4010
- }
4011
- `;
4012
- render() {
4013
- const w = this.prefix ?? "", D = this.token ?? "default", O = this.postfix ?? "", F = `${w}${D}${O}`;
4014
- return x`
4015
- <span
4016
- class="tag"
4017
- style="
4018
- background-color: var(--zoo-tag-${F}-bg, var(--zoo-tag-default-bg, #9e9e9e));
4019
- color: var(--zoo-tag-${F}-fg, var(--zoo-tag-default-fg, #ffffff));
4020
- "
4021
- >
4022
- <slot></slot>
4023
- </span>
4024
- `;
4025
- }
4026
- }
4027
- customElements.get("zoo-tag") || customElements.define("zoo-tag", ZooTag);
4028
- const formatRelativeTime = (U) => {
4029
- const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
4030
- { name: "year", seconds: 31536e3 },
4031
- { name: "month", seconds: 2592e3 },
4032
- { name: "week", seconds: 604800 },
4033
- { name: "day", seconds: 86400 },
4034
- { name: "hour", seconds: 3600 },
4035
- { name: "minute", seconds: 60 },
4036
- { name: "second", seconds: 1 }
4037
- ];
4038
- if (D < 0) {
4039
- const F = Math.abs(D);
4040
- for (const q of O) {
4041
- const W = Math.floor(F / q.seconds);
4042
- if (W >= 1)
4043
- return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
4044
- }
4045
- return "just now";
4046
- }
4047
- for (const F of O) {
4048
- const q = Math.floor(D / F.seconds);
4049
- if (q >= 1)
4050
- return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
4051
- }
4052
- return "just now";
4053
- }, formatDatetime = (U) => {
4054
- const w = new Intl.DateTimeFormat("en", {
4055
- day: "2-digit",
4056
- month: "short",
4057
- year: "2-digit",
4058
- hour: "2-digit",
4059
- minute: "2-digit",
4060
- second: "2-digit",
4061
- hourCycle: "h23"
4062
- }), [{ value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, , { value: Y }] = w.formatToParts(U);
4063
- return `${O} ${D} ${F} ${q}:${W}:${Y}`;
4064
- }, formatDate = (U) => {
4065
- const w = new Intl.DateTimeFormat("en", {
4066
- day: "2-digit",
4067
- month: "short",
4068
- year: "2-digit"
4069
- }), [{ value: D }, , { value: O }, , { value: F }] = w.formatToParts(U);
4070
- return `${O} ${D} ${F}`;
4071
- };
4072
- class ZooTimestamp extends i {
4073
- static properties = {
4074
- timestamp: { type: Number },
4075
- kind: { type: String },
4076
- concat: { type: String }
4077
- };
4078
- static styles = i$3`
4079
- :host {
4080
- display: inline;
4081
- }
4082
-
4083
- .relative {
4084
- color: var(--zoo-timestamp-relative-color, inherit);
4085
- font-weight: var(--zoo-timestamp-relative-weight, inherit);
4086
- font-size: var(--zoo-timestamp-relative-size, inherit);
4087
- }
4088
-
4089
- .static {
4090
- color: var(--zoo-timestamp-static-color, inherit);
4091
- font-weight: var(--zoo-timestamp-static-weight, inherit);
4092
- font-size: var(--zoo-timestamp-static-size, inherit);
4093
- }
4094
-
4095
- .separator {
4096
- color: var(--zoo-timestamp-separator-color, inherit);
4097
- }
4098
- `;
4099
- constructor() {
4100
- super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
4101
- }
4102
- /**
4103
- * Determines if the current kind requires listening to time ticks
4104
- * @returns {boolean}
4105
- */
4106
- _shouldListenToTicks() {
4107
- return this.kind === "relative" || this.kind === "both";
4108
- }
4109
- connectedCallback() {
4110
- super.connectedCallback(), this._updateTickListener();
4111
- }
4112
- disconnectedCallback() {
4113
- this._removeTickListener(), super.disconnectedCallback();
4114
- }
4115
- updated(w) {
4116
- super.updated(w), w.has("kind") && this._updateTickListener();
4117
- }
4118
- /**
4119
- * Add or remove tick listener based on kind
4120
- */
4121
- _updateTickListener() {
4122
- const w = this._shouldListenToTicks();
4123
- w && !this._isListening ? (document.addEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !0) : !w && this._isListening && this._removeTickListener();
4124
- }
4125
- /**
4126
- * Remove tick listener
4127
- */
4128
- _removeTickListener() {
4129
- this._isListening && (document.removeEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !1);
4130
- }
4131
- _onTimeTick() {
4132
- this.requestUpdate();
4133
- }
4134
- /**
4135
- * Parses the concat template and splits it into parts
4136
- * @param {string} template - Template string with 'r' and 's' placeholders
4137
- * @returns {Array} Array of objects with {type: 'text'|'relative'|'static', value: string}
4138
- */
4139
- _parseTemplate(w) {
4140
- const D = [];
4141
- let O = w;
4142
- for (; O.length > 0; ) {
4143
- const F = O.indexOf("r"), q = O.indexOf("s"), W = [F, q].filter((Y) => Y !== -1).sort((Y, G) => Y - G)[0];
4144
- if (W === void 0) {
4145
- O.length > 0 && D.push({ type: "text", value: O });
4146
- break;
4147
- }
4148
- W > 0 && D.push({ type: "text", value: O.substring(0, W) }), W === F ? D.push({ type: "relative", value: "" }) : D.push({ type: "static", value: "" }), O = O.substring(W + 1);
4149
- }
4150
- return D;
4151
- }
4152
- _getFormattedParts() {
4153
- let w = this.timestamp;
4154
- w < 9466848e5 && (w = w * 1e3);
4155
- const D = new Date(w), O = formatRelativeTime(D), F = formatDatetime(D), q = formatDate(D);
4156
- switch (this.kind) {
4157
- case "relative":
4158
- return [{ type: "relative", value: O }];
4159
- case "datetime":
4160
- return [{ type: "static", value: F }];
4161
- case "date":
4162
- return [{ type: "static", value: q }];
4163
- case "both":
4164
- return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
4165
- default:
4166
- return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
4167
- }
4168
- }
4169
- render() {
4170
- let w = this.timestamp;
4171
- w < 9466848e5 && (w = w * 1e3);
4172
- const D = new Date(w), O = this._getFormattedParts();
4173
- return x`<time datetime="${D.toISOString()}">
4174
- ${O.map((F) => F.type === "relative" ? x`<span class="relative">${F.value}</span>` : F.type === "static" ? x`<span class="static">${F.value}</span>` : x`<span class="separator">${F.value}</span>`)}
4175
- </time>`;
4176
- }
4177
- }
4178
- customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", ZooTimestamp);
4179
- const zoo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4180
- __proto__: null,
4181
- ZooTag,
4182
- ZooTimestamp,
4183
- getEventAttribute,
4184
- getSemanticAttributes
4185
- }, Symbol.toStringTag, { value: "Module" }));
4186
- async function registerCarbonLibrary(U = {}) {
4187
- const { registerCarbonLibrary: w } = await import("./register-CpwdnySd.js");
4188
- return w(U);
4189
- }
4190
- async function registerMdcLibrary() {
4191
- const { registerMdcLibrary: U } = await import("./register-D3mJ58Cv.js");
4192
- return U();
4193
- }
4194
- const zooy = {
4195
- Evt,
4196
- Component,
4197
- Dragger,
4198
- Panel,
4199
- FormPanel,
4200
- Split,
4201
- UserManager,
4202
- View,
4203
- Conductor,
4204
- DataBinder: Binder,
4205
- UiEventType,
4206
- domUtils,
4207
- uriUtils,
4208
- registerCarbonLibrary,
4209
- registerMdcLibrary,
4210
- ComponentLibraryRegistry,
4211
- handlers,
4212
- zoo
4213
- };
4214
- export {
4215
- uriUtils as A,
4216
- B,
4217
- ComponentLibraryRegistry as C,
4218
- Dragger as D,
4219
- E,
4220
- FormPanel as F,
4221
- handlers as G,
4222
- zoo as H,
4223
- Panel as P,
4224
- Split as S,
4225
- T,
4226
- UserManager as U,
4227
- View as V,
4228
- _curry2 as _,
4229
- i$3 as a,
4230
- b,
4231
- _curry3 as c,
4232
- _path as d,
4233
- isDefAndNotNull as e,
4234
- f$1 as f,
4235
- getSemanticAttributes as g,
4236
- Binder as h,
4237
- i,
4238
- hasPath as j,
4239
- getEventAttribute as k,
4240
- getElDataMap as l,
4241
- treeUtils as m,
4242
- registerMdcLibrary as n,
4243
- objToPaths as o,
4244
- path as p,
4245
- Evt as q,
4246
- registerCarbonLibrary as r,
4247
- Component as s,
4248
- toLowerCase as t,
4249
- u$1 as u,
4250
- UiEventType as v,
4251
- Conductor as w,
4252
- x,
4253
- domUtils as y,
4254
- zooy as z
4255
- };