@orangelogic/design-system 2.95.0 → 2.97.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 (173) hide show
  1. package/library/chunks/asset.B3vySOI-.js +431 -0
  2. package/library/chunks/{asset.types.6DCzTOQm.js → asset.types.KXRZEtBr.js} +127 -126
  3. package/library/chunks/{button.BZjbVq8t.js → button.CAa1kvwe.js} +2 -2
  4. package/library/chunks/{color-swatch-group.Q8ybVS0A.js → color-swatch-group.ChcPlkPU.js} +5 -5
  5. package/library/chunks/{color-swatch.CbL_TpRZ.js → color-swatch.DJ1kUnBQ.js} +1 -1
  6. package/library/chunks/{confirm-popover.bBo9aPlX.js → confirm-popover.D4x0nO5g.js} +3 -3
  7. package/library/chunks/content-builder.CcgZciZN.js +58 -0
  8. package/library/chunks/{cropper.uKGcvnPk.js → cropper.Bib8Abm3.js} +4937 -4932
  9. package/library/chunks/{dialog.DRW8iwh-.js → dialog.BLaxLMSc.js} +2 -2
  10. package/library/chunks/{dom.DURaLV1d.js → dom.0RpWet6y.js} +1 -1
  11. package/library/chunks/{dot-pagination.CvUr6R4S.js → dot-pagination.-nDdQxJN.js} +1 -1
  12. package/library/chunks/{file-on-demand.KQlA1JFF.js → file-on-demand.AzwoUvwB.js} +10 -10
  13. package/library/chunks/{folder-select.DxBOSyvo.js → folder-select.XpkOFzAW.js} +5 -5
  14. package/library/chunks/{form.nRqYei4e.js → form.Ch1cwYzO.js} +1 -1
  15. package/library/chunks/{header.ClxEkQPZ.js → header.BZxyeLPK.js} +1 -1
  16. package/library/chunks/{i18n.W6czbRms.js → i18n.BABe9hN4.js} +6 -0
  17. package/library/chunks/{icon-button.MqA-pNw8.js → icon-button.C2s3pHG4.js} +1 -1
  18. package/library/chunks/{iframe.PcSPtm_O.js → iframe.DPccxsnE.js} +1 -1
  19. package/library/chunks/{image.Dtdklw5q.js → image.9qwbjGNb.js} +1 -1
  20. package/library/chunks/{image.C-Covc0H.js → image.Cc4V85ID.js} +354 -311
  21. package/library/chunks/{list-editor.BnHKqD0O.js → list-editor.pVYc_70c.js} +183 -153
  22. package/library/chunks/{number.CCF6IxpN.js → number.B4PQLJIg.js} +32 -32
  23. package/library/chunks/{option.Cx54zrJq.js → option.DGXQzdtb.js} +1 -1
  24. package/library/chunks/{pagination.CG5odPWi.js → pagination.DZqKSA86.js} +4 -4
  25. package/library/chunks/{responsive.D9TUCX5p.js → responsive.Oz9HWjyQ.js} +1 -1
  26. package/library/chunks/{string.DfV21HEI.js → string.DUgD4c9f.js} +41 -34
  27. package/library/chunks/{tab-group.BLZ-qEpp.js → tab-group.BhCf9Smq.js} +4 -4
  28. package/library/chunks/{table.CYxWpvAC.js → table.V5PGGTfO.js} +13 -11
  29. package/library/chunks/{time.BNrE47-8.js → time.BiQnh9wt.js} +1 -1
  30. package/library/chunks/toast.D3AW3RWv.js +94 -0
  31. package/library/chunks/transformation.Cqz3hPaQ.js +144 -0
  32. package/library/chunks/{tree.CKi63r95.js → tree.DZa7k-4E.js} +1 -1
  33. package/library/components/alert.js +2 -2
  34. package/library/components/asset-link-format.js +767 -862
  35. package/library/components/atoms.js +12 -12
  36. package/library/components/border-input-group.js +1 -1
  37. package/library/components/breadcrumb.js +1 -1
  38. package/library/components/button.js +3 -3
  39. package/library/components/checkbox.js +1 -1
  40. package/library/components/color-picker.js +3 -3
  41. package/library/components/color-swatch-group.js +6 -6
  42. package/library/components/color-swatch.js +2 -2
  43. package/library/components/confirm-popover.js +4 -4
  44. package/library/components/copy-button.js +1 -1
  45. package/library/components/corner-position-input-group.js +2 -2
  46. package/library/components/cropper.js +1 -1
  47. package/library/components/details.js +4 -4
  48. package/library/components/dialog.js +3 -3
  49. package/library/components/dot-pagination.js +2 -2
  50. package/library/components/drawer.js +2 -2
  51. package/library/components/dropdown.js +1 -1
  52. package/library/components/dynamic-select.js +4 -4
  53. package/library/components/e-chart.js +1 -1
  54. package/library/components/element-clamp.js +2 -2
  55. package/library/components/file-on-demand.js +11 -11
  56. package/library/components/folder-select.js +4 -4
  57. package/library/components/format-bytes.js +1 -1
  58. package/library/components/format-date.js +1 -1
  59. package/library/components/format-number.js +1 -1
  60. package/library/components/format-time.js +2 -2
  61. package/library/components/header.js +2 -2
  62. package/library/components/icon-button.js +2 -2
  63. package/library/components/iframe.js +2 -2
  64. package/library/components/image-comparer.js +1 -1
  65. package/library/components/image.js +2 -2
  66. package/library/components/input.js +4 -7
  67. package/library/components/line-clamp.js +1 -1
  68. package/library/components/list-editor.js +6 -6
  69. package/library/components/masonry.js +2 -2
  70. package/library/components/menu-item.js +1 -1
  71. package/library/components/menu.js +1 -1
  72. package/library/components/molecules.js +5 -5
  73. package/library/components/option.js +2 -2
  74. package/library/components/organisms.js +2 -2
  75. package/library/components/pagination.js +5 -5
  76. package/library/components/popup.js +1 -1
  77. package/library/components/position-picker.js +1 -1
  78. package/library/components/progress-bar.js +1 -1
  79. package/library/components/progress-ring.js +1 -1
  80. package/library/components/radio-group.js +1 -1
  81. package/library/components/range.js +2 -2
  82. package/library/components/rating.js +1 -1
  83. package/library/components/relative-time.js +1 -1
  84. package/library/components/select.js +3 -3
  85. package/library/components/share-option-list.js +2 -2
  86. package/library/components/sidebar.js +1 -1
  87. package/library/components/size-input-group.js +2 -2
  88. package/library/components/spinner.js +1 -1
  89. package/library/components/split-panel.js +1 -1
  90. package/library/components/switch.js +1 -1
  91. package/library/components/tab-group.js +5 -5
  92. package/library/components/tab.js +2 -2
  93. package/library/components/table.js +5 -5
  94. package/library/components/tag.js +2 -2
  95. package/library/components/textarea.js +2 -2
  96. package/library/components/timecode.js +1 -1
  97. package/library/components/tooltip.js +1 -1
  98. package/library/components/tree-item.js +2 -2
  99. package/library/components/tree.js +2 -2
  100. package/library/components/typeface.js +2 -2
  101. package/library/components/types.js +31066 -29848
  102. package/library/components/video.js +554 -545
  103. package/library/package.json +1 -1
  104. package/library/packages/atoms/src/components/image/image.d.ts +15 -1
  105. package/library/packages/atoms/src/components/input/input.d.ts +1 -2
  106. package/library/packages/atoms/src/components/video/video.d.ts +3 -1
  107. package/library/packages/events/src/cx-asset-format-picker-delete.d.ts +6 -0
  108. package/library/packages/events/src/cx-asset-format-picker-select.d.ts +8 -0
  109. package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
  110. package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
  111. package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
  112. package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
  113. package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
  114. package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
  115. package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
  116. package/library/packages/events/src/cx-timeline-data-resolved.d.ts +10 -0
  117. package/library/packages/events/src/cx-video-thumbnail-resolved.d.ts +8 -0
  118. package/library/packages/events/src/events.d.ts +12 -1
  119. package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
  120. package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +56 -0
  121. package/library/packages/molecules/src/asset-format-picker/asset-format-picker.styles.d.ts +2 -0
  122. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +7 -0
  123. package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
  124. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
  125. package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +5 -1
  126. package/library/packages/molecules/src/index.d.ts +1 -0
  127. package/library/packages/molecules/src/timeline/timeline.d.ts +18 -0
  128. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +12 -0
  129. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
  130. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +102 -0
  131. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
  132. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
  133. package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
  134. package/library/packages/organisms/src/carousel/carousel.d.ts +3 -1
  135. package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
  136. package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +4 -0
  137. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
  138. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
  139. package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
  140. package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
  141. package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
  142. package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
  143. package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
  144. package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
  145. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
  146. package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +2 -2
  147. package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
  148. package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
  149. package/library/packages/organisms/src/content-builder/styleController.d.ts +26 -1
  150. package/library/packages/organisms/src/index.d.ts +2 -0
  151. package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
  152. package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
  153. package/library/packages/services/src/api/asset/asset.d.ts +2 -2
  154. package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
  155. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
  156. package/library/packages/tools/src/fetch-image/fetch-image.d.ts +19 -5
  157. package/library/packages/types/src/asset-click-action.d.ts +3 -1
  158. package/library/packages/types/src/asset-format-picker.d.ts +11 -0
  159. package/library/packages/types/src/bento-grid.d.ts +37 -0
  160. package/library/packages/types/src/content-builder.d.ts +37 -1
  161. package/library/packages/types/src/gallery.d.ts +0 -6
  162. package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
  163. package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
  164. package/library/packages/utils/src/index.d.ts +1 -0
  165. package/library/packages/utils/src/string/string.d.ts +1 -0
  166. package/library/packages/utils/src/transformation/index.d.ts +1 -0
  167. package/library/react-web-component.d.ts +236 -8
  168. package/library/utils.js +517 -192
  169. package/package.json +1 -1
  170. package/library/chunks/asset.Duzr3O3z.js +0 -370
  171. package/library/chunks/index.BgXEXk4m.js +0 -398
  172. package/library/chunks/toast.Bc4wpYJ1.js +0 -150
  173. /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
@@ -1,30 +1,32 @@
1
- import { x as B, i as he, E as Le } from "./lit-element.jLBm65_O.js";
1
+ import { x as A, i as he, E as ue } from "./lit-element.jLBm65_O.js";
2
2
  import { C as He, n as d } from "./lib-cortex-element.CVMmyPMC.js";
3
- import { r as H } from "./state.CSDxrqLd.js";
3
+ import { r as L } from "./state.CSDxrqLd.js";
4
4
  import { e as K } from "./query.BBf1UFkC.js";
5
5
  import { E as De, b as ce, a as $e } from "./index.Cpamj0jB.js";
6
- import { c as We } from "./component.styles.CRO4Odto.js";
7
- import { c as Ae } from "./custom-element.L4WJXn1j.js";
6
+ import { c as Te } from "./component.styles.CRO4Odto.js";
7
+ import { c as We } from "./custom-element.L4WJXn1j.js";
8
8
  import { d as Oe } from "./debounce.DaHuiSGU.js";
9
- import { L as Be } from "./i18n.W6czbRms.js";
9
+ import { L as Ae } from "./i18n.BABe9hN4.js";
10
10
  import { w as X } from "./watch.BCJD77bD.js";
11
11
  import { e as j } from "./class-map.BiVq-cVR.js";
12
- import { o as Me } from "./if-defined.BRoBj_Rp.js";
13
- import { o as Te } from "./style-map.llVFPd__.js";
14
- import { n as F } from "./when.Dr1es41R.js";
15
- import je from "../components/icon.js";
16
- import Ne from "../components/popup.js";
17
- import Ze from "../components/resize-observer.js";
18
- import Ie from "../components/skeleton.js";
19
- import Ve from "../components/space.js";
20
- var Pe = /* @__PURE__ */ ((t) => (t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.BottomLeft = "bottom-left", t.BottomRight = "bottom-right", t.CenterCenter = "center-center", t.CenterLeft = "center-left", t.CenterRight = "center-right", t.Left = "left", t.Right = "right", t.Top = "top", t.TopCenter = "top-center", t.TopLeft = "top-left", t.TopRight = "top-right", t))(Pe || {}), q = /* @__PURE__ */ ((t) => (t.Jump = "jump", t.None = "none", t.TextReveal = "text-reveal", t.Zoom = "zoom", t))(q || {}), ue = /* @__PURE__ */ ((t) => (t.PopOut = "pop-out", t.WithinBorders = "within-borders", t))(ue || {}), pe = /* @__PURE__ */ ((t) => (t.Fade = "fade", t.Slide = "slide", t))(pe || {}), se = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Fixed = "fixed", t))(se || {}), A = /* @__PURE__ */ ((t) => (t.Both = "both", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(A || {}), Fe = Object.defineProperty, E = (t, e, o, h) => {
21
- for (var r = void 0, m = t.length - 1, u; m >= 0; m--)
22
- (u = t[m]) && (r = u(e, o, r) || r);
23
- return r && Fe(e, o, r), r;
12
+ import { o as Be } from "./if-defined.BRoBj_Rp.js";
13
+ import { e as Me, i as je } from "./directive.oAbCiebi.js";
14
+ import { m as Ie } from "./directive-helpers.Dm4rc594.js";
15
+ import { o as _e } from "./style-map.llVFPd__.js";
16
+ import { n as P } from "./when.Dr1es41R.js";
17
+ import Ne from "../components/icon.js";
18
+ import Ze from "../components/popup.js";
19
+ import Ve from "../components/resize-observer.js";
20
+ import Pe from "../components/skeleton.js";
21
+ import Fe from "../components/space.js";
22
+ var Ue = /* @__PURE__ */ ((e) => (e.Bottom = "bottom", e.BottomCenter = "bottom-center", e.BottomLeft = "bottom-left", e.BottomRight = "bottom-right", e.CenterCenter = "center-center", e.CenterLeft = "center-left", e.CenterRight = "center-right", e.Left = "left", e.Right = "right", e.Top = "top", e.TopCenter = "top-center", e.TopLeft = "top-left", e.TopRight = "top-right", e))(Ue || {}), q = /* @__PURE__ */ ((e) => (e.Jump = "jump", e.None = "none", e.TextReveal = "text-reveal", e.Zoom = "zoom", e))(q || {}), pe = /* @__PURE__ */ ((e) => (e.PopOut = "pop-out", e.WithinBorders = "within-borders", e))(pe || {}), fe = /* @__PURE__ */ ((e) => (e.Fade = "fade", e.Slide = "slide", e))(fe || {}), se = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.Fixed = "fixed", e))(se || {}), W = /* @__PURE__ */ ((e) => (e.Both = "both", e.Horizontal = "horizontal", e.Vertical = "vertical", e))(W || {}), Ye = Object.defineProperty, C = (e, t, r, h) => {
23
+ for (var o = void 0, g = e.length - 1, u; g >= 0; g--)
24
+ (u = e[g]) && (o = u(t, r, o) || o);
25
+ return o && Ye(t, r, o), o;
24
26
  };
25
- class R extends He {
27
+ class S extends He {
26
28
  constructor() {
27
- super(...arguments), this.hasEvent = !1, this.easing = De.Linear, this.highlightBorder = !1, this.highlightColorOverlay = !1, this.highlightDropShadow = !1, this.highlightBackground = !1, this.highlightOpacity = !1, this.effect = q.None, this.textRevealStyle = pe.Slide, this.zoomStyle = ue.WithinBorders, this.hasSlotContent = !1, this.isCustomSlot = !1, this.isHovering = !1;
29
+ super(...arguments), this.hasEvent = !1, this.easing = De.Linear, this.highlightBorder = !1, this.highlightColorOverlay = !1, this.highlightDropShadow = !1, this.highlightBackground = !1, this.highlightOpacity = !1, this.effect = q.None, this.textRevealStyle = fe.Slide, this.zoomStyle = pe.WithinBorders, this.hasSlotContent = !1, this.isCustomSlot = !1, this.isHovering = !1;
28
30
  }
29
31
  get easeCSSVariable() {
30
32
  return ce[this.easing] || ce.linear;
@@ -46,100 +48,100 @@ class R extends He {
46
48
  */
47
49
  handleSlotChange() {
48
50
  if (this.slotEl) {
49
- const e = this.slotEl.assignedElements({ flatten: !0 });
50
- this.hasSlotContent = e.length > 0, this.isCustomSlot = !e.some(
51
- (o) => o.hasAttribute("data-item-id")
51
+ const t = this.slotEl.assignedElements({ flatten: !0 });
52
+ this.hasSlotContent = t.length > 0, this.isCustomSlot = !t.some(
53
+ (r) => r.hasAttribute("data-item-id")
52
54
  );
53
55
  } else
54
56
  this.hasSlotContent = this.childElementCount > 0, this.isCustomSlot = !0;
55
57
  }
56
58
  }
57
- E([
59
+ C([
58
60
  K("slot")
59
- ], R.prototype, "slotEl");
60
- E([
61
+ ], S.prototype, "slotEl");
62
+ C([
61
63
  d({ attribute: "has-event", reflect: !0, type: Boolean })
62
- ], R.prototype, "hasEvent");
63
- E([
64
+ ], S.prototype, "hasEvent");
65
+ C([
64
66
  d({ reflect: !0, type: String })
65
- ], R.prototype, "easing");
66
- E([
67
+ ], S.prototype, "easing");
68
+ C([
67
69
  d({ attribute: "highlight-border", reflect: !0, type: Boolean })
68
- ], R.prototype, "highlightBorder");
69
- E([
70
+ ], S.prototype, "highlightBorder");
71
+ C([
70
72
  d({
71
73
  attribute: "highlight-color-overlay",
72
74
  reflect: !0,
73
75
  type: Boolean
74
76
  })
75
- ], R.prototype, "highlightColorOverlay");
76
- E([
77
+ ], S.prototype, "highlightColorOverlay");
78
+ C([
77
79
  d({
78
80
  attribute: "highlight-drop-shadow",
79
81
  reflect: !0,
80
82
  type: Boolean
81
83
  })
82
- ], R.prototype, "highlightDropShadow");
83
- E([
84
+ ], S.prototype, "highlightDropShadow");
85
+ C([
84
86
  d({ attribute: "highlight-background", reflect: !0, type: Boolean })
85
- ], R.prototype, "highlightBackground");
86
- E([
87
+ ], S.prototype, "highlightBackground");
88
+ C([
87
89
  d({ attribute: "highlight-opacity", reflect: !0, type: Boolean })
88
- ], R.prototype, "highlightOpacity");
89
- E([
90
+ ], S.prototype, "highlightOpacity");
91
+ C([
90
92
  d({ attribute: "effect", reflect: !0, type: String })
91
- ], R.prototype, "effect");
92
- E([
93
+ ], S.prototype, "effect");
94
+ C([
93
95
  d({
94
96
  attribute: "text-reveal-style",
95
97
  reflect: !0,
96
98
  type: String
97
99
  })
98
- ], R.prototype, "textRevealStyle");
99
- E([
100
+ ], S.prototype, "textRevealStyle");
101
+ C([
100
102
  d({
101
103
  attribute: "zoom-style",
102
104
  reflect: !0,
103
105
  type: String
104
106
  })
105
- ], R.prototype, "zoomStyle");
106
- E([
107
- H()
108
- ], R.prototype, "hasSlotContent");
109
- E([
110
- H()
111
- ], R.prototype, "isCustomSlot");
112
- E([
113
- H()
114
- ], R.prototype, "isHovering");
115
- var _e = Object.defineProperty, O = (t, e, o, h) => {
116
- for (var r = void 0, m = t.length - 1, u; m >= 0; m--)
117
- (u = t[m]) && (r = u(e, o, r) || r);
118
- return r && _e(e, o, r), r;
107
+ ], S.prototype, "zoomStyle");
108
+ C([
109
+ L()
110
+ ], S.prototype, "hasSlotContent");
111
+ C([
112
+ L()
113
+ ], S.prototype, "isCustomSlot");
114
+ C([
115
+ L()
116
+ ], S.prototype, "isHovering");
117
+ var qe = Object.defineProperty, O = (e, t, r, h) => {
118
+ for (var o = void 0, g = e.length - 1, u; g >= 0; g--)
119
+ (u = e[g]) && (o = u(t, r, o) || o);
120
+ return o && qe(t, r, o), o;
119
121
  };
120
- class D extends R {
122
+ class D extends S {
121
123
  constructor() {
122
- super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode = se.Fixed, this.resizeDirection = A.Both, this.noLimit = !1, this.parentContainer = null, this.isResizeActive = !1, this.isResizing = !1, this.resizeSize = {
124
+ super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode = se.Fixed, this.resizeDirection = W.Both, this.noLimit = !1, this.parentContainer = null, this.isResizeActive = !1, this.isResizing = !1, this.resizeSize = {
123
125
  height: 0,
124
126
  width: 0
125
127
  }, this.maxWidth = 0, this.maxHeight = 0, this.minWidth = 0, this.minHeight = 0, this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
126
128
  }
127
129
  get ratio() {
128
- const e = this.clientWidth || 0, o = this.clientHeight || 0;
129
- return !e || !o ? 1 : e / o;
130
+ const t = this.clientWidth || 0, r = this.clientHeight || 0;
131
+ return !t || !r ? 1 : t / r;
130
132
  }
131
133
  get keepRatio() {
132
134
  return this.heightMode === se.Auto;
133
135
  }
134
136
  get canResizeHorizontal() {
135
- return this.resizeDirection !== A.Vertical;
137
+ return this.resizeDirection !== W.Vertical;
136
138
  }
137
139
  get canResizeVertical() {
138
- return this.resizeDirection !== A.Horizontal;
140
+ return this.resizeDirection !== W.Horizontal;
139
141
  }
140
- handleDocumentMouseDown(e) {
141
- const o = e.composedPath();
142
- this.containingElement && !o.includes(this.containingElement) && this.stopResizing();
142
+ handleDocumentMouseDown(t) {
143
+ const r = t.composedPath();
144
+ this.containingElement && !r.includes(this.containingElement) && this.stopResizing();
143
145
  }
144
146
  startResizing() {
145
147
  !this.resizable || this.isResizeActive || (this.isResizeActive = !0, this.ownerDocument.addEventListener(
@@ -153,54 +155,54 @@ class D extends R {
153
155
  this.handleDocumentMouseDown
154
156
  );
155
157
  }
156
- handleResizeDragging(e, o = !1, h = !1) {
157
- e.preventDefault(), e.stopPropagation(), this.maxWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--max-width")) || this.parentContainer?.clientWidth || this.parentElement?.clientWidth || 1 / 0, this.maxHeight = Number.parseInt(
158
+ handleResizeDragging(t, r = !1, h = !1) {
159
+ t.preventDefault(), t.stopPropagation(), this.maxWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--max-width")) || this.parentContainer?.clientWidth || this.parentElement?.clientWidth || 1 / 0, this.maxHeight = Number.parseInt(
158
160
  getComputedStyle(this).getPropertyValue("--max-height")
159
161
  ) || 1 / 0, this.minWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--min-width")) || 40, this.minHeight = Number.parseInt(
160
162
  getComputedStyle(this).getPropertyValue("--min-height")
161
163
  ) || 40, this.isResizing = !0;
162
- const r = { x: e.pageX, y: e.pageY };
163
- let m = 0, u = 0;
164
+ const o = { x: t.pageX, y: t.pageY };
165
+ let g = 0, u = 0;
164
166
  const x = {
165
167
  height: this.containingElement?.clientHeight || 0,
166
168
  width: this.containingElement?.clientWidth || 0
167
169
  };
168
170
  if (!this.noLimit && this.parentElement) {
169
- const $ = getComputedStyle(this.parentElement), p = $.getPropertyValue("padding-left").trim() || "0px", v = $.getPropertyValue("padding-right").trim() || "0px", M = Number(p.replace("px", "")), y = Number(v.replace("px", "")), L = getComputedStyle(this.parentElement).getPropertyValue("--padding").trim() || "0px", C = Number(L.replace("px", "")), ie = Math.max(
170
- M + y,
171
- C * 2
171
+ const $ = getComputedStyle(this.parentElement), p = $.getPropertyValue("padding-left").trim() || "0px", v = $.getPropertyValue("padding-right").trim() || "0px", B = Number(p.replace("px", "")), y = Number(v.replace("px", "")), H = getComputedStyle(this.parentElement).getPropertyValue("--padding").trim() || "0px", E = Number(H.replace("px", "")), ie = Math.max(
172
+ B + y,
173
+ E * 2
172
174
  );
173
175
  this.maxWidth = Math.max(this.maxWidth - ie, 0);
174
176
  }
175
177
  this.emit("cx-resize-start", {
176
178
  detail: {
177
179
  element: this,
178
- event: e
180
+ event: t
179
181
  }
180
182
  });
181
- const Z = ($) => {
182
- m = Number(x.width) + (o ? r.x - $.pageX : $.pageX - r.x), u = Number(x.height) + (h ? r.y - $.pageY : $.pageY - r.y), this.canResizeHorizontal || (m = Number(x.width)), this.canResizeVertical || (u = Number(x.height)), this.resizeDirection === A.Both && this.keepRatio && (u >= m / this.ratio && (u = m / this.ratio), m >= u * this.ratio && (m = u * this.ratio));
183
- let p = m, v = u;
184
- if (this.resizeDirection === A.Both && this.keepRatio) {
185
- const M = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
186
- let L = Math.min(p, M), C = L / this.ratio;
187
- C > y && (C = y, L = C * this.ratio), p = L, v = C;
183
+ const _ = ($) => {
184
+ g = Number(x.width) + (r ? o.x - $.pageX : $.pageX - o.x), u = Number(x.height) + (h ? o.y - $.pageY : $.pageY - o.y), this.canResizeHorizontal || (g = Number(x.width)), this.canResizeVertical || (u = Number(x.height)), this.resizeDirection === W.Both && this.keepRatio && (u >= g / this.ratio && (u = g / this.ratio), g >= u * this.ratio && (g = u * this.ratio));
185
+ let p = g, v = u;
186
+ if (this.resizeDirection === W.Both && this.keepRatio) {
187
+ const B = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
188
+ let H = Math.min(p, B), E = H / this.ratio;
189
+ E > y && (E = y, H = E * this.ratio), p = H, v = E;
188
190
  } else
189
191
  p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
190
192
  this.resizeSize = {
191
193
  height: Math.round(v),
192
194
  width: Math.round(p)
193
- }, this.resizeDirection === A.Both && this.keepRatio ? (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight, this.resizeSize.width = Math.round(this.minHeight * this.ratio)), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth, this.resizeSize.height = Math.round(this.minWidth / this.ratio))) : (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth));
194
- }, I = ($) => {
195
- if (m > 0 && u > 0) {
196
- let p = m, v = u;
197
- if (this.canResizeHorizontal || (p = Number(x.width)), this.canResizeVertical || (v = Number(x.height)), this.resizeDirection === A.Both && this.keepRatio) {
198
- const M = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
199
- let L = Math.min(p, M), C = L / this.ratio;
200
- C > y && (C = y, L = C * this.ratio), p = L, v = C;
195
+ }, this.resizeDirection === W.Both && this.keepRatio ? (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight, this.resizeSize.width = Math.round(this.minHeight * this.ratio)), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth, this.resizeSize.height = Math.round(this.minWidth / this.ratio))) : (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth));
196
+ }, N = ($) => {
197
+ if (g > 0 && u > 0) {
198
+ let p = g, v = u;
199
+ if (this.canResizeHorizontal || (p = Number(x.width)), this.canResizeVertical || (v = Number(x.height)), this.resizeDirection === W.Both && this.keepRatio) {
200
+ const B = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
201
+ let H = Math.min(p, B), E = H / this.ratio;
202
+ E > y && (E = y, H = E * this.ratio), p = H, v = E;
201
203
  } else
202
204
  p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
203
- this.resizeDirection === A.Both && this.keepRatio ? (this.minHeight && v < this.minHeight && (v = this.minHeight, p = Math.round(this.minHeight * this.ratio)), this.minWidth && p < this.minWidth && (p = this.minWidth, v = Math.round(this.minWidth / this.ratio))) : (this.minHeight && v < this.minHeight && (v = this.minHeight), this.minWidth && p < this.minWidth && (p = this.minWidth)), this.width = `${Math.round(p)}px`, this.height = `${Math.round(v)}px`, this.resizeSize = {
205
+ this.resizeDirection === W.Both && this.keepRatio ? (this.minHeight && v < this.minHeight && (v = this.minHeight, p = Math.round(this.minHeight * this.ratio)), this.minWidth && p < this.minWidth && (p = this.minWidth, v = Math.round(this.minWidth / this.ratio))) : (this.minHeight && v < this.minHeight && (v = this.minHeight), this.minWidth && p < this.minWidth && (p = this.minWidth)), this.width = `${Math.round(p)}px`, this.height = `${Math.round(v)}px`, this.resizeSize = {
204
206
  height: 0,
205
207
  width: 0
206
208
  }, this.isResizing = !1;
@@ -212,42 +214,42 @@ class D extends R {
212
214
  }
213
215
  }), this.ownerDocument.defaultView?.removeEventListener(
214
216
  "mousemove",
215
- Z
217
+ _
216
218
  );
217
219
  };
218
220
  this.ownerDocument.defaultView?.addEventListener(
219
221
  "mousemove",
220
- Z
221
- ), this.ownerDocument.defaultView?.addEventListener("mouseup", I, {
222
+ _
223
+ ), this.ownerDocument.defaultView?.addEventListener("mouseup", N, {
222
224
  once: !0
223
225
  });
224
226
  }
225
- handleResizeDraggingTopLeft(e) {
226
- this.handleResizeDragging(e, !0, !0);
227
+ handleResizeDraggingTopLeft(t) {
228
+ this.handleResizeDragging(t, !0, !0);
227
229
  }
228
- handleResizeDraggingTopRight(e) {
229
- this.handleResizeDragging(e, !1, !0);
230
+ handleResizeDraggingTopRight(t) {
231
+ this.handleResizeDragging(t, !1, !0);
230
232
  }
231
- handleResizeDraggingBottomLeft(e) {
232
- this.handleResizeDragging(e, !0, !1);
233
+ handleResizeDraggingBottomLeft(t) {
234
+ this.handleResizeDragging(t, !0, !1);
233
235
  }
234
- handleResizeDraggingBottomRight(e) {
235
- this.handleResizeDragging(e, !1, !1);
236
+ handleResizeDraggingBottomRight(t) {
237
+ this.handleResizeDragging(t, !1, !1);
236
238
  }
237
- handleResizeDraggingLeft(e) {
238
- this.handleResizeDragging(e, !0, !1);
239
+ handleResizeDraggingLeft(t) {
240
+ this.handleResizeDragging(t, !0, !1);
239
241
  }
240
- handleResizeDraggingRight(e) {
241
- this.handleResizeDragging(e, !1, !1);
242
+ handleResizeDraggingRight(t) {
243
+ this.handleResizeDragging(t, !1, !1);
242
244
  }
243
- handleResizeDraggingTop(e) {
244
- this.handleResizeDragging(e, !1, !0);
245
+ handleResizeDraggingTop(t) {
246
+ this.handleResizeDragging(t, !1, !0);
245
247
  }
246
- handleResizeDraggingBottom(e) {
247
- this.handleResizeDragging(e, !1, !1);
248
+ handleResizeDraggingBottom(t) {
249
+ this.handleResizeDragging(t, !1, !1);
248
250
  }
249
251
  renderResizer() {
250
- return this.resizeDirection === A.Horizontal ? B`<div class="resizer resizer--left" @mousedown=${this.handleResizeDraggingLeft}></div><div class="resizer resizer--right" @mousedown=${this.handleResizeDraggingRight}></div>` : this.resizeDirection === A.Vertical ? B`<div class="resizer resizer--top" @mousedown=${this.handleResizeDraggingTop}></div><div class="resizer resizer--bottom" @mousedown=${this.handleResizeDraggingBottom}></div>` : B`<div class="resizer resizer--top-left" @mousedown=${this.handleResizeDraggingTopLeft}></div><div class="resizer resizer--top-right" @mousedown=${this.handleResizeDraggingTopRight}></div><div class="resizer resizer--bottom-left" @mousedown=${this.handleResizeDraggingBottomLeft}></div><div class="resizer resizer--bottom-right" @mousedown=${this.handleResizeDraggingBottomRight}></div>`;
252
+ return this.resizeDirection === W.Horizontal ? A`<div class="resizer resizer--left" @mousedown=${this.handleResizeDraggingLeft}></div><div class="resizer resizer--right" @mousedown=${this.handleResizeDraggingRight}></div>` : this.resizeDirection === W.Vertical ? A`<div class="resizer resizer--top" @mousedown=${this.handleResizeDraggingTop}></div><div class="resizer resizer--bottom" @mousedown=${this.handleResizeDraggingBottom}></div>` : A`<div class="resizer resizer--top-left" @mousedown=${this.handleResizeDraggingTopLeft}></div><div class="resizer resizer--top-right" @mousedown=${this.handleResizeDraggingTopRight}></div><div class="resizer resizer--bottom-left" @mousedown=${this.handleResizeDraggingBottomLeft}></div><div class="resizer resizer--bottom-right" @mousedown=${this.handleResizeDraggingBottomRight}></div>`;
251
253
  }
252
254
  }
253
255
  O([
@@ -275,116 +277,132 @@ O([
275
277
  d({ attribute: !1, type: Object })
276
278
  ], D.prototype, "parentContainer");
277
279
  O([
278
- H()
280
+ L()
279
281
  ], D.prototype, "isResizeActive");
280
282
  O([
281
- H()
283
+ L()
282
284
  ], D.prototype, "isResizing");
283
285
  O([
284
- H()
286
+ L()
285
287
  ], D.prototype, "resizeSize");
286
- const Ue = he`.resizer{background-color:var(--cx-color-primary);z-index:100;width:8px;height:8px;position:absolute}.resizer--top-left{top:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:nw-resize}.resizer--top-right{top:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:ne-resize}.resizer--bottom-left{bottom:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:sw-resize}.resizer--bottom-right{bottom:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:se-resize}.resizer--left{cursor:ew-resize;top:50%;left:0;transform:translateY(-50%)}.resizer--right{cursor:ew-resize;top:50%;right:0;transform:translateY(-50%)}.resizer--top{cursor:ns-resize;top:0;left:50%;transform:translate(-50%)}.resizer--bottom{cursor:ns-resize;bottom:0;left:50%;transform:translate(-50%)}`;
287
- var Y = /* @__PURE__ */ ((t) => (t.Automatic = "automatic", t.Manual = "manual", t))(Y || {});
288
+ const Xe = he`.resizer{background-color:var(--cx-color-primary);z-index:100;width:8px;height:8px;position:absolute}.resizer--top-left{top:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:nw-resize}.resizer--top-right{top:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:ne-resize}.resizer--bottom-left{bottom:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:sw-resize}.resizer--bottom-right{bottom:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:se-resize}.resizer--left{cursor:ew-resize;top:50%;left:0;transform:translateY(-50%)}.resizer--right{cursor:ew-resize;top:50%;right:0;transform:translateY(-50%)}.resizer--top{cursor:ns-resize;top:0;left:50%;transform:translate(-50%)}.resizer--bottom{cursor:ns-resize;bottom:0;left:50%;transform:translate(-50%)}`;
289
+ var Y = /* @__PURE__ */ ((e) => (e.Automatic = "automatic", e.Manual = "manual", e))(Y || {});
290
+ /**
291
+ * @license
292
+ * Copyright 2021 Google LLC
293
+ * SPDX-License-Identifier: BSD-3-Clause
294
+ */
295
+ const Ke = Me(class extends je {
296
+ constructor() {
297
+ super(...arguments), this.key = ue;
298
+ }
299
+ render(e, t) {
300
+ return this.key = e, t;
301
+ }
302
+ update(e, [t, r]) {
303
+ return t !== this.key && (Ie(e), this.key = t), r;
304
+ }
305
+ });
288
306
  /*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
289
- var N = Object.assign || function(t) {
290
- for (var e = 1; e < arguments.length; e++) {
291
- var o = arguments[e];
292
- for (var h in o)
293
- Object.prototype.hasOwnProperty.call(o, h) && (t[h] = o[h]);
294
- }
295
- return t;
296
- }, ee = function(e) {
297
- return e.tagName === "IMG";
298
- }, Ye = function(e) {
299
- return NodeList.prototype.isPrototypeOf(e);
300
- }, te = function(e) {
301
- return e && e.nodeType === 1;
302
- }, me = function(e) {
303
- var o = e.currentSrc || e.src;
304
- return o.substr(-4).toLowerCase() === ".svg";
305
- }, ge = function(e) {
307
+ var I = Object.assign || function(e) {
308
+ for (var t = 1; t < arguments.length; t++) {
309
+ var r = arguments[t];
310
+ for (var h in r)
311
+ Object.prototype.hasOwnProperty.call(r, h) && (e[h] = r[h]);
312
+ }
313
+ return e;
314
+ }, ee = function(t) {
315
+ return t.tagName === "IMG";
316
+ }, Je = function(t) {
317
+ return NodeList.prototype.isPrototypeOf(t);
318
+ }, te = function(t) {
319
+ return t && t.nodeType === 1;
320
+ }, me = function(t) {
321
+ var r = t.currentSrc || t.src;
322
+ return r.substr(-4).toLowerCase() === ".svg";
323
+ }, ge = function(t) {
306
324
  try {
307
- return Array.isArray(e) ? e.filter(ee) : Ye(e) ? [].slice.call(e).filter(ee) : te(e) ? [e].filter(ee) : typeof e == "string" ? [].slice.call(document.querySelectorAll(e)).filter(ee) : [];
325
+ return Array.isArray(t) ? t.filter(ee) : Je(t) ? [].slice.call(t).filter(ee) : te(t) ? [t].filter(ee) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(ee) : [];
308
326
  } catch {
309
327
  throw new TypeError(`The provided selector is invalid.
310
328
  Expects a CSS selector, a Node element, a NodeList or an array.
311
329
  See: https://github.com/francoischalifour/medium-zoom`);
312
330
  }
313
- }, qe = function(e) {
314
- var o = document.createElement("div");
315
- return o.classList.add("medium-zoom-overlay"), o.style.background = e, o;
316
- }, Xe = function(e) {
317
- var o = e.getBoundingClientRect(), h = o.top, r = o.left, m = o.width, u = o.height, x = e.cloneNode(), Z = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, I = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
318
- return x.removeAttribute("id"), x.style.position = "absolute", x.style.top = h + Z + "px", x.style.left = r + I + "px", x.style.width = m + "px", x.style.height = u + "px", x.style.transform = "", x;
319
- }, _ = function(e, o) {
320
- var h = N({
331
+ }, Ge = function(t) {
332
+ var r = document.createElement("div");
333
+ return r.classList.add("medium-zoom-overlay"), r.style.background = t, r;
334
+ }, Qe = function(t) {
335
+ var r = t.getBoundingClientRect(), h = r.top, o = r.left, g = r.width, u = r.height, x = t.cloneNode(), _ = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, N = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
336
+ return x.removeAttribute("id"), x.style.position = "absolute", x.style.top = h + _ + "px", x.style.left = o + N + "px", x.style.width = g + "px", x.style.height = u + "px", x.style.transform = "", x;
337
+ }, F = function(t, r) {
338
+ var h = I({
321
339
  bubbles: !1,
322
340
  cancelable: !1,
323
341
  detail: void 0
324
- }, o);
342
+ }, r);
325
343
  if (typeof window.CustomEvent == "function")
326
- return new CustomEvent(e, h);
327
- var r = document.createEvent("CustomEvent");
328
- return r.initCustomEvent(e, h.bubbles, h.cancelable, h.detail), r;
329
- }, Ke = function t(e) {
330
- var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(a) {
344
+ return new CustomEvent(t, h);
345
+ var o = document.createEvent("CustomEvent");
346
+ return o.initCustomEvent(t, h.bubbles, h.cancelable, h.detail), o;
347
+ }, et = function e(t) {
348
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(a) {
331
349
  function n() {
332
350
  }
333
351
  a(n, n);
334
- }, r = function(a) {
352
+ }, o = function(a) {
335
353
  var n = a.target;
336
354
  if (n === G) {
337
355
  y();
338
356
  return;
339
357
  }
340
- k.indexOf(n) !== -1 && L({ target: n });
341
- }, m = function() {
342
- if (!(V || !i.original)) {
358
+ k.indexOf(n) !== -1 && H({ target: n });
359
+ }, g = function() {
360
+ if (!(Z || !i.original)) {
343
361
  var a = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
344
- Math.abs(le - a) > c.scrollOffset && setTimeout(y, 150);
362
+ Math.abs(le - a) > m.scrollOffset && setTimeout(y, 150);
345
363
  }
346
364
  }, u = function(a) {
347
365
  var n = a.key || a.keyCode;
348
366
  (n === "Escape" || n === "Esc" || n === 27) && y();
349
367
  }, x = function() {
350
368
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a;
351
- if (a.background && (G.style.background = a.background), a.container && a.container instanceof Object && (n.container = N({}, c.container, a.container)), a.template) {
369
+ if (a.background && (G.style.background = a.background), a.container && a.container instanceof Object && (n.container = I({}, m.container, a.container)), a.template) {
352
370
  var f = te(a.template) ? a.template : document.querySelector(a.template);
353
371
  n.template = f;
354
372
  }
355
- return c = N({}, c, n), k.forEach(function(z) {
356
- z.dispatchEvent(_("medium-zoom:update", {
373
+ return m = I({}, m, n), k.forEach(function(z) {
374
+ z.dispatchEvent(F("medium-zoom:update", {
357
375
  detail: { zoom: b }
358
376
  }));
359
377
  }), b;
360
- }, Z = function() {
378
+ }, _ = function() {
361
379
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
362
- return t(N({}, c, a));
363
- }, I = function() {
380
+ return e(I({}, m, a));
381
+ }, N = function() {
364
382
  for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
365
383
  n[f] = arguments[f];
366
- var z = n.reduce(function(s, S) {
367
- return [].concat(s, ge(S));
384
+ var z = n.reduce(function(s, R) {
385
+ return [].concat(s, ge(R));
368
386
  }, []);
369
387
  return z.filter(function(s) {
370
388
  return k.indexOf(s) === -1;
371
389
  }).forEach(function(s) {
372
390
  k.push(s), s.classList.add("medium-zoom-image");
373
391
  }), J.forEach(function(s) {
374
- var S = s.type, W = s.listener, P = s.options;
375
- z.forEach(function(T) {
376
- T.addEventListener(S, W, P);
392
+ var R = s.type, T = s.listener, V = s.options;
393
+ z.forEach(function(M) {
394
+ M.addEventListener(R, T, V);
377
395
  });
378
396
  }), b;
379
397
  }, $ = function() {
380
398
  for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
381
399
  n[f] = arguments[f];
382
400
  i.zoomed && y();
383
- var z = n.length > 0 ? n.reduce(function(s, S) {
384
- return [].concat(s, ge(S));
401
+ var z = n.length > 0 ? n.reduce(function(s, R) {
402
+ return [].concat(s, ge(R));
385
403
  }, []) : k;
386
404
  return z.forEach(function(s) {
387
- s.classList.remove("medium-zoom-image"), s.dispatchEvent(_("medium-zoom:detach", {
405
+ s.classList.remove("medium-zoom-image"), s.dispatchEvent(F("medium-zoom:detach", {
388
406
  detail: { zoom: b }
389
407
  }));
390
408
  }), k = k.filter(function(s) {
@@ -402,7 +420,7 @@ See: https://github.com/francoischalifour/medium-zoom`);
402
420
  }), J = J.filter(function(z) {
403
421
  return !(z.type === "medium-zoom:" + a && z.listener.toString() === n.toString());
404
422
  }), b;
405
- }, M = function() {
423
+ }, B = function() {
406
424
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target, f = function() {
407
425
  var s = {
408
426
  width: document.documentElement.clientWidth,
@@ -411,21 +429,21 @@ See: https://github.com/francoischalifour/medium-zoom`);
411
429
  top: 0,
412
430
  right: 0,
413
431
  bottom: 0
414
- }, S = void 0, W = void 0;
415
- if (c.container)
416
- if (c.container instanceof Object)
417
- s = N({}, s, c.container), S = s.width - s.left - s.right - c.margin * 2, W = s.height - s.top - s.bottom - c.margin * 2;
432
+ }, R = void 0, T = void 0;
433
+ if (m.container)
434
+ if (m.container instanceof Object)
435
+ s = I({}, s, m.container), R = s.width - s.left - s.right - m.margin * 2, T = s.height - s.top - s.bottom - m.margin * 2;
418
436
  else {
419
- var P = te(c.container) ? c.container : document.querySelector(c.container), T = P.getBoundingClientRect(), oe = T.width, ve = T.height, ze = T.left, ye = T.top;
420
- s = N({}, s, {
421
- width: oe,
422
- height: ve,
423
- left: ze,
424
- top: ye
437
+ var V = te(m.container) ? m.container : document.querySelector(m.container), M = V.getBoundingClientRect(), re = M.width, ze = M.height, ye = M.left, be = M.top;
438
+ s = I({}, s, {
439
+ width: re,
440
+ height: ze,
441
+ left: ye,
442
+ top: be
425
443
  });
426
444
  }
427
- S = S || s.width - c.margin * 2, W = W || s.height - c.margin * 2;
428
- var U = i.zoomedHd || i.original, be = me(U) ? S : U.naturalWidth || S, xe = me(U) ? W : U.naturalHeight || W, Q = U.getBoundingClientRect(), we = Q.top, Se = Q.left, re = Q.width, ae = Q.height, Re = Math.min(Math.max(re, be), S) / re, Ee = Math.min(Math.max(ae, xe), W) / ae, ne = Math.min(Re, Ee), Ce = (-Se + (S - re) / 2 + c.margin + s.left) / ne, ke = (-we + (W - ae) / 2 + c.margin + s.top) / ne, de = "scale(" + ne + ") translate3d(" + Ce + "px, " + ke + "px, 0)";
445
+ R = R || s.width - m.margin * 2, T = T || s.height - m.margin * 2;
446
+ var U = i.zoomedHd || i.original, xe = me(U) ? R : U.naturalWidth || R, we = me(U) ? T : U.naturalHeight || T, Q = U.getBoundingClientRect(), Re = Q.top, Se = Q.left, oe = Q.width, ae = Q.height, Ce = Math.min(Math.max(oe, xe), R) / oe, Ee = Math.min(Math.max(ae, we), T) / ae, ne = Math.min(Ce, Ee), ke = (-Se + (R - oe) / 2 + m.margin + s.left) / ne, Le = (-Re + (T - ae) / 2 + m.margin + s.top) / ne, de = "scale(" + ne + ") translate3d(" + ke + "px, " + Le + "px, 0)";
429
447
  i.zoomed.style.transform = de, i.zoomedHd && (i.zoomedHd.style.transform = de);
430
448
  };
431
449
  return new h(function(z) {
@@ -433,8 +451,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
433
451
  z(b);
434
452
  return;
435
453
  }
436
- var s = function oe() {
437
- V = !1, i.zoomed.removeEventListener("transitionend", oe), i.original.dispatchEvent(_("medium-zoom:opened", {
454
+ var s = function re() {
455
+ Z = !1, i.zoomed.removeEventListener("transitionend", re), i.original.dispatchEvent(F("medium-zoom:opened", {
438
456
  detail: { zoom: b }
439
457
  })), z(b);
440
458
  };
@@ -445,102 +463,102 @@ See: https://github.com/francoischalifour/medium-zoom`);
445
463
  if (n)
446
464
  i.original = n;
447
465
  else if (k.length > 0) {
448
- var S = k;
449
- i.original = S[0];
466
+ var R = k;
467
+ i.original = R[0];
450
468
  } else {
451
469
  z(b);
452
470
  return;
453
471
  }
454
- if (i.original.dispatchEvent(_("medium-zoom:open", {
472
+ if (i.original.dispatchEvent(F("medium-zoom:open", {
455
473
  detail: { zoom: b }
456
- })), le = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, V = !0, i.zoomed = Xe(i.original), document.body.appendChild(G), c.template) {
457
- var W = te(c.template) ? c.template : document.querySelector(c.template);
458
- i.template = document.createElement("div"), i.template.appendChild(W.content.cloneNode(!0)), document.body.appendChild(i.template);
474
+ })), le = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, Z = !0, i.zoomed = Qe(i.original), document.body.appendChild(G), m.template) {
475
+ var T = te(m.template) ? m.template : document.querySelector(m.template);
476
+ i.template = document.createElement("div"), i.template.appendChild(T.content.cloneNode(!0)), document.body.appendChild(i.template);
459
477
  }
460
478
  if (i.original.parentElement && i.original.parentElement.tagName === "PICTURE" && i.original.currentSrc && (i.zoomed.src = i.original.currentSrc), document.body.appendChild(i.zoomed), window.requestAnimationFrame(function() {
461
479
  document.body.classList.add("medium-zoom--opened");
462
480
  }), i.original.classList.add("medium-zoom-image--hidden"), i.zoomed.classList.add("medium-zoom-image--opened"), i.zoomed.addEventListener("click", y), i.zoomed.addEventListener("transitionend", s), i.original.getAttribute("data-zoom-src")) {
463
481
  i.zoomedHd = i.zoomed.cloneNode(), i.zoomedHd.removeAttribute("srcset"), i.zoomedHd.removeAttribute("sizes"), i.zoomedHd.removeAttribute("loading"), i.zoomedHd.src = i.zoomed.getAttribute("data-zoom-src"), i.zoomedHd.onerror = function() {
464
- clearInterval(P), console.warn("Unable to reach the zoom image target " + i.zoomedHd.src), i.zoomedHd = null, f();
482
+ clearInterval(V), console.warn("Unable to reach the zoom image target " + i.zoomedHd.src), i.zoomedHd = null, f();
465
483
  };
466
- var P = setInterval(function() {
467
- i.zoomedHd.complete && (clearInterval(P), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f());
484
+ var V = setInterval(function() {
485
+ i.zoomedHd.complete && (clearInterval(V), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f());
468
486
  }, 10);
469
487
  } else if (i.original.hasAttribute("srcset")) {
470
488
  i.zoomedHd = i.zoomed.cloneNode(), i.zoomedHd.removeAttribute("sizes"), i.zoomedHd.removeAttribute("loading");
471
- var T = i.zoomedHd.addEventListener("load", function() {
472
- i.zoomedHd.removeEventListener("load", T), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f();
489
+ var M = i.zoomedHd.addEventListener("load", function() {
490
+ i.zoomedHd.removeEventListener("load", M), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f();
473
491
  });
474
492
  } else
475
493
  f();
476
494
  });
477
495
  }, y = function() {
478
496
  return new h(function(a) {
479
- if (V || !i.original) {
497
+ if (Z || !i.original) {
480
498
  a(b);
481
499
  return;
482
500
  }
483
501
  var n = function f() {
484
- i.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(i.zoomed), i.zoomedHd && document.body.removeChild(i.zoomedHd), document.body.removeChild(G), i.zoomed.classList.remove("medium-zoom-image--opened"), i.template && document.body.removeChild(i.template), V = !1, i.zoomed.removeEventListener("transitionend", f), i.original.dispatchEvent(_("medium-zoom:closed", {
502
+ i.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(i.zoomed), i.zoomedHd && document.body.removeChild(i.zoomedHd), document.body.removeChild(G), i.zoomed.classList.remove("medium-zoom-image--opened"), i.template && document.body.removeChild(i.template), Z = !1, i.zoomed.removeEventListener("transitionend", f), i.original.dispatchEvent(F("medium-zoom:closed", {
485
503
  detail: { zoom: b }
486
504
  })), i.original = null, i.zoomed = null, i.zoomedHd = null, i.template = null, a(b);
487
505
  };
488
- V = !0, document.body.classList.remove("medium-zoom--opened"), i.zoomed.style.transform = "", i.zoomedHd && (i.zoomedHd.style.transform = ""), i.template && (i.template.style.transition = "opacity 150ms", i.template.style.opacity = 0), i.original.dispatchEvent(_("medium-zoom:close", {
506
+ Z = !0, document.body.classList.remove("medium-zoom--opened"), i.zoomed.style.transform = "", i.zoomedHd && (i.zoomedHd.style.transform = ""), i.template && (i.template.style.transition = "opacity 150ms", i.template.style.opacity = 0), i.original.dispatchEvent(F("medium-zoom:close", {
489
507
  detail: { zoom: b }
490
508
  })), i.zoomed.addEventListener("transitionend", n);
491
509
  });
492
- }, L = function() {
510
+ }, H = function() {
493
511
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target;
494
- return i.original ? y() : M({ target: n });
495
- }, C = function() {
496
- return c;
512
+ return i.original ? y() : B({ target: n });
513
+ }, E = function() {
514
+ return m;
497
515
  }, ie = function() {
498
516
  return k;
499
- }, fe = function() {
517
+ }, ve = function() {
500
518
  return i.original;
501
- }, k = [], J = [], V = !1, le = 0, c = o, i = {
519
+ }, k = [], J = [], Z = !1, le = 0, m = r, i = {
502
520
  original: null,
503
521
  zoomed: null,
504
522
  zoomedHd: null,
505
523
  template: null
506
524
  // If the selector is omitted, it's replaced by the options
507
525
  };
508
- Object.prototype.toString.call(e) === "[object Object]" ? c = e : (e || typeof e == "string") && I(e), c = N({
526
+ Object.prototype.toString.call(t) === "[object Object]" ? m = t : (t || typeof t == "string") && N(t), m = I({
509
527
  margin: 0,
510
528
  background: "#fff",
511
529
  scrollOffset: 40,
512
530
  container: null,
513
531
  template: null
514
- }, c);
515
- var G = qe(c.background);
516
- document.addEventListener("click", r), document.addEventListener("keyup", u), document.addEventListener("scroll", m), window.addEventListener("resize", y);
532
+ }, m);
533
+ var G = Ge(m.background);
534
+ document.addEventListener("click", o), document.addEventListener("keyup", u), document.addEventListener("scroll", g), window.addEventListener("resize", y);
517
535
  var b = {
518
- open: M,
536
+ open: B,
519
537
  close: y,
520
- toggle: L,
538
+ toggle: H,
521
539
  update: x,
522
- clone: Z,
523
- attach: I,
540
+ clone: _,
541
+ attach: N,
524
542
  detach: $,
525
543
  on: p,
526
544
  off: v,
527
- getOptions: C,
545
+ getOptions: E,
528
546
  getImages: ie,
529
- getZoomedImage: fe
547
+ getZoomedImage: ve
530
548
  };
531
549
  return b;
532
550
  };
533
- function Je(t, e) {
534
- e === void 0 && (e = {});
535
- var o = e.insertAt;
551
+ function tt(e, t) {
552
+ t === void 0 && (t = {});
553
+ var r = t.insertAt;
536
554
  if (!(typeof document > "u")) {
537
- var h = document.head || document.getElementsByTagName("head")[0], r = document.createElement("style");
538
- r.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(r, h.firstChild) : h.appendChild(r), r.styleSheet ? r.styleSheet.cssText = t : r.appendChild(document.createTextNode(t));
555
+ var h = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style");
556
+ o.type = "text/css", r === "top" && h.firstChild ? h.insertBefore(o, h.firstChild) : h.appendChild(o), o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e));
539
557
  }
540
558
  }
541
- var Ge = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
542
- Je(Ge);
543
- const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .container,:host([effect=zoom]) .container{overflow:initial}:host([effect=jump]) .highlighter{transition:all var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=jump]) .highlighter:hover{transform:translateY(calc(var(--highlightable-item-effect-jump-distance,0) * -1))}.highlighter--effect-text-reveal,:host([effect=zoom]) .highlighter--zoom-style-within-borders{overflow:hidden}:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{z-index:3;animation:none}:host([effect=zoom][zoom-style=pop-out]) .highlighter:not(:hover){animation:drop-z var(--transition-transform-duration) forwards}@keyframes drop-z{0%{z-index:2}99%{z-index:2}to{z-index:0}}.highlighter--can-hover:hover:after,.highlighter--selected:after,.highlighter--color-overlay:after{content:"";pointer-events:none;width:100%;height:100%;transition:all var(--transition-duration,.5s) var(--easing,linear);position:absolute;top:0;left:0}.highlighter--can-hover:hover:after,.highlighter--selected:after{outline:2px solid var(--cx-color-primary)}.highlighter--border:hover .image{border-color:var(--highlightable-item-highlight-border-color,var(--cx-color-primary))}.highlighter--color-overlay:after{border-radius:var(--border-radius,none)}.highlighter--color-overlay:hover:after{background-color:var(--highlightable-item-highlight-color-overlay-color,transparent)}.highlighter--drop-shadow:hover .image{box-shadow:var(--highlightable-item-highlight-drop-shadow,none)}.highlighter--background:hover .highlightable-item{--content-background-color:var(--highlightable-item-highlight-background,transparent);--highlightable-item-background-color:var(--highlightable-item-highlight-background,transparent)}.highlighter--opacity{opacity:var(--highlightable-item-highlight-opacity,1)}:host([effect=zoom][zoom-style=within-borders]) .highlighter .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter{transition:transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=zoom][zoom-style=within-borders]) .highlighter:hover .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{transform:scale(var(--highlightable-item-effect-zoom-scale,1))}.highlightable-item{transition:background-color var(--transition-duration,.5s) var(--easing,linear), border-color var(--transition-duration,.5s) var(--easing,linear), box-shadow var(--transition-duration,.5s) var(--easing,linear), opacity var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear), visibility var(--transition-duration,.5s) var(--easing,linear)}`, et = he`
559
+ var it = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
560
+ tt(it);
561
+ const rt = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .container,:host([effect=zoom]) .container{overflow:initial}:host([effect=jump]) .highlighter{transition:all var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=jump]) .highlighter:hover{transform:translateY(calc(var(--highlightable-item-effect-jump-distance,0) * -1))}.highlighter--effect-text-reveal,:host([effect=zoom]) .highlighter--zoom-style-within-borders{overflow:hidden}:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{z-index:3;animation:none}:host([effect=zoom][zoom-style=pop-out]) .highlighter:not(:hover){animation:drop-z var(--transition-transform-duration) forwards}@keyframes drop-z{0%{z-index:2}99%{z-index:2}to{z-index:0}}.highlighter--can-hover:hover:after,.highlighter--selected:after,.highlighter--color-overlay:after{content:"";pointer-events:none;width:100%;height:100%;transition:all var(--transition-duration,.5s) var(--easing,linear);position:absolute;top:0;left:0}.highlighter--can-hover:hover:after,.highlighter--selected:after{outline:2px solid var(--cx-color-primary)}.highlighter--border:hover .image{border-color:var(--highlightable-item-highlight-border-color,var(--cx-color-primary))}.highlighter--color-overlay:after{border-radius:var(--border-radius,none)}.highlighter--color-overlay:hover:after{background-color:var(--highlightable-item-highlight-color-overlay-color,transparent)}.highlighter--drop-shadow:hover .image{box-shadow:var(--highlightable-item-highlight-drop-shadow,none)}.highlighter--background:hover .highlightable-item{--content-background-color:var(--highlightable-item-highlight-background,transparent);--highlightable-item-background-color:var(--highlightable-item-highlight-background,transparent)}.highlighter--opacity{opacity:var(--highlightable-item-highlight-opacity,1)}:host([effect=zoom][zoom-style=within-borders]) .highlighter .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter{transition:transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=zoom][zoom-style=within-borders]) .highlighter:hover .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{transform:scale(var(--highlightable-item-effect-zoom-scale,1))}.highlightable-item{transition:background-color var(--transition-duration,.5s) var(--easing,linear), border-color var(--transition-duration,.5s) var(--easing,linear), box-shadow var(--transition-duration,.5s) var(--easing,linear), opacity var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear), visibility var(--transition-duration,.5s) var(--easing,linear)}`, ot = he`
544
562
  :host {
545
563
  --justify-content: flex-start;
546
564
  --border-radius: 0px;
@@ -593,7 +611,7 @@ const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
593
611
  max-height: 100%;
594
612
  }
595
613
 
596
- ${Qe}
614
+ ${rt}
597
615
 
598
616
  :host([block]) {
599
617
  width: 100%;
@@ -786,14 +804,14 @@ const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
786
804
  --font-size: var(--cx-font-size-4x-large);
787
805
  }
788
806
  `;
789
- var tt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, g = (t, e, o, h) => {
790
- for (var r = h > 1 ? void 0 : h ? it(e, o) : e, m = t.length - 1, u; m >= 0; m--)
791
- (u = t[m]) && (r = (h ? u(e, o, r) : u(r)) || r);
792
- return h && r && tt(e, o, r), r;
807
+ var at = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, c = (e, t, r, h) => {
808
+ for (var o = h > 1 ? void 0 : h ? nt(t, r) : t, g = e.length - 1, u; g >= 0; g--)
809
+ (u = e[g]) && (o = (h ? u(t, r, o) : u(o)) || o);
810
+ return h && o && at(t, r, o), o;
793
811
  };
794
812
  let l = class extends D {
795
813
  constructor() {
796
- super(...arguments), this.localize = new Be(this), this.isLoaded = !1, this.isError = !1, this.src = "", this.placeholder = "", this.alt = "", this.objectFit = $e.Fill, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.clickHandlerType = Y.Automatic, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null;
814
+ super(...arguments), this.localize = new Ae(this), this._retryCount = 0, this._retryTimer = null, this.isLoaded = !1, this.isError = !1, this._retryIndex = 0, this.src = "", this.placeholder = "", this.alt = "", this.objectFit = $e.Fill, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.clickHandlerType = Y.Automatic, this.retryOnError = !1, this.maxRetries = 3, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null;
797
815
  }
798
816
  get currentAltValue() {
799
817
  return this.alt;
@@ -815,12 +833,12 @@ let l = class extends D {
815
833
  };
816
834
  }
817
835
  get imageClass() {
818
- let t = "landscape", e = this.ratio;
819
- const o = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : o, r = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
820
- return h && r && (e = h / r), e > this.imageRatio && (t = "portrait"), {
836
+ let e = "landscape", t = this.ratio;
837
+ const r = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : r, o = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
838
+ return h && o && (t = h / o), t > this.imageRatio && (e = "portrait"), {
821
839
  image: !0,
822
840
  [`image--${this.objectFit}`]: !0,
823
- [`image--${t}`]: !0,
841
+ [`image--${e}`]: !0,
824
842
  [`image--height-${this.heightMode}`]: !0,
825
843
  "image--can-zoom": this.canZoom,
826
844
  "image--has-action": this.hasZoomAction,
@@ -840,7 +858,7 @@ let l = class extends D {
840
858
  this.hasUpdated && this.requestUpdate("canZoom");
841
859
  }
842
860
  disconnectedCallback() {
843
- super.disconnectedCallback(), this.zoom && this.zoom.detach();
861
+ super.disconnectedCallback(), this.zoom && this.zoom.detach(), this.clearRetryTimer();
844
862
  }
845
863
  /**
846
864
  * Handle mouse enter event.
@@ -860,8 +878,8 @@ let l = class extends D {
860
878
  handleBlur() {
861
879
  this.isZoomed && this.zoom?.close();
862
880
  }
863
- handleKeyDown(t) {
864
- t.target === this.highlighterElement && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.highlighterElement.click());
881
+ handleKeyDown(e) {
882
+ e.target === this.highlighterElement && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.highlighterElement.click());
865
883
  }
866
884
  async handleCanZoomChange() {
867
885
  await this.updateComplete, this.hasZoomAction ? this.initZoom() : (this.zoom?.detach(), this.zoom = null);
@@ -870,10 +888,19 @@ let l = class extends D {
870
888
  await this.updateComplete, this.requestUpdate();
871
889
  }
872
890
  handleSrcChange() {
873
- this.isLoaded = !1, this.isError = !1;
891
+ this.isLoaded = !1, this.isError = !1, this._retryCount = 0, this._retryIndex = 0, this.clearRetryTimer();
892
+ }
893
+ clearRetryTimer() {
894
+ this._retryTimer !== null && (clearTimeout(this._retryTimer), this._retryTimer = null);
895
+ }
896
+ scheduleRetry() {
897
+ const e = Math.min(1e3 * Math.pow(2, this._retryCount - 1), 1e4);
898
+ this._retryTimer = setTimeout(() => {
899
+ this._retryTimer = null, this._retryIndex += 1;
900
+ }, e);
874
901
  }
875
902
  async initZoom() {
876
- this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = Ke(this.zoomImageElement, {
903
+ this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = et(this.zoomImageElement, {
877
904
  background: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8))",
878
905
  margin: 0,
879
906
  scrollOffset: 0
@@ -883,170 +910,186 @@ let l = class extends D {
883
910
  this.emit("cx-image-zoom-close"), this.isZoomed = !1;
884
911
  }));
885
912
  }
886
- handleLoad(t) {
887
- const e = t?.currentTarget ?? this.imageElement;
888
- if (!e)
913
+ handleLoad(e) {
914
+ const t = e?.currentTarget ?? this.imageElement;
915
+ if (!t)
889
916
  return;
890
- const { naturalHeight: o, naturalWidth: h } = e;
891
- this.imageRatio = h / o, this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0, this.isError = !1);
917
+ const { naturalHeight: r, naturalWidth: h } = t;
918
+ this.imageRatio = h / r, this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0, this.isError = !1);
892
919
  }
893
920
  handleError() {
921
+ if (this.retryOnError && this._retryCount < this.maxRetries) {
922
+ this._retryCount += 1, this.scheduleRetry();
923
+ return;
924
+ }
894
925
  this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
895
926
  }
896
927
  handleSizeChange() {
897
- const t = this.isResizing ? `${this.resizeSize.width}px` : this.width, e = this.isResizing ? `${this.resizeSize.height}px` : this.height;
898
- this.width || this.isResizing ? this.style.setProperty("--width", t) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", e) : this.style.removeProperty("--height");
928
+ const e = this.isResizing ? `${this.resizeSize.width}px` : this.width, t = this.isResizing ? `${this.resizeSize.height}px` : this.height;
929
+ this.width || this.isResizing ? this.style.setProperty("--width", e) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", t) : this.style.removeProperty("--height");
899
930
  }
900
- handleResize(t) {
901
- const { entries: e } = t.detail;
902
- for (const o of e)
903
- o.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(o.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(o.contentRect.width);
931
+ handleResize(e) {
932
+ const { entries: t } = e.detail;
933
+ for (const r of t)
934
+ r.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(r.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(r.contentRect.width);
904
935
  }
905
- updateLastPatchedWidth(t) {
906
- this.lastPatchedWidth = t, this.requestUpdate();
936
+ updateLastPatchedWidth(e) {
937
+ this.lastPatchedWidth = e, this.requestUpdate();
907
938
  }
908
939
  /**
909
940
  * Support CMS5 click action for the image.
910
941
  */
911
- handleClickAction(t) {
912
- !(t.target instanceof HTMLElement) || this.clickHandlerType === Y.Manual || this.canZoom && this.openZoom();
942
+ handleClickAction(e) {
943
+ !(e.target instanceof HTMLElement) || this.clickHandlerType === Y.Manual || this.canZoom && this.openZoom();
913
944
  }
914
- updated(t) {
915
- super.updated(t), (t.has("width") || t.has("height") || t.has("resizeSize")) && this.handleSizeChange();
945
+ updated(e) {
946
+ super.updated(e), (e.has("width") || e.has("height") || e.has("resizeSize")) && this.handleSizeChange();
916
947
  }
917
948
  openZoom() {
918
949
  this.zoom && this.zoom.open();
919
950
  }
920
951
  renderContent() {
921
- const t = this.currentSrc, e = this.currentAltValue;
922
- return B`<div part="content" slot="anchor" class=${j(this.highlighterClass)}><img part="image" class=${j(this.imageClass)} src=${t || this.placeholder} alt=${e} aria-label=${e} crossorigin="anonymous" @load=${this.handleLoad} @error=${this.handleError} loading=${this.htmlLoading}></div>`;
952
+ const e = this.currentSrc, t = this.currentAltValue;
953
+ return A`<div part="content" slot="anchor" class=${j(this.highlighterClass)}>${Ke(
954
+ this._retryIndex,
955
+ A`<img part="image" class=${j(this.imageClass)} src=${e || this.placeholder} alt=${t} aria-label=${t} crossorigin="anonymous" @load=${this.handleLoad} @error=${this.handleError} loading=${this.htmlLoading}>`
956
+ )}</div>`;
923
957
  }
924
958
  render() {
925
- const t = this.hasZoomAction, e = this.currentAltValue, o = !this.currentSrc && !this.placeholder;
926
- return B`<div part="base" class=${j({
959
+ const e = this.hasZoomAction, t = this.currentAltValue, r = !this.currentSrc && !this.placeholder;
960
+ return A`<div part="base" class=${j({
927
961
  container: !0,
928
- "container--empty": o,
962
+ "container--empty": r,
929
963
  "container--loading": this.loading,
930
964
  "container--resizing": this.resizable && this.isResizeActive
931
- })} style=${Te({
965
+ })} style=${_e({
932
966
  "--easing": this.easeCSSVariable
933
- })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${Me(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${e} aria-roledescription=${this.localize.term("image")} class=${j(o ? {} : this.getHighlighterClass())} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${F(
934
- o,
935
- () => Le,
936
- () => F(
967
+ })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${Be(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${j(r ? {} : this.getHighlighterClass())} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${P(
968
+ r,
969
+ () => ue,
970
+ () => P(
937
971
  this.effect === q.Jump || this.effect === q.Zoom,
938
- () => B`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
972
+ () => A`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
939
973
  () => this.renderContent()
940
974
  )
941
- )}<div class="zoom-image-container">${F(
942
- t,
943
- () => B`<img part="zoom-image" class=${j({
975
+ )}<div class="zoom-image-container">${P(
976
+ e,
977
+ () => A`<img part="zoom-image" class=${j({
944
978
  "zoom-image": !0,
945
979
  "zoom-image--hidden": !this.isZoomed
946
980
  })} src=${this.currentSrc || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin="anonymous">`
947
- )}</div>${F(
981
+ )}</div>${P(
948
982
  this.skeleton && !this.isLoaded && !this.isError || this.loading,
949
- () => B`<slot name="skeleton" part="skeleton"><div class=${j({
983
+ () => A`<slot name="skeleton" part="skeleton"><div class=${j({
950
984
  skeleton: !0
951
985
  })}><cx-skeleton effect="sheen"></cx-skeleton></div></slot>`
952
986
  )}
953
- ${F(this.isError && this.fallback, () => B`<slot name="fallback" part="fallback"><cx-space class=${j({ fallback: !0 })} direction="column" align-items="center" justify-content="center"><cx-icon name="hide_image" part="fallback-icon"> </cx-icon></cx-space></slot>`)}</div></cx-resize-observer>${F(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
987
+ ${P(this.isError && this.fallback, () => A`<slot name="fallback" part="fallback"><cx-space class=${j({ fallback: !0 })} direction="column" align-items="center" justify-content="center"><cx-icon name="hide_image" part="fallback-icon"> </cx-icon></cx-space></slot>`)}</div></cx-resize-observer>${P(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
954
988
  }
955
989
  };
956
- l.styles = [We, Ue, et];
990
+ l.styles = [Te, Xe, ot];
957
991
  l.dependencies = {
958
- "cx-icon": je,
959
- "cx-popup": Ne,
960
- "cx-resize-observer": Ze,
961
- "cx-skeleton": Ie,
962
- "cx-space": Ve
992
+ "cx-icon": Ne,
993
+ "cx-popup": Ze,
994
+ "cx-resize-observer": Ve,
995
+ "cx-skeleton": Pe,
996
+ "cx-space": Fe
963
997
  };
964
- g([
998
+ c([
965
999
  K(".image")
966
1000
  ], l.prototype, "imageElement", 2);
967
- g([
1001
+ c([
968
1002
  K(".zoom-image")
969
1003
  ], l.prototype, "zoomImageElement", 2);
970
- g([
1004
+ c([
971
1005
  K(".highlighter")
972
1006
  ], l.prototype, "highlighterElement", 2);
973
- g([
974
- H()
1007
+ c([
1008
+ L()
975
1009
  ], l.prototype, "isLoaded", 2);
976
- g([
977
- H()
1010
+ c([
1011
+ L()
978
1012
  ], l.prototype, "isError", 2);
979
- g([
1013
+ c([
1014
+ L()
1015
+ ], l.prototype, "_retryIndex", 2);
1016
+ c([
980
1017
  d({ reflect: !0, type: String })
981
1018
  ], l.prototype, "src", 2);
982
- g([
1019
+ c([
983
1020
  d({ reflect: !0, type: String })
984
1021
  ], l.prototype, "placeholder", 2);
985
- g([
1022
+ c([
986
1023
  d({ reflect: !0, type: String })
987
1024
  ], l.prototype, "alt", 2);
988
- g([
1025
+ c([
989
1026
  d({ attribute: "object-fit", reflect: !0 })
990
1027
  ], l.prototype, "objectFit", 2);
991
- g([
1028
+ c([
992
1029
  d({ reflect: !0, type: Boolean })
993
1030
  ], l.prototype, "skeleton", 2);
994
- g([
1031
+ c([
995
1032
  d({ reflect: !0, type: Boolean })
996
1033
  ], l.prototype, "fallback", 2);
997
- g([
1034
+ c([
998
1035
  d({ attribute: "can-zoom", reflect: !0, type: Boolean })
999
1036
  ], l.prototype, "canZoom", 2);
1000
- g([
1037
+ c([
1001
1038
  d({ reflect: !0, type: Boolean })
1002
1039
  ], l.prototype, "loading", 2);
1003
- g([
1040
+ c([
1004
1041
  d({ reflect: !0, type: Boolean })
1005
1042
  ], l.prototype, "block", 2);
1006
- g([
1043
+ c([
1007
1044
  d({ attribute: "html-loading", reflect: !0, type: String })
1008
1045
  ], l.prototype, "htmlLoading", 2);
1009
- g([
1046
+ c([
1010
1047
  d({ attribute: "click-handler-type", reflect: !0, type: String })
1011
1048
  ], l.prototype, "clickHandlerType", 2);
1012
- g([
1013
- H()
1049
+ c([
1050
+ d({ attribute: "retry-on-error", type: Boolean })
1051
+ ], l.prototype, "retryOnError", 2);
1052
+ c([
1053
+ d({ attribute: "max-retries", type: Number })
1054
+ ], l.prototype, "maxRetries", 2);
1055
+ c([
1056
+ L()
1014
1057
  ], l.prototype, "isZoomed", 2);
1015
- g([
1016
- H()
1058
+ c([
1059
+ L()
1017
1060
  ], l.prototype, "imageRatio", 2);
1018
- g([
1019
- H()
1061
+ c([
1062
+ L()
1020
1063
  ], l.prototype, "parsedAlt", 2);
1021
- g([
1022
- H()
1064
+ c([
1065
+ L()
1023
1066
  ], l.prototype, "parsedAltDarkMode", 2);
1024
- g([
1067
+ c([
1025
1068
  X("isLoaded"),
1026
1069
  X("canZoom", { waitUntilFirstUpdate: !0 })
1027
1070
  ], l.prototype, "handleCanZoomChange", 1);
1028
- g([
1071
+ c([
1029
1072
  X("objectFit", { waitUntilFirstUpdate: !0 })
1030
1073
  ], l.prototype, "handleObjectFitChange", 1);
1031
- g([
1074
+ c([
1032
1075
  X("src"),
1033
1076
  X("srcDarkMode")
1034
1077
  ], l.prototype, "handleSrcChange", 1);
1035
- g([
1078
+ c([
1036
1079
  Oe(100)
1037
1080
  ], l.prototype, "updateLastPatchedWidth", 1);
1038
- l = g([
1039
- Ae("cx-image")
1081
+ l = c([
1082
+ We("cx-image")
1040
1083
  ], l);
1041
1084
  export {
1042
1085
  l as C,
1043
- Pe as H,
1086
+ Ue as H,
1044
1087
  D as R,
1045
- R as a,
1088
+ S as a,
1046
1089
  q as b,
1047
1090
  Y as c,
1048
- pe as d,
1049
- ue as e,
1091
+ fe as d,
1092
+ pe as e,
1050
1093
  se as f,
1051
- Ue as r
1094
+ Xe as r
1052
1095
  };