@orangelogic/design-system 2.0.0-29DUO2-beta-3 → 2.0.0-29IORR-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/library/chunks/{AxisLabelRadial.CgPb7ghO.js → AxisLabelRadial.Bs1P_q_F.js} +1 -1
  2. package/library/chunks/{BaseColumnSeries.B6rG-Ylz.js → BaseColumnSeries.C7jwOxIJ.js} +1 -1
  3. package/library/chunks/{CandlestickSeries.C-YfO-57.js → CandlestickSeries.CkXGtRWE.js} +2 -2
  4. package/library/chunks/{Circle.DhoXSsjo.js → Circle.DBa5Ok8V.js} +1 -1
  5. package/library/chunks/{ColumnSeries.CZi2LBZ2.js → ColumnSeries.DGazbfza.js} +2 -2
  6. package/library/chunks/{EditableAxisLabel.CykTMTsG.js → EditableAxisLabel.wN0t_G2B.js} +2 -2
  7. package/library/chunks/{EditableLabel.BlQ7B4D0.js → EditableLabel.BWeq6fgX.js} +1 -1
  8. package/library/chunks/{Gradient.BQ0JzFEe.js → Gradient.CdcsPIru.js} +1 -1
  9. package/library/chunks/{LinearGradient.DuVS2EHe.js → LinearGradient.B1z9AGUt.js} +2 -2
  10. package/library/chunks/{Picture.DRO0jnR6.js → Picture.YSPC0l0Q.js} +1 -1
  11. package/library/chunks/{Polygon.DEO3f_qs.js → Polygon.BwMvXN2H.js} +1 -1
  12. package/library/chunks/{ProgressPie.Bryx2w1J.js → ProgressPie.DlCwXN17.js} +5 -5
  13. package/library/chunks/{RadialLabel.TyXECvYG.js → RadialLabel.DyVOf2K8.js} +1 -1
  14. package/library/chunks/{Scrollbar.DK48nKk4.js → Scrollbar.BdZVb_Z-.js} +1 -1
  15. package/library/chunks/{Slice.DbXRplXx.js → Slice.DiEswWa6.js} +1 -1
  16. package/library/chunks/{Slider.B27osQYu.js → Slider.C20No2z5.js} +1 -1
  17. package/library/chunks/{SpriteResizer.C4wFzD_x.js → SpriteResizer.DFnmcy0h.js} +1 -1
  18. package/library/chunks/{Triangle.BEmFiHyd.js → Triangle.BaOef7HV.js} +1 -1
  19. package/library/chunks/{ZoomTools.CBqjLDqb.js → ZoomTools.D5JPehoL.js} +1 -1
  20. package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
  21. package/library/chunks/{am-chart.B_OdX4Q-.js → am-chart.H2jnOzFc.js} +254 -262
  22. package/library/chunks/{animation.DfUHRQry.js → animation.7ifl4x2S.js} +4 -8
  23. package/library/chunks/array.DCtvHiLS.js +81 -0
  24. package/library/chunks/asset.D7E0-cUV.js +460 -0
  25. package/library/chunks/{button.KnE3mcyM.js → button.CauAHfdl.js} +10 -45
  26. package/library/chunks/button.styles.CKqn956w.js +5 -0
  27. package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
  28. package/library/chunks/{color-swatch-group.p3Sdqlat.js → color-swatch-group.D5BP2W3P.js} +50 -220
  29. package/library/chunks/{color-swatch.C0oPHfOu.js → color-swatch.2HS4bc3N.js} +20 -204
  30. package/library/chunks/{colorPicker.CJwbdhtn.js → colorPicker.06n6P3aK.js} +5 -5
  31. package/library/chunks/component.styles.CRO4Odto.js +5 -0
  32. package/library/chunks/confirm-popover.DmGAMS8X.js +121 -0
  33. package/library/chunks/{cropper.tSDgXKqJ.js → cropper.ZU2Dy-MM.js} +8182 -8540
  34. package/library/chunks/{dialog.DpZBbTCn.js → dialog.2UW1LNm1.js} +117 -314
  35. package/library/chunks/{dom.BQVKDNd8.js → dom.BslZF2Y_.js} +1 -1
  36. package/library/chunks/dot-pagination.DsAfSNzr.js +204 -0
  37. package/library/chunks/{endpoints.B7lcoc1N.js → endpoints.Fpyb8xvv.js} +214 -203
  38. package/library/chunks/{exporting.DCqJtW6l.js → exporting.Chnl3UWi.js} +2 -2
  39. package/library/chunks/file-on-demand.Dig_iVvx.js +1956 -0
  40. package/library/chunks/{flow.Ch1rU01m.js → flow.D2CqFQa7.js} +5 -5
  41. package/library/chunks/folder-select.BT1drT8C.js +775 -0
  42. package/library/chunks/form-control.styles.CaGWmeAS.js +5 -0
  43. package/library/chunks/{form.DgwYWi0O.js → form.CFc09rKh.js} +1 -1
  44. package/library/chunks/{gantt.rWdF_jmG.js → gantt.DSHD2gjO.js} +8 -8
  45. package/library/chunks/header.BePZwMCQ.js +170 -0
  46. package/library/chunks/{hierarchy.HoRJAu6S.js → hierarchy.DwVsMmsP.js} +5 -5
  47. package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
  48. package/library/chunks/{i18n.C0iakJkV.js → i18n.BFqTRDCA.js} +19 -12
  49. package/library/chunks/icon-button.rKe0N4VB.js +149 -0
  50. package/library/chunks/iframe.DznmlYpV.js +73 -0
  51. package/library/chunks/{image.C9avagDq.js → image.CEtCGsNL.js} +275 -488
  52. package/library/chunks/{index.D2JPKXqq.js → index.C9khsiad.js} +17 -17
  53. package/library/chunks/isObjectLike.z36Fu426.js +34 -0
  54. package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
  55. package/library/chunks/{json.DHNMAC-m.js → json.zyETMOw-.js} +3 -3
  56. package/library/chunks/{list-editor.B2mFE9f7.js → list-editor.CJ96S1Np.js} +58 -372
  57. package/library/chunks/{map.BHmZ4Crx.js → map.CqM2O6LB.js} +2 -2
  58. package/library/chunks/option.COnEtd3X.js +123 -0
  59. package/library/chunks/{overlayscrollbars.XhGWx9Zk.js → overlayscrollbars.BMav4RQ4.js} +252 -958
  60. package/library/chunks/pagination.DaD9Yul6.js +334 -0
  61. package/library/chunks/{percent.CM9cr1H3.js → percent.DuQwbCCg.js} +3 -3
  62. package/library/chunks/{radar.CQUnnhGk.js → radar.FpYl3UH5.js} +4 -4
  63. package/library/chunks/{responsive.CrX-HUow.js → responsive.BndCeSg0.js} +1 -1
  64. package/library/chunks/{sliceGrouper.iv1p8MAK.js → sliceGrouper.BsE7fGMt.js} +1 -1
  65. package/library/chunks/{stock.CU0y6a5P.js → stock.BR-ag4Pt.js} +9 -9
  66. package/library/chunks/string.BigZhczf.js +185 -0
  67. package/library/chunks/{tab-group.05PY0smt.js → tab-group.0Po0eoxR.js} +33 -584
  68. package/library/chunks/{table.DNTm_GMS.js → table.WNd284in.js} +3535 -4852
  69. package/library/chunks/{timeline.yzdwtGKM.js → timeline.DkzkmgEM.js} +5 -5
  70. package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
  71. package/library/chunks/toast.B2cJgW5u.js +71 -0
  72. package/library/chunks/transformation.CzBptarI.js +140 -0
  73. package/library/chunks/{tree.CeMLCbs-.js → tree.QCQd_cuc.js} +32 -400
  74. package/library/chunks/typography.DJC_UXgs.js +52 -0
  75. package/library/chunks/url.Cj9cIQXJ.js +27 -0
  76. package/library/chunks/{venn.BOEi13la.js → venn.D739bOV3.js} +1 -1
  77. package/library/chunks/watch.BCJD77bD.js +547 -0
  78. package/library/chunks/{wc.V-lq02JF.js → wc.DzW311D-.js} +1 -1
  79. package/library/chunks/{xy.Df1hy9ac.js → xy.DCRDfTsa.js} +10 -10
  80. package/library/components/alert.js +11 -179
  81. package/library/components/am-chart.js +3 -3
  82. package/library/components/animated-image.js +13 -101
  83. package/library/components/animation.js +3 -3
  84. package/library/components/array-line-clamp.js +8 -89
  85. package/library/components/asset-link-format.js +718 -1380
  86. package/library/components/atoms.js +18 -18
  87. package/library/components/avatar.js +6 -95
  88. package/library/components/badge.js +11 -139
  89. package/library/components/bicolor-picker.js +4 -23
  90. package/library/components/border-input-group.js +5 -26
  91. package/library/components/breadcrumb-item.js +25 -156
  92. package/library/components/breadcrumb.js +4 -22
  93. package/library/components/button-group.js +3 -28
  94. package/library/components/button.js +6 -6
  95. package/library/components/card.js +4 -126
  96. package/library/components/checkbox.js +13 -254
  97. package/library/components/color-picker.js +57 -728
  98. package/library/components/color-swatch-group.js +9 -9
  99. package/library/components/color-swatch.js +5 -5
  100. package/library/components/confirm-popover.js +6 -6
  101. package/library/components/copy-button.js +11 -256
  102. package/library/components/corner-position-input-group.js +5 -58
  103. package/library/components/cropper.js +2 -2
  104. package/library/components/details.js +6 -152
  105. package/library/components/dialog.js +6 -6
  106. package/library/components/divider.js +6 -68
  107. package/library/components/dot-pagination.js +4 -4
  108. package/library/components/dot-status.js +25 -95
  109. package/library/components/drawer.js +11 -242
  110. package/library/components/dropdown.js +49 -151
  111. package/library/components/dynamic-select.js +10 -75
  112. package/library/components/e-chart.js +8 -51
  113. package/library/components/element-clamp.js +7 -80
  114. package/library/components/file-on-demand.js +13 -13
  115. package/library/components/folder-select.js +9 -7
  116. package/library/components/format-bytes.js +1 -1
  117. package/library/components/format-date.js +3 -7
  118. package/library/components/format-number.js +1 -1
  119. package/library/components/format-time.js +4 -14
  120. package/library/components/grid-item.js +5 -172
  121. package/library/components/grid.js +5 -41
  122. package/library/components/header.js +4 -4
  123. package/library/components/hub-connection.js +2 -2
  124. package/library/components/icon-button.js +14 -679
  125. package/library/components/icon.js +9 -2449
  126. package/library/components/iframe.js +4 -4
  127. package/library/components/image-comparer.js +9 -129
  128. package/library/components/image.js +4 -4
  129. package/library/components/include.js +3 -7
  130. package/library/components/input-group.js +4 -29
  131. package/library/components/input.js +358 -966
  132. package/library/components/line-clamp.js +7 -83
  133. package/library/components/list-editor.js +9 -9
  134. package/library/components/markdown.js +2 -4
  135. package/library/components/masonry.js +24 -223
  136. package/library/components/menu-item.js +155 -445
  137. package/library/components/menu-label.js +3 -20
  138. package/library/components/menu-section.js +3 -17
  139. package/library/components/menu.js +5 -113
  140. package/library/components/molecules.js +5 -5
  141. package/library/components/mutation-observer.js +3 -7
  142. package/library/components/option.js +4 -4
  143. package/library/components/organisms.js +2 -2
  144. package/library/components/padding-input-group.js +5 -16
  145. package/library/components/pagination.js +10 -8
  146. package/library/components/popup.js +385 -682
  147. package/library/components/position-picker.js +4 -94
  148. package/library/components/progress-bar.js +19 -136
  149. package/library/components/progress-ring.js +4 -95
  150. package/library/components/qr-code.js +5 -17
  151. package/library/components/radio-button.js +5 -25
  152. package/library/components/radio-card.js +8 -176
  153. package/library/components/radio-group.js +22 -153
  154. package/library/components/radio.js +14 -171
  155. package/library/components/range.js +123 -660
  156. package/library/components/rating.js +58 -238
  157. package/library/components/relative-time.js +3 -13
  158. package/library/components/resize-observer.js +4 -8
  159. package/library/components/select.js +305 -1012
  160. package/library/components/shadow-input-group.js +5 -24
  161. package/library/components/share-option-list.js +21 -313
  162. package/library/components/sidebar.js +15 -221
  163. package/library/components/size-input-group.js +12 -77
  164. package/library/components/skeleton.js +7 -80
  165. package/library/components/space.js +6 -143
  166. package/library/components/spinner.js +7 -76
  167. package/library/components/split-panel.js +18 -125
  168. package/library/components/step.js +21 -272
  169. package/library/components/stepper-wizard.js +9 -43
  170. package/library/components/stepper.js +17 -34
  171. package/library/components/switch.js +13 -276
  172. package/library/components/tab-group.js +7 -7
  173. package/library/components/tab-panel.js +5 -32
  174. package/library/components/tab.js +11 -257
  175. package/library/components/table.js +8 -8
  176. package/library/components/tag.js +15 -166
  177. package/library/components/textarea.js +183 -504
  178. package/library/components/timecode.js +6 -25
  179. package/library/components/tooltip.js +10 -94
  180. package/library/components/tree-item.js +4 -4
  181. package/library/components/tree.js +4 -4
  182. package/library/components/typeface.js +24 -123
  183. package/library/components/types.js +37225 -47339
  184. package/library/components/typography.js +2 -2
  185. package/library/components/video.js +3875 -6263
  186. package/library/components/visually-hidden.js +3 -15
  187. package/library/package.json +4 -1
  188. package/library/packages/atoms/src/components/dialog/dialog.d.ts +10 -0
  189. package/library/packages/atoms/src/components/icon-button/icon-button.d.ts +2 -1
  190. package/library/packages/atoms/src/components/image/image.d.ts +15 -1
  191. package/library/packages/atoms/src/components/input/auto-grow-controller.d.ts +23 -0
  192. package/library/packages/atoms/src/components/input/input.d.ts +10 -2
  193. package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +4 -0
  194. package/library/packages/atoms/src/components/pagination/pagination.d.ts +32 -2
  195. package/library/packages/atoms/src/components/popup/overlay/Overlay.d.ts +10 -0
  196. package/library/packages/atoms/src/components/popup/popup.d.ts +1 -1
  197. package/library/packages/atoms/src/components/select/select.d.ts +11 -0
  198. package/library/packages/atoms/src/components/table/table.d.ts +49 -8
  199. package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
  200. package/library/packages/atoms/src/components/table/tabulator-tables/core/TabulatorFull.d.ts +1 -0
  201. package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
  202. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
  203. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/Edit.d.ts +1 -0
  204. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +40 -1
  205. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/Filter.d.ts +10 -3
  206. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/formatter-display-resolvers.d.ts +93 -0
  207. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/Group.d.ts +8 -0
  208. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupComponent.d.ts +3 -1
  209. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupLoadMore.d.ts +7 -0
  210. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupRows.d.ts +2 -0
  211. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Page/Page.d.ts +2 -2
  212. package/library/packages/atoms/src/components/textarea/textarea.d.ts +19 -4
  213. package/library/packages/atoms/src/components/video/video.d.ts +3 -1
  214. package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
  215. package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
  216. package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
  217. package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
  218. package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
  219. package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
  220. package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
  221. package/library/packages/events/src/cx-unauthorized.d.ts +10 -0
  222. package/library/packages/events/src/cx-video-format-picker-delete.d.ts +6 -0
  223. package/library/packages/events/src/cx-video-format-picker-select.d.ts +8 -0
  224. package/library/packages/events/src/events.d.ts +11 -1
  225. package/library/packages/molecules/src/cropper/cropper.d.ts +2 -0
  226. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +2 -0
  227. package/library/packages/molecules/src/estimated-reading-time/estimated-reading-time.d.ts +3 -2
  228. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +26 -0
  229. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +46 -0
  230. package/library/packages/molecules/src/folder-select/folder-select.d.ts +25 -0
  231. package/library/packages/molecules/src/index.d.ts +1 -0
  232. package/library/packages/molecules/src/storybook/storybook.d.ts +60 -23
  233. package/library/packages/molecules/src/timeline/timeline.d.ts +14 -0
  234. package/library/packages/molecules/src/video-format-picker/video-format-picker.d.ts +55 -0
  235. package/library/packages/molecules/src/video-format-picker/video-format-picker.styles.d.ts +2 -0
  236. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -1
  237. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
  238. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +95 -0
  239. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
  240. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
  241. package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
  242. package/library/packages/organisms/src/carousel/carousel.d.ts +5 -1
  243. package/library/packages/organisms/src/comment/comment.d.ts +1 -0
  244. package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
  245. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
  246. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
  247. package/library/packages/organisms/src/content-builder/components/folder-picker/folder-picker.d.ts +6 -0
  248. package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
  249. package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
  250. package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
  251. package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
  252. package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
  253. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
  254. package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
  255. package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
  256. package/library/packages/organisms/src/content-builder/styleController.d.ts +20 -2
  257. package/library/packages/organisms/src/index.d.ts +2 -0
  258. package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
  259. package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
  260. package/library/packages/services/src/api/asset/asset.d.ts +3 -2
  261. package/library/packages/services/src/api/asset/asset.types.d.ts +84 -0
  262. package/library/packages/services/src/api/asset/asset.utils.d.ts +9 -0
  263. package/library/packages/services/src/api/endpoints.d.ts +1 -1
  264. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
  265. package/library/packages/tools/src/fetch-image/fetch-image.d.ts +17 -5
  266. package/library/packages/types/src/asset-click-action.d.ts +3 -1
  267. package/library/packages/types/src/bento-grid.d.ts +37 -0
  268. package/library/packages/types/src/content-builder.d.ts +27 -1
  269. package/library/packages/types/src/gallery.d.ts +0 -6
  270. package/library/packages/types/src/icon-button.d.ts +7 -0
  271. package/library/packages/types/src/menu-item.d.ts +33 -0
  272. package/library/packages/types/src/storybook.d.ts +19 -0
  273. package/library/packages/types/src/table.d.ts +37 -1
  274. package/library/packages/types/src/textarea.d.ts +4 -0
  275. package/library/packages/types/src/video-format-picker.d.ts +11 -0
  276. package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
  277. package/library/packages/utils/src/custom-element/i18n.d.ts +10 -3
  278. package/library/packages/utils/src/index.d.ts +1 -0
  279. package/library/packages/utils/src/string/string.d.ts +33 -0
  280. package/library/packages/utils/src/transformation/index.d.ts +1 -0
  281. package/library/packages/utils/src/url/url.d.ts +9 -0
  282. package/library/react-web-component.d.ts +293 -29
  283. package/library/utils.js +483 -178
  284. package/package.json +4 -1
  285. package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
  286. package/library/chunks/asset.CG_yXtWK.js +0 -288
  287. package/library/chunks/button.styles.Dl5IQLHU.js +0 -718
  288. package/library/chunks/component.styles.DMSLciL5.js +0 -71
  289. package/library/chunks/confirm-popover.zmOFI4e-.js +0 -288
  290. package/library/chunks/content-builder.D_phDrlo.js +0 -127
  291. package/library/chunks/dot-pagination.COBkyhoJ.js +0 -325
  292. package/library/chunks/file-on-demand.CbE-qsiP.js +0 -3740
  293. package/library/chunks/folder-select.Bl_WkhVE.js +0 -844
  294. package/library/chunks/form-control.styles.CUGhvlfT.js +0 -67
  295. package/library/chunks/header.BduX6KJP.js +0 -777
  296. package/library/chunks/identity.ByMq8VxU.js +0 -6
  297. package/library/chunks/iframe.BPKV2K7z.js +0 -160
  298. package/library/chunks/index.B3wJT3XS.js +0 -373
  299. package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
  300. package/library/chunks/option.DnpkE8Xi.js +0 -296
  301. package/library/chunks/pagination.C30LoTya.js +0 -341
  302. package/library/chunks/string.B_rEG27K.js +0 -160
  303. package/library/chunks/toast.BXNbwZV8.js +0 -25
  304. package/library/chunks/typography.oDzoLbZS.js +0 -149
  305. package/library/chunks/url.LjsR2sB5.js +0 -15
  306. package/library/chunks/watch.q1sEjPWL.js +0 -501
  307. /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
@@ -0,0 +1,775 @@
1
+ import N from "../components/icon.js";
2
+ import oe from "../components/input.js";
3
+ import H from "../components/line-clamp.js";
4
+ import ce from "../components/select.js";
5
+ import ne from "../components/tag.js";
6
+ import { C as g, a as he } from "./tree.QCQd_cuc.js";
7
+ import { n as r, C as U } from "./lib-cortex-element.CVMmyPMC.js";
8
+ import { h as E, F as de, c as pe } from "./endpoints.Fpyb8xvv.js";
9
+ import { c as Z } from "./component.styles.CRO4Odto.js";
10
+ import { c as L } from "./custom-element.L4WJXn1j.js";
11
+ import { L as M } from "./i18n.BFqTRDCA.js";
12
+ import { w as f } from "./watch.BCJD77bD.js";
13
+ import { x as m, i as ue } from "./lit-element.jLBm65_O.js";
14
+ import { r as x } from "./state.CSDxrqLd.js";
15
+ import { e as J } from "./query.BBf1UFkC.js";
16
+ import { r as fe } from "./choose.BTbF6BAn.js";
17
+ import { C as K } from "./button.CauAHfdl.js";
18
+ import { d as me } from "./debounce.DaHuiSGU.js";
19
+ import { g as X, p as W, e as ye } from "./string.BigZhczf.js";
20
+ import { o as y } from "./if-defined.BRoBj_Rp.js";
21
+ import { c as Y } from "./repeat.DbF2p5ae.js";
22
+ import { n as D } from "./when.Dr1es41R.js";
23
+ import xe from "../components/space.js";
24
+ import { M as q } from "./asset-link-format.BSRDqHg7.js";
25
+ import { g as be } from "./template.CsJd8Pb_.js";
26
+ import { e as ge } from "./class-map.BiVq-cVR.js";
27
+ var R = /* @__PURE__ */ ((e) => (e.Album = "Album", e.Audio = "Audio", e.Image = "Image", e.Multimedia = "Multimedia", e.ProjectDocument = "ProjectDocument", e.Story = "Story", e.Video = "Video", e.Widget = "Widget", e))(R || {}), v = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(v || {});
28
+ const ve = 50;
29
+ async function A({
30
+ allowedFolders: e,
31
+ baseUrl: t,
32
+ bearerToken: s,
33
+ excludeVirtualFolders: l,
34
+ folderId: a,
35
+ includeDirectChild: p,
36
+ limit: u = ve,
37
+ searchTerm: $,
38
+ self: T,
39
+ start: G = 0,
40
+ token: ae
41
+ }) {
42
+ let k = [], z = p ?? !0;
43
+ e && e.length > 0 && !a ? (k = e, T = !0, z = !1) : a && (k = [a]);
44
+ try {
45
+ return (await E.request({
46
+ baseURL: t,
47
+ headers: {
48
+ Authorization: `Bearer ${s}`
49
+ },
50
+ method: "GET",
51
+ params: {
52
+ IncludeDirectChild: z,
53
+ IncludeVirtualFolders: !l,
54
+ Limit: u,
55
+ ObjectRecordIDs: k,
56
+ SeeThru: !!$,
57
+ Self: T,
58
+ Start: G,
59
+ Text: $ || void 0,
60
+ Token: ae || void 0
61
+ },
62
+ paramsSerializer: {
63
+ indexes: null
64
+ },
65
+ responseType: "json",
66
+ transformResponse: [
67
+ ...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
68
+ (S, Pe, w) => {
69
+ if (w !== void 0 && (w < 200 || w >= 300))
70
+ return {
71
+ data: [],
72
+ hasMore: !1,
73
+ totalCount: 0
74
+ };
75
+ if (!S || typeof S != "object")
76
+ throw new Error("Invalid response format");
77
+ const ie = S.contentItems?.length ?? 0;
78
+ return {
79
+ data: S.contentItems?.map((b) => {
80
+ const O = b.fields[v.DocType] ?? "", P = b.fields[v.TitleWithFallback] ?? "", I = b.fields[v.CortexPath] ?? "", V = I.endsWith("/") && I.length > 1 ? I.slice(0, -1) : I;
81
+ let B = V;
82
+ return (O === R.Album || O === R.ProjectDocument) && (B = V ? `${V}/${P}` : P), {
83
+ docType: O,
84
+ fullPath: B,
85
+ hasChildren: b.fields[v.HasBrowserChildren] === "1",
86
+ id: b.recordID,
87
+ isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
88
+ representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
89
+ title: P
90
+ };
91
+ }) ?? [],
92
+ hasMore: G + ie < S.totalCount,
93
+ totalCount: S.totalCount
94
+ };
95
+ }
96
+ ],
97
+ url: de
98
+ })).data;
99
+ } catch {
100
+ return {
101
+ data: [],
102
+ hasMore: !1,
103
+ totalCount: 0
104
+ };
105
+ }
106
+ }
107
+ var C = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(C || {}), $e = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, h = (e, t, s, l) => {
108
+ for (var a = l > 1 ? void 0 : l ? Se(t, s) : t, p = e.length - 1, u; p >= 0; p--)
109
+ (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
110
+ return l && a && $e(t, s, a), a;
111
+ };
112
+ let o = class extends U {
113
+ constructor() {
114
+ super(...arguments), this.localize = new M(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = q.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.selection = "single", this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = A, this.excludeVirtualFolders = !1, this.url = "", this.icon = "", this.data = null, this.hasMore = !1, this.loading = !1;
115
+ }
116
+ /**
117
+ * This is used to render the cx-tree-item inside the cx-folder-item without the shadow root so that the cx-tree can query select the cx-tree-item inside
118
+ */
119
+ createRenderRoot() {
120
+ return this;
121
+ }
122
+ async fetchFolders({
123
+ folderId: e,
124
+ start: t = 0
125
+ }) {
126
+ if (!this.api)
127
+ return {
128
+ data: [],
129
+ hasMore: !1,
130
+ totalCount: 0
131
+ };
132
+ try {
133
+ const { data: s, hasMore: l, totalCount: a } = await this.api({
134
+ baseUrl: this.baseUrl,
135
+ bearerToken: this.bearerToken,
136
+ excludeVirtualFolders: this.excludeVirtualFolders,
137
+ folderId: e,
138
+ start: t,
139
+ token: this.token
140
+ });
141
+ return {
142
+ data: s,
143
+ hasMore: l,
144
+ totalCount: a
145
+ };
146
+ } catch {
147
+ return {
148
+ data: [],
149
+ hasMore: !1,
150
+ totalCount: 0
151
+ };
152
+ }
153
+ }
154
+ async loadMore(e) {
155
+ e.stopPropagation();
156
+ const t = this.data?.length || 0;
157
+ this.loading = !0;
158
+ try {
159
+ const { data: s, hasMore: l } = await this.fetchFolders({
160
+ folderId: this.folderId,
161
+ start: t
162
+ });
163
+ this.data = [...this.data || [], ...s], this.hasMore = l;
164
+ } catch {
165
+ } finally {
166
+ this.loading = !1;
167
+ }
168
+ }
169
+ async handleLazyLoad(e) {
170
+ e.stopPropagation(), this.treeItem.expanded = !0;
171
+ const t = this.data?.length || 0;
172
+ try {
173
+ const { data: s, hasMore: l } = await this.fetchFolders({
174
+ folderId: this.folderId,
175
+ start: t
176
+ });
177
+ this.data = s, this.hasMore = l;
178
+ } catch {
179
+ this.treeItem.expanded = !1;
180
+ }
181
+ }
182
+ async syncBoxes() {
183
+ if (this.selection !== "multiple" || (await this.updateComplete, !this.treeItem))
184
+ return;
185
+ const e = this.fullPath, t = X({ id: this.folderId, path: e }), s = W(e), l = this.currentRootIDsSet.has(t);
186
+ let a = !1;
187
+ if (e)
188
+ for (const u of this.currentRootIDsSet) {
189
+ const $ = ye(u);
190
+ if (!$.path.trim() || !$.id.trim())
191
+ continue;
192
+ const T = W($.path);
193
+ if (T.startsWith(s) && T !== s) {
194
+ a = !0;
195
+ break;
196
+ }
197
+ }
198
+ const p = !l && a;
199
+ this.treeItem.selected = l, await this.treeItem.updateComplete, this.treeItem.indeterminate = p;
200
+ }
201
+ render() {
202
+ let e = "filled";
203
+ return this.docType === q.Album && (e = "outlined"), m`<cx-tree-item class=${ge({
204
+ "folder-select-tree-item": !0
205
+ })} data-id=${this.folderId} data-url=${y(this.url)} data-name=${y(this.name?.trim() || void 0)} data-representative-asset-id=${y(
206
+ this.representativeAssetId || void 0
207
+ )} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selection !== "multiple" && this.selectedValue === this.folderId} ?disabled-sync-checkboxes=${this.selection === "multiple"} .selectable=${this.selectable} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name=${this.icon || "folder"} variant=${e}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${be(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${Y(
208
+ this.data || [],
209
+ (t) => t.id,
210
+ (t) => m`<cx-folder-select-tree-item slot="children" folder-id=${t.id} full-path=${t.fullPath} name=${t.title} representative-asset-id=${t.representativeAssetId} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${t.hasChildren} ?selectable=${this.selectable} base-url=${this.baseUrl} url=${y(t.url ?? void 0)} .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} value=${t.url}></cx-folder-select-tree-item>`
211
+ )}</cx-tree-item>${D(
212
+ this.hasMore,
213
+ () => m`<div slot="children" class="load-more-button"><cx-button variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button></div>`
214
+ )}
215
+ `;
216
+ }
217
+ };
218
+ o.styles = [Z];
219
+ o.dependencies = {
220
+ "cx-button": K,
221
+ "cx-icon": N,
222
+ "cx-line-clamp": H,
223
+ "cx-space": xe,
224
+ "cx-tree-item": g
225
+ };
226
+ h([
227
+ J("cx-tree-item")
228
+ ], o.prototype, "treeItem", 2);
229
+ h([
230
+ r({ attribute: "folder-id", reflect: !0, type: String })
231
+ ], o.prototype, "folderId", 2);
232
+ h([
233
+ r({ attribute: "has-children", reflect: !0, type: Boolean })
234
+ ], o.prototype, "hasChildren", 2);
235
+ h([
236
+ r({ reflect: !0, type: Boolean })
237
+ ], o.prototype, "selectable", 2);
238
+ h([
239
+ r({ attribute: "full-path", reflect: !0, type: String })
240
+ ], o.prototype, "fullPath", 2);
241
+ h([
242
+ r({ attribute: "doc-type", reflect: !0, type: String })
243
+ ], o.prototype, "docType", 2);
244
+ h([
245
+ r({ reflect: !0, type: String })
246
+ ], o.prototype, "name", 2);
247
+ h([
248
+ r({
249
+ attribute: "representative-asset-id",
250
+ reflect: !0,
251
+ type: String
252
+ })
253
+ ], o.prototype, "representativeAssetId", 2);
254
+ h([
255
+ r({ attribute: "selected-value", reflect: !0, type: String })
256
+ ], o.prototype, "selectedValue", 2);
257
+ h([
258
+ r({ attribute: "selection", reflect: !0, type: String })
259
+ ], o.prototype, "selection", 2);
260
+ h([
261
+ r({ attribute: !1, type: Object })
262
+ ], o.prototype, "currentRootIDsSet", 2);
263
+ h([
264
+ r({ attribute: !1, type: Array })
265
+ ], o.prototype, "removedIDs", 2);
266
+ h([
267
+ r({ reflect: !0, type: String })
268
+ ], o.prototype, "token", 2);
269
+ h([
270
+ r({ attribute: "bearer-token", reflect: !0, type: String })
271
+ ], o.prototype, "bearerToken", 2);
272
+ h([
273
+ r({ attribute: "base-url", reflect: !0, type: String })
274
+ ], o.prototype, "baseUrl", 2);
275
+ h([
276
+ r({ attribute: "search-term", reflect: !0, type: String })
277
+ ], o.prototype, "searchTerm", 2);
278
+ h([
279
+ r({ type: Function })
280
+ ], o.prototype, "api", 2);
281
+ h([
282
+ r({
283
+ attribute: "exclude-virtual-folders",
284
+ reflect: !0,
285
+ type: Boolean
286
+ })
287
+ ], o.prototype, "excludeVirtualFolders", 2);
288
+ h([
289
+ r({ reflect: !0, type: String })
290
+ ], o.prototype, "url", 2);
291
+ h([
292
+ r({ reflect: !0, type: String })
293
+ ], o.prototype, "icon", 2);
294
+ h([
295
+ x()
296
+ ], o.prototype, "data", 2);
297
+ h([
298
+ x()
299
+ ], o.prototype, "hasMore", 2);
300
+ h([
301
+ x()
302
+ ], o.prototype, "loading", 2);
303
+ h([
304
+ f("currentRootIDsSet"),
305
+ f("removedIDs"),
306
+ f("fullPath"),
307
+ f("folderId")
308
+ ], o.prototype, "syncBoxes", 1);
309
+ o = h([
310
+ L("cx-folder-select-tree-item")
311
+ ], o);
312
+ var Fe = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, ee = (e) => {
313
+ throw TypeError(e);
314
+ }, d = (e, t, s, l) => {
315
+ for (var a = l > 1 ? void 0 : l ? Te(t, s) : t, p = e.length - 1, u; p >= 0; p--)
316
+ (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
317
+ return l && a && Fe(t, s, a), a;
318
+ }, te = (e, t, s) => t.has(e) || ee("Cannot " + s), Ce = (e, t, s) => (te(e, t, "read from private field"), t.get(e)), Ie = (e, t, s) => t.has(e) ? ee("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), De = (e, t, s, l) => (te(e, t, "write to private field"), t.set(e, s), s), _;
319
+ let n = class extends U {
320
+ constructor() {
321
+ super(...arguments), this.localize = new M(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = A, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], Ie(this, _, !1);
322
+ }
323
+ get empty() {
324
+ return !this.loading && this.data.length === 0;
325
+ }
326
+ /**
327
+ * This is used to render the cx-tree inside the cx-folder-select without the shadow root so that the cx-folder-select can query select the cx-tree inside
328
+ */
329
+ createRenderRoot() {
330
+ return this;
331
+ }
332
+ runFirstUpdated() {
333
+ this.searchTerm = "", this.handleFetchFolders();
334
+ }
335
+ async handleExtraFolderIdChange() {
336
+ if (!this.extraFolderId || !this.api) {
337
+ this.extraFolderData = null;
338
+ return;
339
+ }
340
+ const { data: e } = await this.api({
341
+ baseUrl: this.baseUrl,
342
+ bearerToken: this.bearerToken,
343
+ excludeVirtualFolders: this.excludeVirtualFolders,
344
+ folderId: this.extraFolderId,
345
+ includeDirectChild: !1,
346
+ limit: 1,
347
+ searchTerm: this.searchTerm,
348
+ seeThru: this.seeThru,
349
+ self: !0,
350
+ start: 0,
351
+ token: this.token
352
+ });
353
+ this.extraFolderData = e[0] ?? null;
354
+ }
355
+ /**
356
+ * Update `currentRootIDsSet` from a tree-item's toggle. Per-folder
357
+ * selection: each folder is independent, so a click only adds/removes
358
+ * the clicked folder — never its ancestors or descendants. Parents
359
+ * showing an indeterminate hint is purely visual (computed in
360
+ * `cx-folder-select-tree-item.syncBoxes` from path-prefix matches),
361
+ * not a real selection.
362
+ *
363
+ * Only runs in multiple mode — single mode is still driven by `selectedValue`.
364
+ */
365
+ async handleSelectedChange(e) {
366
+ if (this.selection !== "multiple")
367
+ return;
368
+ const t = e.target, s = t.dataset.id ?? "", l = t.closest(
369
+ "cx-folder-select-tree-item"
370
+ )?.fullPath;
371
+ if (await t.updateComplete, !s.trim() || !l?.trim())
372
+ return;
373
+ const a = X({ id: s, path: l });
374
+ t.indeterminate && !t.selected || (t.selected ? this.currentRootIDsSet.add(a) : this.currentRootIDsSet.delete(a), this.currentRootIDsSet = new Set(this.currentRootIDsSet));
375
+ }
376
+ async loadMore(e) {
377
+ if (!this.api)
378
+ return;
379
+ e.stopPropagation();
380
+ const t = this.data.length;
381
+ this.loading = !0;
382
+ const { data: s, hasMore: l } = await this.api({
383
+ baseUrl: this.baseUrl,
384
+ bearerToken: this.bearerToken,
385
+ excludeVirtualFolders: this.excludeVirtualFolders,
386
+ folderId: "",
387
+ limit: 10,
388
+ searchTerm: this.searchTerm,
389
+ seeThru: this.seeThru,
390
+ start: t,
391
+ token: this.token
392
+ });
393
+ this.data = [...this.data, ...s], this.hasMore = l, this.loading = !1;
394
+ }
395
+ async handleFetchFolders() {
396
+ const { data: e, hasMore: t } = await this.fetchFolders();
397
+ Ce(this, _) || e.length > 0 && (this.firstFetchCallback?.(e), De(this, _, !0)), this.data = e, this.hasMore = t, this.loading = !1;
398
+ }
399
+ async fetchFolders() {
400
+ if (!this.api)
401
+ return {
402
+ data: [],
403
+ hasMore: !1
404
+ };
405
+ if (this.searchTerm.length > 0 && this.searchTerm.length < this.minQueryLength)
406
+ return {
407
+ data: [],
408
+ hasMore: !1
409
+ };
410
+ this.loading = !0;
411
+ const { data: e, hasMore: t } = await this.api({
412
+ baseUrl: this.baseUrl,
413
+ bearerToken: this.bearerToken,
414
+ excludeVirtualFolders: this.excludeVirtualFolders,
415
+ folderId: "",
416
+ limit: 10,
417
+ searchTerm: this.searchTerm,
418
+ seeThru: this.seeThru,
419
+ start: 0,
420
+ token: this.token
421
+ });
422
+ return this.data = e, this.hasMore = t, this.loading = !1, {
423
+ data: e,
424
+ hasMore: t
425
+ };
426
+ }
427
+ renderFolder(e) {
428
+ return m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${e.docType} folder-id=${e.id} full-path=${y(e.fullPath ?? void 0)} name=${e.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(e.url ?? void 0)} ?has-children=${e.hasChildren} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`;
429
+ }
430
+ render() {
431
+ return m`<cx-tree class="folder-select-tree" selection=${this.selection} force-on-change disabled-auto-expand disabled-sync-checkboxes @cx-selected-change=${this.handleSelectedChange}>${D(
432
+ this.empty,
433
+ () => m`<div class="folder-select-tree__empty-message" role="status" aria-live="polite"><cx-typography variant="body3">${this.localize.term("noResults")}</cx-typography></div>`
434
+ )}
435
+ ${D(
436
+ this.extraFolderData,
437
+ () => m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${y(this.extraFolderData?.docType ?? void 0)} folder-id=${y(this.extraFolderData?.id ?? void 0)} full-path=${y(this.extraFolderData?.fullPath ?? void 0)} icon=${this.extraFolderIcon} name=${this.extraFolderTitle || this.extraFolderData?.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
438
+ )}
439
+ ${Y(
440
+ this.data,
441
+ (e) => e.id,
442
+ (e) => this.renderFolder(e)
443
+ )}
444
+ ${D(
445
+ this.hasMore,
446
+ () => m`<cx-button class="folder-select-tree__load-more" variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button>`
447
+ )}</cx-tree>`;
448
+ }
449
+ };
450
+ _ = /* @__PURE__ */ new WeakMap();
451
+ n.dependencies = {
452
+ "cx-button": K,
453
+ "cx-folder-select-tree-item": o,
454
+ "cx-tree": he
455
+ };
456
+ d([
457
+ r({ attribute: "min-query-length", reflect: !0, type: Number })
458
+ ], n.prototype, "minQueryLength", 2);
459
+ d([
460
+ r({ attribute: "selection", reflect: !0, type: String })
461
+ ], n.prototype, "selection", 2);
462
+ d([
463
+ r({ attribute: "search-term", reflect: !0, type: String })
464
+ ], n.prototype, "searchTerm", 2);
465
+ d([
466
+ r({ attribute: "selected-value", reflect: !0, type: String })
467
+ ], n.prototype, "selectedValue", 2);
468
+ d([
469
+ r({ reflect: !0, type: String })
470
+ ], n.prototype, "token", 2);
471
+ d([
472
+ r({ attribute: "bearer-token", reflect: !0, type: String })
473
+ ], n.prototype, "bearerToken", 2);
474
+ d([
475
+ r({ attribute: "base-url", reflect: !0, type: String })
476
+ ], n.prototype, "baseUrl", 2);
477
+ d([
478
+ r({ attribute: "extra-folder-id", reflect: !0, type: String })
479
+ ], n.prototype, "extraFolderId", 2);
480
+ d([
481
+ r({ attribute: "extra-folder-title", reflect: !0, type: String })
482
+ ], n.prototype, "extraFolderTitle", 2);
483
+ d([
484
+ r({ attribute: "extra-folder-icon", reflect: !0, type: String })
485
+ ], n.prototype, "extraFolderIcon", 2);
486
+ d([
487
+ r({ attribute: "see-thru", reflect: !0, type: Boolean })
488
+ ], n.prototype, "seeThru", 2);
489
+ d([
490
+ x()
491
+ ], n.prototype, "extraFolderData", 2);
492
+ d([
493
+ r({ type: Function })
494
+ ], n.prototype, "api", 2);
495
+ d([
496
+ r({
497
+ attribute: "exclude-virtual-folders",
498
+ reflect: !0,
499
+ type: Boolean
500
+ })
501
+ ], n.prototype, "excludeVirtualFolders", 2);
502
+ d([
503
+ r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
504
+ ], n.prototype, "firstFetchCallback", 2);
505
+ d([
506
+ x()
507
+ ], n.prototype, "data", 2);
508
+ d([
509
+ x()
510
+ ], n.prototype, "hasMore", 2);
511
+ d([
512
+ x()
513
+ ], n.prototype, "loading", 2);
514
+ d([
515
+ x()
516
+ ], n.prototype, "currentRootIDsSet", 2);
517
+ d([
518
+ x()
519
+ ], n.prototype, "removedIDs", 2);
520
+ d([
521
+ f("extraFolderId")
522
+ ], n.prototype, "handleExtraFolderIdChange", 1);
523
+ d([
524
+ f("baseUrl", { waitUntilFirstUpdate: !0 }),
525
+ f("token", { waitUntilFirstUpdate: !0 }),
526
+ f("searchTerm", { waitUntilFirstUpdate: !0 }),
527
+ f("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
528
+ me(500)
529
+ ], n.prototype, "handleFetchFolders", 1);
530
+ n = d([
531
+ L("cx-folder-select-tree")
532
+ ], n);
533
+ const _e = ue`:host{width:100%;display:block}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.folder-select-tree{flex:1;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
534
+ var ke = Object.defineProperty, we = Object.getOwnPropertyDescriptor, re = (e) => {
535
+ throw TypeError(e);
536
+ }, c = (e, t, s, l) => {
537
+ for (var a = l > 1 ? void 0 : l ? we(t, s) : t, p = e.length - 1, u; p >= 0; p--)
538
+ (u = e[p]) && (a = (l ? u(t, s, a) : u(a)) || a);
539
+ return l && a && ke(t, s, a), a;
540
+ }, se = (e, t, s) => t.has(e) || re("Cannot " + s), Q = (e, t, s) => (se(e, t, "read from private field"), s ? s.call(e) : t.get(e)), Oe = (e, t, s) => t.has(e) ? re("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), j = (e, t, s, l) => (se(e, t, "write to private field"), t.set(e, s), s), F;
541
+ let i = class extends U {
542
+ constructor() {
543
+ super(), this.localize = new M(this), this.minQueryLength = 1, this.selection = "single", this.variant = C.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = A, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.firstFetchCallback = null, this.searchTerm = "", Oe(this, F), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.selectGetTag = this.selectGetTag.bind(this), this.updateWrappedApi();
544
+ }
545
+ updateWrappedApi() {
546
+ if (!this.api) {
547
+ j(this, F, void 0);
548
+ return;
549
+ }
550
+ j(this, F, async (e) => {
551
+ try {
552
+ return await this.api(e);
553
+ } catch (t) {
554
+ return t instanceof pe && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
555
+ }
556
+ });
557
+ }
558
+ handleSearchTermChange() {
559
+ this.emit("cx-folder-select-search-term-change", {
560
+ detail: {
561
+ value: this.searchTerm
562
+ }
563
+ });
564
+ }
565
+ handleSearchTermInputChange(e) {
566
+ this.searchTerm = e.target.value;
567
+ }
568
+ handleSearchTermSelectChange(e) {
569
+ e.target === e.currentTarget && (this.searchTerm = e.currentTarget.displayInput.value);
570
+ }
571
+ handleSelectClear() {
572
+ if (this.searchTerm = "", this.selection !== "multiple")
573
+ return;
574
+ const e = this.shadowRoot?.querySelector("cx-folder-select-tree");
575
+ e && (e.currentRootIDsSet = /* @__PURE__ */ new Set(), e.removedIDs = []);
576
+ }
577
+ /**
578
+ * cx-select's selectedOptions cache (which drives the tag UI in
579
+ * `multiple` mode) is only recomputed during its own `selectionChanged`
580
+ * flow — that flow doesn't run in our setup because we no-op
581
+ * `selectSetOptionSelected` for multi-select (cx-tree owns selection).
582
+ * After the tree's selection change propagates through `syncBoxes` and
583
+ * lands on each tree-item's `.selected`, ask cx-select to re-read its
584
+ * options so the rendered tag list matches.
585
+ */
586
+ async handleTreeSelectedChange() {
587
+ this.selection !== "multiple" || !this.selectEl || (await new Promise(
588
+ (e) => requestAnimationFrame(() => e())
589
+ ), this.selectEl.handleDefaultSlotChange(), await this.selectEl.updateComplete, this.selectEl.displayLabel = this.searchTerm);
590
+ }
591
+ selectGetOptionValue(e) {
592
+ return !e || !(e instanceof g) ? this.value : e.dataset.id || this.value;
593
+ }
594
+ selectGetOptionLabel(e) {
595
+ return !e || !(e instanceof g) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
596
+ }
597
+ selectGetOptionSelected(e) {
598
+ if (!(!e || !(e instanceof g)))
599
+ return e.selected;
600
+ }
601
+ selectFilterCallback(e) {
602
+ return !(!e || !(e instanceof g));
603
+ }
604
+ /**
605
+ * Custom tag renderer for cx-select multi mode. Identical visuals to the
606
+ * default tag, but the X click goes through cx-tree's selection flow
607
+ * (`option.selected = false` → `cx-selected-change` →
608
+ * cx-folder-select-tree.handleSelectedChange) rather than
609
+ * cx-select.toggleOptionSelection (which our `selectSetOptionSelected`
610
+ * no-ops in multi mode, so the default X click would do nothing).
611
+ */
612
+ selectGetTag(e) {
613
+ return m`<cx-tag part="tag" exportparts="
614
+ base:tag__base,
615
+ content:tag__content,
616
+ remove-button:tag__remove-button,
617
+ remove-button__base:tag__remove-button__base
618
+ " removable @cx-remove=${(s) => {
619
+ s.stopPropagation(), e instanceof g && (e.selected = !1);
620
+ }}><cx-line-clamp lines="1">${this.selectGetOptionLabel(e)}</cx-line-clamp></cx-tag>`;
621
+ }
622
+ selectSetOptionSelected(e, t) {
623
+ if (!(!e || !(e instanceof g)) && this.selection !== "multiple") {
624
+ if (t === void 0) {
625
+ e.selected = !e.selected;
626
+ return;
627
+ }
628
+ e.selected = t;
629
+ }
630
+ }
631
+ updateFunctionProps() {
632
+ this.selectEl && (this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.getTag = this.selectGetTag, this.selectEl.handleDefaultSlotChange());
633
+ }
634
+ handleOpenChange() {
635
+ if (this.selectEl) {
636
+ if (!this.open) {
637
+ this.selectEl.hide();
638
+ return;
639
+ }
640
+ this.updateFunctionProps();
641
+ }
642
+ }
643
+ async handleVariantChange() {
644
+ this.variant === C.Select && (await this.updateComplete, this.updateFunctionProps());
645
+ }
646
+ handleValueChange() {
647
+ this.selectEl && (this.searchTerm = "", this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.getTag = this.selectGetTag, this.selectEl.handleDefaultSlotChange());
648
+ }
649
+ render() {
650
+ return m`<div class="folder-select">${fe(this.variant, [
651
+ [
652
+ C.Input,
653
+ () => m`<cx-input aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${Q(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
654
+ ],
655
+ [
656
+ C.Select,
657
+ () => m`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} ?multiple=${this.selection === "multiple"} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSelectClear} @cx-selected-change=${this.handleTreeSelectedChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${Q(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
658
+ ]
659
+ ])}</div>`;
660
+ }
661
+ };
662
+ F = /* @__PURE__ */ new WeakMap();
663
+ i.styles = [Z, _e];
664
+ i.dependencies = {
665
+ "cx-folder-select-tree": n,
666
+ "cx-icon": N,
667
+ "cx-input": oe,
668
+ "cx-line-clamp": H,
669
+ "cx-select": ce,
670
+ "cx-tag": ne
671
+ };
672
+ c([
673
+ J("cx-select")
674
+ ], i.prototype, "selectEl", 2);
675
+ c([
676
+ r({ attribute: "min-query-length", reflect: !0, type: Number })
677
+ ], i.prototype, "minQueryLength", 2);
678
+ c([
679
+ r({ attribute: "selection", reflect: !0, type: String })
680
+ ], i.prototype, "selection", 2);
681
+ c([
682
+ r({ attribute: "variant", reflect: !0, type: String })
683
+ ], i.prototype, "variant", 2);
684
+ c([
685
+ r({ reflect: !0, type: String })
686
+ ], i.prototype, "value", 2);
687
+ c([
688
+ r({ reflect: !0, type: String })
689
+ ], i.prototype, "name", 2);
690
+ c([
691
+ r({ attribute: "selected-label", reflect: !0, type: String })
692
+ ], i.prototype, "selectedLabel", 2);
693
+ c([
694
+ r({ attribute: "base-url", reflect: !0, type: String })
695
+ ], i.prototype, "baseUrl", 2);
696
+ c([
697
+ r({ reflect: !0, type: Boolean })
698
+ ], i.prototype, "open", 2);
699
+ c([
700
+ r({ reflect: !1, type: String })
701
+ ], i.prototype, "token", 2);
702
+ c([
703
+ r({ attribute: "bearer-token", reflect: !0, type: String })
704
+ ], i.prototype, "bearerToken", 2);
705
+ c([
706
+ r({ attribute: "see-thru", reflect: !0, type: Boolean })
707
+ ], i.prototype, "seeThru", 2);
708
+ c([
709
+ r({ type: Function })
710
+ ], i.prototype, "api", 2);
711
+ c([
712
+ r({ reflect: !0, type: Boolean })
713
+ ], i.prototype, "required", 2);
714
+ c([
715
+ r({ reflect: !1 })
716
+ ], i.prototype, "form", 2);
717
+ c([
718
+ r({
719
+ attribute: "exclude-virtual-folders",
720
+ reflect: !0,
721
+ type: Boolean
722
+ })
723
+ ], i.prototype, "excludeVirtualFolders", 2);
724
+ c([
725
+ r({
726
+ attribute: "extra-folder-id",
727
+ reflect: !0,
728
+ type: String
729
+ })
730
+ ], i.prototype, "extraFolderId", 2);
731
+ c([
732
+ r({
733
+ attribute: "extra-folder-title",
734
+ reflect: !0,
735
+ type: String
736
+ })
737
+ ], i.prototype, "extraFolderTitle", 2);
738
+ c([
739
+ r({
740
+ attribute: "extra-folder-icon",
741
+ reflect: !0,
742
+ type: String
743
+ })
744
+ ], i.prototype, "extraFolderIcon", 2);
745
+ c([
746
+ r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
747
+ ], i.prototype, "firstFetchCallback", 2);
748
+ c([
749
+ x()
750
+ ], i.prototype, "searchTerm", 2);
751
+ c([
752
+ f("api")
753
+ ], i.prototype, "updateWrappedApi", 1);
754
+ c([
755
+ f("searchTerm", { waitUntilFirstUpdate: !0 })
756
+ ], i.prototype, "handleSearchTermChange", 1);
757
+ c([
758
+ f("open")
759
+ ], i.prototype, "handleOpenChange", 1);
760
+ c([
761
+ f("variant")
762
+ ], i.prototype, "handleVariantChange", 1);
763
+ c([
764
+ f("selectedLabel", { waitUntilFirstUpdate: !0 }),
765
+ f("value", { waitUntilFirstUpdate: !0 })
766
+ ], i.prototype, "handleValueChange", 1);
767
+ i = c([
768
+ L("cx-folder-select")
769
+ ], i);
770
+ export {
771
+ i as C,
772
+ C as F,
773
+ R as M,
774
+ A as a
775
+ };