@orangelogic/design-system 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/library/chunks/{abnfDiagram-N423BO3Z.H1zwr_k6.js → abnfDiagram-N423BO3Z.DF8zrlpl.js} +3 -3
  2. package/library/chunks/{alert.DcLDhp3k.js → alert.D4RTWtiS.js} +2 -2
  3. package/library/chunks/{architectureDiagram-T3A2C74G.AxjW1Pvo.js → architectureDiagram-T3A2C74G.ChMyS2RN.js} +5 -5
  4. package/library/chunks/{array-line-clamp.DXOk4Q3x.js → array-line-clamp.CFndztdp.js} +2 -2
  5. package/library/chunks/{asset-link-format.DqMFH-AV.js → asset-link-format.BbDrlRL5.js} +733 -658
  6. package/library/chunks/{audio.DhBjwOl_.js → audio.jEmfjIWU.js} +2 -2
  7. package/library/chunks/{bicolor-picker.COIlx1gv.js → bicolor-picker.DoLf8yCy.js} +1 -1
  8. package/library/chunks/{block-width.BOCYHUDs.js → block-width.nVsYTBw6.js} +40 -40
  9. package/library/chunks/{blockDiagram-VBNYF7ZC.BA5YJ5tg.js → blockDiagram-VBNYF7ZC.Dd9MRQVF.js} +6 -6
  10. package/library/chunks/{border-input-group.QyWhH0yj.js → border-input-group.CQ-BZvjI.js} +3 -3
  11. package/library/chunks/{breadcrumb.SMzaqsuX.js → breadcrumb.8_0yuiOI.js} +1 -1
  12. package/library/chunks/{button.DHmArHfu.js → button.VUFrOP0u.js} +3 -3
  13. package/library/chunks/{c4Diagram-5PPSVZJV.B1weqOqz.js → c4Diagram-5PPSVZJV.BYo1Zq25.js} +3 -3
  14. package/library/chunks/{channel.Bqlqmufs.js → channel.DQU07rrH.js} +1 -1
  15. package/library/chunks/{checkbox.CA7imbiT.js → checkbox.BzR50Is_.js} +1 -1
  16. package/library/chunks/{chunk-2GRJ4B5K.BOBf1_FX.js → chunk-2GRJ4B5K.DSIuCed9.js} +1 -1
  17. package/library/chunks/{chunk-4I5QYGJK.DfO_P7bO.js → chunk-4I5QYGJK.C74S0dID.js} +1 -1
  18. package/library/chunks/{chunk-5RXB4S5H.oisV3Q1b.js → chunk-5RXB4S5H.BSZ9vwQ_.js} +6 -6
  19. package/library/chunks/{chunk-6Q2QTUOP.ByglL7sM.js → chunk-6Q2QTUOP.C98k0Ypz.js} +2 -2
  20. package/library/chunks/{chunk-7Z6QIM7H.BXSFN_6B.js → chunk-7Z6QIM7H.CbyAI1qL.js} +6 -6
  21. package/library/chunks/{chunk-GF5L2VYU.BBRVN_Sz.js → chunk-GF5L2VYU.BwnEI-9p.js} +6 -6
  22. package/library/chunks/{chunk-I66GZJ75.lUTR0Zxp.js → chunk-I66GZJ75.hYJHAb8_.js} +1 -1
  23. package/library/chunks/{chunk-JQJVKLGR.dOAJ_eec.js → chunk-JQJVKLGR.Ca9c6WQC.js} +8 -8
  24. package/library/chunks/{chunk-KBJHAD2P.Bfz5cQAa.js → chunk-KBJHAD2P.Dpm7St5I.js} +1 -1
  25. package/library/chunks/{chunk-NSK5VX7P.BkWzMz1o.js → chunk-NSK5VX7P.JTL9VQLt.js} +1 -1
  26. package/library/chunks/{chunk-QR6OTTB3.DyBl4spZ.js → chunk-QR6OTTB3.1iZWec7S.js} +6 -6
  27. package/library/chunks/{chunk-UBXNYLIW.BjkOeuJd.js → chunk-UBXNYLIW.DiZRcRzh.js} +2 -2
  28. package/library/chunks/{chunk-W5SLKNZC.DzlXmWcA.js → chunk-W5SLKNZC.BpdNkiim.js} +1 -1
  29. package/library/chunks/{chunk-WRU74C26.BDl8PZFV.js → chunk-WRU74C26.BREX4nlj.js} +3 -3
  30. package/library/chunks/{classDiagram-JCYQIIEL.P36yteOv.js → classDiagram-JCYQIIEL.CHysnuuw.js} +12 -12
  31. package/library/chunks/{classDiagram-v2-OCEON4UE.C05djrx3.js → classDiagram-v2-OCEON4UE.CMVfaUrJ.js} +12 -12
  32. package/library/chunks/{color-picker.BERL3UOq.js → color-picker.C1CCN1nS.js} +11 -11
  33. package/library/chunks/{color-swatch-group.C0n7SaJl.js → color-swatch-group.BAIZMur5.js} +21 -21
  34. package/library/chunks/{color-swatch.CTbZYqbp.js → color-swatch.93BgkncM.js} +3 -3
  35. package/library/chunks/{config-manager.C2GBBqS5.js → config-manager.DijEOQly.js} +31 -31
  36. package/library/chunks/{configs-controller.BcOmixH6.js → configs-controller.B91MEy-4.js} +8 -8
  37. package/library/chunks/{confirm-popover.BiPCxJfb.js → confirm-popover.BRYw_62p.js} +4 -4
  38. package/library/chunks/{copy-button.muB45Tao.js → copy-button.BVuGJ0pX.js} +2 -2
  39. package/library/chunks/{corner-position-input-group.BKESUGfi.js → corner-position-input-group.zh-KziJB.js} +4 -4
  40. package/library/chunks/{cynefinDiagram-MW4NZA55.CN3dX-zy.js → cynefinDiagram-MW4NZA55.CNmGi2wN.js} +3 -3
  41. package/library/chunks/{dagre-VZM6K2ZE.DpSsP2YW.js → dagre-VZM6K2ZE.pAZyqROg.js} +8 -8
  42. package/library/chunks/{date-calendar.CSrG_jgw.js → date-calendar.D-LYjKFX.js} +2 -2
  43. package/library/chunks/{details.BQjEDJPA.js → details.BXMJk9oy.js} +1 -1
  44. package/library/chunks/{diagram-7IWD3JNH.C3K0gCHG.js → diagram-7IWD3JNH.BDOF6I2J.js} +4 -4
  45. package/library/chunks/{diagram-B4RE2ZJO.BULgC23C.js → diagram-B4RE2ZJO.DT1Xf2Kc.js} +2 -2
  46. package/library/chunks/{diagram-LBJQPF4R.BmYYTkym.js → diagram-LBJQPF4R.i67nojTE.js} +3 -3
  47. package/library/chunks/{diagram-Q27KOJAE.Bj5ayV3p.js → diagram-Q27KOJAE.C9Y5E3pX.js} +5 -5
  48. package/library/chunks/{diagram-UB23O5K3.Bu_lTx_A.js → diagram-UB23O5K3.Dxnn2pgu.js} +3 -3
  49. package/library/chunks/{dialog.BY2wT_Yq.js → dialog.C21jNK4r.js} +3 -3
  50. package/library/chunks/{diff.Bmdpmpvo.js → diff.BLPeoeMo.js} +1 -1
  51. package/library/chunks/{document-viewer.DviPbYQs.js → document-viewer.CZ2Fhfs7.js} +14 -14
  52. package/library/chunks/{dom.BLHsooDR.js → dom.8wD7rIGz.js} +1 -1
  53. package/library/chunks/{dot-pagination.Bc4kqtcF.js → dot-pagination.BdG_9NTv.js} +2 -2
  54. package/library/chunks/{drawer.UPV3DrmP.js → drawer.DM1zAUgP.js} +2 -2
  55. package/library/chunks/{dropdown.D6MQirjI.js → dropdown.DG5U64BM.js} +5 -5
  56. package/library/chunks/{dynamic-select.CsuWTgdl.js → dynamic-select.hfD2F6e4.js} +5 -5
  57. package/library/chunks/{e-chart.iJAWfcbZ.js → e-chart.BtYiI1g7.js} +2 -2
  58. package/library/chunks/{ebnfDiagram-BXEA7PRR.Cg96HHIs.js → ebnfDiagram-BXEA7PRR.C15CrBEH.js} +3 -3
  59. package/library/chunks/{element-clamp.fo2t5tv8.js → element-clamp.Bmn_oyV6.js} +2 -2
  60. package/library/chunks/{erDiagram-JOGREHBK.CrJ962th.js → erDiagram-JOGREHBK.BAFJcDwv.js} +11 -11
  61. package/library/chunks/{file-on-demand.CtYHSqZ8.js → file-on-demand.DoiRhsJ7.js} +17 -17
  62. package/library/chunks/flowDiagram-UKHOOZJN.BkgRtWrB.js +16 -0
  63. package/library/chunks/{folder-select.BHMjbJpa.js → folder-select.DrM6sqAw.js} +8 -8
  64. package/library/chunks/{form.D_eBa3AQ.js → form.ChOu6BIn.js} +1 -1
  65. package/library/chunks/{format-time.CJc4crvX.js → format-time.BZ7jIbu7.js} +1 -1
  66. package/library/chunks/{ganttDiagram-PKOTCBZU.D216_p5R.js → ganttDiagram-PKOTCBZU.BWKE9zb3.js} +2 -2
  67. package/library/chunks/{gitGraphDiagram-DS77QQ5N.BGTaYiUE.js → gitGraphDiagram-DS77QQ5N.Dh9BZvJA.js} +2 -2
  68. package/library/chunks/{header.BMzrFqrX.js → header.aHKslWaJ.js} +2 -2
  69. package/library/chunks/{i18n.tAD84KB3.js → i18n.qIMzqW-F.js} +4 -1
  70. package/library/chunks/{icon-button.hZj_g6Bt.js → icon-button.DTyZ7Nwc.js} +2 -2
  71. package/library/chunks/{iframe.DESEj5FX.js → iframe.DU9XEE6J.js} +1 -1
  72. package/library/chunks/{image-comparer.zps8IR5_.js → image-comparer.yDCQTe-Z.js} +1 -1
  73. package/library/chunks/{image.CSmzcQJh.js → image.C6ffajdy.js} +2 -2
  74. package/library/chunks/{infoDiagram-6WML65LV.BHVojFJh.js → infoDiagram-6WML65LV.BlZ2eFcf.js} +2 -2
  75. package/library/chunks/{input.is3tnNFr.js → input.1CW0nLBL.js} +2 -2
  76. package/library/chunks/{ishikawaDiagram-WSZJBQD7.nZsYnPcQ.js → ishikawaDiagram-WSZJBQD7.QMHGwtgV.js} +3 -3
  77. package/library/chunks/{journeyDiagram-NVQOT4AX.BXUxAk98.js → journeyDiagram-NVQOT4AX.C-ovuC8R.js} +2 -2
  78. package/library/chunks/{kanban-definition-27J2QSJJ.Bg8-oEtc.js → kanban-definition-27J2QSJJ.CwAo6fJw.js} +8 -8
  79. package/library/chunks/{line-clamp.iGRr7-Xj.js → line-clamp.BDFNqZZ8.js} +2 -2
  80. package/library/chunks/{markdown.BXDKzr2h.js → markdown.BBOqRlzE.js} +4 -4
  81. package/library/chunks/{masonry.DANqZg1j.js → masonry.BrOEearB.js} +3 -3
  82. package/library/chunks/{menu-item.DL81yBgV.js → menu-item.B6Lww_R9.js} +3 -3
  83. package/library/chunks/{menu.CVJpMzSd.js → menu.DgRAUDo_.js} +2 -2
  84. package/library/chunks/{mermaid.core.m1JI7kDY.js → mermaid.core.CGY0RVtv.js} +49 -49
  85. package/library/chunks/{mindmap-definition-FAOFIHXS.DwjOzYq5.js → mindmap-definition-FAOFIHXS.CQvqcBzU.js} +10 -10
  86. package/library/chunks/{option.y4dln0Vc.js → option.DXo-QZhI.js} +1 -1
  87. package/library/chunks/{padding-input-group.DxO3Jpy_.js → padding-input-group.tjIBMptQ.js} +1 -1
  88. package/library/chunks/{pagination.BNxyfajb.js → pagination.CVVtlgOf.js} +7 -7
  89. package/library/chunks/{pegDiagram-VL7TDLO6.BaVddVr3.js → pegDiagram-VL7TDLO6.CCjKBwxn.js} +3 -3
  90. package/library/chunks/{pieDiagram-7S7Q4E2Y.lZiCqBKs.js → pieDiagram-7S7Q4E2Y.BIlwtlJL.js} +3 -3
  91. package/library/chunks/{popup.CDY1A9dW.js → popup.jQD3De0E.js} +1 -1
  92. package/library/chunks/{position-picker.DTyM69dy.js → position-picker.DW9YTney.js} +2 -2
  93. package/library/chunks/{progress-bar.DCx1bJbA.js → progress-bar.2YrCjo_K.js} +1 -1
  94. package/library/chunks/{progress-ring.CLF04Ukk.js → progress-ring.D50j7Uhy.js} +1 -1
  95. package/library/chunks/purify.es.jxOE2kAK.js +867 -0
  96. package/library/chunks/{quadrantDiagram-CIZ2JOQS.DswnHa_z.js → quadrantDiagram-CIZ2JOQS.DorpRl0y.js} +1 -1
  97. package/library/chunks/{radio-card.Z4lQJH5n.js → radio-card.C_GVggMn.js} +1 -1
  98. package/library/chunks/{radio-group.CHlxPcrs.js → radio-group.DfR13lVB.js} +1 -1
  99. package/library/chunks/{railroadDiagram-AXF67PYL.RYtWvnP4.js → railroadDiagram-AXF67PYL.c5ghpRCW.js} +3 -3
  100. package/library/chunks/{range.9siIIf5L.js → range.C14Kx5Ln.js} +3 -3
  101. package/library/chunks/{rating.oryYIw6x.js → rating.B6WhmtiT.js} +1 -1
  102. package/library/chunks/{relative-time.U8veN742.js → relative-time.BF48GQmV.js} +1 -1
  103. package/library/chunks/{requirementDiagram-LRYGKXZP.BhxZAEJL.js → requirementDiagram-LRYGKXZP.MlkqKyhd.js} +10 -10
  104. package/library/chunks/{sankeyDiagram-W5VNT64P.Dk8npZSg.js → sankeyDiagram-W5VNT64P.Ch23b1-S.js} +1 -1
  105. package/library/chunks/{select.Bd8WvUMZ.js → select.D-QQK2rH.js} +61 -54
  106. package/library/chunks/{sequenceDiagram-SI44F4Z6.BNjBc769.js → sequenceDiagram-SI44F4Z6.CZxsjRpC.js} +4 -4
  107. package/library/chunks/{shadow-input-group.CoOi3L__.js → shadow-input-group.Ch6vHKZp.js} +2 -2
  108. package/library/chunks/{share-option-list.DM5dfW9M.js → share-option-list.DZHvOfV4.js} +3 -3
  109. package/library/chunks/{sidebar.DfNm5C-n.js → sidebar.BftNiyQt.js} +4 -4
  110. package/library/chunks/{size-input-group.BdYSDpsy.js → size-input-group.CbsKvFaO.js} +5 -5
  111. package/library/chunks/{spinner.DPl3rjQY.js → spinner.CCSVc6Z6.js} +1 -1
  112. package/library/chunks/{split-panel.D4Hn_Esh.js → split-panel.CRHvHDiv.js} +1 -1
  113. package/library/chunks/{src.DwbXw2Wv.js → src.D0_s2pWf.js} +4 -4
  114. package/library/chunks/src.DEO8lR91.js +103 -0
  115. package/library/chunks/{stateDiagram-OKZ733FA.DkiIgxjd.js → stateDiagram-OKZ733FA.JCaGHMmH.js} +12 -12
  116. package/library/chunks/{stateDiagram-v2-UEYNNEHI.oVj_Ex1_.js → stateDiagram-v2-UEYNNEHI.CKrKpvxj.js} +12 -12
  117. package/library/chunks/{step.CmqaPVg_.js → step.CiCIM79l.js} +3 -3
  118. package/library/chunks/{stepper-wizard.H45UqSLe.js → stepper-wizard.BKSPLzfU.js} +2 -2
  119. package/library/chunks/{stepper.CDWfFmPh.js → stepper.r0k2sIAi.js} +1 -1
  120. package/library/chunks/{string.9yahdkB8.js → string.TY0RTPc8.js} +1 -1
  121. package/library/chunks/{swimlanes-SLNWSIFB.DKU7qXJ7.js → swimlanes-SLNWSIFB.BnCITr-P.js} +8 -8
  122. package/library/chunks/{swimlanesDiagram-ULZ7WXOC.DYwYMO_K.js → swimlanesDiagram-ULZ7WXOC.DMYLowNi.js} +12 -12
  123. package/library/chunks/{switch.BM9msK5T.js → switch.BuleQplE.js} +1 -1
  124. package/library/chunks/{tab-group.6FT_XQDH.js → tab-group.B6O3pBw0.js} +8 -8
  125. package/library/chunks/{tab.q5aFhnHA.js → tab.DHblc3F_.js} +3 -3
  126. package/library/chunks/{tag.BSBIN-rz.js → tag.Bp7R2CeG.js} +3 -3
  127. package/library/chunks/{textarea.CHSZI8vt.js → textarea.BQV58bk8.js} +1 -1
  128. package/library/chunks/{timecode.DjI1OTXD.js → timecode.B6JsxLxl.js} +1 -1
  129. package/library/chunks/{timeline-definition-Z64GVDOM.agRZ87Zs.js → timeline-definition-Z64GVDOM.DpGlraiA.js} +3 -3
  130. package/library/chunks/{tooltip.DurE2LL4.js → tooltip.C11omEOs.js} +2 -2
  131. package/library/chunks/{tree.C0imvgIg.js → tree.CpN2Va5s.js} +4 -4
  132. package/library/chunks/{typeface.DPVH5wzi.js → typeface.oJr92CGd.js} +3 -3
  133. package/library/chunks/{vennDiagram-T6HMQDX7.Cd9lVObe.js → vennDiagram-T6HMQDX7.DYlGT1g9.js} +3 -3
  134. package/library/chunks/{video.CYO0jBx9.js → video.CtWiwJj6.js} +3 -3
  135. package/library/chunks/{wardleyDiagram-T6FBY63Y.yCklp5Oa.js → wardleyDiagram-T6FBY63Y.DFkqP4xG.js} +3 -3
  136. package/library/chunks/{xychartDiagram-ELKLHX3M.CLuRN0XK.js → xychartDiagram-ELKLHX3M.CmCPBha7.js} +5 -5
  137. package/library/components/alert.js +1 -1
  138. package/library/components/array-line-clamp.js +1 -1
  139. package/library/components/asset-link-format.js +1 -1
  140. package/library/components/atoms.js +54 -54
  141. package/library/components/audio.js +1 -1
  142. package/library/components/bicolor-picker.js +1 -1
  143. package/library/components/border-input-group.js +1 -1
  144. package/library/components/breadcrumb.js +1 -1
  145. package/library/components/button.js +1 -1
  146. package/library/components/checkbox.js +1 -1
  147. package/library/components/color-picker.js +1 -1
  148. package/library/components/color-swatch-group.js +1 -1
  149. package/library/components/color-swatch.js +1 -1
  150. package/library/components/confirm-popover.js +1 -1
  151. package/library/components/copy-button.js +1 -1
  152. package/library/components/corner-position-input-group.js +1 -1
  153. package/library/components/date-calendar.js +1 -1
  154. package/library/components/details.js +1 -1
  155. package/library/components/dialog.js +1 -1
  156. package/library/components/diff.js +1 -1
  157. package/library/components/document-viewer.js +1 -1
  158. package/library/components/dot-pagination.js +1 -1
  159. package/library/components/drawer.js +1 -1
  160. package/library/components/dropdown.js +1 -1
  161. package/library/components/dynamic-select.js +1 -1
  162. package/library/components/e-chart.js +1 -1
  163. package/library/components/element-clamp.js +1 -1
  164. package/library/components/file-on-demand.js +1 -1
  165. package/library/components/folder-select.js +1 -1
  166. package/library/components/format-bytes.js +1 -1
  167. package/library/components/format-date.js +1 -1
  168. package/library/components/format-number.js +1 -1
  169. package/library/components/format-time.js +1 -1
  170. package/library/components/header.js +1 -1
  171. package/library/components/icon-button.js +1 -1
  172. package/library/components/iframe.js +1 -1
  173. package/library/components/image-comparer.js +1 -1
  174. package/library/components/image.js +1 -1
  175. package/library/components/input.js +1 -1
  176. package/library/components/line-clamp.js +1 -1
  177. package/library/components/markdown.js +1 -1
  178. package/library/components/masonry.js +1 -1
  179. package/library/components/menu-item.js +1 -1
  180. package/library/components/menu.js +1 -1
  181. package/library/components/molecules.js +16 -16
  182. package/library/components/option.js +1 -1
  183. package/library/components/organisms.js +3 -3
  184. package/library/components/padding-input-group.js +1 -1
  185. package/library/components/pagination.js +1 -1
  186. package/library/components/popup.js +1 -1
  187. package/library/components/position-picker.js +1 -1
  188. package/library/components/progress-bar.js +1 -1
  189. package/library/components/progress-ring.js +1 -1
  190. package/library/components/radio-card.js +1 -1
  191. package/library/components/radio-group.js +1 -1
  192. package/library/components/range.js +1 -1
  193. package/library/components/rating.js +1 -1
  194. package/library/components/relative-time.js +1 -1
  195. package/library/components/select.js +1 -1
  196. package/library/components/shadow-input-group.js +1 -1
  197. package/library/components/share-option-list.js +1 -1
  198. package/library/components/sidebar.js +1 -1
  199. package/library/components/size-input-group.js +1 -1
  200. package/library/components/spinner.js +1 -1
  201. package/library/components/split-panel.js +1 -1
  202. package/library/components/step.js +1 -1
  203. package/library/components/stepper-wizard.js +1 -1
  204. package/library/components/stepper.js +1 -1
  205. package/library/components/switch.js +1 -1
  206. package/library/components/tab-group.js +1 -1
  207. package/library/components/tab.js +1 -1
  208. package/library/components/tag.js +1 -1
  209. package/library/components/textarea.js +1 -1
  210. package/library/components/timecode.js +1 -1
  211. package/library/components/tooltip.js +1 -1
  212. package/library/components/tree-item.js +1 -1
  213. package/library/components/tree.js +1 -1
  214. package/library/components/typeface.js +1 -1
  215. package/library/components/types.js +111 -95
  216. package/library/components/video.js +1 -1
  217. package/library/package.json +1 -1
  218. package/library/packages/atoms/src/components/select/select.d.ts +7 -5
  219. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +43 -2
  220. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-dimensions/asset-link-format-dimensions.d.ts +12 -3
  221. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-quality/asset-link-format-quality.d.ts +1 -0
  222. package/library/packages/organisms/src/downloader/downloader.d.ts +6 -0
  223. package/library/packages/utils/src/custom-element/i18n.d.ts +3 -0
  224. package/library/react-web-component.d.ts +12 -4
  225. package/library/utils.js +5 -5
  226. package/package.json +1 -1
  227. package/library/chunks/flowDiagram-UKHOOZJN.Bj_loY7-.js +0 -16
  228. package/library/chunks/purify.es.Bwsrv9kG.js +0 -866
  229. package/library/chunks/src.BGRU1qh5.js +0 -103
@@ -3,49 +3,50 @@ import { a as r, i, n as a, r as o, t as s } from "./cortex-element.DTrNUtdr.js"
3
3
  import { t as c } from "./query.B1yi7t71.js";
4
4
  import { t as l } from "./component.styles.0xM1ZmBs.js";
5
5
  import { t as u } from "./custom-element.BEMYNDK1.js";
6
- import { t as d } from "./i18n.tAD84KB3.js";
6
+ import { t as d } from "./i18n.qIMzqW-F.js";
7
7
  import { t as f } from "./watch.Ub5r8btz.js";
8
- import { t as p } from "./icon-button.hZj_g6Bt.js";
8
+ import { t as p } from "./icon-button.DTyZ7Nwc.js";
9
9
  import { t as m } from "./when.BUskJLtZ.js";
10
10
  import { t as h } from "./icon.CeQpEaQz.js";
11
11
  import { t as g } from "./style-map.DPGQIxip.js";
12
12
  import { c as ee } from "./browser.gIznFIix.js";
13
- import { t as _ } from "./button.DHmArHfu.js";
14
- import { g as te } from "./string.9yahdkB8.js";
15
- import { t as ne } from "./tooltip.DurE2LL4.js";
13
+ import { t as _ } from "./button.VUFrOP0u.js";
14
+ import { g as te } from "./string.TY0RTPc8.js";
15
+ import { t as ne } from "./tooltip.C11omEOs.js";
16
16
  import { n as v } from "./position-picker.dY_vgF_H.js";
17
- import { l as re, r as y } from "./number.CNp5LKkv.js";
18
- import { t as ie } from "./image.C0s1gL4z.js";
19
- import { n as b, t as x } from "./typography.B0mkhqTB.js";
20
- import { t as ae } from "./button-group.CPfXrqyq.js";
21
- import { t as oe } from "./checkbox.CA7imbiT.js";
22
- import { t as S } from "./repeat.CKv9FPlC.js";
23
- import { t as se } from "./input.is3tnNFr.js";
24
- import { t as C } from "./option.y4dln0Vc.js";
25
- import { t as w } from "./space.Dd8jezXK.js";
26
- import { t as T } from "./select.Bd8WvUMZ.js";
27
- import { t as ce } from "./visually-hidden.Bv3SInZp.js";
28
- import { D as le, E as ue, T as de, b as fe, f as pe, g as me, m as he, x as ge } from "./src.DwbXw2Wv.js";
29
- import { t as E } from "./details.BQjEDJPA.js";
30
- import { t as _e } from "./divider.CqSNZCU8.js";
31
- import { a as D, c as O, l as k, n as ve, o as A, r as j, s as M, t as N, u as P } from "./asset-link-format.D6L-qc3X.js";
32
- import { t as ye } from "./menu-label.B-FOyfAX.js";
33
- import { t as be } from "./switch.BM9msK5T.js";
34
- import { t as xe } from "./v4.JyXW8GUB.js";
17
+ import { l as re, r as ie } from "./number.CNp5LKkv.js";
18
+ import { t as ae } from "./image.C0s1gL4z.js";
19
+ import { n as y, t as b } from "./typography.B0mkhqTB.js";
20
+ import { t as oe } from "./button-group.CPfXrqyq.js";
21
+ import { t as se } from "./checkbox.BzR50Is_.js";
22
+ import { t as ce } from "./math.od1DVmRk.js";
23
+ import { t as x } from "./repeat.CKv9FPlC.js";
24
+ import { t as le } from "./input.1CW0nLBL.js";
25
+ import { t as S } from "./option.DXo-QZhI.js";
26
+ import { t as C } from "./space.Dd8jezXK.js";
27
+ import { t as w } from "./select.D-QQK2rH.js";
28
+ import { t as ue } from "./visually-hidden.Bv3SInZp.js";
29
+ import { D as de, E as fe, T as pe, b as me, f as he, g as ge, m as _e, x as ve } from "./src.D0_s2pWf.js";
30
+ import { t as T } from "./details.BXMJk9oy.js";
31
+ import { t as ye } from "./divider.CqSNZCU8.js";
32
+ import { a as E, c as be, l as D, n as xe, o as O, r as k, s as A, t as j, u as M } from "./asset-link-format.D6L-qc3X.js";
33
+ import { t as Se } from "./menu-label.B-FOyfAX.js";
34
+ import { t as Ce } from "./switch.BuleQplE.js";
35
+ import { t as we } from "./v4.JyXW8GUB.js";
35
36
  import "./cropper.D8Uu43xy.js";
36
- import { t as Se } from "./_baseUniq.h_pGICPH.js";
37
- import { d as Ce, i as we, n as Te, o as Ee, p as F, r as De, s as Oe, t as ke } from "./string-array.F2GuxHp0.js";
38
- import { t as Ae } from "./position-picker.DTyM69dy.js";
37
+ import { t as Te } from "./_baseUniq.h_pGICPH.js";
38
+ import { d as Ee, i as De, n as Oe, o as ke, p as N, r as Ae, s as je, t as Me } from "./string-array.F2GuxHp0.js";
39
+ import { t as Ne } from "./position-picker.DW9YTney.js";
39
40
  //#region ../../node_modules/lodash-es/uniq.js
40
- function je(e) {
41
- return e && e.length ? Se(e) : [];
41
+ function Pe(e) {
42
+ return e && e.length ? Te(e) : [];
42
43
  }
43
44
  //#endregion
44
45
  //#region ../../packages/services/src/api/asset/asset.utils.ts
45
- function Me(e) {
46
+ function Fe(e) {
46
47
  return typeof e == "object" && !!e && "URI" in e;
47
48
  }
48
- var Ne = {
49
+ var Ie = {
49
50
  artist: "Artist",
50
51
  color: "Color",
51
52
  createDate: "CreateDate",
@@ -67,34 +68,34 @@ var Ne = {
67
68
  systemIdentifier: "SystemIdentifier",
68
69
  text: "Text",
69
70
  title: "Title"
70
- }, Pe = /* @__PURE__ */ new Set([
71
+ }, Le = /* @__PURE__ */ new Set([
71
72
  "mediaDate",
72
73
  "createDate",
73
74
  "editDate"
74
75
  ]);
75
- function Fe(e) {
76
+ function Re(e) {
76
77
  return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
77
78
  }
78
- function Ie(e, t) {
79
- let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${Fe(t)}`);
79
+ function ze(e, t) {
80
+ let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${Re(t)}`);
80
81
  return n.length > 1 ? `(${n.join(" OR ")})` : n[0] ?? "";
81
82
  }
82
- function Le(e, t) {
83
+ function Be(e, t) {
83
84
  return (Array.isArray(t) ? t : [t]).map((t) => `${e}${t.operator}${t.value}`).join(" AND ");
84
85
  }
85
- function Re(e) {
86
+ function Ve(e) {
86
87
  let t = [];
87
88
  for (let n of Object.keys(e)) {
88
89
  let r = n, i = e[r];
89
90
  if (i == null) continue;
90
91
  if (r === "custom") {
91
- for (let [e, n] of Object.entries(i)) t.push(Ie(e, n));
92
+ for (let [e, n] of Object.entries(i)) t.push(ze(e, n));
92
93
  continue;
93
94
  }
94
- let a = Ne[r];
95
+ let a = Ie[r];
95
96
  if (a) {
96
- if (Pe.has(r)) {
97
- t.push(Le(a, i));
97
+ if (Le.has(r)) {
98
+ t.push(Be(a, i));
98
99
  continue;
99
100
  }
100
101
  if (r === "color") {
@@ -104,87 +105,87 @@ function Re(e) {
104
105
  if (r === "parentFolderIdentifier") {
105
106
  let e = Array.isArray(i) ? i : [i];
106
107
  if (e.length === 0) continue;
107
- let n = [...e.map((e) => `ParentFolderIdentifier:${Fe(String(e))}`), ...e.map((e) => `ParentAlbumIdentifier:${Fe(String(e))}`)];
108
+ let n = [...e.map((e) => `ParentFolderIdentifier:${Re(String(e))}`), ...e.map((e) => `ParentAlbumIdentifier:${Re(String(e))}`)];
108
109
  t.push(`(${n.join(" OR ")})`);
109
110
  continue;
110
111
  }
111
- t.push(Ie(a, i));
112
+ t.push(ze(a, i));
112
113
  }
113
114
  }
114
115
  return t.join(" AND ");
115
116
  }
116
- function ze(e) {
117
- if ("and" in e) return e.and.map(ze).filter(Boolean).join(" AND ");
117
+ function He(e) {
118
+ if ("and" in e) return e.and.map(He).filter(Boolean).join(" AND ");
118
119
  if ("or" in e) {
119
- let t = e.or.map(ze).filter(Boolean);
120
+ let t = e.or.map(He).filter(Boolean);
120
121
  return t.length > 1 ? `(${t.join(" OR ")})` : t[0] ?? "";
121
122
  }
122
123
  if ("not" in e) {
123
- let t = ze(e.not);
124
+ let t = He(e.not);
124
125
  return t ? `NOT (${t})` : "";
125
126
  }
126
- return Re(e);
127
+ return Ve(e);
127
128
  }
128
129
  //#endregion
129
130
  //#region ../../packages/services/src/api/asset/asset.ts
130
- var Be = "CoreField.LargeSizePreview", I = "CoreField.DocType", Ve = "Document.Title", He = "Document.CaptionLong", L = "Document.FileExtension", Ue = "CoreField.FileSize", We = "CoreField.Identifier", Ge = "CoreField.MaxHeight", Ke = "CoreField.MaxWidth", R = "Document.RecordID", qe = "CoreField.DocSubType", Je = "CoreField.TitleWithFallback", z = "CoreField.OriginalFileName", Ye = "__width", Xe = "__height", Ze = "CoreField.OriginalPreview", Qe = "Document.DocSubType", $e = "Document.InPoint", et = "Document.OutPoint", tt = {
131
+ var Ue = "CoreField.LargeSizePreview", P = "CoreField.DocType", We = "Document.Title", Ge = "Document.CaptionLong", F = "Document.FileExtension", Ke = "CoreField.FileSize", qe = "CoreField.Identifier", Je = "CoreField.MaxHeight", Ye = "CoreField.MaxWidth", I = "Document.RecordID", Xe = "CoreField.DocSubType", Ze = "CoreField.TitleWithFallback", L = "CoreField.OriginalFileName", Qe = "__width", $e = "__height", et = "CoreField.OriginalPreview", tt = "Document.DocSubType", nt = "Document.InPoint", rt = "Document.OutPoint", it = {
131
132
  DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
132
133
  ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
133
- }, nt = {
134
- [Be]: tt.DEFAULT_VIEW_SIZE,
135
- [Ze]: tt.ORIGINAL_VIEW_SIZE
136
- }, rt = Object.fromEntries(Object.entries(nt).map(([e, t]) => [t, e]));
137
- function it(e) {
138
- return nt[e] ?? e;
134
+ }, at = {
135
+ [Ue]: it.DEFAULT_VIEW_SIZE,
136
+ [et]: it.ORIGINAL_VIEW_SIZE
137
+ }, ot = Object.fromEntries(Object.entries(at).map(([e, t]) => [t, e]));
138
+ function st(e) {
139
+ return at[e] ?? e;
139
140
  }
140
- function at(e) {
141
- return e === "CoreField.TitleWithFallback" ? [Ve, z] : [it(e)];
141
+ function ct(e) {
142
+ return e === "CoreField.TitleWithFallback" ? [We, L] : [st(e)];
142
143
  }
143
- function ot(e) {
144
+ function lt(e) {
144
145
  let t = {};
145
146
  for (let [n, r] of Object.entries(e)) {
146
- let e = rt[n] ?? n;
147
+ let e = ot[n] ?? n;
147
148
  t[e] = r;
148
149
  }
149
150
  return t;
150
151
  }
151
- function st(e, t, n) {
152
- e[n] = B(t, n);
152
+ function ut(e, t, n) {
153
+ e[n] = R(t, n);
153
154
  let r = t[n];
154
- return r != null && Me(r) && (typeof r.Width == "number" && r.Width > 0 && (e[`${n}${Ye}`] = String(r.Width)), typeof r.Height == "number" && r.Height > 0 && (e[`${n}${Xe}`] = String(r.Height))), e;
155
+ return r != null && Fe(r) && (typeof r.Width == "number" && r.Width > 0 && (e[`${n}${Qe}`] = String(r.Width)), typeof r.Height == "number" && r.Height > 0 && (e[`${n}${$e}`] = String(r.Height))), e;
155
156
  }
156
- function ct(e) {
157
+ function dt(e) {
157
158
  let t = new URLSearchParams();
158
159
  for (let [n, r] of Object.entries(e)) r != null && (Array.isArray(r) ? r.forEach((e) => t.append(n, String(e))) : t.append(n, String(r)));
159
160
  return t;
160
161
  }
161
- async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAssetsPaths: r, httpMethod: i = "GET", isSiteBuilder: a, pageNumber: o, query: s, securityByPassToken: c, siteUrl: l, sort: u, throwOnError: d, token: f, useSession: p }) {
162
- let m = n?.flatMap(at), h = n?.includes("CoreField.TitleWithFallback") ?? !1, g = (e) => {
163
- let t = ot(e);
164
- return h && (t[Je] = B(t, "Document.Title") || B(t, "CoreField.OriginalFileName")), t;
162
+ async function ft({ consistency: e, countPerPage: t, fields: n, getPermanentAssetsPaths: r, httpMethod: i = "GET", isSiteBuilder: a, pageNumber: o, query: s, securityByPassToken: c, siteUrl: l, sort: u, throwOnError: d, token: f, useSession: p }) {
163
+ let m = n?.flatMap(ct), h = n?.includes("CoreField.TitleWithFallback") ?? !1, g = (e) => {
164
+ let t = lt(e);
165
+ return h && (t[Ze] = R(t, "Document.Title") || R(t, "CoreField.OriginalFileName")), t;
165
166
  }, ee = {
166
167
  Consistency: e || void 0,
167
168
  CountPerPage: t,
168
- Fields: je(m),
169
+ Fields: Pe(m),
169
170
  Format: "json",
170
171
  GetPermanentAssetsPaths: r ?? void 0,
171
172
  PageNumber: o,
172
- Query: ze(s),
173
+ Query: He(s),
173
174
  SecurityByPassToken: c || void 0,
174
175
  Sort: u || void 0,
175
176
  UseSession: p || void 0
176
177
  }, _ = i === "POST";
177
178
  try {
178
- return (await F.request({
179
+ return (await N.request({
179
180
  baseURL: l,
180
181
  headers: f ? { Authorization: `Bearer ${f}` } : void 0,
181
182
  method: i,
182
- ..._ ? { data: a ? ee : ct(ee) } : {
183
+ ..._ ? { data: a ? ee : dt(ee) } : {
183
184
  params: ee,
184
185
  paramsSerializer: { indexes: null }
185
186
  },
186
187
  responseType: "json",
187
- transformResponse: [...Array.isArray(F.defaults.transformResponse) ? F.defaults.transformResponse : [], a ? (e) => ({
188
+ transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], a ? (e) => ({
188
189
  items: (e.results?.Items ?? []).map(g),
189
190
  sort: e.results?.GlobalInfo?.Sort ?? "",
190
191
  totalCount: e.results?.GlobalInfo?.TotalCount ?? 0
@@ -193,7 +194,7 @@ async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
193
194
  sort: e.APIResponse?.GlobalInfo?.Sort ?? "",
194
195
  totalCount: e.APIResponse?.GlobalInfo?.TotalCount ?? 0
195
196
  })],
196
- url: a ? _ ? Oe.SEARCH_ASSETS_POST : Oe.SEARCH_ASSETS : Ce["4.0"]
197
+ url: a ? _ ? je.SEARCH_ASSETS_POST : je.SEARCH_ASSETS : Ee["4.0"]
197
198
  })).data;
198
199
  } catch (e) {
199
200
  if (d) throw e;
@@ -204,9 +205,9 @@ async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
204
205
  };
205
206
  }
206
207
  }
207
- async function ut({ assetId: e, extension: t, format: n, siteUrl: r, token: i, transformations: a, useSession: o }) {
208
+ async function pt({ assetId: e, extension: t, format: n, siteUrl: r, token: i, transformations: a, useSession: o }) {
208
209
  try {
209
- return (await F.request({
210
+ return (await N.request({
210
211
  baseURL: r,
211
212
  method: "GET",
212
213
  params: {
@@ -218,19 +219,19 @@ async function ut({ assetId: e, extension: t, format: n, siteUrl: r, token: i, t
218
219
  UseSession: o || void 0
219
220
  },
220
221
  timeout: 3e5,
221
- url: De.GET_TRANSFORM_ASSET_LINK
222
+ url: Ae.GET_TRANSFORM_ASSET_LINK
222
223
  })).data;
223
224
  } catch {
224
225
  return null;
225
226
  }
226
227
  }
227
- var dt = 50;
228
- function ft(e, t) {
228
+ var mt = 50;
229
+ function ht(e, t) {
229
230
  let n = [];
230
231
  for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
231
232
  return n;
232
233
  }
233
- async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n, isSiteBuilder: r, recordIds: i, securityByPassToken: a, throwOnError: o, token: s }) {
234
+ async function gt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n, isSiteBuilder: r, recordIds: i, securityByPassToken: a, throwOnError: o, token: s }) {
234
235
  if (!Array.isArray(i) || i.length === 0) return {
235
236
  facets: [],
236
237
  items: [],
@@ -238,11 +239,11 @@ async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
238
239
  };
239
240
  let c = t?.filter((e) => e && typeof e == "string") ?? [], l = [
240
241
  ...c,
241
- z,
242
- Ve,
243
- He,
244
- R
245
- ], u = ft(i, dt), d = await Promise.all(u.map((t) => lt({
242
+ L,
243
+ We,
244
+ Ge,
245
+ I
246
+ ], u = ht(i, mt), d = await Promise.all(u.map((t) => ft({
246
247
  consistency: e,
247
248
  countPerPage: t.length,
248
249
  fields: l,
@@ -258,18 +259,18 @@ async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
258
259
  return {
259
260
  facets: [],
260
261
  items: d.flatMap((e) => e.items).map((e) => ({
261
- name: B(e, z),
262
- recordId: B(e, R),
263
- ...c.reduce((t, n) => st(t, e, n), {})
262
+ name: R(e, L),
263
+ recordId: R(e, I),
264
+ ...c.reduce((t, n) => ut(t, e, n), {})
264
265
  })).sort((e, t) => (f.get(e.recordId) ?? Infinity) - (f.get(t.recordId) ?? Infinity)),
265
266
  totalCount: d.reduce((e, t) => e + t.totalCount, 0)
266
267
  };
267
268
  }
268
- function B(e, t) {
269
+ function R(e, t) {
269
270
  let n = e[t];
270
- return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : Me(n) ? n.URI : "";
271
+ return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : Fe(n) ? n.URI : "";
271
272
  }
272
- async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifier: n, extraFields: r, getPermanentAssetsPaths: i, isSiteBuilder: a, limitedDocTypes: o, pageNumber: s, parentFolderIdentifier: c, searchTerm: l, securityByPassToken: u, sortOrder: d, throwOnError: f, token: p }) {
273
+ async function _t({ consistency: e, countPerPage: t, directParentFolderIdentifier: n, extraFields: r, getPermanentAssetsPaths: i, isSiteBuilder: a, limitedDocTypes: o, pageNumber: s, parentFolderIdentifier: c, searchTerm: l, securityByPassToken: u, sortOrder: d, throwOnError: f, token: p }) {
273
274
  if (!n && !c) return {
274
275
  facets: [],
275
276
  items: [],
@@ -280,19 +281,19 @@ async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifie
280
281
  parentFolderIdentifier: c,
281
282
  ...l ? { text: l } : {},
282
283
  ...o && o.length > 0 ? { docType: o } : {}
283
- }, g = await lt({
284
+ }, g = await ft({
284
285
  consistency: e,
285
286
  countPerPage: t,
286
287
  fields: [
287
288
  ...m,
288
- Je,
289
- Ue,
290
- I,
289
+ Ze,
290
+ Ke,
291
+ P,
292
+ Xe,
291
293
  qe,
292
- We,
293
- L,
294
- R,
295
- z
294
+ F,
295
+ I,
296
+ L
296
297
  ],
297
298
  getPermanentAssetsPaths: i,
298
299
  httpMethod: "POST",
@@ -307,27 +308,27 @@ async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifie
307
308
  return {
308
309
  facets: [],
309
310
  items: g.items.map((e) => {
310
- let t = B(e, L);
311
+ let t = R(e, F);
311
312
  t && !t.startsWith(".") && (t = "." + t);
312
- let n = B(e, R);
313
+ let n = R(e, I);
313
314
  return {
314
- docSubType: B(e, qe),
315
- docType: B(e, "CoreField.DocType") || "",
315
+ docSubType: R(e, Xe),
316
+ docType: R(e, "CoreField.DocType") || "",
316
317
  extension: t,
317
318
  id: n,
318
- identifier: B(e, We),
319
- name: B(e, z),
319
+ identifier: R(e, qe),
320
+ name: R(e, L),
320
321
  recordId: n,
321
- size: B(e, "CoreField.FileSize") || "0 MB",
322
- ...m.reduce((t, n) => st(t, e, n), {})
322
+ size: R(e, "CoreField.FileSize") || "0 MB",
323
+ ...m.reduce((t, n) => ut(t, e, n), {})
323
324
  };
324
325
  }),
325
326
  totalCount: g.totalCount
326
327
  };
327
328
  }
328
- async function ht({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, useSession: i }) {
329
+ async function vt({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, useSession: i }) {
329
330
  try {
330
- return (await F.request({
331
+ return (await N.request({
331
332
  method: "GET",
332
333
  params: {
333
334
  AutoCropMode: e,
@@ -338,21 +339,21 @@ async function ht({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, u
338
339
  },
339
340
  responseType: "json",
340
341
  timeout: 3e5,
341
- transformResponse: [...Array.isArray(F.defaults.transformResponse) ? F.defaults.transformResponse : [], (e) => ({
342
+ transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => ({
342
343
  height: e.cropHeight,
343
344
  width: e.cropWidth,
344
345
  x: e.cropX,
345
346
  y: e.cropY
346
347
  })],
347
- url: De.GET_CROP_ZONE_SUGGESTION
348
+ url: Ae.GET_CROP_ZONE_SUGGESTION
348
349
  })).data;
349
350
  } catch {
350
351
  return null;
351
352
  }
352
353
  }
353
- async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, useSession: i }) {
354
+ async function yt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, useSession: i }) {
354
355
  try {
355
- return (await F.request({
356
+ return (await N.request({
356
357
  baseURL: n,
357
358
  method: "GET",
358
359
  params: {
@@ -361,7 +362,7 @@ async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, us
361
362
  UseSession: i || void 0
362
363
  },
363
364
  responseType: "json",
364
- transformResponse: [...Array.isArray(F.defaults.transformResponse) ? F.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? [] : e.proxies?.map((e) => ({
365
+ transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? [] : e.proxies?.map((e) => ({
365
366
  cdnName: e.cdnName,
366
367
  extension: e.extension,
367
368
  formatHeight: e.formatHeight,
@@ -372,31 +373,31 @@ async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, us
372
373
  proxyName: e.proxyName,
373
374
  width: e.width
374
375
  })) ?? []],
375
- url: t ? Oe.GET_AVAILABLE_PROXIES : Ee
376
+ url: t ? je.GET_AVAILABLE_PROXIES : ke
376
377
  })).data;
377
378
  } catch {
378
379
  return [];
379
380
  }
380
381
  }
381
- async function _t({ siteUrl: e } = {}) {
382
+ async function bt({ siteUrl: e } = {}) {
382
383
  try {
383
- return (await F.request({
384
+ return (await N.request({
384
385
  baseURL: e,
385
386
  method: "GET",
386
387
  responseType: "json",
387
- transformResponse: [...Array.isArray(F.defaults.transformResponse) ? F.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? { formatsByDocType: {
388
+ transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? { formatsByDocType: {
388
389
  Audio: {},
389
390
  Image: {},
390
391
  Multimedia: {},
391
392
  Video: {}
392
393
  } } : { formatsByDocType: e.formatsByDocType ?? {} }],
393
- url: Te
394
+ url: Oe
394
395
  })).data;
395
396
  } catch {
396
397
  return { formatsByDocType: {} };
397
398
  }
398
399
  }
399
- async function vt({ recordIds: e, rightsToCheck: t }) {
400
+ async function xt({ recordIds: e, rightsToCheck: t }) {
400
401
  let n = {
401
402
  authorizedObjects: [],
402
403
  forbiddenObjectsOfReadPermission: [],
@@ -404,7 +405,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
404
405
  invalidObjects: []
405
406
  };
406
407
  try {
407
- let { data: n } = await F.request({
408
+ let { data: n } = await N.request({
408
409
  method: "GET",
409
410
  params: {
410
411
  RecordIDs: e,
@@ -412,7 +413,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
412
413
  },
413
414
  paramsSerializer: { indexes: null },
414
415
  responseType: "json",
415
- url: we.GET_AUTHORIZED_OBJECTS
416
+ url: De.GET_AUTHORIZED_OBJECTS
416
417
  });
417
418
  return n;
418
419
  } catch {
@@ -421,7 +422,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
421
422
  }
422
423
  //#endregion
423
424
  //#region ../../packages/tools/src/fetch-image/fetch-image.ts
424
- var yt = 20, V = "TR1", H = "TRX", bt = /* @__PURE__ */ new Set([".gif"]), xt = /* @__PURE__ */ new Set([
425
+ var St = 20, z = "TR1", B = "TRX", Ct = /* @__PURE__ */ new Set([".gif"]), wt = /* @__PURE__ */ new Set([
425
426
  ".avif",
426
427
  ".bmp",
427
428
  ".gif",
@@ -432,18 +433,18 @@ var yt = 20, V = "TR1", H = "TRX", bt = /* @__PURE__ */ new Set([".gif"]), xt =
432
433
  ".svg",
433
434
  ".webp"
434
435
  ]);
435
- function St(e) {
436
+ function Tt(e) {
436
437
  let t = e.toLowerCase(), n = t.startsWith(".") ? t : `.${t}`;
437
- return xt.has(n);
438
+ return wt.has(n);
438
439
  }
439
- function Ct(e, t) {
440
- return e !== void 0 && e !== "" && e !== O.Image ? !1 : !t || St(t);
440
+ function Et(e, t) {
441
+ return e !== void 0 && e !== "" && e !== be.Image ? !1 : !t || Tt(t);
441
442
  }
442
- function wt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i, item: a, manualFormat: o, size: s, useExpiringAssetUrls: c }) {
443
- let l = r?.toLowerCase() ?? "", u = l.startsWith(".") ? l : `.${l}`, d = `path_${V}`, f = (n, r) => {
443
+ function Dt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i, item: a, manualFormat: o, size: s, useExpiringAssetUrls: c }) {
444
+ let l = r?.toLowerCase() ?? "", u = l.startsWith(".") ? l : `.${l}`, d = `path_${z}`, f = (n, r) => {
444
445
  let i = a[n];
445
446
  if (!i) return;
446
- let s = a[`${n}${Ye}`], u = a[`${n}${Xe}`], d = e && !c ? pe(i, [], {
447
+ let s = a[`${n}${Qe}`], u = a[`${n}${$e}`], d = e && !c ? he(i, [], {
447
448
  autoFormat: !o,
448
449
  extension: l,
449
450
  format: r
@@ -452,31 +453,31 @@ function wt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i
452
453
  maxHeight: u,
453
454
  maxWidth: s,
454
455
  src: d,
455
- srcset: t && !c ? he(d, {
456
+ srcset: t && !c ? _e(d, {
456
457
  extension: l,
457
458
  format: r,
458
- maxWidth: ge(o, s)
459
+ maxWidth: ve(o, s)
459
460
  }) : ""
460
461
  };
461
462
  };
462
463
  if (c) {
463
- let e = ue(a, Ct(n, l), l);
464
+ let e = fe(a, Et(n, l), l);
464
465
  return e ? f(e) ?? {} : {};
465
466
  }
466
467
  if (!o) {
467
- let e = fe(l, s);
468
- return f(`path_${e}`, e) ?? f(d, V) ?? {};
468
+ let e = me(l, s);
469
+ return f(`path_${e}`, e) ?? f(d, z) ?? {};
469
470
  }
470
471
  let p = i ? `path_${i}` : void 0;
471
- return p && a[p] ? i !== H || Ct(n, l) ? f(p, i) ?? {} : f(d, V) ?? {} : l && bt.has(u) ? f(`path_${H}`, H) ?? f(d, V) ?? {} : f(d, V) ?? {};
472
+ return p && a[p] ? i !== B || Et(n, l) ? f(p, i) ?? {} : f(d, z) ?? {} : l && Ct.has(u) ? f(`path_${B}`, B) ?? f(d, z) ?? {} : f(d, z) ?? {};
472
473
  }
473
- var Tt = class {
474
+ var Ot = class {
474
475
  constructor(e, t) {
475
- this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize = yt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
476
+ this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize = St, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
476
477
  let n = t?.maxEnd;
477
478
  this.maxEnd = typeof n == "number" && Number.isFinite(n) && n >= 0 ? Math.floor(n) : Infinity;
478
479
  let r = t?.pageSize;
479
- this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) : yt, this.authToken = t?.token, this.securityByPassToken = t?.securityByPassToken, this.isSiteBuilder = t?.isSiteBuilder ?? !1, this.autoFormat = t?.autoFormat ?? !1, this.buildSrcset = t?.buildSrcset ?? !1, this.consistency = t?.consistency;
480
+ this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) : St, this.authToken = t?.token, this.securityByPassToken = t?.securityByPassToken, this.isSiteBuilder = t?.isSiteBuilder ?? !1, this.autoFormat = t?.autoFormat ?? !1, this.buildSrcset = t?.buildSrcset ?? !1, this.consistency = t?.consistency;
480
481
  }
481
482
  get totalDataCount() {
482
483
  return this.totalCount;
@@ -485,34 +486,34 @@ var Tt = class {
485
486
  this.securityByPassToken !== e && (this.securityByPassToken = e, this.resetPageCache());
486
487
  }
487
488
  setPageSize(e) {
488
- let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) : yt;
489
+ let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) : St;
489
490
  if (this.pageSize === t) return;
490
491
  let n = this.fetchedPages.size > 0;
491
492
  n && t < this.pageSize || (this.pageSize = t, n && (this.requestEpoch += 1, this.fetchedPages.clear()));
492
493
  }
493
494
  async fetchImages({ end: e, extraFields: t = [], format: n, manualFormat: r = !0, start: i, throwOnError: a = !1, transformations: o }) {
494
495
  if (e < i || this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < i)) return this.data;
495
- let s = this.requestEpoch, c = de(this.host.ownerDocument.defaultView);
496
+ let s = this.requestEpoch, c = pe(this.host.ownerDocument.defaultView);
496
497
  if (!this.folderId || s !== this.requestEpoch) return this.data;
497
- let l = n ? `path_${n}` : void 0, u = `path_${V}`, d = `path_${H}`, f = c ? [u, d] : [...new Set([
498
+ let l = n ? `path_${n}` : void 0, u = `path_${z}`, d = `path_${B}`, f = c ? [u, d] : [...new Set([
498
499
  l,
499
500
  u,
500
501
  d
501
502
  ].filter((e) => !!e))], p = Math.floor(i / this.pageSize) + 1, m = Math.floor(e / this.pageSize) + 1;
502
503
  for (let e = p; e <= m; e++) {
503
504
  if (this.fetchedPages.has(e)) continue;
504
- let i = await mt({
505
+ let i = await _t({
505
506
  consistency: this.consistency,
506
507
  countPerPage: this.pageSize,
507
508
  directParentFolderIdentifier: this.folderId,
508
509
  extraFields: [...t, ...f],
509
- getPermanentAssetsPaths: le(this.host.ownerDocument.defaultView),
510
+ getPermanentAssetsPaths: de(this.host.ownerDocument.defaultView),
510
511
  isSiteBuilder: this.isSiteBuilder,
511
512
  limitedDocTypes: [
512
- O.Image,
513
- O.Audio,
514
- O.Video,
515
- O.Multimedia
513
+ be.Image,
514
+ be.Audio,
515
+ be.Video,
516
+ be.Multimedia
516
517
  ],
517
518
  pageNumber: e,
518
519
  searchTerm: "",
@@ -526,7 +527,7 @@ var Tt = class {
526
527
  let e = Math.min(this.maxEnd, i.totalCount);
527
528
  this.totalCount = e, this.data = Array.from({ length: e }, () => ({
528
529
  alt: "",
529
- id: `temp-${xe()}`,
530
+ id: `temp-${we()}`,
530
531
  name: "",
531
532
  src: ""
532
533
  }));
@@ -535,7 +536,7 @@ var Tt = class {
535
536
  for (let e = 0; e < i.items.length; e++) {
536
537
  let a = l + e;
537
538
  if (a < this.data.length) {
538
- let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } = wt({
539
+ let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } = Dt({
539
540
  autoFormat: this.autoFormat,
540
541
  buildSrcset: this.buildSrcset,
541
542
  docType: s.docType,
@@ -546,7 +547,7 @@ var Tt = class {
546
547
  size: s.size,
547
548
  useExpiringAssetUrls: c
548
549
  }), p = d, m = f;
549
- !c && p && o && o.length > 0 && (p = pe(p, o), m = ""), this.data[a] = {
550
+ !c && p && o && o.length > 0 && (p = he(p, o), m = ""), this.data[a] = {
550
551
  alt: s.name,
551
552
  docType: s.docType,
552
553
  extension: s.extension,
@@ -589,39 +590,39 @@ var Tt = class {
589
590
  }
590
591
  async fetchImagesByIDs({ extraFields: e = [], format: t, manualFormat: n = !0, recordIds: r, throwOnError: i = !1, transformations: a }) {
591
592
  if (r.length === 0) return [];
592
- let o = de(this.host.ownerDocument.defaultView), s = t ? `path_${t}` : void 0, c = `path_${V}`, l = `path_${H}`, u = o ? [c, l] : [...new Set([
593
+ let o = pe(this.host.ownerDocument.defaultView), s = t ? `path_${t}` : void 0, c = `path_${z}`, l = `path_${B}`, u = o ? [c, l] : [...new Set([
593
594
  s,
594
595
  c,
595
596
  l
596
- ].filter((e) => !!e))], d = [L, ...o ? [] : [Ue]], f = [...e, I];
597
- return (await pt({
597
+ ].filter((e) => !!e))], d = [F, ...o ? [] : [Ke]], f = [...e, P];
598
+ return (await gt({
598
599
  consistency: this.consistency,
599
600
  extraFields: [
600
601
  ...f,
601
602
  ...u,
602
603
  ...d
603
604
  ].filter((e) => e !== ""),
604
- getPermanentAssetsPaths: le(this.host.ownerDocument.defaultView),
605
+ getPermanentAssetsPaths: de(this.host.ownerDocument.defaultView),
605
606
  isSiteBuilder: this.isSiteBuilder,
606
607
  recordIds: r,
607
608
  securityByPassToken: this.securityByPassToken,
608
609
  throwOnError: i,
609
610
  token: this.authToken
610
611
  })).items.map((e) => {
611
- let { maxHeight: r, maxWidth: i, src: s, srcset: c } = wt({
612
+ let { maxHeight: r, maxWidth: i, src: s, srcset: c } = Dt({
612
613
  autoFormat: this.autoFormat,
613
614
  buildSrcset: this.buildSrcset,
614
- docType: e[I],
615
- extension: e[L],
615
+ docType: e[P],
616
+ extension: e[F],
616
617
  format: t,
617
618
  item: e,
618
619
  manualFormat: n,
619
- size: e[Ue],
620
+ size: e[Ke],
620
621
  useExpiringAssetUrls: o
621
622
  }), l = s, u = c;
622
- return !o && l && a && a.length > 0 && (l = pe(l, a), u = ""), {
623
+ return !o && l && a && a.length > 0 && (l = he(l, a), u = ""), {
623
624
  alt: e.name,
624
- docType: e[I],
625
+ docType: e[P],
625
626
  extension: e["Document.FileExtension"] || "",
626
627
  id: e.recordId,
627
628
  maxHeight: r,
@@ -688,46 +689,46 @@ var Tt = class {
688
689
  resetFolderState() {
689
690
  this.resetPageCache();
690
691
  }
691
- }, Et = t`.asset-link-format__panel{position:relative}.asset-link-format--formats .asset-link-format__panel:not(:last-child){border-bottom:1px solid var(--cx-color-neutral-200)}.asset-link-format__panel--placeholder,.asset-link-format--formats .asset-link-format__panel--placeholder:not(:last-child){height:var(--cx-spacing-3x-small);background-color:var(--cx-color-primary);border:none;overflow:hidden}.asset-link-format__panel--placeholder>*{visibility:hidden}.asset-link-format__drag-handle{cursor:grab;touch-action:none;width:max-content;margin-inline:auto;position:absolute;inset-block-start:calc(var(--cx-spacing-small) + var(--cx-font-size-3x-large) / 2);inset-inline:0;transform:translateY(-50%)}.asset-link-format__drag-handle::part(base){cursor:grab}.asset-link-format__drag-handle:active,.asset-link-format__drag-handle:active::part(base){cursor:grabbing}.asset-link-format__drag-handle::part(icon){color:var(--cx-color-neutral-300);rotate:90deg}.asset-link-format__announcement{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.asset-link-format__order-hint{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200);color:var(--cx-input-help-text-color);font:var(--cx-font-label-x-small)}.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__formats-summary{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__formats-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__formats-summary [part=icon]{width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__formats-crop cx-asset-link-format-crop{box-sizing:border-box;width:100%;padding:0 var(--cx-spacing-medium) var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}.asset-link-format__footer,.asset-link-format__footer>slot{display:block}`, Dt = t`:host([inline]){display:block}cx-details::part(base){border-bottom-width:0}.details--inline::part(base){border-width:0}.details--inline::part(header){display:none}.details--inline::part(content){padding:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}.crop__limit{color:var(--cx-input-help-text-color);margin-block-start:calc(-1 * var(--spacing-container-gap))}.crop__limit:empty{position:absolute}`, U, W = class extends s {
692
- static #e = U = this;
692
+ }, kt = t`.asset-link-format__panel{position:relative}.asset-link-format--formats .asset-link-format__panel:not(:last-child){border-bottom:1px solid var(--cx-color-neutral-200)}.asset-link-format__panel--placeholder,.asset-link-format--formats .asset-link-format__panel--placeholder:not(:last-child){height:var(--cx-spacing-3x-small);background-color:var(--cx-color-primary);border:none;overflow:hidden}.asset-link-format__panel--placeholder>*{visibility:hidden}.asset-link-format__drag-handle{cursor:grab;touch-action:none;width:max-content;margin-inline:auto;position:absolute;inset-block-start:calc(var(--cx-spacing-small) + var(--cx-font-size-3x-large) / 2);inset-inline:0;transform:translateY(-50%)}.asset-link-format__drag-handle::part(base){cursor:grab}.asset-link-format__drag-handle:active,.asset-link-format__drag-handle:active::part(base){cursor:grabbing}.asset-link-format__drag-handle::part(icon){color:var(--cx-color-neutral-300);rotate:90deg}.asset-link-format__announcement{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.asset-link-format__order-hint{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200);color:var(--cx-input-help-text-color);font:var(--cx-font-label-x-small)}.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__formats-summary{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__formats-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__formats-summary [part=icon]{width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__formats-crop cx-asset-link-format-crop{box-sizing:border-box;width:100%;padding:0 var(--cx-spacing-medium) var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}.asset-link-format__footer,.asset-link-format__footer>slot{display:block}`, At = t`:host([inline]){display:block}cx-details::part(base){border-bottom-width:0}.details--inline::part(base){border-width:0}.details--inline::part(header){display:none}.details--inline::part(content){padding:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}.crop__limit{color:var(--cx-input-help-text-color);margin-block-start:calc(-1 * var(--spacing-container-gap))}.crop__limit:empty{position:absolute}`, V, H = class extends s {
693
+ static #e = V = this;
693
694
  constructor(...e) {
694
- super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = P.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.hasCropper = !1, this.dimensionsLimited = !1, this.lastAppliedSetting = {
695
- [P.Pixel]: {
695
+ super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = M.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.hasCropper = !1, this.dimensionsLimited = !1, this.lastAppliedSetting = {
696
+ [M.Pixel]: {
696
697
  height: 0,
697
698
  percentageHeight: 100,
698
699
  percentageWidth: 100,
699
- unit: P.Pixel,
700
+ unit: M.Pixel,
700
701
  width: 0,
701
702
  x: 0,
702
703
  y: 0
703
704
  },
704
- [P.AspectRatio]: {
705
+ [M.AspectRatio]: {
705
706
  height: 1,
706
707
  percentageHeight: 100,
707
708
  percentageWidth: 100,
708
- unit: P.AspectRatio,
709
+ unit: M.AspectRatio,
709
710
  width: 1,
710
711
  x: 0,
711
712
  y: 0
712
713
  }
713
714
  }, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = v.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
714
715
  }
715
- static #t = this.styles = [l, Dt];
716
+ static #t = this.styles = [l, At];
716
717
  static #n = this.dependencies = {
717
718
  "cx-button": _,
718
- "cx-details": E,
719
- "cx-divider": _e,
719
+ "cx-details": T,
720
+ "cx-divider": ye,
720
721
  "cx-icon": h,
721
722
  "cx-icon-button": p,
722
- "cx-input": se,
723
- "cx-option": C,
724
- "cx-position-picker": Ae,
725
- "cx-select": T,
726
- "cx-space": w,
727
- "cx-typography": x
723
+ "cx-input": le,
724
+ "cx-option": S,
725
+ "cx-position-picker": Ne,
726
+ "cx-select": w,
727
+ "cx-space": C,
728
+ "cx-typography": b
728
729
  };
729
730
  static getRatioSize(e, t, n, r, i) {
730
- return n === P.Pixel && Number.isFinite(r) && Number.isFinite(i) ? ie(r, i, e, t) : {
731
+ return n === M.Pixel && Number.isFinite(r) && Number.isFinite(i) ? ae(r, i, e, t) : {
731
732
  height: t,
732
733
  width: e
733
734
  };
@@ -745,11 +746,11 @@ var Tt = class {
745
746
  return;
746
747
  }
747
748
  if (this.keepAspectRatio) {
748
- if (this.unit === P.Pixel && this.width && this.height) {
749
+ if (this.unit === M.Pixel && this.width && this.height) {
749
750
  this.aspectRatio = this.width / this.height;
750
751
  return;
751
752
  }
752
- if (this.unit === P.AspectRatio && this.ratioWidth && this.ratioHeight) {
753
+ if (this.unit === M.AspectRatio && this.ratioWidth && this.ratioHeight) {
753
754
  this.aspectRatio = this.ratioWidth / this.ratioHeight;
754
755
  return;
755
756
  }
@@ -777,9 +778,9 @@ var Tt = class {
777
778
  this.invalidWidth = !0;
778
779
  return;
779
780
  }
780
- this.invalidWidth = !1, t = Math.min(t, M), this.unit === P.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
781
- let n = this.unit === P.Pixel ? this.height : this.ratioHeight, r = !1;
782
- this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit === P.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight));
781
+ this.invalidWidth = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
782
+ let n = this.unit === M.Pixel ? this.height : this.ratioHeight, r = !1;
783
+ this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight));
783
784
  let i = this.getSideMax(this.maxHeight);
784
785
  n > i && (n = i, r = this.keepAspectRatio), r ||= this.#a(t, n), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
785
786
  breakAspectRatio: r,
@@ -795,9 +796,9 @@ var Tt = class {
795
796
  this.invalidHeight = !0;
796
797
  return;
797
798
  }
798
- this.invalidHeight = !1, t = Math.min(t, M), this.unit === P.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
799
- let n = this.unit === P.Pixel ? this.width : this.ratioWidth, r = !1;
800
- this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit === P.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth));
799
+ this.invalidHeight = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
800
+ let n = this.unit === M.Pixel ? this.width : this.ratioWidth, r = !1;
801
+ this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth));
801
802
  let i = this.getSideMax(this.maxWidth);
802
803
  n > i && (n = i, r = this.keepAspectRatio), r ||= this.#a(n, t), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
803
804
  breakAspectRatio: r,
@@ -810,17 +811,17 @@ var Tt = class {
810
811
  onCropModeChange(e) {
811
812
  let t = e.target.value, n = this.cropModes.find((e) => e.value === t)?.auto;
812
813
  if (t === "free") this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", { detail: {
813
- height: this.lastAppliedSetting[P.Pixel].height,
814
+ height: this.lastAppliedSetting[M.Pixel].height,
814
815
  keepAspectRatio: !1,
815
816
  silent: !0,
816
- unit: P.Pixel,
817
- width: this.lastAppliedSetting[P.Pixel].width
817
+ unit: M.Pixel,
818
+ width: this.lastAppliedSetting[M.Pixel].width
818
819
  } });
819
- else if (!n) {
820
- let [e, n] = t.split(":").map(Number), r = this.unit === P.Pixel && this.hasMaxSize ? P.Pixel : P.AspectRatio;
820
+ else if (!n && /^\d+:\d+$/.test(t)) {
821
+ let [e, n] = t.split(":").map(Number), r = this.unit === M.Pixel && this.hasMaxSize ? M.Pixel : M.AspectRatio;
821
822
  this.emit("cx-asset-link-format-crop-change", { detail: {
822
- ...U.getRatioSize(e, n, r, this.maxWidth, this.maxHeight),
823
- keepAspectRatio: r === P.Pixel || !this.inline,
823
+ ...V.getRatioSize(e, n, r, this.maxWidth, this.maxHeight),
824
+ keepAspectRatio: r === M.Pixel || !this.inline,
824
825
  silent: !0,
825
826
  unit: r
826
827
  } });
@@ -835,7 +836,7 @@ var Tt = class {
835
836
  this.emit("cx-asset-link-format-crop-position-change", { detail: { position: this.positionPicker.value } });
836
837
  }
837
838
  onUnitChange(e) {
838
- let t = e.target.value === P.AspectRatio ? P.AspectRatio : P.Pixel;
839
+ let t = e.target.value === M.AspectRatio ? M.AspectRatio : M.Pixel;
839
840
  if (this.hasCropper) {
840
841
  this.emit("cx-asset-link-format-crop-change", { detail: {
841
842
  ...this.#i(t),
@@ -863,21 +864,21 @@ var Tt = class {
863
864
  if (/^\d+:\d+$/.test(this.cropMode)) {
864
865
  let [n, r] = this.cropMode.split(":").map(Number);
865
866
  return {
866
- ...U.getRatioSize(n, r, e, this.maxWidth, this.maxHeight),
867
+ ...V.getRatioSize(n, r, e, this.maxWidth, this.maxHeight),
867
868
  keepAspectRatio: t
868
869
  };
869
870
  }
870
- return e === P.AspectRatio ? {
871
+ return e === M.AspectRatio ? {
871
872
  height: this.height,
872
873
  keepAspectRatio: t,
873
874
  width: this.width
874
875
  } : {
875
- ...U.getRatioSize(this.ratioWidth, this.ratioHeight, e, this.maxWidth, this.maxHeight),
876
+ ...V.getRatioSize(this.ratioWidth, this.ratioHeight, e, this.maxWidth, this.maxHeight),
876
877
  keepAspectRatio: t
877
878
  };
878
879
  }
879
880
  #i(e) {
880
- if (e === P.AspectRatio && /^\d+:\d+$/.test(this.cropMode)) {
881
+ if (e === M.AspectRatio && /^\d+:\d+$/.test(this.cropMode)) {
881
882
  let [e, t] = this.cropMode.split(":").map(Number);
882
883
  return {
883
884
  height: t,
@@ -908,14 +909,14 @@ var Tt = class {
908
909
  }
909
910
  handleAspectRatioClick() {
910
911
  this.emit("cx-asset-link-format-crop-change", { detail: {
911
- height: this.unit === P.Pixel ? this.height : this.ratioHeight,
912
+ height: this.unit === M.Pixel ? this.height : this.ratioHeight,
912
913
  keepAspectRatio: !this.keepAspectRatio,
913
914
  unit: this.unit,
914
- width: this.unit === P.Pixel ? this.width : this.ratioWidth
915
+ width: this.unit === M.Pixel ? this.width : this.ratioWidth
915
916
  } });
916
917
  }
917
918
  getSideMax(e) {
918
- return this.unit === P.Pixel && e >= 1 ? Math.min(e, M) : M;
919
+ return this.unit === M.Pixel && e >= 1 ? Math.min(e, A) : A;
919
920
  }
920
921
  getSizeMaskBlocks(e) {
921
922
  return { num: {
@@ -934,111 +935,111 @@ var Tt = class {
934
935
  }
935
936
  #a(e, t) {
936
937
  let n = /^(\d+):(\d+)$/.exec(this.cropMode);
937
- return this.unit === P.Pixel && !this.keepAspectRatio && n !== null && Number(n[1]) * t !== Number(n[2]) * e;
938
+ return this.unit === M.Pixel && !this.keepAspectRatio && n !== null && Number(n[1]) * t !== Number(n[2]) * e;
938
939
  }
939
940
  render() {
940
941
  let t = this.cropModes.filter((e) => !e.auto), n = this.cropModes.filter((e) => e.auto);
941
- return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${S(t, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}
942
+ return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${x(t, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}
942
943
  ${m(n.length > 0, () => e`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`)}
943
- ${S(n, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxWidth)} value=${this.unit === P.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
944
+ ${x(n, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxWidth)} value=${this.unit === M.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
944
945
  W
945
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxHeight)} value=${this.unit === P.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
946
+ </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxHeight)} value=${this.unit === M.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
946
947
  H
947
- </cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${P.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${P.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><div class="crop__limit" data-testid="cx-asset-link-format-crop-dimensions-limit" role="status">${m(this.dimensionsLimited, () => e`<cx-typography variant="small">${this.localize.term("cropLimitedByDimensions", this.maxWidth, this.maxHeight)}</cx-typography>`)}</div>${m(this.focusModes.length > 0, () => e`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${S(this.focusModes, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}
948
+ </cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${M.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${M.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><div class="crop__limit" data-testid="cx-asset-link-format-crop-dimensions-limit" role="status">${m(this.dimensionsLimited, () => e`<cx-typography variant="small">${this.localize.term("cropLimitedByDimensions", this.maxWidth, this.maxHeight)}</cx-typography>`)}</div>${m(this.focusModes.length > 0, () => e`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${x(this.focusModes, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}
948
949
  ${m(this.showPositionPicker && this.focusMode === "manual", () => e`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`)}
949
950
  ${m(!this.inline, () => e`<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
950
951
  }
951
952
  };
952
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], W.prototype, "base", void 0), a([c("cx-position-picker"), o("design:type", Ae === void 0 ? Object : Ae)], W.prototype, "positionPicker", void 0), a([r({
953
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], H.prototype, "base", void 0), a([c("cx-position-picker"), o("design:type", Ne === void 0 ? Object : Ne)], H.prototype, "positionPicker", void 0), a([r({
953
954
  reflect: !0,
954
955
  type: Boolean
955
- }), o("design:type", Boolean)], W.prototype, "open", void 0), a([r({
956
+ }), o("design:type", Boolean)], H.prototype, "open", void 0), a([r({
956
957
  reflect: !0,
957
958
  type: Boolean
958
- }), o("design:type", Boolean)], W.prototype, "inline", void 0), a([r({
959
+ }), o("design:type", Boolean)], H.prototype, "inline", void 0), a([r({
959
960
  reflect: !0,
960
961
  type: Number
961
- }), o("design:type", Number)], W.prototype, "width", void 0), a([r({
962
+ }), o("design:type", Number)], H.prototype, "width", void 0), a([r({
962
963
  reflect: !0,
963
964
  type: Number
964
- }), o("design:type", Number)], W.prototype, "height", void 0), a([r({
965
+ }), o("design:type", Number)], H.prototype, "height", void 0), a([r({
965
966
  attribute: "max-width",
966
967
  reflect: !0,
967
968
  type: Number
968
- }), o("design:type", Number)], W.prototype, "maxWidth", void 0), a([r({
969
+ }), o("design:type", Number)], H.prototype, "maxWidth", void 0), a([r({
969
970
  attribute: "max-height",
970
971
  reflect: !0,
971
972
  type: Number
972
- }), o("design:type", Number)], W.prototype, "maxHeight", void 0), a([r({
973
+ }), o("design:type", Number)], H.prototype, "maxHeight", void 0), a([r({
973
974
  attribute: "ratio-width",
974
975
  reflect: !0,
975
976
  type: Number
976
- }), o("design:type", Number)], W.prototype, "ratioWidth", void 0), a([r({
977
+ }), o("design:type", Number)], H.prototype, "ratioWidth", void 0), a([r({
977
978
  attribute: "ratio-height",
978
979
  reflect: !0,
979
980
  type: Number
980
- }), o("design:type", Number)], W.prototype, "ratioHeight", void 0), a([r({
981
+ }), o("design:type", Number)], H.prototype, "ratioHeight", void 0), a([r({
981
982
  attribute: "percentage-width",
982
983
  reflect: !0,
983
984
  type: Number
984
- }), o("design:type", Number)], W.prototype, "percentageWidth", void 0), a([r({
985
+ }), o("design:type", Number)], H.prototype, "percentageWidth", void 0), a([r({
985
986
  attribute: "percentage-height",
986
987
  reflect: !0,
987
988
  type: Number
988
- }), o("design:type", Number)], W.prototype, "percentageHeight", void 0), a([r({
989
+ }), o("design:type", Number)], H.prototype, "percentageHeight", void 0), a([r({
989
990
  reflect: !0,
990
991
  type: String
991
- }), o("design:type", P === void 0 ? Object : P)], W.prototype, "unit", void 0), a([r({
992
+ }), o("design:type", M === void 0 ? Object : M)], H.prototype, "unit", void 0), a([r({
992
993
  attribute: "disabled-apply",
993
994
  reflect: !0,
994
995
  type: Boolean
995
- }), o("design:type", Boolean)], W.prototype, "disabledApply", void 0), a([r({
996
+ }), o("design:type", Boolean)], H.prototype, "disabledApply", void 0), a([r({
996
997
  attribute: "no-ratio-modes",
997
998
  reflect: !0,
998
999
  type: Boolean
999
- }), o("design:type", Boolean)], W.prototype, "noRatioModes", void 0), a([r({
1000
+ }), o("design:type", Boolean)], H.prototype, "noRatioModes", void 0), a([r({
1000
1001
  attribute: "show-position-picker",
1001
1002
  reflect: !0,
1002
1003
  type: Boolean
1003
- }), o("design:type", Boolean)], W.prototype, "showPositionPicker", void 0), a([r({
1004
+ }), o("design:type", Boolean)], H.prototype, "showPositionPicker", void 0), a([r({
1004
1005
  attribute: "has-cropper",
1005
1006
  reflect: !0,
1006
1007
  type: Boolean
1007
- }), o("design:type", Boolean)], W.prototype, "hasCropper", void 0), a([r({
1008
+ }), o("design:type", Boolean)], H.prototype, "hasCropper", void 0), a([r({
1008
1009
  attribute: "dimensions-limited",
1009
1010
  reflect: !0,
1010
1011
  type: Boolean
1011
- }), o("design:type", Boolean)], W.prototype, "dimensionsLimited", void 0), a([r({
1012
+ }), o("design:type", Boolean)], H.prototype, "dimensionsLimited", void 0), a([r({
1012
1013
  attribute: "last-applied-setting",
1013
1014
  reflect: !1,
1014
1015
  type: Object
1015
- }), o("design:type", typeof Record > "u" ? Object : Record)], W.prototype, "lastAppliedSetting", void 0), a([r({
1016
+ }), o("design:type", typeof Record > "u" ? Object : Record)], H.prototype, "lastAppliedSetting", void 0), a([r({
1016
1017
  reflect: !0,
1017
1018
  type: Boolean
1018
- }), o("design:type", Boolean)], W.prototype, "loading", void 0), a([r({
1019
+ }), o("design:type", Boolean)], H.prototype, "loading", void 0), a([r({
1019
1020
  attribute: "crop-modes",
1020
1021
  reflect: !1,
1021
1022
  type: Array
1022
- }), o("design:type", Array)], W.prototype, "cropModes", void 0), a([r({
1023
+ }), o("design:type", Array)], H.prototype, "cropModes", void 0), a([r({
1023
1024
  attribute: "focus-modes",
1024
1025
  reflect: !1,
1025
1026
  type: Object
1026
- }), o("design:type", Array)], W.prototype, "focusModes", void 0), a([r({
1027
+ }), o("design:type", Array)], H.prototype, "focusModes", void 0), a([r({
1027
1028
  attribute: "focus-mode",
1028
1029
  reflect: !0,
1029
1030
  type: String
1030
- }), o("design:type", String)], W.prototype, "focusMode", void 0), a([r({
1031
+ }), o("design:type", String)], H.prototype, "focusMode", void 0), a([r({
1031
1032
  attribute: "crop-mode",
1032
1033
  reflect: !0,
1033
1034
  type: String
1034
- }), o("design:type", String)], W.prototype, "cropMode", void 0), a([r({
1035
+ }), o("design:type", String)], H.prototype, "cropMode", void 0), a([r({
1035
1036
  reflect: !0,
1036
1037
  type: String
1037
- }), o("design:type", v === void 0 ? Object : v)], W.prototype, "position", void 0), a([r({
1038
+ }), o("design:type", v === void 0 ? Object : v)], H.prototype, "position", void 0), a([r({
1038
1039
  attribute: "keep-aspect-ratio",
1039
1040
  reflect: !0,
1040
1041
  type: Boolean
1041
- }), o("design:type", Boolean)], W.prototype, "keepAspectRatio", void 0), a([i(), o("design:type", Boolean)], W.prototype, "invalidWidth", void 0), a([i(), o("design:type", Boolean)], W.prototype, "invalidHeight", void 0), a([i(), o("design:type", Number)], W.prototype, "aspectRatio", void 0), a([
1042
+ }), o("design:type", Boolean)], H.prototype, "keepAspectRatio", void 0), a([i(), o("design:type", Boolean)], H.prototype, "invalidWidth", void 0), a([i(), o("design:type", Boolean)], H.prototype, "invalidHeight", void 0), a([i(), o("design:type", Number)], H.prototype, "aspectRatio", void 0), a([
1042
1043
  f("cropMode", { waitUntilFirstUpdate: !0 }),
1043
1044
  f("maxWidth", { waitUntilFirstUpdate: !0 }),
1044
1045
  f("maxHeight", { waitUntilFirstUpdate: !0 }),
@@ -1046,56 +1047,65 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], W.prototype, "ba
1046
1047
  o("design:type", Function),
1047
1048
  o("design:paramtypes", []),
1048
1049
  o("design:returntype", Promise)
1049
- ], W.prototype, "handleCropModeChange", null), a([
1050
+ ], H.prototype, "handleCropModeChange", null), a([
1050
1051
  f("open", { waitUntilFirstUpdate: !0 }),
1051
1052
  o("design:type", Function),
1052
1053
  o("design:paramtypes", []),
1053
1054
  o("design:returntype", Promise)
1054
- ], W.prototype, "handleOpenChange", null), W = U = a([u("cx-asset-link-format-crop")], W);
1055
- var Ot = W, kt = t`:host{display:block}.asset-link-format__dimensions-select{width:100%}.details::part(base){border-bottom-width:0}.asset-link-format__dimensions-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__dimensions-custom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,7rem);align-items:center;display:grid}.asset-link-format__dimensions-custom cx-input,.asset-link-format__dimensions-custom cx-select{min-width:0}.asset-link-format__dimensions-apply{margin-inline-start:auto}`, At = {
1056
- [A.Percent]: { num: {
1055
+ ], H.prototype, "handleOpenChange", null), H = V = a([u("cx-asset-link-format-crop")], H);
1056
+ var jt = H, Mt = t`:host{display:block}.asset-link-format__dimensions-select{width:100%}.details::part(base){border-bottom-width:0}.asset-link-format__dimensions-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__dimensions-custom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,7rem);align-items:center;display:grid}.asset-link-format__dimensions-custom cx-input,.asset-link-format__dimensions-custom cx-select{min-width:0}.asset-link-format__dimensions-apply{margin-inline-start:auto}`, U = 1, Nt = {
1057
+ [O.Percent]: { num: {
1058
+ autofix: !0,
1057
1059
  mask: Number,
1058
- min: 1,
1060
+ max: 100,
1061
+ min: U,
1059
1062
  radix: ".",
1060
- scale: 2
1063
+ scale: 0
1061
1064
  } },
1062
- [A.Pixel]: { num: {
1065
+ [O.Pixel]: { num: {
1063
1066
  autofix: !0,
1064
1067
  mask: Number,
1065
- max: M,
1066
- min: 1,
1068
+ max: A,
1069
+ min: U,
1067
1070
  radix: ".",
1068
1071
  scale: 0
1069
1072
  } }
1070
- }, G = class extends s {
1073
+ }, W = class extends s {
1071
1074
  constructor(...e) {
1072
- super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = N.Legacy, this.loading = !1, this.items = [], this.canCustom = !1, this.customDimensionsUnit = A.Pixel, this.dimensionsSelection = "", this.customDimensionsDrafts = {
1073
- [A.Percent]: {
1075
+ super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = j.Legacy, this.loading = !1, this.items = [], this.canCustom = !1, this.canPercent = !1, this.customDimensionsUnit = O.Pixel, this.dimensionsSelection = "", this.customDimensionsDrafts = {
1076
+ [O.Percent]: {
1074
1077
  height: "100",
1075
1078
  width: "100"
1076
1079
  },
1077
- [A.Pixel]: {
1080
+ [O.Pixel]: {
1078
1081
  height: "1080",
1079
1082
  width: "1920"
1080
1083
  }
1081
1084
  };
1082
1085
  }
1083
- static #e = this.styles = [l, kt];
1086
+ static #e = this.styles = [l, Mt];
1084
1087
  static #t = this.dependencies = {
1085
1088
  "cx-button": _,
1086
- "cx-details": E,
1087
- "cx-divider": _e,
1089
+ "cx-details": T,
1090
+ "cx-divider": ye,
1088
1091
  "cx-icon": h,
1089
- "cx-input": se,
1090
- "cx-menu-label": ye,
1091
- "cx-option": C,
1092
- "cx-select": T,
1093
- "cx-space": w,
1094
- "cx-typography": x
1092
+ "cx-input": le,
1093
+ "cx-menu-label": Se,
1094
+ "cx-option": S,
1095
+ "cx-select": w,
1096
+ "cx-space": C,
1097
+ "cx-typography": b
1095
1098
  };
1096
- handleDimensionsValueChange() {
1097
- let e = this.value;
1098
- this.dimensionsSelection = e?.mode === D.Custom ? D.Custom : e?.mode === D.Preset ? `preset:${e.value}` : "", e?.mode === D.Custom && (this.customDimensionsUnit = e.unit, this.customDimensionsDrafts = {
1099
+ willUpdate(e) {
1100
+ super.willUpdate(e), (e.has("value") && e.get("value") !== this.value || e.has("canPercent")) && this.#n();
1101
+ }
1102
+ #n() {
1103
+ let e = this.value, t = e?.mode === E.Custom && e.unit === O.Percent && !this.canPercent;
1104
+ if (this.canPercent || (this.customDimensionsUnit = O.Pixel), t) {
1105
+ this.dimensionsSelection = "";
1106
+ return;
1107
+ }
1108
+ this.dimensionsSelection = e?.mode === E.Custom ? E.Custom : e?.mode === E.Preset ? `preset:${e.value}` : "", e?.mode === E.Custom && (this.customDimensionsUnit = e.unit, this.customDimensionsDrafts = {
1099
1109
  ...this.customDimensionsDrafts,
1100
1110
  [e.unit]: {
1101
1111
  height: String(e.height),
@@ -1108,26 +1118,45 @@ var Ot = W, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
1108
1118
  }
1109
1119
  getCustomDimensionsValue() {
1110
1120
  let e = this.customDimensionsUnit, t = this.customDimensionsDrafts[e], n = Number(t.width), r = Number(t.height);
1111
- if (!(!Number.isFinite(n) || !Number.isFinite(r) || n < 1 || r < 1) && (e !== A.Pixel || Number.isInteger(n) && Number.isInteger(r))) return {
1121
+ if (!(!Number.isInteger(n) || !Number.isInteger(r) || n < U || r < U) && !(e === O.Percent && (n > 100 || n !== r))) return {
1112
1122
  height: r,
1113
- mode: D.Custom,
1123
+ mode: E.Custom,
1114
1124
  unit: e,
1115
1125
  width: n
1116
1126
  };
1117
1127
  }
1128
+ #r(e, t) {
1129
+ let n = this.customDimensionsUnit, r = n === O.Percent ? {
1130
+ height: t,
1131
+ width: t
1132
+ } : {
1133
+ ...this.customDimensionsDrafts[n],
1134
+ [e]: t
1135
+ };
1136
+ this.customDimensionsDrafts = {
1137
+ ...this.customDimensionsDrafts,
1138
+ [n]: r
1139
+ };
1140
+ }
1141
+ #i(e) {
1142
+ let t = this.customDimensionsUnit, n = this.customDimensionsDrafts[t][e], r = Number(n), i = this.value, a = i?.mode === E.Custom && i.unit === t && String(i[e]) === n;
1143
+ if (!n || a || Number.isNaN(r)) return;
1144
+ let o = t === O.Percent ? 100 : A, s = String(ce(r, U, o));
1145
+ s !== n && this.#r(e, s);
1146
+ }
1118
1147
  get pendingValue() {
1119
- if (this.dimensionsSelection === D.Custom) return this.getCustomDimensionsValue();
1148
+ if (this.dimensionsSelection === E.Custom) return this.getCustomDimensionsValue();
1120
1149
  if (this.dimensionsSelection.startsWith("preset:")) {
1121
1150
  let e = this.items.find((e) => `preset:${e.value}` === this.dimensionsSelection && !e.disabled);
1122
1151
  return e ? {
1123
- mode: D.Preset,
1152
+ mode: E.Preset,
1124
1153
  value: e.value
1125
1154
  } : void 0;
1126
1155
  }
1127
1156
  }
1128
1157
  get applyDisabled() {
1129
1158
  let e = this.pendingValue;
1130
- return !e || !this.value || e.mode !== this.value.mode ? !e : e.mode === D.Preset && this.value.mode === D.Preset ? e.value === this.value.value : e.mode === D.Custom && this.value.mode === D.Custom && e.height === this.value.height && e.unit === this.value.unit && e.width === this.value.width;
1159
+ return !e || !this.value || e.mode !== this.value.mode ? !e : e.mode === E.Preset && this.value.mode === E.Preset ? e.value === this.value.value : e.mode === E.Custom && this.value.mode === E.Custom && e.height === this.value.height && e.unit === this.value.unit && e.width === this.value.width;
1131
1160
  }
1132
1161
  applyPendingValue() {
1133
1162
  let e = this.pendingValue;
@@ -1136,33 +1165,29 @@ var Ot = W, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
1136
1165
  onDimensionsSelectChange(e) {
1137
1166
  if (e.target !== e.currentTarget || this.loading) return;
1138
1167
  let t = e.currentTarget.value;
1139
- if (t === D.Custom && this.canCustom) this.dimensionsSelection = D.Custom, this.applyBehavior !== N.Manual && this.applyPendingValue();
1168
+ if (t === E.Custom && this.canCustom) this.dimensionsSelection = E.Custom, this.applyBehavior !== j.Manual && this.applyPendingValue();
1140
1169
  else if (t.startsWith("preset:")) {
1141
1170
  let e = this.items.find((e) => `preset:${e.value}` === t && !e.disabled);
1142
- e && (this.dimensionsSelection = t, this.applyBehavior !== N.Manual && this.emitDimensionsValue({
1143
- mode: D.Preset,
1171
+ e && (this.dimensionsSelection = t, this.applyBehavior !== j.Manual && this.emitDimensionsValue({
1172
+ mode: E.Preset,
1144
1173
  value: e.value
1145
1174
  }));
1146
1175
  }
1147
1176
  }
1148
1177
  onDimensionsInput(e) {
1149
1178
  if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
1150
- let t = e.currentTarget, n = t.name === "height" ? "height" : "width", r = this.customDimensionsUnit;
1151
- this.customDimensionsDrafts = {
1152
- ...this.customDimensionsDrafts,
1153
- [r]: {
1154
- ...this.customDimensionsDrafts[r],
1155
- [n]: t.value
1156
- }
1157
- };
1179
+ let t = e.currentTarget;
1180
+ this.#r(t.name === "height" ? "height" : "width", t.value);
1158
1181
  }
1159
1182
  onDimensionsCustomChange(e) {
1160
- e.target === e.currentTarget && !this.loading && this.canCustom && e.currentTarget.reportValidity() && this.applyBehavior !== N.Manual && this.applyPendingValue();
1183
+ if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
1184
+ let t = e.currentTarget;
1185
+ this.#i(t.name === "height" ? "height" : "width"), t.reportValidity() && this.applyBehavior !== j.Manual && this.applyPendingValue();
1161
1186
  }
1162
1187
  onDimensionsUnitChange(e) {
1163
1188
  if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
1164
1189
  let t = e.currentTarget.value;
1165
- (t === A.Pixel || t === A.Percent) && (this.customDimensionsUnit = t, this.applyBehavior !== N.Manual && this.applyPendingValue());
1190
+ (t === O.Pixel || t === O.Percent && this.canPercent) && (this.customDimensionsUnit = t, this.applyBehavior !== j.Manual && this.applyPendingValue());
1166
1191
  }
1167
1192
  onApply() {
1168
1193
  !this.loading && !this.applyDisabled && this.applyPendingValue();
@@ -1175,21 +1200,21 @@ var Ot = W, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
1175
1200
  }
1176
1201
  renderCustomDimensions() {
1177
1202
  let t = this.customDimensionsUnit, n = this.customDimensionsDrafts[t];
1178
- return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${At[t]} aria-label=${this.localize.term("maxWidth")} value=${n.width} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">W</cx-typography></cx-input><cx-input name="height" mask="num" .maskBlocks=${At[t]} aria-label=${this.localize.term("maxHeight")} value=${n.height} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">H</cx-typography></cx-input><cx-select data-label=${this.localize.term("unit")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsUnitChange}><cx-option value=${A.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${A.Percent}>${this.localize.term("dimensionsPercent")}</cx-option></cx-select></cx-space>`;
1203
+ return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${Nt[t]} aria-label=${this.localize.term("maxWidth")} value=${n.width} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">W</cx-typography></cx-input><cx-input name="height" mask="num" .maskBlocks=${Nt[t]} aria-label=${this.localize.term("maxHeight")} value=${n.height} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">H</cx-typography></cx-input><cx-select data-label=${this.localize.term("unit")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsUnitChange}><cx-option value=${O.Pixel}>${this.localize.term("pixels")}</cx-option>${m(this.canPercent, () => e`<cx-option value=${O.Percent}>${this.localize.term("dimensionsPercent")}</cx-option>`)}</cx-select></cx-space>`;
1179
1204
  }
1180
1205
  renderSummary() {
1181
- return e`<cx-space class="asset-link-format__dimensions-summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant=${this.inline ? b.Body3 : b.Body2}>${this.localize.term("dimensions")}</cx-typography></cx-space>`;
1206
+ return e`<cx-space class="asset-link-format__dimensions-summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("dimensions")}</cx-typography></cx-space>`;
1182
1207
  }
1183
1208
  renderContent() {
1184
- let t = this.canCustom && this.dimensionsSelection === D.Custom;
1185
- return e`<cx-space class="asset-link-format__dimensions-content" direction="vertical" spacing="small"><cx-select class="asset-link-format__dimensions-select" data-label=${this.localize.term("dimensions")} value=${this.dimensionsSelection === D.Custom && !this.canCustom ? "" : this.dimensionsSelection} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsSelectChange}>${S(this.items, (e) => e.value, (t, n) => e`
1209
+ let t = this.canCustom && this.dimensionsSelection === E.Custom;
1210
+ return e`<cx-space class="asset-link-format__dimensions-content" direction="vertical" spacing="small"><cx-select class="asset-link-format__dimensions-select" data-label=${this.localize.term("dimensions")} value=${this.dimensionsSelection === E.Custom && !this.canCustom ? "" : this.dimensionsSelection} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsSelectChange}>${x(this.items, (e) => e.value, (t, n) => e`
1186
1211
  ${m(t.group !== this.items[n - 1]?.group, () => e`
1187
1212
  ${m(n > 0, () => e`<cx-divider></cx-divider>`)}
1188
1213
  ${m(!!t.group, () => e`<cx-menu-label>${t.group}</cx-menu-label>`)}
1189
1214
  `)}<cx-option value=${`preset:${t.value}`} ?disabled=${t.disabled}>${t.label}</cx-option>`)}
1190
1215
  ${m(this.canCustom, () => e`
1191
- ${m(this.items.length > 0, () => e`<cx-divider></cx-divider>`)}<cx-option value=${D.Custom}><cx-icon slot="prefix" name="edit"></cx-icon>${this.localize.term("custom")}</cx-option>`)}</cx-select>${m(t, () => this.renderCustomDimensions())}
1192
- ${m(this.applyBehavior === N.Manual, () => e`<cx-button class="asset-link-format__dimensions-apply" data-testid="cx-asset-link-format-dimensions-apply" variant="primary" ?disabled=${this.applyDisabled} ?loading=${this.loading} @click=${this.onApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space>`;
1216
+ ${m(this.items.length > 0, () => e`<cx-divider></cx-divider>`)}<cx-option value=${E.Custom}><cx-icon slot="prefix" name="edit"></cx-icon>${this.localize.term("custom")}</cx-option>`)}</cx-select>${m(t, () => this.renderCustomDimensions())}
1217
+ ${m(this.applyBehavior === j.Manual, () => e`<cx-button class="asset-link-format__dimensions-apply" data-testid="cx-asset-link-format-dimensions-apply" variant="primary" ?disabled=${this.applyDisabled} ?loading=${this.loading} @click=${this.onApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space>`;
1193
1218
  }
1194
1219
  render() {
1195
1220
  return this.inline ? e`<div class="asset-link-format__dimensions-inline">${this.renderSummary()}
@@ -1199,74 +1224,72 @@ var Ot = W, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
1199
1224
  a([r({
1200
1225
  reflect: !0,
1201
1226
  type: Boolean
1202
- }), o("design:type", Object)], G.prototype, "open", void 0), a([r({
1227
+ }), o("design:type", Object)], W.prototype, "open", void 0), a([r({
1203
1228
  reflect: !0,
1204
1229
  type: Boolean
1205
- }), o("design:type", Object)], G.prototype, "inline", void 0), a([r({
1230
+ }), o("design:type", Object)], W.prototype, "inline", void 0), a([r({
1206
1231
  attribute: "apply-behavior",
1207
1232
  reflect: !0,
1208
1233
  type: String
1209
- }), o("design:type", Object)], G.prototype, "applyBehavior", void 0), a([r({
1234
+ }), o("design:type", Object)], W.prototype, "applyBehavior", void 0), a([r({
1210
1235
  reflect: !0,
1211
1236
  type: Boolean
1212
- }), o("design:type", Object)], G.prototype, "loading", void 0), a([r({
1237
+ }), o("design:type", Object)], W.prototype, "loading", void 0), a([r({
1213
1238
  attribute: !1,
1214
1239
  type: Array
1215
- }), o("design:type", Array)], G.prototype, "items", void 0), a([r({
1240
+ }), o("design:type", Array)], W.prototype, "items", void 0), a([r({
1216
1241
  attribute: "can-custom",
1217
1242
  type: Boolean
1218
- }), o("design:type", Object)], G.prototype, "canCustom", void 0), a([r({
1243
+ }), o("design:type", Object)], W.prototype, "canCustom", void 0), a([r({
1244
+ attribute: "can-percent",
1245
+ type: Boolean
1246
+ }), o("design:type", Object)], W.prototype, "canPercent", void 0), a([r({
1219
1247
  attribute: !1,
1220
1248
  type: Object
1221
- }), o("design:type", Object)], G.prototype, "value", void 0), a([i(), o("design:type", Object)], G.prototype, "customDimensionsUnit", void 0), a([i(), o("design:type", Object)], G.prototype, "dimensionsSelection", void 0), a([i(), o("design:type", Object)], G.prototype, "customDimensionsDrafts", void 0), a([
1222
- f("value"),
1223
- o("design:type", Function),
1224
- o("design:paramtypes", []),
1225
- o("design:returntype", void 0)
1226
- ], G.prototype, "handleDimensionsValueChange", null), G = a([u("cx-asset-link-format-dimensions")], G);
1227
- var jt = G, Mt = t`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`, K = class extends s {
1249
+ }), o("design:type", Object)], W.prototype, "value", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsUnit", void 0), a([i(), o("design:type", Object)], W.prototype, "dimensionsSelection", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsDrafts", void 0), W = a([u("cx-asset-link-format-dimensions")], W);
1250
+ var Pt = W, Ft = t`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`, G = class extends s {
1228
1251
  constructor(...e) {
1229
1252
  super(...e), this.localize = new d(this), this.value = "", this.items = [];
1230
1253
  }
1231
- static #e = this.styles = [l, Mt];
1254
+ static #e = this.styles = [l, Ft];
1232
1255
  static #t = this.dependencies = {
1233
- "cx-option": C,
1234
- "cx-select": T,
1235
- "cx-space": w,
1236
- "cx-typography": x
1256
+ "cx-option": S,
1257
+ "cx-select": w,
1258
+ "cx-space": C,
1259
+ "cx-typography": b
1237
1260
  };
1238
1261
  handleExtensionChange(e) {
1239
1262
  let t = e.target.value;
1240
1263
  this.emit("cx-asset-link-format-extension-change", { detail: t });
1241
1264
  }
1242
1265
  render() {
1243
- return e`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${S(this.items, (e) => e.value, (t) => e`<cx-option value=${t.value}>${t.displayName}</cx-option>`)}</cx-select></cx-space>`;
1266
+ return e`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${x(this.items, (e) => e.value, (t) => e`<cx-option value=${t.value}>${t.displayName}</cx-option>`)}</cx-select></cx-space>`;
1244
1267
  }
1245
1268
  };
1246
1269
  a([r({
1247
1270
  reflect: !0,
1248
1271
  type: String
1249
- }), o("design:type", String)], K.prototype, "value", void 0), a([r({
1272
+ }), o("design:type", String)], G.prototype, "value", void 0), a([r({
1250
1273
  reflect: !1,
1251
1274
  type: Array
1252
- }), o("design:type", typeof Array > "u" ? Object : Array)], K.prototype, "items", void 0), K = a([u("cx-asset-link-format-extension")], K);
1253
- var Nt = K, Pt = t`cx-details::part(base){border-bottom-width:0}`, Ft = "auto", q = class extends s {
1275
+ }), o("design:type", typeof Array > "u" ? Object : Array)], G.prototype, "items", void 0), G = a([u("cx-asset-link-format-extension")], G);
1276
+ var It = G, Lt = t`cx-details::part(base){border-bottom-width:0}`, Rt = "auto", K = class extends s {
1254
1277
  constructor(...e) {
1255
1278
  super(...e), this.localize = new d(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
1256
1279
  }
1257
- static #e = this.styles = [l, Pt];
1280
+ static #e = this.styles = [l, Lt];
1258
1281
  static #t = this.dependencies = {
1259
1282
  "cx-button": _,
1260
- "cx-details": E,
1261
- "cx-divider": _e,
1283
+ "cx-details": T,
1284
+ "cx-divider": ye,
1262
1285
  "cx-icon": h,
1263
- "cx-option": C,
1264
- "cx-select": T,
1265
- "cx-space": w,
1266
- "cx-typography": x
1286
+ "cx-option": S,
1287
+ "cx-select": w,
1288
+ "cx-space": C,
1289
+ "cx-typography": b
1267
1290
  };
1268
1291
  get committedValue() {
1269
- return this.autoFormat ? Ft : this.value;
1292
+ return this.autoFormat ? Rt : this.value;
1270
1293
  }
1271
1294
  handleValueChange() {
1272
1295
  this.scopedValue = this.committedValue;
@@ -1297,61 +1320,68 @@ var Nt = K, Pt = t`cx-details::part(base){border-bottom-width:0}`, Ft = "auto",
1297
1320
  e.target !== this.base && e.stopPropagation();
1298
1321
  }
1299
1322
  render() {
1300
- return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${S(this.items, (e) => e.id, (t) => e`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`)}
1301
- ${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Ft}>${this.localize.term("auto")}</cx-option>`, () => n)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${g({ "margin-left": "auto" })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1323
+ return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${x(this.items, (e) => e.id, (t) => e`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`)}
1324
+ ${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Rt}>${this.localize.term("auto")}</cx-option>`, () => n)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${g({ "margin-left": "auto" })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1302
1325
  }
1303
1326
  };
1304
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], q.prototype, "base", void 0), a([r({
1327
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], K.prototype, "base", void 0), a([r({
1305
1328
  reflect: !0,
1306
1329
  type: Boolean
1307
- }), o("design:type", Object)], q.prototype, "open", void 0), a([r({
1330
+ }), o("design:type", Object)], K.prototype, "open", void 0), a([r({
1308
1331
  reflect: !0,
1309
1332
  type: String
1310
- }), o("design:type", Object)], q.prototype, "value", void 0), a([r({
1333
+ }), o("design:type", Object)], K.prototype, "value", void 0), a([r({
1311
1334
  reflect: !1,
1312
1335
  type: Array
1313
- }), o("design:type", Array)], q.prototype, "items", void 0), a([r({
1336
+ }), o("design:type", Array)], K.prototype, "items", void 0), a([r({
1314
1337
  attribute: "can-auto-format",
1315
1338
  reflect: !0,
1316
1339
  type: Boolean
1317
- }), o("design:type", Object)], q.prototype, "canAutoFormat", void 0), a([r({
1340
+ }), o("design:type", Object)], K.prototype, "canAutoFormat", void 0), a([r({
1318
1341
  attribute: "auto-format",
1319
1342
  reflect: !0,
1320
1343
  type: Boolean
1321
- }), o("design:type", Object)], q.prototype, "autoFormat", void 0), a([r({
1344
+ }), o("design:type", Object)], K.prototype, "autoFormat", void 0), a([r({
1322
1345
  reflect: !0,
1323
1346
  type: Boolean
1324
- }), o("design:type", Object)], q.prototype, "loading", void 0), a([i(), o("design:type", Object)], q.prototype, "scopedValue", void 0), a([
1347
+ }), o("design:type", Object)], K.prototype, "loading", void 0), a([i(), o("design:type", Object)], K.prototype, "scopedValue", void 0), a([
1325
1348
  f("autoFormat"),
1326
1349
  f("value"),
1327
1350
  o("design:type", Function),
1328
1351
  o("design:paramtypes", []),
1329
1352
  o("design:returntype", void 0)
1330
- ], q.prototype, "handleValueChange", null), a([
1353
+ ], K.prototype, "handleValueChange", null), a([
1331
1354
  f("open", { waitUntilFirstUpdate: !0 }),
1332
1355
  o("design:type", Function),
1333
1356
  o("design:paramtypes", []),
1334
1357
  o("design:returntype", void 0)
1335
- ], q.prototype, "handleOpenChange", null), q = a([u("cx-asset-link-format-proxy")], q);
1336
- var It = q, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__quality-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__quality-inline .asset-link-format__quality-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__quality-inline .asset-link-format__quality-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__quality-apply{margin-inline-start:auto}`, J = class extends s {
1358
+ ], K.prototype, "handleOpenChange", null), K = a([u("cx-asset-link-format-proxy")], K);
1359
+ var zt = K, Bt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__quality-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__quality-inline .asset-link-format__quality-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__quality-inline .asset-link-format__quality-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__quality-apply{margin-inline-start:auto}`, Vt = 1, Ht = 100, Ut = { num: {
1360
+ autofix: !0,
1361
+ mask: Number,
1362
+ max: Ht,
1363
+ min: Vt,
1364
+ radix: ".",
1365
+ scale: 0
1366
+ } }, q = class extends s {
1337
1367
  constructor(...e) {
1338
- super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = N.Legacy, this.value = 100, this.items = [], this.customSelected = !1, this.loading = !1, this.scopedValue = 100;
1368
+ super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = j.Legacy, this.value = 100, this.items = [], this.customSelected = !1, this.loading = !1, this.scopedValue = 100;
1339
1369
  }
1340
- static #e = this.styles = [l, Lt];
1370
+ static #e = this.styles = [l, Bt];
1341
1371
  static #t = this.dependencies = {
1342
1372
  "cx-button": _,
1343
- "cx-details": E,
1344
- "cx-divider": _e,
1373
+ "cx-details": T,
1374
+ "cx-divider": ye,
1345
1375
  "cx-icon": h,
1346
- "cx-input": se,
1347
- "cx-option": C,
1348
- "cx-select": T,
1349
- "cx-space": w,
1376
+ "cx-input": le,
1377
+ "cx-option": S,
1378
+ "cx-select": w,
1379
+ "cx-space": C,
1350
1380
  "cx-tooltip": ne,
1351
- "cx-typography": x
1381
+ "cx-typography": b
1352
1382
  };
1353
1383
  get invalidValue() {
1354
- return isNaN(Number(this.scopedValue)) || Number(this.scopedValue) < 1 || Number(this.scopedValue) > 100 || this.value === this.scopedValue;
1384
+ return isNaN(Number(this.scopedValue)) || Number(this.scopedValue) < Vt || Number(this.scopedValue) > Ht || this.value === this.scopedValue;
1355
1385
  }
1356
1386
  handleValueChange() {
1357
1387
  this.scopedValue = this.value, this.customSelected = !1;
@@ -1361,14 +1391,17 @@ var It = q, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1361
1391
  let t = e.currentTarget.value;
1362
1392
  if (this.customSelected = t === "custom", this.customSelected) return;
1363
1393
  let n = this.items.find((e) => String(e.value) === t && !e.disabled);
1364
- !n || !Number.isFinite(n.value) || n.value < 1 || n.value > 100 || (this.scopedValue = n.value, n.value !== this.value && this.applyBehavior !== N.Manual && this.handleApply());
1394
+ !n || !Number.isFinite(n.value) || n.value < Vt || n.value > Ht || (this.scopedValue = n.value, n.value !== this.value && this.applyBehavior !== j.Manual && this.handleApply());
1365
1395
  }
1366
1396
  handleQualityChange(e) {
1367
1397
  let t = e.target.value;
1368
1398
  this.customSelected = !0, this.scopedValue = Number(t);
1369
1399
  }
1370
1400
  handleQualityCommit(e) {
1371
- e.target === e.currentTarget && this.applyBehavior === N.Automatic && this.handleApply();
1401
+ e.target === e.currentTarget && (this.#n(e.target.value), this.applyBehavior === j.Automatic && this.handleApply());
1402
+ }
1403
+ #n(e) {
1404
+ e && this.scopedValue !== this.value && (this.scopedValue = ce(this.scopedValue, Vt, Ht));
1372
1405
  }
1373
1406
  handleApply() {
1374
1407
  this.loading || this.invalidValue || this.emit("cx-asset-link-format-quality-change", { detail: Number(this.scopedValue) });
@@ -1381,11 +1414,11 @@ var It = q, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1381
1414
  }
1382
1415
  renderPresets() {
1383
1416
  let t = !this.customSelected && this.items.some((e) => e.value === this.scopedValue) ? String(this.scopedValue) : "custom";
1384
- return e`<cx-select data-label=${this.localize.term("quality")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.handlePresetChange}>${S(this.items, (e) => e.value, (t) => e`<cx-option value=${String(t.value)} ?disabled=${t.disabled}>${t.label}
1417
+ return e`<cx-select data-label=${this.localize.term("quality")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.handlePresetChange}>${x(this.items, (e) => e.value, (t) => e`<cx-option value=${String(t.value)} ?disabled=${t.disabled}>${t.label}
1385
1418
  ${m(!!t.description, () => e`<span slot="help-text">${t.description}</span>`)}</cx-option>`)}<cx-divider></cx-divider><cx-option value="custom"><cx-icon slot="prefix" name="edit"></cx-icon>${this.localize.term("custom")}<span slot="help-text">${this.localize.term("qualityHelpText")}</span></cx-option></cx-select>`;
1386
1419
  }
1387
1420
  renderSummary() {
1388
- return e`<cx-space class="asset-link-format__quality-summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant=${this.inline ? b.Body3 : b.Body2}>${this.localize.term("quality")}</cx-typography></cx-space>`;
1421
+ return e`<cx-space class="asset-link-format__quality-summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("quality")}</cx-typography></cx-space>`;
1389
1422
  }
1390
1423
  renderApplyButton() {
1391
1424
  return e`<cx-button class="asset-link-format__quality-apply" data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`;
@@ -1393,76 +1426,70 @@ var It = q, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1393
1426
  renderContent() {
1394
1427
  let t = this.items.length === 0 || this.customSelected || !this.items.some((e) => e.value === this.scopedValue);
1395
1428
  return e`<cx-space class="asset-link-format__quality-content" direction="vertical" spacing="small">${m(this.items.length > 0, () => this.renderPresets())}
1396
- ${m(t, () => e`<cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: {
1397
- mask: Number,
1398
- max: 100,
1399
- min: 1,
1400
- radix: ".",
1401
- scale: 0
1402
- } }} value=${this.scopedValue.toString()} style=${g({ flex: "1" })} @cx-input=${this.handleQualityChange} @cx-change=${this.handleQualityCommit}></cx-input></cx-tooltip>${m(this.applyBehavior === N.Legacy, () => this.renderApplyButton())}</cx-space>`)}
1403
- ${m(this.applyBehavior === N.Manual, () => this.renderApplyButton())}</cx-space>`;
1429
+ ${m(t, () => e`<cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${Ut} value=${this.scopedValue.toString()} style=${g({ flex: "1" })} @cx-input=${this.handleQualityChange} @cx-change=${this.handleQualityCommit}></cx-input></cx-tooltip>${m(this.applyBehavior === j.Legacy, () => this.renderApplyButton())}</cx-space>`)}
1430
+ ${m(this.applyBehavior === j.Manual, () => this.renderApplyButton())}</cx-space>`;
1404
1431
  }
1405
1432
  render() {
1406
1433
  return this.inline ? e`<div class="asset-link-format__quality-inline">${this.renderSummary()}
1407
1434
  ${this.renderContent()}</div>` : e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><div slot="summary">${this.renderSummary()}</div>${this.renderContent()}</cx-details>`;
1408
1435
  }
1409
1436
  };
1410
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], J.prototype, "base", void 0), a([r({
1437
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], q.prototype, "base", void 0), a([r({
1411
1438
  reflect: !0,
1412
1439
  type: Boolean
1413
- }), o("design:type", Object)], J.prototype, "open", void 0), a([r({
1440
+ }), o("design:type", Object)], q.prototype, "open", void 0), a([r({
1414
1441
  reflect: !0,
1415
1442
  type: Boolean
1416
- }), o("design:type", Object)], J.prototype, "inline", void 0), a([r({
1443
+ }), o("design:type", Object)], q.prototype, "inline", void 0), a([r({
1417
1444
  attribute: "apply-behavior",
1418
1445
  reflect: !0,
1419
1446
  type: String
1420
- }), o("design:type", Object)], J.prototype, "applyBehavior", void 0), a([r({
1447
+ }), o("design:type", Object)], q.prototype, "applyBehavior", void 0), a([r({
1421
1448
  reflect: !0,
1422
1449
  type: Number
1423
- }), o("design:type", Object)], J.prototype, "value", void 0), a([r({
1450
+ }), o("design:type", Object)], q.prototype, "value", void 0), a([r({
1424
1451
  attribute: !1,
1425
1452
  type: Array
1426
- }), o("design:type", Array)], J.prototype, "items", void 0), a([i(), o("design:type", Object)], J.prototype, "customSelected", void 0), a([r({
1453
+ }), o("design:type", Array)], q.prototype, "items", void 0), a([i(), o("design:type", Object)], q.prototype, "customSelected", void 0), a([r({
1427
1454
  reflect: !0,
1428
1455
  type: Boolean
1429
- }), o("design:type", Object)], J.prototype, "loading", void 0), a([i(), o("design:type", Object)], J.prototype, "scopedValue", void 0), a([
1456
+ }), o("design:type", Object)], q.prototype, "loading", void 0), a([i(), o("design:type", Object)], q.prototype, "scopedValue", void 0), a([
1430
1457
  f("value"),
1431
1458
  o("design:type", Function),
1432
1459
  o("design:paramtypes", []),
1433
1460
  o("design:returntype", void 0)
1434
- ], J.prototype, "handleValueChange", null), J = a([u("cx-asset-link-format-quality")], J);
1435
- var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`, Bt = { num: {
1461
+ ], q.prototype, "handleValueChange", null), q = a([u("cx-asset-link-format-quality")], q);
1462
+ var Wt = q, Gt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`, Kt = { num: {
1436
1463
  autofix: !0,
1437
1464
  mask: Number,
1438
- max: M,
1465
+ max: A,
1439
1466
  min: 1,
1440
1467
  radix: ".",
1441
1468
  scale: 0
1442
- } }, Y = class extends s {
1469
+ } }, J = class extends s {
1443
1470
  constructor(...e) {
1444
- super(...e), this.localize = new d(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = P.Pixel, this.lastAppliedSetting = {
1445
- [P.Pixel]: {
1471
+ super(...e), this.localize = new d(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = M.Pixel, this.lastAppliedSetting = {
1472
+ [M.Pixel]: {
1446
1473
  height: 0,
1447
1474
  width: 0
1448
1475
  },
1449
- [P.AspectRatio]: {
1476
+ [M.AspectRatio]: {
1450
1477
  height: 1,
1451
1478
  width: 1
1452
1479
  }
1453
1480
  }, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
1454
1481
  }
1455
- static #e = this.styles = [l, zt];
1482
+ static #e = this.styles = [l, Gt];
1456
1483
  static #t = this.dependencies = {
1457
1484
  "cx-button": _,
1458
- "cx-details": E,
1485
+ "cx-details": T,
1459
1486
  "cx-icon": h,
1460
1487
  "cx-icon-button": p,
1461
- "cx-input": se,
1462
- "cx-option": C,
1463
- "cx-select": T,
1464
- "cx-space": w,
1465
- "cx-typography": x
1488
+ "cx-input": le,
1489
+ "cx-option": S,
1490
+ "cx-select": w,
1491
+ "cx-space": C,
1492
+ "cx-typography": b
1466
1493
  };
1467
1494
  get disabledApply() {
1468
1495
  return this.lastAppliedSetting[this.unit].width === this.width && this.lastAppliedSetting[this.unit].height === this.height;
@@ -1470,11 +1497,11 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1470
1497
  async handleCropModeChange() {
1471
1498
  let e = Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && this.maxWidth > 0 && this.maxHeight > 0;
1472
1499
  if (this.keepAspectRatio) {
1473
- if (this.unit === P.AspectRatio && this.ratioWidth && this.ratioHeight) {
1500
+ if (this.unit === M.AspectRatio && this.ratioWidth && this.ratioHeight) {
1474
1501
  this.aspectRatio = this.ratioWidth / this.ratioHeight;
1475
1502
  return;
1476
1503
  }
1477
- if (this.unit === P.Pixel && !e && this.width && this.height) {
1504
+ if (this.unit === M.Pixel && !e && this.width && this.height) {
1478
1505
  this.aspectRatio = this.width / this.height;
1479
1506
  return;
1480
1507
  }
@@ -1502,9 +1529,9 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1502
1529
  this.invalidWidth = !0;
1503
1530
  return;
1504
1531
  }
1505
- this.invalidWidth = !1, t = Math.min(t, M), this.unit === P.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
1506
- let n = this.unit === P.Pixel ? this.height : this.ratioHeight;
1507
- !this.keepAspectRatio && this.unit === P.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight, M), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1532
+ this.invalidWidth = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
1533
+ let n = this.unit === M.Pixel ? this.height : this.ratioHeight;
1534
+ !this.keepAspectRatio && this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight, A), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1508
1535
  height: n,
1509
1536
  keepAspectRatio: this.keepAspectRatio,
1510
1537
  unit: this.unit,
@@ -1517,9 +1544,9 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1517
1544
  this.invalidHeight = !0;
1518
1545
  return;
1519
1546
  }
1520
- this.invalidHeight = !1, t = Math.min(t, M), this.unit === P.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
1521
- let n = this.unit === P.Pixel ? this.width : this.ratioWidth;
1522
- !this.keepAspectRatio && this.unit === P.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth, M), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1547
+ this.invalidHeight = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
1548
+ let n = this.unit === M.Pixel ? this.width : this.ratioWidth;
1549
+ !this.keepAspectRatio && this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth, A), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1523
1550
  height: t,
1524
1551
  keepAspectRatio: this.keepAspectRatio,
1525
1552
  unit: this.unit,
@@ -1527,16 +1554,16 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1527
1554
  } });
1528
1555
  }
1529
1556
  onUnitChange(e) {
1530
- e.target.value === P.AspectRatio ? this.emit("cx-asset-link-format-resize-change", { detail: {
1531
- height: this.lastAppliedSetting[P.AspectRatio].height,
1557
+ e.target.value === M.AspectRatio ? this.emit("cx-asset-link-format-resize-change", { detail: {
1558
+ height: this.lastAppliedSetting[M.AspectRatio].height,
1532
1559
  keepAspectRatio: this.keepAspectRatio,
1533
- unit: P.AspectRatio,
1534
- width: this.lastAppliedSetting[P.AspectRatio].width
1560
+ unit: M.AspectRatio,
1561
+ width: this.lastAppliedSetting[M.AspectRatio].width
1535
1562
  } }) : this.emit("cx-asset-link-format-resize-change", { detail: {
1536
- height: this.lastAppliedSetting[P.Pixel].height,
1563
+ height: this.lastAppliedSetting[M.Pixel].height,
1537
1564
  keepAspectRatio: this.keepAspectRatio,
1538
- unit: P.Pixel,
1539
- width: this.lastAppliedSetting[P.Pixel].width
1565
+ unit: M.Pixel,
1566
+ width: this.lastAppliedSetting[M.Pixel].width
1540
1567
  } });
1541
1568
  }
1542
1569
  handleApply() {
@@ -1554,10 +1581,10 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1554
1581
  }
1555
1582
  handleAspectRatioClick() {
1556
1583
  this.emit("cx-asset-link-format-resize-change", { detail: {
1557
- height: this.unit === P.Pixel ? this.height : this.ratioHeight,
1584
+ height: this.unit === M.Pixel ? this.height : this.ratioHeight,
1558
1585
  keepAspectRatio: !this.keepAspectRatio,
1559
1586
  unit: this.unit,
1560
- width: this.unit === P.Pixel ? this.width : this.ratioWidth
1587
+ width: this.unit === M.Pixel ? this.width : this.ratioWidth
1561
1588
  } });
1562
1589
  }
1563
1590
  fitRatioSides(e, t, n, r) {
@@ -1566,57 +1593,57 @@ var Rt = J, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1566
1593
  return [i, Math.min(t, r * i)];
1567
1594
  }
1568
1595
  render() {
1569
- return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${Bt} value=${this.unit === P.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1596
+ return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${Kt} value=${this.unit === M.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1570
1597
  W
1571
- </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${Bt} value=${this.unit === P.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1598
+ </cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${Kt} value=${this.unit === M.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
1572
1599
  H
1573
- </cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${P.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${P.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1600
+ </cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${M.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${M.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
1574
1601
  }
1575
1602
  };
1576
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], Y.prototype, "base", void 0), a([r({
1603
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], J.prototype, "base", void 0), a([r({
1577
1604
  reflect: !0,
1578
1605
  type: Boolean
1579
- }), o("design:type", Boolean)], Y.prototype, "open", void 0), a([r({
1606
+ }), o("design:type", Boolean)], J.prototype, "open", void 0), a([r({
1580
1607
  reflect: !0,
1581
1608
  type: Number
1582
- }), o("design:type", Number)], Y.prototype, "width", void 0), a([r({
1609
+ }), o("design:type", Number)], J.prototype, "width", void 0), a([r({
1583
1610
  reflect: !0,
1584
1611
  type: Number
1585
- }), o("design:type", Number)], Y.prototype, "height", void 0), a([r({
1612
+ }), o("design:type", Number)], J.prototype, "height", void 0), a([r({
1586
1613
  attribute: "max-width",
1587
1614
  reflect: !0,
1588
1615
  type: Number
1589
- }), o("design:type", Number)], Y.prototype, "maxWidth", void 0), a([r({
1616
+ }), o("design:type", Number)], J.prototype, "maxWidth", void 0), a([r({
1590
1617
  attribute: "max-height",
1591
1618
  reflect: !0,
1592
1619
  type: Number
1593
- }), o("design:type", Number)], Y.prototype, "maxHeight", void 0), a([r({
1620
+ }), o("design:type", Number)], J.prototype, "maxHeight", void 0), a([r({
1594
1621
  attribute: "ratio-width",
1595
1622
  reflect: !0,
1596
1623
  type: Number
1597
- }), o("design:type", Number)], Y.prototype, "ratioWidth", void 0), a([r({
1624
+ }), o("design:type", Number)], J.prototype, "ratioWidth", void 0), a([r({
1598
1625
  attribute: "ratio-height",
1599
1626
  reflect: !0,
1600
1627
  type: Number
1601
- }), o("design:type", Number)], Y.prototype, "ratioHeight", void 0), a([r({
1628
+ }), o("design:type", Number)], J.prototype, "ratioHeight", void 0), a([r({
1602
1629
  reflect: !0,
1603
1630
  type: String
1604
- }), o("design:type", P === void 0 ? Object : P)], Y.prototype, "unit", void 0), a([r({
1631
+ }), o("design:type", M === void 0 ? Object : M)], J.prototype, "unit", void 0), a([r({
1605
1632
  attribute: "last-applied-setting",
1606
1633
  reflect: !1,
1607
1634
  type: Object
1608
- }), o("design:type", typeof Record > "u" ? Object : Record)], Y.prototype, "lastAppliedSetting", void 0), a([r({
1635
+ }), o("design:type", typeof Record > "u" ? Object : Record)], J.prototype, "lastAppliedSetting", void 0), a([r({
1609
1636
  reflect: !0,
1610
1637
  type: Boolean
1611
- }), o("design:type", Boolean)], Y.prototype, "loading", void 0), a([r({
1638
+ }), o("design:type", Boolean)], J.prototype, "loading", void 0), a([r({
1612
1639
  attribute: "no-ratio-modes",
1613
1640
  reflect: !0,
1614
1641
  type: Boolean
1615
- }), o("design:type", Boolean)], Y.prototype, "noRatioModes", void 0), a([r({
1642
+ }), o("design:type", Boolean)], J.prototype, "noRatioModes", void 0), a([r({
1616
1643
  attribute: "keep-aspect-ratio",
1617
1644
  reflect: !0,
1618
1645
  type: Boolean
1619
- }), o("design:type", Boolean)], Y.prototype, "keepAspectRatio", void 0), a([i(), o("design:type", Boolean)], Y.prototype, "invalidWidth", void 0), a([i(), o("design:type", Boolean)], Y.prototype, "invalidHeight", void 0), a([i(), o("design:type", Number)], Y.prototype, "aspectRatio", void 0), a([
1646
+ }), o("design:type", Boolean)], J.prototype, "keepAspectRatio", void 0), a([i(), o("design:type", Boolean)], J.prototype, "invalidWidth", void 0), a([i(), o("design:type", Boolean)], J.prototype, "invalidHeight", void 0), a([i(), o("design:type", Number)], J.prototype, "aspectRatio", void 0), a([
1620
1647
  f("cropMode", { waitUntilFirstUpdate: !0 }),
1621
1648
  f("maxWidth", { waitUntilFirstUpdate: !0 }),
1622
1649
  f("maxHeight", { waitUntilFirstUpdate: !0 }),
@@ -1624,25 +1651,25 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], Y.prototype, "ba
1624
1651
  o("design:type", Function),
1625
1652
  o("design:paramtypes", []),
1626
1653
  o("design:returntype", Promise)
1627
- ], Y.prototype, "handleCropModeChange", null), a([
1654
+ ], J.prototype, "handleCropModeChange", null), a([
1628
1655
  f("open", { waitUntilFirstUpdate: !0 }),
1629
1656
  o("design:type", Function),
1630
1657
  o("design:paramtypes", []),
1631
1658
  o("design:returntype", Promise)
1632
- ], Y.prototype, "handleOpenChange", null), Y = a([u("cx-asset-link-format-resize")], Y);
1633
- var Vt = Y, Ht = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__rotation-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}`, X = class extends s {
1659
+ ], J.prototype, "handleOpenChange", null), J = a([u("cx-asset-link-format-resize")], J);
1660
+ var qt = J, Jt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__rotation-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}`, Y = class extends s {
1634
1661
  constructor(...e) {
1635
1662
  super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
1636
1663
  }
1637
- static #e = this.styles = [l, Ht];
1664
+ static #e = this.styles = [l, Jt];
1638
1665
  static #t = this.dependencies = {
1639
1666
  "cx-button": _,
1640
- "cx-button-group": ae,
1641
- "cx-details": E,
1667
+ "cx-button-group": oe,
1668
+ "cx-details": T,
1642
1669
  "cx-icon": h,
1643
1670
  "cx-icon-button": p,
1644
- "cx-space": w,
1645
- "cx-typography": x
1671
+ "cx-space": C,
1672
+ "cx-typography": b
1646
1673
  };
1647
1674
  handleOpenChange() {
1648
1675
  this.open || this.emit("cx-asset-link-format-rotation-change", { detail: this.lastAppliedValue });
@@ -1666,7 +1693,7 @@ var Vt = Y, Ht = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1666
1693
  this.value === 360 || this.value === -360 || this.loading || this.emit("cx-asset-link-format-rotation-apply", { detail: this.value });
1667
1694
  }
1668
1695
  renderSummary() {
1669
- return e`<cx-space class="asset-link-format__rotation-summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant=${this.inline ? b.Body3 : b.Body2}>${this.localize.term("rotate")}</cx-typography></cx-space>`;
1696
+ return e`<cx-space class="asset-link-format__rotation-summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("rotate")}</cx-typography></cx-space>`;
1670
1697
  }
1671
1698
  renderControls() {
1672
1699
  return e`<cx-space class="asset-link-format__rotation-controls" spacing="small"><cx-button-group label=${this.localize.term("rotate")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("rotateCounterclockwise")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("rotateClockwise")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: {
@@ -1686,45 +1713,45 @@ var Vt = Y, Ht = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
1686
1713
  ${this.renderControls()}</div>` : e`<cx-details class="details" ?open=${this.open}><div slot="summary">${this.renderSummary()}</div>${this.renderControls()}</cx-details>`;
1687
1714
  }
1688
1715
  };
1689
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], X.prototype, "base", void 0), a([r({
1716
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], Y.prototype, "base", void 0), a([r({
1690
1717
  reflect: !0,
1691
1718
  type: Boolean
1692
- }), o("design:type", Object)], X.prototype, "open", void 0), a([r({
1719
+ }), o("design:type", Object)], Y.prototype, "open", void 0), a([r({
1693
1720
  reflect: !0,
1694
1721
  type: Boolean
1695
- }), o("design:type", Object)], X.prototype, "inline", void 0), a([r({
1722
+ }), o("design:type", Object)], Y.prototype, "inline", void 0), a([r({
1696
1723
  reflect: !0,
1697
1724
  type: Number
1698
- }), o("design:type", Object)], X.prototype, "value", void 0), a([r({
1725
+ }), o("design:type", Object)], Y.prototype, "value", void 0), a([r({
1699
1726
  attribute: "default-value",
1700
1727
  reflect: !0,
1701
1728
  type: Number
1702
- }), o("design:type", Object)], X.prototype, "defaultValue", void 0), a([r({
1729
+ }), o("design:type", Object)], Y.prototype, "defaultValue", void 0), a([r({
1703
1730
  reflect: !0,
1704
1731
  type: Boolean
1705
- }), o("design:type", Object)], X.prototype, "loading", void 0), a([r({
1732
+ }), o("design:type", Object)], Y.prototype, "loading", void 0), a([r({
1706
1733
  attribute: "last-applied-value",
1707
1734
  reflect: !0,
1708
1735
  type: Number
1709
- }), o("design:type", Object)], X.prototype, "lastAppliedValue", void 0), a([
1736
+ }), o("design:type", Object)], Y.prototype, "lastAppliedValue", void 0), a([
1710
1737
  f("open", { waitUntilFirstUpdate: !0 }),
1711
1738
  o("design:type", Function),
1712
1739
  o("design:paramtypes", []),
1713
1740
  o("design:returntype", void 0)
1714
- ], X.prototype, "handleOpenChange", null), X = a([u("cx-asset-link-format-rotation")], X);
1715
- var Ut = X, Wt = t`cx-details::part(base){border-bottom-width:0}`, Z = class extends s {
1741
+ ], Y.prototype, "handleOpenChange", null), Y = a([u("cx-asset-link-format-rotation")], Y);
1742
+ var Yt = Y, Xt = t`cx-details::part(base){border-bottom-width:0}`, X = class extends s {
1716
1743
  constructor(...e) {
1717
1744
  super(...e), this.localize = new d(this), this.open = !1, this.value = !1;
1718
1745
  }
1719
- static #e = this.styles = [l, Wt];
1746
+ static #e = this.styles = [l, Xt];
1720
1747
  static #t = this.dependencies = {
1721
1748
  "cx-button": _,
1722
- "cx-checkbox": oe,
1723
- "cx-details": E,
1749
+ "cx-checkbox": se,
1750
+ "cx-details": T,
1724
1751
  "cx-icon": h,
1725
- "cx-space": w,
1752
+ "cx-space": C,
1726
1753
  "cx-tooltip": ne,
1727
- "cx-typography": x
1754
+ "cx-typography": b
1728
1755
  };
1729
1756
  handleApply(e) {
1730
1757
  this.emit("cx-asset-link-format-metadata-change", { detail: e.target.checked });
@@ -1739,61 +1766,61 @@ var Ut = X, Wt = t`cx-details::part(base){border-bottom-width:0}`, Z = class ext
1739
1766
  return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
1740
1767
  }
1741
1768
  };
1742
- a([c(".details"), o("design:type", E === void 0 ? Object : E)], Z.prototype, "base", void 0), a([r({
1769
+ a([c(".details"), o("design:type", T === void 0 ? Object : T)], X.prototype, "base", void 0), a([r({
1743
1770
  reflect: !0,
1744
1771
  type: Boolean
1745
- }), o("design:type", Object)], Z.prototype, "open", void 0), a([r({
1772
+ }), o("design:type", Object)], X.prototype, "open", void 0), a([r({
1746
1773
  reflect: !0,
1747
1774
  type: Boolean
1748
- }), o("design:type", Object)], Z.prototype, "value", void 0), Z = a([u("cx-asset-link-format-metadata")], Z);
1749
- var Gt = Z, Q, Kt = {
1750
- [j.Crop]: k.Crop,
1751
- [j.Dimensions]: k.Dimensions,
1752
- [j.Quality]: k.Quality,
1753
- [j.Resize]: k.Resize,
1754
- [j.Rotate]: k.Rotate
1755
- }, qt = [
1756
- j.Proxy,
1757
- j.Crop,
1758
- j.Resize,
1759
- j.Rotate,
1760
- j.Quality,
1761
- j.Metadata
1762
- ], Jt = [
1763
- j.Proxy,
1764
- j.Dimensions,
1765
- ...qt.slice(1)
1766
- ], Yt = [
1767
- j.Dimensions,
1768
- j.Crop,
1769
- j.Resize,
1770
- j.Rotate,
1771
- j.Quality
1772
- ], $ = class extends s {
1773
- static #e = Q = this;
1774
- static #t = this.styles = [l, Et];
1775
+ }), o("design:type", Object)], X.prototype, "value", void 0), X = a([u("cx-asset-link-format-metadata")], X);
1776
+ var Zt = X, Z, Qt = {
1777
+ [k.Crop]: D.Crop,
1778
+ [k.Dimensions]: D.Dimensions,
1779
+ [k.Quality]: D.Quality,
1780
+ [k.Resize]: D.Resize,
1781
+ [k.Rotate]: D.Rotate
1782
+ }, Q = [
1783
+ k.Proxy,
1784
+ k.Crop,
1785
+ k.Resize,
1786
+ k.Rotate,
1787
+ k.Quality,
1788
+ k.Metadata
1789
+ ], $t = [
1790
+ k.Proxy,
1791
+ k.Dimensions,
1792
+ ...Q.slice(1)
1793
+ ], en = [
1794
+ k.Dimensions,
1795
+ k.Crop,
1796
+ k.Resize,
1797
+ k.Rotate,
1798
+ k.Quality
1799
+ ], tn = "|", $ = class extends s {
1800
+ static #e = Z = this;
1801
+ static #t = this.styles = [l, kt];
1775
1802
  static #n = this.dependencies = {
1776
- "cx-asset-link-format-crop": Ot,
1777
- "cx-asset-link-format-dimensions": jt,
1778
- "cx-asset-link-format-extension": Nt,
1779
- "cx-asset-link-format-metadata": Gt,
1780
- "cx-asset-link-format-proxy": It,
1781
- "cx-asset-link-format-quality": Rt,
1782
- "cx-asset-link-format-resize": Vt,
1783
- "cx-asset-link-format-rotation": Ut,
1803
+ "cx-asset-link-format-crop": jt,
1804
+ "cx-asset-link-format-dimensions": Pt,
1805
+ "cx-asset-link-format-extension": It,
1806
+ "cx-asset-link-format-metadata": Zt,
1807
+ "cx-asset-link-format-proxy": zt,
1808
+ "cx-asset-link-format-quality": Wt,
1809
+ "cx-asset-link-format-resize": qt,
1810
+ "cx-asset-link-format-rotation": Yt,
1784
1811
  "cx-button": _,
1785
1812
  "cx-icon": h,
1786
1813
  "cx-icon-button": p,
1787
- "cx-space": w,
1788
- "cx-switch": be,
1789
- "cx-typography": x,
1790
- "cx-visually-hidden": ce
1814
+ "cx-space": C,
1815
+ "cx-switch": Ce,
1816
+ "cx-typography": b,
1817
+ "cx-visually-hidden": ue
1791
1818
  };
1792
1819
  static getTransformExtension(e) {
1793
- return !e || St(e) ? e : "jpg";
1820
+ return !e || Tt(e) ? e : "jpg";
1794
1821
  }
1795
1822
  static fitRatioResizeSize(e, t, n, r) {
1796
- let { height: i, width: a } = ie(n, r, e, t);
1823
+ let { height: i, width: a } = ae(n, r, e, t);
1797
1824
  return {
1798
1825
  height: Math.max(i, 1),
1799
1826
  width: Math.max(a, 1)
@@ -1803,7 +1830,7 @@ var Gt = Z, Q, Kt = {
1803
1830
  return [...new Map(e.map((e) => [e.key, e])).values()];
1804
1831
  }
1805
1832
  static orderTransformations(e, t) {
1806
- let n = t.map((e) => Kt[e]).filter((e) => e !== void 0), r = e.filter((e) => n.includes(e.key)).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)), i = 0;
1833
+ let n = t.map((e) => Qt[e]).filter((e) => e !== void 0), r = e.filter((e) => n.includes(e.key)).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)), i = 0;
1807
1834
  return e.map((e) => n.includes(e.key) ? r[i++] : e);
1808
1835
  }
1809
1836
  static getDimensionsPresetSize(e) {
@@ -1814,24 +1841,36 @@ var Gt = Z, Q, Kt = {
1814
1841
  } : void 0;
1815
1842
  }
1816
1843
  static getDimensionsSize(e) {
1817
- if (e?.mode === D.Preset) return Q.getDimensionsPresetSize(e.value);
1818
- if (e?.mode === D.Custom && e.unit === A.Pixel && Number.isInteger(e.width) && Number.isInteger(e.height) && e.width >= 1 && e.height >= 1) return {
1844
+ if (e?.mode === E.Preset) return Z.getDimensionsPresetSize(e.value);
1845
+ if (e?.mode === E.Custom && e.unit === O.Pixel && Number.isInteger(e.width) && Number.isInteger(e.height) && e.width >= 1 && e.height >= 1) return {
1819
1846
  height: e.height,
1820
1847
  width: e.width
1821
1848
  };
1822
1849
  }
1850
+ static getPercentDimensions(e) {
1851
+ return e?.mode === E.Custom && e.unit === O.Percent ? e : void 0;
1852
+ }
1853
+ static parsePercentDimensions(e) {
1854
+ let t = /^\s*(\d+)\s*%\s*,\s*(\d+)\s*%\s*$/.exec(e), n = Number(t?.[1]), r = Number(t?.[2]);
1855
+ return n >= 1 && n <= 100 && r === n ? {
1856
+ height: r,
1857
+ mode: E.Custom,
1858
+ unit: O.Percent,
1859
+ width: n
1860
+ } : void 0;
1861
+ }
1823
1862
  static getSizeBoundAfterStep(e, t) {
1824
1863
  let { height: n = 0, rotation: r = 0, unit: i, width: a = 0 } = t.value, o = Math.round(a) >= 1 && Math.round(n) >= 1;
1825
1864
  switch (t.key) {
1826
- case k.Resize: return i !== P.AspectRatio && o ? {
1865
+ case D.Resize: return i !== M.AspectRatio && o ? {
1827
1866
  height: Math.round(n),
1828
1867
  width: Math.round(a)
1829
1868
  } : void 0;
1830
- case k.Dimensions: return o ? {
1869
+ case D.Dimensions: return o ? {
1831
1870
  height: Math.min(e?.height ?? Infinity, Math.round(n)),
1832
1871
  width: Math.min(e?.width ?? Infinity, Math.round(a))
1833
1872
  } : e;
1834
- case k.Rotate: {
1873
+ case D.Rotate: {
1835
1874
  if (!e) return;
1836
1875
  let t = r * Math.PI / 180, n = Math.abs(Math.cos(t)), i = Math.abs(Math.sin(t));
1837
1876
  return {
@@ -1842,28 +1881,32 @@ var Gt = Z, Q, Kt = {
1842
1881
  default: return e;
1843
1882
  }
1844
1883
  }
1884
+ #r;
1885
+ #i;
1886
+ #a;
1887
+ #o;
1845
1888
  get canReorder() {
1846
1889
  return this.reorderable && !this.asset;
1847
1890
  }
1848
1891
  get isFormatsLayout() {
1849
- return this.layout === ve.Formats;
1892
+ return this.layout === xe.Formats;
1850
1893
  }
1851
1894
  get hasUnfrozenTransformations() {
1852
1895
  return !(this.transformations.length === 0 || this.frozenIndex !== void 0 && this.frozenIndex >= this.transformations.length - 1);
1853
1896
  }
1854
1897
  get lastAppliedCropUnit() {
1855
- return this.transformations.findLast((e) => e.key === k.Crop)?.value.unit ?? P.Pixel;
1898
+ return this.transformations.findLast((e) => e.key === D.Crop)?.value.unit ?? M.Pixel;
1856
1899
  }
1857
1900
  get lastAppliedCropFocusMode() {
1858
- return this.transformations.findLast((e) => e.key === k.Crop)?.value.focusMode ?? "manual";
1901
+ return this.transformations.findLast((e) => e.key === D.Crop)?.value.focusMode ?? "manual";
1859
1902
  }
1860
1903
  get lastAppliedCropPosition() {
1861
- return this.transformations.findLast((e) => e.key === k.Crop)?.value.position ?? v.CenterCenter;
1904
+ return this.transformations.findLast((e) => e.key === D.Crop)?.value.position ?? v.CenterCenter;
1862
1905
  }
1863
1906
  get disabledCropApply() {
1864
1907
  if (!this.asset && this.cropSize.unit !== this.lastAppliedCropUnit) return !1;
1865
- if (this.cropSize.unit === P.AspectRatio && !this.asset) {
1866
- let e = this.lastCropSize[P.AspectRatio];
1908
+ if (this.cropSize.unit === M.AspectRatio && !this.asset) {
1909
+ let e = this.lastCropSize[M.AspectRatio];
1867
1910
  return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
1868
1911
  }
1869
1912
  if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition) return !1;
@@ -1874,14 +1917,14 @@ var Gt = Z, Q, Kt = {
1874
1917
  "width",
1875
1918
  "x",
1876
1919
  "y"
1877
- ]) if (this.cropSize[e] !== this.lastCropSize[P.Pixel][e]) return !1;
1920
+ ]) if (this.cropSize[e] !== this.lastCropSize[M.Pixel][e]) return !1;
1878
1921
  return !0;
1879
1922
  }
1880
1923
  get formats() {
1881
1924
  return this.proxies?.filter((e) => !e.cdnName) || [];
1882
1925
  }
1883
1926
  get activeParts() {
1884
- let e = new Set(Object.values(j)), t = /* @__PURE__ */ new Set();
1927
+ let e = new Set(Object.values(k)), t = /* @__PURE__ */ new Set();
1885
1928
  for (let n of this.parts) e.has(n) && t.add(n);
1886
1929
  return [...t];
1887
1930
  }
@@ -1892,70 +1935,78 @@ var Gt = Z, Q, Kt = {
1892
1935
  };
1893
1936
  }
1894
1937
  get stepsBeforeCrop() {
1895
- let e = this.transformations.findIndex((e) => e.key === k.Crop);
1938
+ let e = this.transformations.findIndex((e) => e.key === D.Crop);
1896
1939
  if (e >= 0) return this.transformations.slice(0, e);
1897
1940
  if (!this.canReorder) return this.transformations;
1898
1941
  let t = {
1899
- key: k.Crop,
1942
+ key: D.Crop,
1900
1943
  value: {}
1901
- }, n = Q.orderTransformations([...this.transformations, t], this.activeParts);
1944
+ }, n = Z.orderTransformations([...this.transformations, t], this.activeParts);
1902
1945
  return n.slice(0, n.indexOf(t));
1903
1946
  }
1904
1947
  get cropMaxSize() {
1905
- return this.stepsBeforeCrop.reduce(Q.getSizeBoundAfterStep, void 0) ?? {
1948
+ return this.stepsBeforeCrop.reduce(Z.getSizeBoundAfterStep, void 0) ?? {
1906
1949
  height: Infinity,
1907
1950
  width: Infinity
1908
1951
  };
1909
1952
  }
1953
+ get #s() {
1954
+ if (!this.canPercentDimensions) return "";
1955
+ let e = Z.getPercentDimensions(this.selectedDimensions);
1956
+ return e ? `${tn}${e.width}%,${e.height}%` : tn;
1957
+ }
1958
+ get #c() {
1959
+ return this.canPercentDimensions && this.canCustomDimensions && !this.asset && this.activeParts.includes(k.Dimensions);
1960
+ }
1910
1961
  get isCropAtDimensionsLimit() {
1911
1962
  let e = this.stepsBeforeCrop;
1912
- if (this.asset || this.cropSize.unit !== P.Pixel || !e.some((e) => e.key === k.Dimensions)) return !1;
1963
+ if (this.asset || this.cropSize.unit !== M.Pixel || !e.some((e) => e.key === D.Dimensions)) return !1;
1913
1964
  let t = {
1914
1965
  height: Infinity,
1915
1966
  width: Infinity
1916
- }, n = e.reduce(Q.getSizeBoundAfterStep, void 0) ?? t, r = e.filter((e) => e.key !== k.Dimensions).reduce(Q.getSizeBoundAfterStep, void 0) ?? t;
1967
+ }, n = e.reduce(Z.getSizeBoundAfterStep, void 0) ?? t, r = e.filter((e) => e.key !== D.Dimensions).reduce(Z.getSizeBoundAfterStep, void 0) ?? t;
1917
1968
  return n.width < r.width && this.cropSize.width >= n.width || n.height < r.height && this.cropSize.height >= n.height;
1918
1969
  }
1919
1970
  get lastCropSize() {
1920
1971
  if (!this.asset) {
1921
- let e = this.transformations.findLast((e) => e.key === k.Crop);
1922
- if (e?.value.unit === P.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
1923
- [P.AspectRatio]: {
1972
+ let e = this.transformations.findLast((e) => e.key === D.Crop);
1973
+ if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
1974
+ [M.AspectRatio]: {
1924
1975
  height: e.value.ratioHeight,
1925
1976
  percentageHeight: 100,
1926
1977
  percentageWidth: 100,
1927
- unit: P.AspectRatio,
1978
+ unit: M.AspectRatio,
1928
1979
  width: e.value.ratioWidth,
1929
1980
  x: 0,
1930
1981
  y: 0
1931
1982
  },
1932
- [P.Pixel]: {
1983
+ [M.Pixel]: {
1933
1984
  height: 1,
1934
1985
  percentageHeight: 100,
1935
1986
  percentageWidth: 100,
1936
- unit: P.Pixel,
1987
+ unit: M.Pixel,
1937
1988
  width: 1,
1938
1989
  x: 0,
1939
1990
  y: 0
1940
1991
  }
1941
1992
  };
1942
1993
  if (e?.value.width && e?.value.height) {
1943
- let { height: t, width: n, x: r = 0, y: i = 0 } = e.value, a = y(n, t);
1994
+ let { height: t, width: n, x: r = 0, y: i = 0 } = e.value, a = ie(n, t);
1944
1995
  return {
1945
- [P.AspectRatio]: {
1996
+ [M.AspectRatio]: {
1946
1997
  height: a.height,
1947
1998
  percentageHeight: 100,
1948
1999
  percentageWidth: 100,
1949
- unit: P.AspectRatio,
2000
+ unit: M.AspectRatio,
1950
2001
  width: a.width,
1951
2002
  x: 0,
1952
2003
  y: 0
1953
2004
  },
1954
- [P.Pixel]: {
2005
+ [M.Pixel]: {
1955
2006
  height: t,
1956
2007
  percentageHeight: 100,
1957
2008
  percentageWidth: 100,
1958
- unit: P.Pixel,
2009
+ unit: M.Pixel,
1959
2010
  width: n,
1960
2011
  x: r,
1961
2012
  y: i
@@ -1963,25 +2014,25 @@ var Gt = Z, Q, Kt = {
1963
2014
  };
1964
2015
  }
1965
2016
  }
1966
- let e = this.lastImageSize.width && this.lastImageSize.height ? y(this.lastImageSize.width, this.lastImageSize.height) : {
2017
+ let e = this.lastImageSize.width && this.lastImageSize.height ? ie(this.lastImageSize.width, this.lastImageSize.height) : {
1967
2018
  height: 1,
1968
2019
  width: 1
1969
2020
  };
1970
2021
  return {
1971
- [P.AspectRatio]: {
2022
+ [M.AspectRatio]: {
1972
2023
  height: e.height,
1973
2024
  percentageHeight: 100,
1974
2025
  percentageWidth: 100,
1975
- unit: P.AspectRatio,
2026
+ unit: M.AspectRatio,
1976
2027
  width: e.width,
1977
2028
  x: 0,
1978
2029
  y: 0
1979
2030
  },
1980
- [P.Pixel]: {
2031
+ [M.Pixel]: {
1981
2032
  height: this.lastImageSize.height,
1982
2033
  percentageHeight: 100,
1983
2034
  percentageWidth: 100,
1984
- unit: P.Pixel,
2035
+ unit: M.Pixel,
1985
2036
  width: this.lastImageSize.width,
1986
2037
  x: 0,
1987
2038
  y: 0
@@ -1990,57 +2041,57 @@ var Gt = Z, Q, Kt = {
1990
2041
  }
1991
2042
  get lastResizeSize() {
1992
2043
  if (!this.asset) {
1993
- let e = this.transformations.findLast((e) => e.key === k.Resize);
1994
- if (e?.value.unit === P.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
1995
- [P.AspectRatio]: {
2044
+ let e = this.transformations.findLast((e) => e.key === D.Resize);
2045
+ if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
2046
+ [M.AspectRatio]: {
1996
2047
  height: e.value.ratioHeight,
1997
- unit: P.AspectRatio,
2048
+ unit: M.AspectRatio,
1998
2049
  width: e.value.ratioWidth
1999
2050
  },
2000
- [P.Pixel]: {
2051
+ [M.Pixel]: {
2001
2052
  height: 1,
2002
- unit: P.Pixel,
2053
+ unit: M.Pixel,
2003
2054
  width: 1
2004
2055
  }
2005
2056
  };
2006
2057
  if (e?.value.width && e?.value.height) {
2007
- let { height: t, width: n } = e.value, r = y(n, t);
2058
+ let { height: t, width: n } = e.value, r = ie(n, t);
2008
2059
  return {
2009
- [P.AspectRatio]: {
2060
+ [M.AspectRatio]: {
2010
2061
  height: r.height,
2011
- unit: P.AspectRatio,
2062
+ unit: M.AspectRatio,
2012
2063
  width: r.width
2013
2064
  },
2014
- [P.Pixel]: {
2065
+ [M.Pixel]: {
2015
2066
  height: t,
2016
- unit: P.Pixel,
2067
+ unit: M.Pixel,
2017
2068
  width: n
2018
2069
  }
2019
2070
  };
2020
2071
  }
2021
2072
  }
2022
- let e = this.lastImageSize.width && this.lastImageSize.height ? y(this.lastImageSize.width, this.lastImageSize.height) : {
2073
+ let e = this.lastImageSize.width && this.lastImageSize.height ? ie(this.lastImageSize.width, this.lastImageSize.height) : {
2023
2074
  height: 1,
2024
2075
  width: 1
2025
2076
  };
2026
2077
  return {
2027
- [P.AspectRatio]: {
2078
+ [M.AspectRatio]: {
2028
2079
  height: e.height,
2029
- unit: P.AspectRatio,
2080
+ unit: M.AspectRatio,
2030
2081
  width: e.width
2031
2082
  },
2032
- [P.Pixel]: {
2083
+ [M.Pixel]: {
2033
2084
  height: this.lastImageSize.height,
2034
- unit: P.Pixel,
2085
+ unit: M.Pixel,
2035
2086
  width: this.lastImageSize.width
2036
2087
  }
2037
2088
  };
2038
2089
  }
2039
2090
  get lastRotation() {
2040
- return this.asset ? 0 : this.transformations.findLast((e) => e.key === k.Rotate)?.value.rotation ?? 0;
2091
+ return this.asset ? 0 : this.transformations.findLast((e) => e.key === D.Rotate)?.value.rotation ?? 0;
2041
2092
  }
2042
2093
  get transformationString() {
2043
- return me({
2094
+ return ge({
2044
2095
  asset: this.asset,
2045
2096
  baseUrl: "",
2046
2097
  parameters: this.parameters,
@@ -2049,7 +2100,7 @@ var Gt = Z, Q, Kt = {
2049
2100
  }).replace(/\/t\//g, "");
2050
2101
  }
2051
2102
  constructor() {
2052
- super(), this.localize = new d(this), this.initialParts = [...qt], this.sortableRevision = 0, this.dragPreviousSibling = null, this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
2103
+ super(), this.localize = new d(this), this.initialParts = [...Q], this.sortableRevision = 0, this.dragPreviousSibling = null, this.#r = void 0, this.#i = !1, this.#a = [], this.#o = [], this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
2053
2104
  {
2054
2105
  label: "Free",
2055
2106
  value: "free"
@@ -2108,7 +2159,7 @@ var Gt = Z, Q, Kt = {
2108
2159
  label: "Smart Swatch",
2109
2160
  value: "SmartSwatch"
2110
2161
  }
2111
- ], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout = ve.Accordion, this.cropEnabled = !1, this.reorderable = !1, this.dimensionsItems = [], this.qualityItems = [], this.canCustomDimensions = !1, this.lastImageSize = {
2162
+ ], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout = xe.Accordion, this.cropEnabled = !1, this.reorderable = !1, this.dimensionsItems = [], this.qualityItems = [], this.canCustomDimensions = !1, this.canPercentDimensions = !1, this.percentDimensions = "", this.lastImageSize = {
2112
2163
  height: 0,
2113
2164
  width: 0
2114
2165
  }, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
@@ -2116,7 +2167,7 @@ var Gt = Z, Q, Kt = {
2116
2167
  keepAspectRatio: !0,
2117
2168
  ratioHeight: 1,
2118
2169
  ratioWidth: 1,
2119
- unit: P.Pixel,
2170
+ unit: M.Pixel,
2120
2171
  width: 1
2121
2172
  }, this.cropSize = {
2122
2173
  cropMode: "free",
@@ -2128,14 +2179,14 @@ var Gt = Z, Q, Kt = {
2128
2179
  position: v.CenterCenter,
2129
2180
  ratioHeight: 1,
2130
2181
  ratioWidth: 1,
2131
- unit: P.Pixel,
2182
+ unit: M.Pixel,
2132
2183
  width: 1,
2133
2184
  x: 0,
2134
2185
  y: 0
2135
2186
  }, this.rotation = 0, this.defaultSize = {
2136
2187
  height: 0,
2137
2188
  width: 0
2138
- }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink = ut, this.apiGetCropFocusMode = ht, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
2189
+ }, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink = pt, this.apiGetCropFocusMode = vt, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
2139
2190
  }
2140
2191
  runConnectedCallback() {
2141
2192
  this.hasUpdated && (this.syncSortable(), this.handleCropperSelectorChange(), this.cropperElement && (this.cropperElement.addEventListener("cx-cropper-crop-complete", this.onCropComplete), this.cropperElement.addEventListener("cx-cropper-crop-drag-start", this.onCropDragStart)));
@@ -2144,7 +2195,9 @@ var Gt = Z, Q, Kt = {
2144
2195
  super.disconnectedCallback(), this.sortableRevision++, this.destroySortable(), this.cropperElement && (this.cropperElement.removeEventListener("cx-cropper-crop-complete", this.onCropComplete), this.cropperElement.removeEventListener("cx-cropper-crop-drag-start", this.onCropDragStart));
2145
2196
  }
2146
2197
  willUpdate(e) {
2147
- super.willUpdate(e), e.has("dimensionsItems") && this.syncSelectedDimensions(!1);
2198
+ super.willUpdate(e), this.parts ??= this.initialParts, e.has("dimensionsItems") && this.syncSelectedDimensions(!1);
2199
+ let t = this.#c, n = t !== this.#i;
2200
+ this.#i = t, (e.has("percentDimensions") || n) && this.#m(), this.#p(e);
2148
2201
  }
2149
2202
  updated(e) {
2150
2203
  if ((e.has("forCropper") || e.has("queryElement")) && this.handleCropperSelectorChange(), e.has("asset") && this.handleAssetChange(), e.has("proxies") && this.handleProxiesChange(), this.autoFormat && (e.has("asset") || e.has("proxies"))) {
@@ -2154,7 +2207,7 @@ var Gt = Z, Q, Kt = {
2154
2207
  if (e.has("activeSetting") && this.handleActiveSettingChange(), e.has("selectedFormat") && this.handleSelectedFormatChange(), e.has("resizeSize") && this.handleResizeSizeChange(), e.has("cropSize") && this.handleCropSizeChange(), e.has("rotation") && this.handleRotationChange(), e.has("cropperElement") && this.handleCropperElementChange(), e.has("selectedFormat")) {
2155
2208
  if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === e.get("selectedFormat")?.extension) return;
2156
2209
  this.loading = !0, this.requestTransformAsset().then((e) => {
2157
- this.loading = !1, e?.relativePath && this.selectedFormat && (this.lastAction === k.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
2210
+ this.loading = !1, e?.relativePath && this.selectedFormat && (this.lastAction === D.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
2158
2211
  height: e.height,
2159
2212
  width: e.width
2160
2213
  }, this.selectedFormat = {
@@ -2164,7 +2217,7 @@ var Gt = Z, Q, Kt = {
2164
2217
  width: e.width
2165
2218
  });
2166
2219
  });
2167
- let t = me({
2220
+ let t = ge({
2168
2221
  asset: this.asset,
2169
2222
  baseUrl: "",
2170
2223
  extension: this.selectedFormat.extension,
@@ -2188,7 +2241,7 @@ var Gt = Z, Q, Kt = {
2188
2241
  get transformRequestOptions() {
2189
2242
  return {
2190
2243
  assetId: this.asset?.id ?? "",
2191
- extension: Q.getTransformExtension(this.selectedFormat?.extension ?? ""),
2244
+ extension: Z.getTransformExtension(this.selectedFormat?.extension ?? ""),
2192
2245
  format: this.proxies?.find((e) => e.id === this.selectedProxy)?.proxyName ?? "",
2193
2246
  siteUrl: this.baseUrl,
2194
2247
  token: this.token,
@@ -2218,20 +2271,20 @@ var Gt = Z, Q, Kt = {
2218
2271
  this.frozenIndex = this.transformations.length - 1;
2219
2272
  }
2220
2273
  upsertTransformation(e) {
2221
- e.key === k.Crop && (this.editedCrop = e), this.asset || (this.transformations = Q.uniqueTransformations(this.transformations));
2274
+ e.key === D.Crop && (this.editedCrop = e), this.asset || (this.transformations = Z.uniqueTransformations(this.transformations));
2222
2275
  let t = this.transformations.findIndex((t) => t.key === e.key);
2223
2276
  if (t >= 0) {
2224
2277
  let n = [...this.transformations];
2225
2278
  n[t] = e, this.transformations = n;
2226
2279
  } else this.transformations = [...this.transformations, e];
2227
- this.canReorder && (this.transformations = Q.orderTransformations(this.transformations, this.activeParts));
2280
+ this.canReorder && (this.transformations = Z.orderTransformations(this.transformations, this.activeParts));
2228
2281
  }
2229
2282
  isCropPanelSize(e) {
2230
- let { height: t, ratioHeight: n, ratioWidth: r, unit: i = P.Pixel, width: a } = e.value;
2231
- return i === this.cropSize.unit ? i === P.AspectRatio ? r === this.cropSize.ratioWidth && n === this.cropSize.ratioHeight : a === this.cropSize.width && t === this.cropSize.height : !1;
2283
+ let { height: t, ratioHeight: n, ratioWidth: r, unit: i = M.Pixel, width: a } = e.value;
2284
+ return i === this.cropSize.unit ? i === M.AspectRatio ? r === this.cropSize.ratioWidth && n === this.cropSize.ratioHeight : a === this.cropSize.width && t === this.cropSize.height : !1;
2232
2285
  }
2233
- #r(e) {
2234
- let { height: t = 0, ratioHeight: n = 0, ratioWidth: r = 0, unit: i = P.Pixel, width: a = 0 } = e.value, o = i === P.AspectRatio, s = o ? r : a, c = o ? n : t;
2286
+ #l(e) {
2287
+ let { height: t = 0, ratioHeight: n = 0, ratioWidth: r = 0, unit: i = M.Pixel, width: a = 0 } = e.value, o = i === M.AspectRatio, s = o ? r : a, c = o ? n : t;
2235
2288
  if (!s || !c) return;
2236
2289
  let l = this.cropModes.filter((e) => !e.auto && /^\d+:\d+$/.test(e.value)).map(({ value: e }) => {
2237
2290
  let [t, n] = e.split(":").map(Number);
@@ -2244,8 +2297,8 @@ var Gt = Z, Q, Kt = {
2244
2297
  return u || o ? u?.value : l.find(({ modeHeight: e, modeWidth: t }) => Math.abs(t * c - e * s) <= Math.max(t, e) / 2)?.value;
2245
2298
  }
2246
2299
  capCropToMaxSize() {
2247
- let e = this.transformations.find((e) => e.key === k.Crop);
2248
- if (this.asset || !e || (e.value.unit ?? P.Pixel) !== P.Pixel) return;
2300
+ let e = this.transformations.find((e) => e.key === D.Crop);
2301
+ if (this.asset || !e || (e.value.unit ?? M.Pixel) !== M.Pixel) return;
2249
2302
  let { height: t = 0, width: n = 0 } = e.value, r = this.cropMaxSize;
2250
2303
  if (n <= r.width && t <= r.height) return;
2251
2304
  let i = Math.min(t, r.height), a = Math.min(n, r.width), o = this.isCropPanelSize(e) && n * i === t * a;
@@ -2266,20 +2319,20 @@ var Gt = Z, Q, Kt = {
2266
2319
  async handleTransformationsChange(e) {
2267
2320
  let t = e, n = this.canReorder && t !== void 0 && t.length === this.transformations.length && t.every((e) => this.transformations.includes(e));
2268
2321
  if (!this.asset) {
2269
- let e = Q.uniqueTransformations(this.transformations), t = this.canReorder ? Q.orderTransformations(e, this.activeParts) : e;
2322
+ let e = Z.uniqueTransformations(this.transformations), t = this.canReorder ? Z.orderTransformations(e, this.activeParts) : e;
2270
2323
  (t.length !== this.transformations.length || t.some((e, t) => e !== this.transformations[t])) && (this.transformations = t), n || this.capCropToMaxSize();
2271
2324
  }
2272
2325
  if (this.syncSelectedDimensions(), await this.updateComplete, !this.asset) {
2273
- if (this.emit("cx-asset-link-format-change", { detail: me({
2326
+ if (this.emit("cx-asset-link-format-change", { detail: ge({
2274
2327
  asset: this.asset,
2275
2328
  baseUrl: "",
2276
2329
  options: { omitZeroXY: !0 },
2277
2330
  parameters: this.parameters,
2278
2331
  transformations: this.transformations,
2279
2332
  useSession: this.useSession
2280
- }).replace(/\/t\//g, "") }), n) return;
2281
- let e = this.transformations.findLast((e) => e.key === k.Crop && (e.value.unit === P.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width && e.value.height)), t = e !== void 0 && e === this.editedCrop && this.isCropPanelSize(e), r = e && !t ? this.#r(e) : void 0, i = t ? this.cropSize.cropMode : r ?? "free";
2282
- if (e?.value.unit === P.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) {
2333
+ }).replace(/\/t\//g, "") + this.#s }), n) return;
2334
+ let e = this.transformations.findLast((e) => e.key === D.Crop && (e.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width && e.value.height)), t = e !== void 0 && e === this.editedCrop && this.isCropPanelSize(e), r = e && !t ? this.#l(e) : void 0, i = t ? this.cropSize.cropMode : r ?? "free";
2335
+ if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) {
2283
2336
  let { focusMode: n, position: r, ratioHeight: a, ratioWidth: o } = e.value;
2284
2337
  this.cropSize = {
2285
2338
  ...this.cropSize,
@@ -2291,7 +2344,7 @@ var Gt = Z, Q, Kt = {
2291
2344
  position: r ?? v.CenterCenter,
2292
2345
  ratioHeight: a,
2293
2346
  ratioWidth: o,
2294
- unit: P.AspectRatio
2347
+ unit: M.AspectRatio
2295
2348
  };
2296
2349
  } else if (e) {
2297
2350
  let { focusMode: t, height: n, position: a, unit: o, width: s, x: c = 0, y: l = 0 } = e.value;
@@ -2304,7 +2357,7 @@ var Gt = Z, Q, Kt = {
2304
2357
  percentageHeight: 100,
2305
2358
  percentageWidth: 100,
2306
2359
  position: a ?? v.CenterCenter,
2307
- unit: o ?? P.Pixel,
2360
+ unit: o ?? M.Pixel,
2308
2361
  width: s,
2309
2362
  x: c,
2310
2363
  y: l
@@ -2317,37 +2370,37 @@ var Gt = Z, Q, Kt = {
2317
2370
  percentageHeight: 0,
2318
2371
  percentageWidth: 0,
2319
2372
  position: v.CenterCenter,
2320
- unit: P.Pixel,
2373
+ unit: M.Pixel,
2321
2374
  width: 1,
2322
2375
  x: 0,
2323
2376
  y: 0
2324
2377
  };
2325
- let a = this.transformations.findLast((e) => e.key === k.Resize && (e.value.unit === P.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width || e.value.height));
2326
- if (a?.value.unit === P.AspectRatio && a.value.ratioWidth && a.value.ratioHeight) {
2378
+ let a = this.transformations.findLast((e) => e.key === D.Resize && (e.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width || e.value.height));
2379
+ if (a?.value.unit === M.AspectRatio && a.value.ratioWidth && a.value.ratioHeight) {
2327
2380
  let { ratioHeight: e, ratioWidth: t } = a.value;
2328
2381
  this.resizeSize = {
2329
2382
  ...this.resizeSize,
2330
2383
  ratioHeight: e,
2331
2384
  ratioWidth: t,
2332
- unit: P.AspectRatio
2385
+ unit: M.AspectRatio
2333
2386
  };
2334
2387
  } else if (a) {
2335
2388
  let { height: e = 0, unit: t, width: n = 0 } = a.value;
2336
2389
  this.resizeSize = {
2337
2390
  ...this.resizeSize,
2338
2391
  height: e,
2339
- unit: t ?? P.Pixel,
2392
+ unit: t ?? M.Pixel,
2340
2393
  width: n
2341
2394
  };
2342
2395
  } else this.resizeSize = {
2343
2396
  ...this.resizeSize,
2344
2397
  height: 1,
2345
- unit: P.Pixel,
2398
+ unit: M.Pixel,
2346
2399
  width: 1
2347
2400
  };
2348
- let o = this.transformations.findLast((e) => e.key === k.Rotate);
2401
+ let o = this.transformations.findLast((e) => e.key === D.Rotate);
2349
2402
  this.rotation = o?.value.rotation ?? 0;
2350
- let s = this.transformations.findLast((e) => e.key === k.Quality)?.value.quality ?? 100, c = this.transformations.some((e) => e.key === k.Metadata);
2403
+ let s = this.transformations.findLast((e) => e.key === D.Quality)?.value.quality ?? 100, c = this.transformations.some((e) => e.key === D.Metadata);
2351
2404
  this.selectedFormat = this.selectedFormat ? {
2352
2405
  ...this.selectedFormat,
2353
2406
  keepMetadata: c,
@@ -2377,7 +2430,7 @@ var Gt = Z, Q, Kt = {
2377
2430
  keepAspectRatio: !0,
2378
2431
  ratioHeight: 1,
2379
2432
  ratioWidth: 1,
2380
- unit: P.Pixel,
2433
+ unit: M.Pixel,
2381
2434
  width: r.width
2382
2435
  }, this.cropSize = {
2383
2436
  cropMode: "free",
@@ -2389,12 +2442,12 @@ var Gt = Z, Q, Kt = {
2389
2442
  position: v.CenterCenter,
2390
2443
  ratioHeight: 1,
2391
2444
  ratioWidth: 1,
2392
- unit: P.Pixel,
2445
+ unit: M.Pixel,
2393
2446
  width: r.width,
2394
2447
  x: 0,
2395
2448
  y: 0
2396
- }, this.lastAction === k.Rotate && (this.rotation = 0), this.lastAction = void 0;
2397
- let i = this.transformations.some((e) => e.key === k.Metadata), a = this.transformations.findLast((e) => e.key === k.Quality);
2449
+ }, this.lastAction === D.Rotate && (this.rotation = 0), this.lastAction = void 0;
2450
+ let i = this.transformations.some((e) => e.key === D.Metadata), a = this.transformations.findLast((e) => e.key === D.Quality);
2398
2451
  this.selectedFormat = {
2399
2452
  ...this.selectedFormat,
2400
2453
  height: r.height,
@@ -2403,7 +2456,7 @@ var Gt = Z, Q, Kt = {
2403
2456
  url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${r.relativePath}` : r.relativePath,
2404
2457
  width: r.width
2405
2458
  };
2406
- let o = me({
2459
+ let o = ge({
2407
2460
  asset: this.asset,
2408
2461
  baseUrl: "",
2409
2462
  extension: this.selectedFormat.extension,
@@ -2425,7 +2478,7 @@ var Gt = Z, Q, Kt = {
2425
2478
  height: Number.parseInt(this.asset.height, 10),
2426
2479
  width: Number.parseInt(this.asset.width, 10)
2427
2480
  });
2428
- let e = this.transformations.findLast((e) => e.key === k.Quality);
2481
+ let e = this.transformations.findLast((e) => e.key === D.Quality);
2429
2482
  this.selectedFormat = {
2430
2483
  extension: this.asset.extension,
2431
2484
  height: this.defaultSize.height,
@@ -2450,7 +2503,7 @@ var Gt = Z, Q, Kt = {
2450
2503
  position: v.CenterCenter,
2451
2504
  ratioHeight: 1,
2452
2505
  ratioWidth: 1,
2453
- unit: P.Pixel,
2506
+ unit: M.Pixel,
2454
2507
  width: this.defaultSize.width,
2455
2508
  x: 0,
2456
2509
  y: 0
@@ -2469,7 +2522,7 @@ var Gt = Z, Q, Kt = {
2469
2522
  t.proxyName === "TRX" && (t.formatHeight = Number(this.asset.height), t.formatWidth = Number(this.asset.width));
2470
2523
  let n = this.proxies?.find((t) => t.id === e);
2471
2524
  n && (this.asset && n.proxyName === "TRX" && (n.formatHeight = Number(this.asset.height), n.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((e) => {
2472
- if (e.key === k.Crop) {
2525
+ if (e.key === D.Crop) {
2473
2526
  let r = e.value, i = r.width / n.formatWidth * t.formatWidth, a = r.height / n.formatHeight * t.formatHeight, o = r.x / n.formatWidth * t.formatWidth, s = r.y / n.formatHeight * t.formatHeight;
2474
2527
  return {
2475
2528
  ...e,
@@ -2482,7 +2535,7 @@ var Gt = Z, Q, Kt = {
2482
2535
  }
2483
2536
  };
2484
2537
  }
2485
- if (e.key === k.Resize) {
2538
+ if (e.key === D.Resize) {
2486
2539
  let r = e.value, i = r.width / n.formatWidth * t.formatWidth, a = r.height / n.formatHeight * t.formatHeight;
2487
2540
  return {
2488
2541
  ...e,
@@ -2503,24 +2556,24 @@ var Gt = Z, Q, Kt = {
2503
2556
  }, await this.updateComplete, this.cropSize = {
2504
2557
  cropMode: "free",
2505
2558
  focusMode: "manual",
2506
- height: this.lastCropSize[P.Pixel].height,
2559
+ height: this.lastCropSize[M.Pixel].height,
2507
2560
  keepAspectRatio: !0,
2508
2561
  percentageHeight: 100,
2509
2562
  percentageWidth: 100,
2510
2563
  position: v.CenterCenter,
2511
2564
  ratioHeight: 1,
2512
2565
  ratioWidth: 1,
2513
- unit: P.Pixel,
2514
- width: this.lastCropSize[P.Pixel].width,
2566
+ unit: M.Pixel,
2567
+ width: this.lastCropSize[M.Pixel].width,
2515
2568
  x: 0,
2516
2569
  y: 0
2517
2570
  }, this.resizeSize = {
2518
- height: this.lastResizeSize[P.Pixel].height,
2571
+ height: this.lastResizeSize[M.Pixel].height,
2519
2572
  keepAspectRatio: !0,
2520
2573
  ratioHeight: 1,
2521
2574
  ratioWidth: 1,
2522
- unit: P.Pixel,
2523
- width: this.lastResizeSize[P.Pixel].width
2575
+ unit: M.Pixel,
2576
+ width: this.lastResizeSize[M.Pixel].width
2524
2577
  };
2525
2578
  }
2526
2579
  handleLoadingChange() {
@@ -2540,17 +2593,17 @@ var Gt = Z, Q, Kt = {
2540
2593
  }
2541
2594
  handlePartsChange() {
2542
2595
  if (this.activeParts.some((e) => {
2543
- let t = e === j.Rotate ? "rotation" : e;
2596
+ let t = e === k.Rotate ? "rotation" : e;
2544
2597
  return this.activeSetting === `cx-asset-link-format-${t}`;
2545
2598
  }) || (this.activeSetting = ""), this.canReorder) {
2546
- let e = Q.orderTransformations(Q.uniqueTransformations(this.transformations), this.activeParts);
2599
+ let e = Z.orderTransformations(Z.uniqueTransformations(this.transformations), this.activeParts);
2547
2600
  (e.length !== this.transformations.length || e.some((e, t) => e !== this.transformations[t])) && (this.transformations = e);
2548
2601
  }
2549
2602
  }
2550
2603
  handleReorderableChange() {
2551
2604
  if (this.orderUndo = [], this.canReorder && this.parts === this.initialParts && this.transformations.length > 0) {
2552
- let e = Q.uniqueTransformations(this.transformations).flatMap((e) => qt.filter((t) => Kt[t] === e.key)), t = [...e, ...qt.filter((t) => Kt[t] && !e.includes(t))], n = 0;
2553
- this.parts = qt.map((e) => Kt[e] ? t[n++] : e);
2605
+ let e = Z.uniqueTransformations(this.transformations).flatMap((e) => Q.filter((t) => Qt[t] === e.key)), t = [...e, ...Q.filter((t) => Qt[t] && !e.includes(t))], n = 0;
2606
+ this.parts = Q.map((e) => Qt[e] ? t[n++] : e);
2554
2607
  }
2555
2608
  this.handlePartsChange(), this.syncSortable();
2556
2609
  }
@@ -2588,6 +2641,7 @@ var Gt = Z, Q, Kt = {
2588
2641
  this.orderUndo = [...this.orderUndo, {
2589
2642
  autoFormat: this.autoFormat,
2590
2643
  parts: [...this.activeParts],
2644
+ percentDimensions: Z.getPercentDimensions(this.selectedDimensions),
2591
2645
  selectedProxy: this.selectedProxy,
2592
2646
  transformations: this.transformations.map((e) => ({
2593
2647
  ...e,
@@ -2606,12 +2660,12 @@ var Gt = Z, Q, Kt = {
2606
2660
  }
2607
2661
  movePart(e, t) {
2608
2662
  if (!this.canReorder || this.loading) return;
2609
- let n = this.activeParts.filter((e) => Yt.includes(e)), r = n.indexOf(e);
2663
+ let n = this.activeParts.filter((e) => en.includes(e)), r = n.indexOf(e);
2610
2664
  if (r < 0 || t < 0 || t >= n.length || r === t) return;
2611
2665
  this.rememberOrder(), n.splice(r, 1), n.splice(t, 0, e);
2612
2666
  let i = 0;
2613
- this.parts = this.activeParts.map((e) => Yt.includes(e) ? n[i++] : e);
2614
- let a = Q.orderTransformations(this.transformations, this.parts);
2667
+ this.parts = this.activeParts.map((e) => en.includes(e) ? n[i++] : e);
2668
+ let a = Z.orderTransformations(this.transformations, this.parts);
2615
2669
  a.some((e, t) => e !== this.transformations[t]) && (this.transformations = a), this.capCropToMaxSize(), this.reorderAnnouncement = `${this.localize.term(e)}: ${t + 1} / ${n.length}`, this.emitReorder(), this.updateComplete.then(() => {
2616
2670
  this.shadowRoot?.querySelector(`[data-part="${e}"] .asset-link-format__drag-handle`)?.focus();
2617
2671
  });
@@ -2619,22 +2673,22 @@ var Gt = Z, Q, Kt = {
2619
2673
  handleReorderKeyDown(e) {
2620
2674
  if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
2621
2675
  e.preventDefault(), e.stopPropagation();
2622
- let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) => Yt.includes(e));
2676
+ let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) => en.includes(e));
2623
2677
  this.movePart(t, n.indexOf(t) + (e.key === "ArrowUp" ? -1 : 1));
2624
2678
  }
2625
2679
  handleActiveSettingChange() {
2626
2680
  this.cropperElement && (this.resizeSize = {
2627
- height: this.lastResizeSize[P.Pixel].height,
2681
+ height: this.lastResizeSize[M.Pixel].height,
2628
2682
  keepAspectRatio: !0,
2629
2683
  ratioHeight: 1,
2630
2684
  ratioWidth: 1,
2631
- unit: P.Pixel,
2632
- width: this.lastResizeSize[P.Pixel].width
2685
+ unit: M.Pixel,
2686
+ width: this.lastResizeSize[M.Pixel].width
2633
2687
  }, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
2634
2688
  }
2635
2689
  async handleRequestAutoCropSuggestion({ cropMode: e, focusMode: t, height: n, keepAspectRatio: r, percentageHeight: i, percentageWidth: a, ratioHeight: o, ratioWidth: s, unit: c, useCropMode: l, width: u }) {
2636
2690
  if (!this.selectedFormat?.url || t === "manual") return;
2637
- this.loading = !0, this.lastAction = k.Crop;
2691
+ this.loading = !0, this.lastAction = D.Crop;
2638
2692
  let d = await this.apiGetCropFocusMode({
2639
2693
  autoCropMode: t,
2640
2694
  cropHeight: n,
@@ -2672,7 +2726,7 @@ var Gt = Z, Q, Kt = {
2672
2726
  if (r === 0 || n === 0) return;
2673
2727
  let o = this.cropSize.percentageWidth !== r, s = this.cropSize.percentageHeight !== n, c = this.cropSize.height, l = this.cropSize.width;
2674
2728
  o && (l = Math.round(r * this.selectedFormat.width / 100)), s && (c = Math.round(n * this.selectedFormat.height / 100));
2675
- let u = this.cropSize.focusMode, d = this.focusModes.find((e) => e.value === u)?.auto, f = l !== this.cropSize.width || c !== this.cropSize.height, p = f ? this.#i(l, c) : {};
2729
+ let u = this.cropSize.focusMode, d = this.focusModes.find((e) => e.value === u)?.auto, f = l !== this.cropSize.width || c !== this.cropSize.height, p = f ? this.#u(l, c) : {};
2676
2730
  d && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
2677
2731
  ...p,
2678
2732
  focusMode: u,
@@ -2689,13 +2743,13 @@ var Gt = Z, Q, Kt = {
2689
2743
  width: l,
2690
2744
  x: i,
2691
2745
  y: a
2692
- }, f && this.#o();
2746
+ }, f && this.#f();
2693
2747
  }
2694
- #i(e, t) {
2748
+ #u(e, t) {
2695
2749
  let { keepAspectRatio: n, unit: r } = this.cropSize, i = {};
2696
- return n ? i : (this.#a(e, t) && (i.cropMode = "free"), r === P.AspectRatio && (i.ratioHeight = t, i.ratioWidth = e), i);
2750
+ return n ? i : (this.#d(e, t) && (i.cropMode = "free"), r === M.AspectRatio && (i.ratioHeight = t, i.ratioWidth = e), i);
2697
2751
  }
2698
- #a(e, t) {
2752
+ #d(e, t) {
2699
2753
  let n = /^(\d+):(\d+)$/.exec(this.cropSize.cropMode);
2700
2754
  return n !== null && Number(n[1]) * t !== Number(n[2]) * e;
2701
2755
  }
@@ -2715,12 +2769,12 @@ var Gt = Z, Q, Kt = {
2715
2769
  this.activeSetting === e.target.localName && (this.activeSetting = "");
2716
2770
  }
2717
2771
  get autoResolvedProxyId() {
2718
- let e = fe(this.asset?.extension, this.asset?.size);
2772
+ let e = me(this.asset?.extension, this.asset?.size);
2719
2773
  return this.proxies?.find((t) => t.proxyName === e)?.id ?? "";
2720
2774
  }
2721
2775
  onProxyChange(e) {
2722
2776
  let t = e.detail;
2723
- if (this.lastAction = k.Proxy, t.autoFormat) {
2777
+ if (this.lastAction = D.Proxy, t.autoFormat) {
2724
2778
  this.autoFormat = !0;
2725
2779
  let e = this.autoResolvedProxyId;
2726
2780
  e && (this.selectedProxy = e);
@@ -2736,7 +2790,7 @@ var Gt = Z, Q, Kt = {
2736
2790
  });
2737
2791
  else {
2738
2792
  let e = this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto, n = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, i = this.cropSize.x, a = this.cropSize.y;
2739
- t === "free" ? (n = !1, this.cropperElement && (r = "manual")) : this.cropSize.unit === P.Pixel && !e && (i = 0, a = 0), this.focusModes.find((e) => e.value === r)?.auto && this.selectedFormat?.url ? await this.handleRequestAutoCropSuggestion({
2793
+ t === "free" ? (n = !1, this.cropperElement && (r = "manual")) : this.cropSize.unit === M.Pixel && !e && (i = 0, a = 0), this.focusModes.find((e) => e.value === r)?.auto && this.selectedFormat?.url ? await this.handleRequestAutoCropSuggestion({
2740
2794
  cropMode: t,
2741
2795
  focusMode: r,
2742
2796
  height: this.cropSize.height,
@@ -2772,11 +2826,11 @@ var Gt = Z, Q, Kt = {
2772
2826
  }
2773
2827
  async onCropChange(e) {
2774
2828
  let t = this.cropSize.unit;
2775
- if (e.detail.unit === P.AspectRatio) {
2829
+ if (e.detail.unit === M.AspectRatio) {
2776
2830
  let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 1), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 1), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
2777
2831
  o + a > 100 && (o = 100 - a), s + i > 100 && (s = 100 - i);
2778
- let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = !e.detail.keepAspectRatio && this.#a(e.detail.width, e.detail.height);
2779
- (l || u) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit = P.AspectRatio, this.cropSize.width = n) : this.cropSize = {
2832
+ let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = !e.detail.keepAspectRatio && this.#d(e.detail.width, e.detail.height);
2833
+ (l || u) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit = M.AspectRatio, this.cropSize.width = n) : this.cropSize = {
2780
2834
  ...this.cropSize,
2781
2835
  cropMode: c,
2782
2836
  height: r,
@@ -2785,7 +2839,7 @@ var Gt = Z, Q, Kt = {
2785
2839
  percentageWidth: a,
2786
2840
  ratioHeight: e.detail.height,
2787
2841
  ratioWidth: e.detail.width,
2788
- unit: P.AspectRatio,
2842
+ unit: M.AspectRatio,
2789
2843
  width: n,
2790
2844
  x: o,
2791
2845
  y: s
@@ -2794,14 +2848,14 @@ var Gt = Z, Q, Kt = {
2794
2848
  let t = this.asset ? e.detail.height * 100 / this.selectedFormat.height : 100, n = this.asset ? e.detail.width * 100 / this.selectedFormat.width : 100, r = this.cropSize.x, i = this.cropSize.y;
2795
2849
  r + n > 100 && (r = 100 - n), i + t > 100 && (i = 100 - t);
2796
2850
  let a = this.cropSize.cropMode, o = this.cropModes.find((e) => e.value === a)?.auto;
2797
- (e.detail.breakAspectRatio || o) && (a = "free"), e.detail.silent ? (this.cropSize.cropMode = a, this.cropSize.height = e.detail.height, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = t, this.cropSize.percentageWidth = n, this.cropSize.unit = P.Pixel, this.cropSize.width = e.detail.width, this.cropSize.x = r, this.cropSize.y = i) : this.cropSize = {
2851
+ (e.detail.breakAspectRatio || o) && (a = "free"), e.detail.silent ? (this.cropSize.cropMode = a, this.cropSize.height = e.detail.height, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = t, this.cropSize.percentageWidth = n, this.cropSize.unit = M.Pixel, this.cropSize.width = e.detail.width, this.cropSize.x = r, this.cropSize.y = i) : this.cropSize = {
2798
2852
  ...this.cropSize,
2799
2853
  cropMode: a,
2800
2854
  height: e.detail.height,
2801
2855
  keepAspectRatio: e.detail.keepAspectRatio,
2802
2856
  percentageHeight: t,
2803
2857
  percentageWidth: n,
2804
- unit: P.Pixel,
2858
+ unit: M.Pixel,
2805
2859
  width: e.detail.width,
2806
2860
  x: r,
2807
2861
  y: i
@@ -2812,10 +2866,10 @@ var Gt = Z, Q, Kt = {
2812
2866
  cropMode: "free"
2813
2867
  }), this.onCropChanged()), this.isFormatsLayout && this.cropEnabled && this.applyCropTransformation();
2814
2868
  }
2815
- #o() {
2869
+ #f() {
2816
2870
  let { ratioHeight: e, ratioWidth: t, unit: n } = this.cropSize;
2817
- if (n !== P.AspectRatio) return;
2818
- let r = y(t, e);
2871
+ if (n !== M.AspectRatio) return;
2872
+ let r = ie(t, e);
2819
2873
  (r.width !== t || r.height !== e) && (this.cropSize = {
2820
2874
  ...this.cropSize,
2821
2875
  ratioHeight: r.height,
@@ -2823,7 +2877,7 @@ var Gt = Z, Q, Kt = {
2823
2877
  });
2824
2878
  }
2825
2879
  async onCropChanged() {
2826
- this.#o(), this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto && await this.handleRequestAutoCropSuggestion({
2880
+ this.#f(), this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto && await this.handleRequestAutoCropSuggestion({
2827
2881
  focusMode: this.cropSize.focusMode,
2828
2882
  height: this.cropSize.height,
2829
2883
  width: this.cropSize.width
@@ -2837,11 +2891,11 @@ var Gt = Z, Q, Kt = {
2837
2891
  unit: this.cropSize.unit,
2838
2892
  width: this.cropSize.width
2839
2893
  }) {
2840
- if (this.clearResetSnapshot(), this.lastAction = k.Crop, !this.asset) {
2894
+ if (this.clearResetSnapshot(), this.lastAction = D.Crop, !this.asset) {
2841
2895
  let { focusMode: e, height: t, position: n, ratioHeight: r, ratioWidth: i, unit: a, width: o, x: s, y: c } = this.cropSize, l = this.focusModes.find((t) => t.value === e)?.auto ?? !1;
2842
- if (a === P.AspectRatio) {
2896
+ if (a === M.AspectRatio) {
2843
2897
  i && r && this.upsertTransformation({
2844
- key: k.Crop,
2898
+ key: D.Crop,
2845
2899
  value: {
2846
2900
  focusMode: e,
2847
2901
  isFocusModeAuto: l,
@@ -2854,7 +2908,7 @@ var Gt = Z, Q, Kt = {
2854
2908
  return;
2855
2909
  }
2856
2910
  (t || o) && Number.isFinite(t) && Number.isFinite(o) && this.upsertTransformation({
2857
- key: k.Crop,
2911
+ key: D.Crop,
2858
2912
  value: {
2859
2913
  focusMode: e,
2860
2914
  height: t,
@@ -2873,8 +2927,8 @@ var Gt = Z, Q, Kt = {
2873
2927
  let a = this.cropSize.focusMode, o = this.focusModes.find((e) => e.value === a)?.auto ?? !1;
2874
2928
  if (t && i && r) {
2875
2929
  let e = i, s = t;
2876
- if (r === P.AspectRatio && (e = this.cropSize.percentageWidth * this.selectedFormat.width / 100, s = this.cropSize.percentageHeight * this.selectedFormat.height / 100), n) this.transformations = [...this.transformations, {
2877
- key: k.Crop,
2930
+ if (r === M.AspectRatio && (e = this.cropSize.percentageWidth * this.selectedFormat.width / 100, s = this.cropSize.percentageHeight * this.selectedFormat.height / 100), n) this.transformations = [...this.transformations, {
2931
+ key: D.Crop,
2878
2932
  value: {
2879
2933
  focusMode: a,
2880
2934
  height: s,
@@ -2886,7 +2940,7 @@ var Gt = Z, Q, Kt = {
2886
2940
  else {
2887
2941
  let t = this.cropSize.x / 100 * this.selectedFormat.width, n = this.cropSize.y / 100 * this.selectedFormat.height;
2888
2942
  this.transformations = [...this.transformations, {
2889
- key: k.Crop,
2943
+ key: D.Crop,
2890
2944
  value: {
2891
2945
  focusMode: a,
2892
2946
  height: s,
@@ -2899,7 +2953,7 @@ var Gt = Z, Q, Kt = {
2899
2953
  }];
2900
2954
  }
2901
2955
  } else n && (this.transformations = [...this.transformations, {
2902
- key: k.Crop,
2956
+ key: D.Crop,
2903
2957
  value: {
2904
2958
  focusMode: a,
2905
2959
  isFocusModeAuto: o,
@@ -2909,15 +2963,15 @@ var Gt = Z, Q, Kt = {
2909
2963
  }
2910
2964
  getRatioResizePreviewSize(e, t) {
2911
2965
  let { height: n, width: r } = this.imageSize;
2912
- if (this.asset && r && n) return Q.fitRatioResizeSize(e, t, r, n);
2913
- let i = e / t, a = Math.max(Math.round(this.lastResizeSize[P.Pixel].height * i), 0);
2966
+ if (this.asset && r && n) return Z.fitRatioResizeSize(e, t, r, n);
2967
+ let i = e / t, a = Math.max(Math.round(this.lastResizeSize[M.Pixel].height * i), 0);
2914
2968
  return {
2915
2969
  height: Math.max(Math.round(a / i), 0),
2916
2970
  width: a
2917
2971
  };
2918
2972
  }
2919
2973
  onResizeChange(e) {
2920
- if (e.detail.unit === P.AspectRatio) {
2974
+ if (e.detail.unit === M.AspectRatio) {
2921
2975
  let { height: t, width: n } = this.getRatioResizePreviewSize(e.detail.width, e.detail.height);
2922
2976
  this.resizeSize = {
2923
2977
  ...this.resizeSize,
@@ -2939,11 +2993,11 @@ var Gt = Z, Q, Kt = {
2939
2993
  onResizeApply(e) {
2940
2994
  let { height: t, unit: n, width: r } = e.detail;
2941
2995
  if (!Number.isFinite(r) || !Number.isFinite(t)) return;
2942
- if (this.clearResetSnapshot(), this.lastAction = k.Resize, !this.asset) {
2943
- if (n === P.AspectRatio) {
2996
+ if (this.clearResetSnapshot(), this.lastAction = D.Resize, !this.asset) {
2997
+ if (n === M.AspectRatio) {
2944
2998
  let { ratioHeight: e, ratioWidth: t } = this.resizeSize;
2945
2999
  t && e && this.upsertTransformation({
2946
- key: k.Resize,
3000
+ key: D.Resize,
2947
3001
  value: {
2948
3002
  ratioHeight: e,
2949
3003
  ratioWidth: t,
@@ -2953,7 +3007,7 @@ var Gt = Z, Q, Kt = {
2953
3007
  return;
2954
3008
  }
2955
3009
  (t || r) && (this.upsertTransformation({
2956
- key: k.Resize,
3010
+ key: D.Resize,
2957
3011
  value: {
2958
3012
  height: t,
2959
3013
  unit: n,
@@ -2964,8 +3018,8 @@ var Gt = Z, Q, Kt = {
2964
3018
  }
2965
3019
  if (!this.selectedFormat) return;
2966
3020
  let i = this.selectedFormat.width || this.defaultSize.width, a = this.selectedFormat.height || this.defaultSize.height, o = r, s = t;
2967
- this.resizeSize.unit === n ? n === P.AspectRatio && ({height: s, width: o} = Q.fitRatioResizeSize(r, t, i, a)) : (o = i, s = a), this.transformations = [...this.transformations, {
2968
- key: k.Resize,
3021
+ this.resizeSize.unit === n ? n === M.AspectRatio && ({height: s, width: o} = Z.fitRatioResizeSize(r, t, i, a)) : (o = i, s = a), this.transformations = [...this.transformations, {
3022
+ key: D.Resize,
2969
3023
  value: {
2970
3024
  height: s,
2971
3025
  unit: n,
@@ -2980,23 +3034,23 @@ var Gt = Z, Q, Kt = {
2980
3034
  this.applyRotationTransformation(e.detail);
2981
3035
  }
2982
3036
  applyRotationTransformation(e) {
2983
- if (this.clearResetSnapshot(), this.lastAction = k.Rotate, !this.asset) {
3037
+ if (this.clearResetSnapshot(), this.lastAction = D.Rotate, !this.asset) {
2984
3038
  e ? this.upsertTransformation({
2985
- key: k.Rotate,
3039
+ key: D.Rotate,
2986
3040
  value: { rotation: e }
2987
- }) : this.transformations = this.transformations.filter((e) => e.key !== k.Rotate);
3041
+ }) : this.transformations = this.transformations.filter((e) => e.key !== D.Rotate);
2988
3042
  return;
2989
3043
  }
2990
3044
  this.selectedFormat && (this.transformations = [...this.transformations, {
2991
- key: k.Rotate,
3045
+ key: D.Rotate,
2992
3046
  value: { rotation: e }
2993
3047
  }]);
2994
3048
  }
2995
3049
  onQualityChange(e) {
2996
3050
  let t = e.detail;
2997
- this.selectedFormat && (this.selectedFormat.quality = t), this.clearResetSnapshot(), this.lastAction = k.Quality;
3051
+ this.selectedFormat && (this.selectedFormat.quality = t), this.clearResetSnapshot(), this.lastAction = D.Quality;
2998
3052
  let n = {
2999
- key: k.Quality,
3053
+ key: D.Quality,
3000
3054
  value: { quality: t }
3001
3055
  };
3002
3056
  this.asset ? this.transformations = [...this.transformations, n] : this.upsertTransformation(n);
@@ -3008,15 +3062,15 @@ var Gt = Z, Q, Kt = {
3008
3062
  keepMetadata: t
3009
3063
  }, !this.asset) {
3010
3064
  t ? this.upsertTransformation({
3011
- key: k.Metadata,
3065
+ key: D.Metadata,
3012
3066
  value: { keepMetadata: t }
3013
- }) : this.transformations = this.transformations.filter((e) => e.key !== k.Metadata);
3067
+ }) : this.transformations = this.transformations.filter((e) => e.key !== D.Metadata);
3014
3068
  return;
3015
3069
  }
3016
3070
  t ? this.upsertTransformation({
3017
- key: k.Metadata,
3071
+ key: D.Metadata,
3018
3072
  value: { keepMetadata: t }
3019
- }) : this.transformations = this.transformations.filter((e) => e.key !== k.Metadata);
3073
+ }) : this.transformations = this.transformations.filter((e) => e.key !== D.Metadata);
3020
3074
  }
3021
3075
  onExtensionChange(e) {
3022
3076
  let t = e.detail;
@@ -3026,14 +3080,14 @@ var Gt = Z, Q, Kt = {
3026
3080
  };
3027
3081
  }
3028
3082
  syncQuality() {
3029
- let e = this.transformations.findLast((e) => e.key === k.Quality)?.value?.quality;
3083
+ let e = this.transformations.findLast((e) => e.key === D.Quality)?.value?.quality;
3030
3084
  this.selectedFormat &&= {
3031
3085
  ...this.selectedFormat,
3032
3086
  quality: e ?? 100
3033
3087
  };
3034
3088
  }
3035
3089
  syncSelectedDimensions(e = !0) {
3036
- let t = this.transformations.findLast((e) => e.key === k.Dimensions), n = Q.getDimensionsSize(this.selectedDimensions);
3090
+ let t = this.transformations.findLast((e) => e.key === D.Dimensions), n = Z.getDimensionsSize(this.selectedDimensions);
3037
3091
  if (!t) {
3038
3092
  n && (this.selectedDimensions = void 0);
3039
3093
  return;
@@ -3041,55 +3095,70 @@ var Gt = Z, Q, Kt = {
3041
3095
  let r = Math.round(t.value.width ?? 0), i = Math.round(t.value.height ?? 0);
3042
3096
  if (e && n?.width === r && n.height === i) return;
3043
3097
  let a = this.dimensionsItems.find((e) => {
3044
- let t = Q.getDimensionsPresetSize(e.value);
3098
+ let t = Z.getDimensionsPresetSize(e.value);
3045
3099
  return !e.disabled && t?.width === r && t.height === i;
3046
3100
  });
3047
3101
  this.selectedDimensions = a ? {
3048
- mode: D.Preset,
3102
+ mode: E.Preset,
3049
3103
  value: a.value
3050
3104
  } : {
3051
3105
  height: i,
3052
- mode: D.Custom,
3053
- unit: A.Pixel,
3106
+ mode: E.Custom,
3107
+ unit: O.Pixel,
3054
3108
  width: r
3055
3109
  };
3056
3110
  }
3111
+ #p(e) {
3112
+ e.has("cropModes") && (this.#a = this.cropModes.some((e) => e.value === "free") ? this.cropModes : [{
3113
+ label: this.localize.term("cropFreeMode"),
3114
+ value: "free"
3115
+ }, ...this.cropModes]), e.has("focusModes") && (this.#o = this.focusModes.some((e) => e.value === "manual") ? this.focusModes : [{
3116
+ label: this.localize.term("cropManualFocus"),
3117
+ value: "manual"
3118
+ }, ...this.focusModes]);
3119
+ }
3120
+ #m() {
3121
+ this.transformations.some((e) => e.key === D.Dimensions) || this.#h(this.#i ? Z.parsePercentDimensions(this.percentDimensions) : void 0);
3122
+ }
3123
+ #h(e) {
3124
+ e ? this.selectedDimensions = e : Z.getPercentDimensions(this.selectedDimensions) && (this.selectedDimensions = void 0);
3125
+ }
3057
3126
  get hasResettableState() {
3058
- let e = Jt.filter((e) => this.activeParts.includes(e));
3059
- return this.canReorder && this.activeParts.some((t, n) => t !== e[n]) || this.transformations.length > 0 ? !0 : this.canAutoFormat && !this.autoFormat;
3127
+ let e = $t.filter((e) => this.activeParts.includes(e));
3128
+ return this.canReorder && this.activeParts.some((t, n) => t !== e[n]) || this.transformations.length > 0 || Z.getPercentDimensions(this.selectedDimensions) ? !0 : this.canAutoFormat && !this.autoFormat;
3060
3129
  }
3061
3130
  clearResetSnapshot() {
3062
- this.canReorder && this.rememberOrder(), this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0;
3131
+ this.canReorder && this.rememberOrder(), this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.#r = void 0;
3063
3132
  }
3064
3133
  handleUndo() {
3065
3134
  if (this.canReorder && this.orderUndo.length > 0) {
3066
3135
  let e = this.orderUndo[this.orderUndo.length - 1];
3067
- this.orderUndo = this.orderUndo.slice(0, -1), this.parts = e.parts, this.autoFormat = e.autoFormat, this.selectedProxy = e.selectedProxy, this.transformations = e.transformations, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.emitReorder(), this.syncQuality();
3136
+ this.orderUndo = this.orderUndo.slice(0, -1), this.parts = e.parts, this.autoFormat = e.autoFormat, this.selectedProxy = e.selectedProxy, this.#h(e.percentDimensions), this.transformations = e.transformations, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.#r = void 0, this.emitReorder(), this.syncQuality();
3068
3137
  return;
3069
3138
  }
3070
- !this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0, this.preResetAutoFormat !== void 0 && (this.autoFormat = this.preResetAutoFormat, this.preResetAutoFormat = void 0), this.preResetSelectedProxy !== void 0 && (this.selectedProxy = this.preResetSelectedProxy, this.preResetSelectedProxy = void 0)) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
3139
+ !this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0, this.preResetAutoFormat !== void 0 && (this.autoFormat = this.preResetAutoFormat, this.preResetAutoFormat = void 0), this.preResetSelectedProxy !== void 0 && (this.selectedProxy = this.preResetSelectedProxy, this.preResetSelectedProxy = void 0), this.#h(this.#r), this.#r = void 0) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
3071
3140
  }
3072
3141
  handleReset() {
3073
- if (this.canReorder && this.rememberOrder(), this.preResetTransformations = [...this.transformations], this.preResetAutoFormat = this.autoFormat, this.preResetSelectedProxy = this.selectedProxy, this.canAutoFormat) this.autoFormat = !0, this.selectedProxy = this.autoResolvedProxyId || this.selectedProxy;
3142
+ if (this.canReorder && this.rememberOrder(), this.preResetTransformations = [...this.transformations], this.preResetAutoFormat = this.autoFormat, this.preResetSelectedProxy = this.selectedProxy, this.#r = Z.getPercentDimensions(this.selectedDimensions), this.#h(void 0), this.canAutoFormat) this.autoFormat = !0, this.selectedProxy = this.autoResolvedProxyId || this.selectedProxy;
3074
3143
  else {
3075
3144
  let e = !!this.defaultProxy && !!this.proxies?.some((e) => e.id === this.defaultProxy);
3076
3145
  this.selectedProxy = e ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "";
3077
3146
  }
3078
- this.transformations = [], this.canReorder && (this.parts = Jt.filter((e) => this.activeParts.includes(e)), this.emitReorder()), this.frozenIndex = -1, this.syncQuality();
3147
+ this.transformations = [], this.canReorder && (this.parts = $t.filter((e) => this.activeParts.includes(e)), this.emitReorder()), this.frozenIndex = -1, this.syncQuality();
3079
3148
  }
3080
3149
  onDimensionsChange(e) {
3081
3150
  e.stopPropagation();
3082
- let t = Q.getDimensionsSize(e.detail);
3083
- this.clearResetSnapshot(), this.lastAction = k.Dimensions, this.selectedDimensions = { ...e.detail }, t ? this.upsertTransformation({
3084
- key: k.Dimensions,
3151
+ let t = Z.getDimensionsSize(e.detail);
3152
+ this.clearResetSnapshot(), this.lastAction = D.Dimensions, this.selectedDimensions = { ...e.detail }, t ? this.upsertTransformation({
3153
+ key: D.Dimensions,
3085
3154
  value: t
3086
- }) : this.transformations = this.transformations.filter((e) => e.key !== k.Dimensions), this.capCropToMaxSize();
3155
+ }) : this.transformations = this.transformations.filter((e) => e.key !== D.Dimensions), this.capCropToMaxSize();
3087
3156
  }
3088
3157
  onCropToggle(e) {
3089
- e.stopPropagation(), this.clearResetSnapshot(), this.cropEnabled = e.currentTarget.checked, this.cropEnabled || (this.transformations = this.transformations.filter((e) => e.key !== k.Crop)), this.emit("cx-asset-link-format-crop-toggle", { detail: this.cropEnabled });
3158
+ e.stopPropagation(), this.clearResetSnapshot(), this.cropEnabled = e.currentTarget.checked, this.cropEnabled || (this.transformations = this.transformations.filter((e) => e.key !== D.Crop)), this.emit("cx-asset-link-format-crop-toggle", { detail: this.cropEnabled });
3090
3159
  }
3091
3160
  renderDimensionsPart() {
3092
- return e`<cx-asset-link-format-dimensions class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? N.Automatic : N.Manual} .inline=${this.isFormatsLayout} ?open=${this.activeSetting === "cx-asset-link-format-dimensions"} ?loading=${this.loading} .items=${this.dimensionsItems} .value=${this.selectedDimensions} ?can-custom=${this.canCustomDimensions} @cx-asset-link-format-dimensions-change=${this.onDimensionsChange}></cx-asset-link-format-dimensions>`;
3161
+ return e`<cx-asset-link-format-dimensions class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? j.Automatic : j.Manual} .inline=${this.isFormatsLayout} ?open=${this.activeSetting === "cx-asset-link-format-dimensions"} ?loading=${this.loading} .items=${this.dimensionsItems} .value=${this.selectedDimensions} ?can-custom=${this.canCustomDimensions} ?can-percent=${this.#i} @cx-asset-link-format-dimensions-change=${this.onDimensionsChange}></cx-asset-link-format-dimensions>`;
3093
3162
  }
3094
3163
  renderHeader() {
3095
3164
  return m(!this.hideHeader && !this.isFormatsLayout, () => e`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0 && (!this.canReorder || this.orderUndo.length === 0)} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${m(this.canReset, () => e`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`, () => n);
@@ -3098,42 +3167,42 @@ var Gt = Z, Q, Kt = {
3098
3167
  return m(this.canReorder, () => e`<div class="asset-link-format__order-hint" data-testid="cx-asset-link-format-order-hint">${this.localize.term("transformationOrderHint")}</div>`);
3099
3168
  }
3100
3169
  renderProxyPart() {
3101
- return e`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === k.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`;
3170
+ return e`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === D.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`;
3102
3171
  }
3103
3172
  renderCropEditor(t) {
3104
- let n = this.asset ? this.lastResizeSize[P.Pixel] : this.cropMaxSize;
3105
- return e`<cx-asset-link-format-crop class="asset-link-format__details" .inline=${t} ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === k.Crop} ?show-position-picker=${!this.asset} ?has-cropper=${!!this.cropperElement} ?dimensions-limited=${this.isCropAtDimensionsLimit} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${n.width} max-height=${n.height} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`;
3173
+ let n = this.asset ? this.lastResizeSize[M.Pixel] : this.cropMaxSize;
3174
+ return e`<cx-asset-link-format-crop class="asset-link-format__details" .inline=${t} ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === D.Crop} ?show-position-picker=${!this.asset} ?has-cropper=${!!this.cropperElement} ?dimensions-limited=${this.isCropAtDimensionsLimit} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${n.width} max-height=${n.height} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.#a} .focusModes=${this.#o} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`;
3106
3175
  }
3107
3176
  renderCropPart() {
3108
3177
  return this.isFormatsLayout ? e`<div class="asset-link-format__formats-crop"><cx-space class="asset-link-format__formats-summary" align-items="center" justify-content="space-between"><cx-space align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body3">${this.localize.term("crop")}</cx-typography></cx-space><cx-switch data-testid="cx-asset-link-format-crop-toggle" .checked=${this.cropEnabled} ?disabled=${this.loading} @cx-change=${this.onCropToggle}><cx-visually-hidden>${this.localize.term("crop")}</cx-visually-hidden></cx-switch></cx-space>${m(this.cropEnabled, () => this.renderCropEditor(!0))}</div>` : this.renderCropEditor(!1);
3109
3178
  }
3110
3179
  renderResizePart() {
3111
- return e`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === k.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : Infinity} max-height=${this.asset ? this.imageSize.height : Infinity} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`;
3180
+ return e`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === D.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : Infinity} max-height=${this.asset ? this.imageSize.height : Infinity} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`;
3112
3181
  }
3113
3182
  renderRotatePart() {
3114
- return e`<cx-asset-link-format-rotation class="asset-link-format__details" .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === k.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`;
3183
+ return e`<cx-asset-link-format-rotation class="asset-link-format__details" .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === D.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`;
3115
3184
  }
3116
3185
  renderQualityPart() {
3117
- return e`<cx-asset-link-format-quality class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? N.Automatic : N.Manual} .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === k.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} .items=${this.qualityItems} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>`;
3186
+ return e`<cx-asset-link-format-quality class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? j.Automatic : j.Manual} .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === D.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} .items=${this.qualityItems} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>`;
3118
3187
  }
3119
3188
  renderMetadataPart() {
3120
3189
  return e`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`;
3121
3190
  }
3122
3191
  renderPart(e) {
3123
3192
  switch (e) {
3124
- case j.Dimensions: return this.renderDimensionsPart();
3125
- case j.Proxy: return this.renderProxyPart();
3126
- case j.Crop: return this.renderCropPart();
3127
- case j.Resize: return this.renderResizePart();
3128
- case j.Rotate: return this.renderRotatePart();
3129
- case j.Quality: return this.renderQualityPart();
3130
- case j.Metadata: return this.renderMetadataPart();
3193
+ case k.Dimensions: return this.renderDimensionsPart();
3194
+ case k.Proxy: return this.renderProxyPart();
3195
+ case k.Crop: return this.renderCropPart();
3196
+ case k.Resize: return this.renderResizePart();
3197
+ case k.Rotate: return this.renderRotatePart();
3198
+ case k.Quality: return this.renderQualityPart();
3199
+ case k.Metadata: return this.renderMetadataPart();
3131
3200
  default: return n;
3132
3201
  }
3133
3202
  }
3134
3203
  render() {
3135
3204
  return e`<div class="asset-link-format ${this.isFormatsLayout ? "asset-link-format--formats" : ""}" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${this.renderHeader()}
3136
- ${this.renderOrderHint()}<div class="asset-link-format__panels">${S(this.activeParts, (e) => e, (t) => e`<div class="asset-link-format__panel" data-part=${t} ?data-reorderable=${this.canReorder && Yt.includes(t)}>${m(this.canReorder && Yt.includes(t), () => e`<cx-icon-button class="asset-link-format__drag-handle" name="drag_indicator" label=${this.localize.term("reorderTransformation", this.localize.term(t))} ?disabled=${this.loading} @keydown=${this.handleReorderKeyDown}></cx-icon-button>`)}
3205
+ ${this.renderOrderHint()}<div class="asset-link-format__panels">${x(this.activeParts, (e) => e, (t) => e`<div class="asset-link-format__panel" data-part=${t} ?data-reorderable=${this.canReorder && en.includes(t)}>${m(this.canReorder && en.includes(t), () => e`<cx-icon-button class="asset-link-format__drag-handle" name="drag_indicator" label=${this.localize.term("reorderTransformation", this.localize.term(t))} ?disabled=${this.loading} @keydown=${this.handleReorderKeyDown}></cx-icon-button>`)}
3137
3206
  ${this.renderPart(t)}</div>`)}</div><span class="asset-link-format__announcement" role="status" aria-live="polite">${this.reorderAnnouncement}</span>${m(this.useCustomExtension, () => e`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`)}<div class="asset-link-format__footer"><slot name="footer"></slot></div></div>`;
3138
3207
  }
3139
3208
  };
@@ -3193,12 +3262,12 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
3193
3262
  type: Boolean
3194
3263
  }), o("design:type", Boolean)], $.prototype, "useCustomExtension", void 0), a([r({
3195
3264
  attribute: "parts",
3196
- converter: ke,
3265
+ converter: Me,
3197
3266
  type: Array
3198
3267
  }), o("design:type", Array)], $.prototype, "parts", void 0), a([r({
3199
3268
  reflect: !0,
3200
3269
  type: String
3201
- }), o("design:type", ve === void 0 ? Object : ve)], $.prototype, "layout", void 0), a([r({
3270
+ }), o("design:type", xe === void 0 ? Object : xe)], $.prototype, "layout", void 0), a([r({
3202
3271
  attribute: "crop-enabled",
3203
3272
  reflect: !0,
3204
3273
  type: Boolean
@@ -3212,6 +3281,12 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
3212
3281
  attribute: "can-custom-dimensions",
3213
3282
  type: Boolean
3214
3283
  }), o("design:type", Object)], $.prototype, "canCustomDimensions", void 0), a([r({
3284
+ attribute: "can-percent-dimensions",
3285
+ type: Boolean
3286
+ }), o("design:type", Object)], $.prototype, "canPercentDimensions", void 0), a([r({
3287
+ attribute: "percent-dimensions",
3288
+ type: String
3289
+ }), o("design:type", Object)], $.prototype, "percentDimensions", void 0), a([r({
3215
3290
  attribute: "last-image-size",
3216
3291
  reflect: !1,
3217
3292
  type: Object
@@ -3251,7 +3326,7 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
3251
3326
  o("design:type", Function),
3252
3327
  o("design:paramtypes", []),
3253
3328
  o("design:returntype", void 0)
3254
- ], $.prototype, "handleReorderableChange", null), $ = Q = a([u("cx-asset-link-format"), o("design:paramtypes", [])], $);
3255
- var Xt = $;
3329
+ ], $.prototype, "handleReorderableChange", null), $ = Z = a([u("cx-asset-link-format"), o("design:paramtypes", [])], $);
3330
+ var nn = $;
3256
3331
  //#endregion
3257
- export { lt as C, gt as S, je as T, Je as _, Qe as a, pt as b, L as c, $e as d, Ge as f, qe as g, R as h, St as i, Ue as l, et as m, Tt as n, Ve as o, Ke as p, Ct as r, I as s, Xt as t, We as u, Ye as v, Me as w, vt as x, _t as y };
3332
+ export { ft as C, yt as S, Pe as T, Ze as _, tt as a, gt as b, F as c, nt as d, Je as f, Xe as g, I as h, Tt as i, Ke as l, rt as m, Ot as n, We as o, Ye as p, Et as r, P as s, nn as t, qe as u, Qe as v, Fe as w, xt as x, bt as y };