@getmicdrop/venue-calendar 4.3.8 → 4.3.10

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 (124) hide show
  1. package/dist/{ArrowLeftIcon-DvIbVly-.js → ArrowLeftIcon-BYu_Qbkb.js} +1 -1
  2. package/dist/{Badge-vsC_L__r.js → Badge-DCHGGod2.js} +8 -10
  3. package/dist/{BlockPlaceholder-BMD1gnmE.js → BlockPlaceholder-BoPMt_9Z.js} +2 -2
  4. package/dist/{Button-Cm6xkipe.js → Button-vmWb6wKc.js} +117 -63
  5. package/dist/{Calendar-CPD8dS_i.js → Calendar-D11ctjrD.js} +307 -282
  6. package/dist/{CalendarFoundryView-BY1uJgYA.js → CalendarFoundryView-DKhpjxnV.js} +6510 -6504
  7. package/dist/{CalendarIcon-CCgHZAu4.js → CalendarIcon-C8-UVSje.js} +1 -1
  8. package/dist/{CartView-DVugxQ3D.js → CartView-IqOekmQg.js} +814 -814
  9. package/dist/Checkout-ByQsDGg3.js +1005 -0
  10. package/dist/Checkout-C0lQ0AwV.js +1846 -0
  11. package/dist/{CheckoutTimer-CgGCv_jP.js → CheckoutTimer-B0E9KnHc.js} +15 -15
  12. package/dist/{ChevronDownIcon-gELqaIeP.js → ChevronDownIcon-C1uJ2yvz.js} +1 -1
  13. package/dist/{ClockIcon-C4MxWMqH.js → ClockIcon-Dk9q65sX.js} +1 -1
  14. package/dist/{CloseIcon-D3NjpzeW.js → CloseIcon-CyR73vpD.js} +1 -1
  15. package/dist/{CollectionView-C55yLTPR.js → CollectionView-B-CNyf9Z.js} +17 -17
  16. package/dist/CropImage-4WcoXkHt.js +537 -0
  17. package/dist/{Event-ClxgC-gP.js → Event-B4x0sGkc.js} +1142 -870
  18. package/dist/{EventPage-ziJYmBIZ.js → EventPage--xwhM503.js} +244 -236
  19. package/dist/{Heading-D7TEStkb.js → Heading-Br1Yqnvg.js} +3 -4
  20. package/dist/{Image-CjM21MQP.js → Image-M5RaWbKU.js} +12 -13
  21. package/dist/{Input-CIRGYHTC.js → Input-Bk8lP6TX.js} +53 -53
  22. package/dist/{MailIcon-iy7T12Hz.js → MailIcon-Ic2SruY-.js} +1 -1
  23. package/dist/{Modal-wQSo-C1f.js → Modal-CLeZUJ_i.js} +2 -2
  24. package/dist/ModalFooter-CSoG_uic.js +470 -0
  25. package/dist/ModalHeader-DpKxDJT_.js +18 -0
  26. package/dist/{PasswordInput-Cj8i4djG.js → PasswordInput-BHj_lokg.js} +2 -2
  27. package/dist/RecommendationsRail-8AVZ0aLE.js +445 -0
  28. package/dist/{ScarcityBadge-DbUVeqpx.js → ScarcityBadge-DakRfDx4.js} +19 -19
  29. package/dist/{SeriesPage-doki-1XH.js → SeriesPage-BaOeDNb6.js} +5 -5
  30. package/dist/{Spinner-Dua8H4Z1.js → Spinner-a1KCKWxZ.js} +2 -2
  31. package/dist/{Success-DZOYl6St.js → Success-BtUgc4H7.js} +290 -257
  32. package/dist/{TagIcon-CCyZd0sm.js → TagIcon-BiYfs6T7.js} +1 -1
  33. package/dist/{ViewTicketsEmbed-CF2Aq-qy.js → ViewTicketsEmbed-Lxg7n02-.js} +109 -109
  34. package/dist/{WarningCircleIcon-BuVhRrHd.js → WarningCircleIcon-AuYbQdPU.js} +1 -1
  35. package/dist/{WarningTriIcon-0hefhcdZ.js → WarningTriIcon-BzI-tSDG.js} +1 -1
  36. package/dist/{__SKIP_PATHS__-Dyw31EsB.js → __SKIP_PATHS__-B3OPLTzA.js} +1 -1
  37. package/dist/api/api.cjs +1 -1
  38. package/dist/api/api.mjs +239 -237
  39. package/dist/{api-QG8CoGcM.js → api-C1M2t6HU.js} +114 -112
  40. package/dist/{browser-viCaCwoW.js → browser-DrfMvEfn.js} +7 -7
  41. package/dist/{labels-0dEJldQX.js → constants-YG4UeBdR.js} +17 -4
  42. package/dist/{copyToClipboard-C7KGa7gG.js → copyToClipboard-3SejVveg.js} +1 -1
  43. package/dist/{de-K0-gFyNH.js → de-CzupmMIa.js} +14 -1
  44. package/dist/{defaultLabels-BdLGAc3u.js → defaultLabels-CXCsTwix.js} +331 -356
  45. package/dist/{es-DsZSuXW4.js → es-B-vQxM9Z.js} +14 -1
  46. package/dist/{event-CyPf2sZS.js → event-DAjJ01GM.js} +1 -1
  47. package/dist/{event-transform-DQmD2u_S.js → event-transform-DNqGTQhp.js} +54 -53
  48. package/dist/{eventStatusStream-BFOvtJyO.js → eventStatusStream-CLLN-Rvf.js} +2 -2
  49. package/dist/{fr-BmHldIKE.js → fr-B2g-kG7i.js} +14 -1
  50. package/dist/{href-CbfSre4l.js → href-DuxMJt4c.js} +3 -3
  51. package/dist/{i18n-CSftOFAS.js → i18n-Ct9Bo-Vp.js} +179 -129
  52. package/dist/{i18n-D54CGXK2.js → i18n-KdVjJUV5.js} +2 -2
  53. package/dist/{id-CBHA4B6C.js → id-Dgu5-FC6.js} +14 -1
  54. package/dist/imageOptimizer-Ba8P7ZEJ.js +140 -0
  55. package/dist/{it-CK6ravjO.js → it-C580sMYp.js} +14 -1
  56. package/dist/{ja-COO0Ibrr.js → ja-DLki4zXU.js} +14 -1
  57. package/dist/{ko-D8YqNrZs.js → ko-BUcfb1Gi.js} +14 -1
  58. package/dist/locales/4.3.10/flow/de.js +1 -0
  59. package/dist/locales/4.3.10/flow/es.js +1 -0
  60. package/dist/locales/4.3.10/flow/fr.js +1 -0
  61. package/dist/locales/4.3.10/flow/id.js +1 -0
  62. package/dist/locales/4.3.10/flow/it.js +1 -0
  63. package/dist/locales/4.3.10/flow/ja.js +1 -0
  64. package/dist/locales/4.3.10/flow/ko.js +1 -0
  65. package/dist/locales/4.3.10/flow/nl.js +1 -0
  66. package/dist/locales/4.3.10/flow/pl.js +1 -0
  67. package/dist/locales/4.3.10/flow/pt-br.js +1 -0
  68. package/dist/locales/4.3.10/flow/tr.js +1 -0
  69. package/dist/locales/4.3.10/flow/zh.js +1 -0
  70. package/dist/modalManager.svelte-Cz_6x1Qd.js +37 -0
  71. package/dist/{nl-Bk3DPD7e.js → nl-CivAQA0D.js} +14 -1
  72. package/dist/order-totals-DyVkHVqG.js +151 -0
  73. package/dist/{orders-Bat2EL64.js → orders-rH0WZYOW.js} +18 -18
  74. package/dist/{phoneUtils-Cm9iv40N.js → phoneUtils-BFrVEwkQ.js} +1 -1
  75. package/dist/{pixels-Ha6vOCaS.js → pixels-mdd6C3Bk.js} +3 -3
  76. package/dist/{pl-CPmO94ic.js → pl-C5VwFH2B.js} +14 -1
  77. package/dist/{promo-DWzTN7u9.js → promo-CTRn_F4t.js} +1 -1
  78. package/dist/{pt-br-Ch6NFhW6.js → pt-br-B0w9dhVB.js} +14 -1
  79. package/dist/{constants-q-jR2-bz.js → scarcity-Ccj5RlrR.js} +2 -5
  80. package/dist/{serverTotals-BBlkfqMf.js → serverTotals-Dk3z9sIA.js} +1 -1
  81. package/dist/{showcase-state-options-CxRQ-phi.js → showcase-state-options-8-egiV5-.js} +1 -1
  82. package/dist/{to-event-card-props-BIl0qQs0.js → to-event-card-props-a4k6D100.js} +49 -49
  83. package/dist/{tr-CXnalLJT.js → tr-LGkP5gpA.js} +14 -1
  84. package/dist/{utils-ChgG4jiQ.js → utils-BseYYrbn.js} +82 -78
  85. package/dist/venue-calendar.css +1 -1
  86. package/dist/venue-calendar.es.js +994 -996
  87. package/dist/venue-calendar.iife.js +56 -57
  88. package/dist/venue-calendar.umd.js +51 -52
  89. package/dist/{zh-CM2J1Py4.js → zh-D2ZAdq3T.js} +14 -1
  90. package/package.json +2 -2
  91. package/dist/Checkout-D7KSikhw.js +0 -980
  92. package/dist/Checkout-Ddcw2_8F.js +0 -1846
  93. package/dist/CropImage-CxLcNArr.js +0 -445
  94. package/dist/ModalFooter-DlRXuHQz.js +0 -301
  95. package/dist/imageOptimizer-BwLwBMI6.js +0 -112
  96. package/dist/keyboard-fiZFqeNA.js +0 -29
  97. package/dist/locales/4.3.8/flow/de.js +0 -1
  98. package/dist/locales/4.3.8/flow/es.js +0 -1
  99. package/dist/locales/4.3.8/flow/fr.js +0 -1
  100. package/dist/locales/4.3.8/flow/id.js +0 -1
  101. package/dist/locales/4.3.8/flow/it.js +0 -1
  102. package/dist/locales/4.3.8/flow/ja.js +0 -1
  103. package/dist/locales/4.3.8/flow/ko.js +0 -1
  104. package/dist/locales/4.3.8/flow/nl.js +0 -1
  105. package/dist/locales/4.3.8/flow/pl.js +0 -1
  106. package/dist/locales/4.3.8/flow/pt-br.js +0 -1
  107. package/dist/locales/4.3.8/flow/tr.js +0 -1
  108. package/dist/locales/4.3.8/flow/zh.js +0 -1
  109. package/dist/modalManager.svelte-Dnv5jhxp.js +0 -53
  110. package/dist/order-totals-Ci_p6SG6.js +0 -131
  111. package/dist/portal-DqxEuE-7.js +0 -166
  112. package/dist/shareCopyFeedback.svelte-CW0Yy9Oz.js +0 -330
  113. /package/dist/locales/{4.3.8 → 4.3.10}/main/de.js +0 -0
  114. /package/dist/locales/{4.3.8 → 4.3.10}/main/es.js +0 -0
  115. /package/dist/locales/{4.3.8 → 4.3.10}/main/fr.js +0 -0
  116. /package/dist/locales/{4.3.8 → 4.3.10}/main/id.js +0 -0
  117. /package/dist/locales/{4.3.8 → 4.3.10}/main/it.js +0 -0
  118. /package/dist/locales/{4.3.8 → 4.3.10}/main/ja.js +0 -0
  119. /package/dist/locales/{4.3.8 → 4.3.10}/main/ko.js +0 -0
  120. /package/dist/locales/{4.3.8 → 4.3.10}/main/nl.js +0 -0
  121. /package/dist/locales/{4.3.8 → 4.3.10}/main/pl.js +0 -0
  122. /package/dist/locales/{4.3.8 → 4.3.10}/main/pt-br.js +0 -0
  123. /package/dist/locales/{4.3.8 → 4.3.10}/main/tr.js +0 -0
  124. /package/dist/locales/{4.3.8 → 4.3.10}/main/zh.js +0 -0
@@ -1,28 +1,28 @@
1
- import { D as e, b as t, h as n } from "./defaultLabels-BdLGAc3u.js";
2
- import { t as r } from "./ClockIcon-C4MxWMqH.js";
1
+ import { t as e } from "./ClockIcon-Dk9q65sX.js";
2
+ import { D as t, b as n, h as r } from "./defaultLabels-CXCsTwix.js";
3
3
  import { t as i } from "./Text-CqjLjIF8.js";
4
- import { t as a } from "./labels-0dEJldQX.js";
4
+ import { n as a } from "./constants-YG4UeBdR.js";
5
5
  import "svelte/internal/disclose-version";
6
6
  import * as o from "svelte/internal/client";
7
7
  //#region src/lib/utils/event-ended.ts
8
- function s(r, i = e()) {
9
- if (!r) return !1;
10
- let a = t(r.endDateTime || r.startDateTime);
11
- return a ? n(a, i) < 0 : !1;
8
+ function s(e, i = t()) {
9
+ if (!e) return !1;
10
+ let a = n(e.endDateTime || e.startDateTime);
11
+ return a ? r(a, i) < 0 : !1;
12
12
  }
13
13
  //#endregion
14
14
  //#region src/lib/public-calendar-flow/CheckoutTimer.svelte
15
15
  var c = o.from_html("<div><!> <!></div>");
16
- function l(e, t) {
17
- o.push(t, !0);
18
- let n = o.prop(t, "labels", 3, a), s = o.derived(() => (() => {
19
- let e = Math.floor(t.seconds / 60), n = t.seconds % 60;
20
- return `${e.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
21
- })()), l = o.derived(() => t.isUrgent ? n().completeSoon || "Complete soon" : n().reservationHeld || "Reservation held");
16
+ function l(t, n) {
17
+ o.push(n, !0);
18
+ let r = o.prop(n, "labels", 3, a), s = o.derived(() => (() => {
19
+ let e = Math.floor(n.seconds / 60), t = n.seconds % 60;
20
+ return `${e.toString().padStart(2, "0")}:${t.toString().padStart(2, "0")}`;
21
+ })()), l = o.derived(() => n.isUrgent ? r().completeSoon || "Complete soon" : r().reservationHeld || "Reservation held");
22
22
  var u = c();
23
23
  let d;
24
24
  var f = o.child(u);
25
- r(f, {
25
+ e(f, {
26
26
  size: "16",
27
27
  class: "shrink-0"
28
28
  });
@@ -37,7 +37,7 @@ function l(e, t) {
37
37
  o.template_effect(() => o.set_text(n, `${o.get(l) ?? ""} · ${o.get(s) ?? ""}`)), o.append(e, n);
38
38
  },
39
39
  $$slots: { default: !0 }
40
- }), o.reset(u), o.template_effect(() => d = o.set_class(u, 1, "timer-display text-color-secondary svelte-8jbi4g", null, d, { urgent: t.isUrgent })), o.append(e, u), o.pop();
40
+ }), o.reset(u), o.template_effect(() => d = o.set_class(u, 1, "timer-display text-color-secondary svelte-8jbi4g", null, d, { urgent: n.isUrgent })), o.append(t, u), o.pop();
41
41
  }
42
42
  //#endregion
43
43
  export { s as n, l as t };
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-q-jR2-bz.js";
1
+ import { q as e } from "./scarcity-Ccj5RlrR.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/ChevronDownIcon.svelte
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-q-jR2-bz.js";
1
+ import { q as e } from "./scarcity-Ccj5RlrR.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/ClockIcon.svelte
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-q-jR2-bz.js";
1
+ import { q as e } from "./scarcity-Ccj5RlrR.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/CalendarOutline.svelte
@@ -1,11 +1,11 @@
1
- import { x as e } from "./Button-Cm6xkipe.js";
2
- import { i as t, t as n } from "./defaultLabels-BdLGAc3u.js";
3
- import { t as r } from "./Event-ClxgC-gP.js";
4
- import { r as i } from "./shareCopyFeedback.svelte-CW0Yy9Oz.js";
5
- import { n as a } from "./ScarcityBadge-DbUVeqpx.js";
6
- import { t as o } from "./__SKIP_PATHS__-Dyw31EsB.js";
7
- import { t as s } from "./PasswordInput-Cj8i4djG.js";
8
- import { p as c } from "./api-QG8CoGcM.js";
1
+ import { E as e } from "./Button-vmWb6wKc.js";
2
+ import { t } from "./Event-B4x0sGkc.js";
3
+ import { i as n } from "./RecommendationsRail-8AVZ0aLE.js";
4
+ import { n as r } from "./ScarcityBadge-DakRfDx4.js";
5
+ import { i, t as a } from "./defaultLabels-CXCsTwix.js";
6
+ import { t as o } from "./__SKIP_PATHS__-B3OPLTzA.js";
7
+ import { t as s } from "./PasswordInput-BHj_lokg.js";
8
+ import { p as c } from "./api-C1M2t6HU.js";
9
9
  import { i as l, n as u, t as d } from "./gate-password-cache-oOcDm9Ki.js";
10
10
  import "svelte/internal/disclose-version";
11
11
  import * as f from "svelte/internal/client";
@@ -16,7 +16,7 @@ function v(v, y) {
16
16
  f.push(y, !0), e("CollectionView"), f.prop(y, "organizationId", 3, "");
17
17
  let b = f.prop(y, "onNavigateToEvent", 3, void 0), x = f.prop(y, "password", 3, void 0);
18
18
  f.prop(y, "displayMode", 3, "gallery"), f.prop(y, "showViewSwitcher", 3, !0);
19
- let S = f.prop(y, "labels", 3, n), C = f.prop(y, "locale", 3, void 0), w = f.state(null), T = f.state(!0), E = f.state(null), D = f.state(!1), O = f.state(!1), k = f.state(""), A = f.state(!1), j = f.derived(() => f.get(w) ? i(f.get(w)) : null), M = 0;
19
+ let S = f.prop(y, "labels", 3, a), C = f.prop(y, "locale", 3, void 0), w = f.state(null), T = f.state(!0), E = f.state(null), D = f.state(!1), O = f.state(!1), k = f.state(""), A = f.state(!1), j = f.derived(() => f.get(w) ? n(f.get(w)) : null), M = 0;
20
20
  async function N(e, t = !1) {
21
21
  if (!f.get(D)) return;
22
22
  let n = ++M;
@@ -54,7 +54,7 @@ function v(v, y) {
54
54
  e.preventDefault(), f.get(k).trim() && N(f.get(k));
55
55
  }
56
56
  function F(e) {
57
- b() && e.id ? b()(Number(e.id), e.slug) : a(o("/[id]/[slug]", {
57
+ b() && e.id ? b()(Number(e.id), e.slug) : r(o("/[id]/[slug]", {
58
58
  id: String(e.id),
59
59
  slug: String(e.slug)
60
60
  }));
@@ -70,9 +70,9 @@ function v(v, y) {
70
70
  var t = h(), n = f.child(t), r = f.child(n, !0);
71
71
  f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, S().loadingCollection || "Loading collection...")), f.append(e, t);
72
72
  }, z = (e) => {
73
- var n = g(), r = f.child(n), i = f.child(r), a = f.child(i, !0);
74
- f.reset(i);
75
- var o = f.sibling(i, 2), c = f.child(o, !0);
73
+ var t = g(), n = f.child(t), r = f.child(n), a = f.child(r, !0);
74
+ f.reset(r);
75
+ var o = f.sibling(r, 2), c = f.child(o, !0);
76
76
  f.reset(o);
77
77
  var l = f.sibling(o, 2), u = f.child(l);
78
78
  {
@@ -93,7 +93,7 @@ function v(v, y) {
93
93
  });
94
94
  }
95
95
  var d = f.sibling(u, 2);
96
- t(d, {
96
+ i(d, {
97
97
  variant: "default",
98
98
  type: "submit",
99
99
  children: (e, t) => {
@@ -102,14 +102,14 @@ function v(v, y) {
102
102
  f.template_effect(() => f.set_text(n, S().viewCollection || "View collection")), f.append(e, n);
103
103
  },
104
104
  $$slots: { default: !0 }
105
- }), f.reset(l), f.reset(r), f.reset(n), f.template_effect(() => {
105
+ }), f.reset(l), f.reset(n), f.reset(t), f.template_effect(() => {
106
106
  f.set_text(a, S().collectionPrivateTitle || "This collection is private"), f.set_text(c, S().collectionPrivateDescription || "Please enter the password to view this collection");
107
- }), f.event("submit", l, P), f.append(e, n);
107
+ }), f.event("submit", l, P), f.append(e, t);
108
108
  }, B = (e) => {
109
109
  var t = _(), n = f.child(t), r = f.child(n);
110
110
  f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, `${(S().errorPrefix || "Error:") ?? ""} ${f.get(E) ?? ""}`)), f.append(e, t);
111
111
  }, V = (e) => {
112
- r(e, {
112
+ t(e, {
113
113
  get event() {
114
114
  return f.get(j);
115
115
  },
@@ -0,0 +1,537 @@
1
+ import { A as e, C as t, E as n, O as r, T as i, t as a } from "./Button-vmWb6wKc.js";
2
+ import { t as o } from "./CloseOutline-qpVa62mu.js";
3
+ import { a as s, i as c, o as l, r as u, t as d } from "./imageOptimizer-Ba8P7ZEJ.js";
4
+ import { a as f, i as p, n as m, o as h, r as g, t as _ } from "./ModalFooter-CSoG_uic.js";
5
+ import { t as v } from "./ModalHeader-DpKxDJT_.js";
6
+ import "svelte/internal/disclose-version";
7
+ import * as y from "svelte/internal/client";
8
+ import { MediaQuery as b } from "svelte/reactivity";
9
+ import { onDestroy as x, onMount as ee } from "svelte";
10
+ //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/MinusOutline.svelte
11
+ var S = y.from_svg("<svg aria-hidden=\"true\" fill=\"none\" stroke-width=\"2\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 12h-15\"></path></svg>");
12
+ function C(e, t) {
13
+ let n = y.prop(t, "size", 3, "24"), r = y.prop(t, "color", 3, "currentColor"), i = y.prop(t, "class", 3, "");
14
+ var a = S();
15
+ y.template_effect(() => {
16
+ y.set_class(a, 0, y.clsx(i())), y.set_attribute(a, "width", n()), y.set_attribute(a, "height", n()), y.set_attribute(a, "stroke", r());
17
+ }), y.append(e, a);
18
+ }
19
+ //#endregion
20
+ //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Modal/ModalClose.svelte
21
+ function w(t, n) {
22
+ y.push(n, !0);
23
+ let i = { close: "Close" }, s = y.prop(n, "disabled", 3, !1), c = y.prop(n, "labels", 19, () => ({})), l = h(), u = y.derived(() => r(i, c()));
24
+ {
25
+ let r = y.derived(() => e(n.class));
26
+ a(t, {
27
+ variant: "icon",
28
+ size: "xs",
29
+ get disabled() {
30
+ return s();
31
+ },
32
+ get class() {
33
+ return y.get(r);
34
+ },
35
+ get "aria-label"() {
36
+ return y.get(u).close;
37
+ },
38
+ onclick: () => l.resetModal(),
39
+ children: (e, t) => {
40
+ o(e, { class: "w-3 h-3" });
41
+ },
42
+ $$slots: { default: !0 }
43
+ });
44
+ }
45
+ y.pop();
46
+ }
47
+ //#endregion
48
+ //#region node_modules/svelte-easy-crop/dist/helpers.js
49
+ function T(e, t, n) {
50
+ return e >= t * n ? {
51
+ width: t * n,
52
+ height: t
53
+ } : {
54
+ width: e,
55
+ height: e / n
56
+ };
57
+ }
58
+ function E(e, t, n, r) {
59
+ return {
60
+ x: D(e.x, t.width, n.width, r),
61
+ y: D(e.y, t.height, n.height, r)
62
+ };
63
+ }
64
+ function D(e, t, n, r) {
65
+ let i = Math.abs(t * r / 2 - n / 2);
66
+ return Math.min(i, Math.max(e, -i));
67
+ }
68
+ function O(e, t) {
69
+ return Math.sqrt((e.y - t.y) ** 2 + (e.x - t.x) ** 2);
70
+ }
71
+ function k(e, t, n, r, i, a = !0) {
72
+ let o = a ? A : j, s = {
73
+ x: o(100, ((t.width - n.width / i) / 2 - e.x / i) / t.width * 100),
74
+ y: o(100, ((t.height - n.height / i) / 2 - e.y / i) / t.height * 100),
75
+ width: o(100, n.width / t.width * 100 / i),
76
+ height: o(100, n.height / t.height * 100 / i)
77
+ }, c = o(t.naturalWidth, s.width * t.naturalWidth / 100, !0), l = o(t.naturalHeight, s.height * t.naturalHeight / 100, !0), u = t.naturalWidth >= t.naturalHeight * r ? {
78
+ width: Math.round(l * r),
79
+ height: l
80
+ } : {
81
+ width: c,
82
+ height: Math.round(c / r)
83
+ };
84
+ return {
85
+ croppedAreaPercentages: s,
86
+ croppedAreaPixels: {
87
+ ...u,
88
+ x: o(t.naturalWidth - u.width, s.x * t.naturalWidth / 100, !0),
89
+ y: o(t.naturalHeight - u.height, s.y * t.naturalHeight / 100, !0)
90
+ }
91
+ };
92
+ }
93
+ function A(e, t, n = !1) {
94
+ return Math.min(e, Math.max(0, n ? Math.round(t) : t));
95
+ }
96
+ function j(e, t) {
97
+ return t;
98
+ }
99
+ function M(e, t) {
100
+ return {
101
+ x: (t.x + e.x) / 2,
102
+ y: (t.y + e.y) / 2
103
+ };
104
+ }
105
+ //#endregion
106
+ //#region node_modules/svelte-easy-crop/dist/Cropper.svelte
107
+ var N = y.from_html("<div data-testid=\"cropper\"></div>"), P = y.from_html("<div class=\"svelte-easy-crop-container svelte-1yetlj5\" role=\"button\" data-testid=\"container\"><img class=\"svelte-easy-crop-image svelte-1yetlj5\" alt=\"\"/> <!></div>");
108
+ function F(e, t) {
109
+ y.push(t, !0);
110
+ let n = y.prop(t, "crop", 31, () => y.proxy({
111
+ x: 0,
112
+ y: 0
113
+ })), r = y.prop(t, "zoom", 15, 1), i = y.prop(t, "minZoom", 11, 1), a = y.prop(t, "maxZoom", 11, 3), o = y.prop(t, "aspect", 3, 4 / 3), s = y.prop(t, "cropSize", 3, null), c = y.prop(t, "cropShape", 3, "rect"), l = y.prop(t, "showGrid", 3, !0), u = y.prop(t, "zoomSpeed", 3, 1), d = y.prop(t, "crossOrigin", 3, null), f = y.prop(t, "restrictPosition", 3, !0), p = y.prop(t, "tabindex", 3, void 0), m = y.state(null), h = y.state(y.proxy({
114
+ width: 0,
115
+ height: 0,
116
+ naturalWidth: 0,
117
+ naturalHeight: 0
118
+ })), g = y.state(null), _ = y.state(null), v = y.state(null), b = y.state(y.proxy({
119
+ x: 0,
120
+ y: 0
121
+ })), S = y.state(y.proxy({
122
+ x: 0,
123
+ y: 0
124
+ })), C = y.state(0), w = y.state(null), D = y.state(null);
125
+ ee(() => {
126
+ y.get(v) && y.get(v).complete && F(), y.get(g) && (y.get(g).addEventListener("gesturestart", A), y.get(g).addEventListener("gesturechange", A));
127
+ }), x(() => {
128
+ y.get(g) && (y.get(g).removeEventListener("gesturestart", A), y.get(g).removeEventListener("gesturechange", A)), j();
129
+ });
130
+ let A = (e) => e.preventDefault(), j = () => {
131
+ typeof document < "u" && (document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", K), document.removeEventListener("touchmove", U), document.removeEventListener("touchend", K));
132
+ }, F = () => {
133
+ L(), Z();
134
+ }, I = () => s() ? s().width / s().height : o(), L = () => {
135
+ y.get(v) && (y.set(h, {
136
+ width: y.get(v).width,
137
+ height: y.get(v).height,
138
+ naturalWidth: y.get(v).naturalWidth,
139
+ naturalHeight: y.get(v).naturalHeight
140
+ }, !0), y.set(m, s() ? s() : T(y.get(v).width, y.get(v).height, o()), !0)), y.get(g) && y.set(_, y.get(g).getBoundingClientRect(), !0);
141
+ }, R = (e) => ({
142
+ x: Number(e.clientX),
143
+ y: Number(e.clientY)
144
+ }), z = (e) => ({
145
+ x: Number(e.clientX),
146
+ y: Number(e.clientY)
147
+ }), B = (e) => {
148
+ e.preventDefault(), document.addEventListener("mousemove", V), document.addEventListener("mouseup", K), W(R(e));
149
+ }, V = (e) => G(R(e)), H = (e) => {
150
+ e.preventDefault(), document.addEventListener("touchmove", U, { passive: !1 }), document.addEventListener("touchend", K), e.touches.length === 2 ? q(e) : e.touches.length === 1 && W(z(e.touches[0]));
151
+ }, U = (e) => {
152
+ e.preventDefault(), e.touches.length === 2 ? te(e) : e.touches.length === 1 && G(z(e.touches[0]));
153
+ }, W = ({ x: e, y: t }) => {
154
+ y.set(b, {
155
+ x: e,
156
+ y: t
157
+ }, !0), y.set(S, {
158
+ x: n().x,
159
+ y: n().y
160
+ }, !0);
161
+ }, G = ({ x: e, y: t }) => {
162
+ y.get(w) && window.cancelAnimationFrame(y.get(w)), y.set(w, window.requestAnimationFrame(() => {
163
+ if (e === void 0 || t === void 0 || !y.get(m)) return;
164
+ let i = e - y.get(b).x, a = t - y.get(b).y, o = {
165
+ x: y.get(S).x + i,
166
+ y: y.get(S).y + a
167
+ };
168
+ n(f() ? E(o, y.get(h), y.get(m), r()) : o);
169
+ }), !0);
170
+ }, K = () => {
171
+ j(), Z();
172
+ }, q = (e) => {
173
+ let t = z(e.touches[0]), n = z(e.touches[1]);
174
+ y.set(C, O(t, n), !0), W(M(t, n));
175
+ }, te = (e) => {
176
+ let t = z(e.touches[0]), n = z(e.touches[1]), i = M(t, n);
177
+ G(i), y.get(D) && window.cancelAnimationFrame(y.get(D)), y.set(D, window.requestAnimationFrame(() => {
178
+ let e = O(t, n), a = r() * (e / y.get(C));
179
+ X(a, i), y.set(C, e, !0);
180
+ }), !0);
181
+ }, J = (e) => {
182
+ e.preventDefault();
183
+ let t = R(e), n = r() - e.deltaY * u() / 200;
184
+ X(n, t);
185
+ }, Y = ({ x: e, y: t }) => {
186
+ if (!y.get(_)) throw Error("The Cropper is not mounted");
187
+ return {
188
+ x: y.get(_).width / 2 - (e - y.get(_).left),
189
+ y: y.get(_).height / 2 - (t - y.get(_).top)
190
+ };
191
+ }, ne = ({ x: e, y: t }) => ({
192
+ x: (e + n().x) / r(),
193
+ y: (t + n().y) / r()
194
+ }), X = (e, t) => {
195
+ if (!y.get(m)) return;
196
+ let o = Y(t), s = ne(o);
197
+ r(Math.min(a(), Math.max(e, i())));
198
+ let c = {
199
+ x: s.x * r() - o.x,
200
+ y: s.y * r() - o.y
201
+ };
202
+ n(f() ? E(c, y.get(h), y.get(m), r()) : c);
203
+ }, Z = () => {
204
+ if (!y.get(m) || y.get(m).width === 0) return;
205
+ let { croppedAreaPercentages: e, croppedAreaPixels: i } = k(f() ? E(n(), y.get(h), y.get(m), r()) : n(), y.get(h), y.get(m), I(), r(), f());
206
+ t.oncropcomplete?.({
207
+ percent: e,
208
+ pixels: i
209
+ });
210
+ };
211
+ y.user_effect(() => {
212
+ y.get(v) && y.set(m, s() ? s() : T(y.get(v).width, y.get(v).height, o()), !0);
213
+ }), y.user_effect(() => {
214
+ r() && Z();
215
+ });
216
+ let re = (e) => {
217
+ y.user_effect(() => (e.addEventListener("touchstart", H), e.addEventListener("mousedown", B), e.addEventListener("wheel", J, { passive: !1 }), () => {
218
+ e.removeEventListener("touchstart", H), e.removeEventListener("mousedown", B), e.removeEventListener("wheel", J);
219
+ }));
220
+ };
221
+ var Q = P();
222
+ y.event("resize", y.window, L);
223
+ var $ = y.child(Q);
224
+ y.bind_this($, (e) => y.set(v, e), () => y.get(v));
225
+ var ie = y.sibling($, 2), ae = (e) => {
226
+ var t = N();
227
+ let n;
228
+ y.template_effect(() => {
229
+ n = y.set_class(t, 1, "svelte-easy-crop-area svelte-1yetlj5", null, n, {
230
+ "svelte-easy-crop-round": c() === "round",
231
+ "svelte-easy-crop-grid": l()
232
+ }), y.set_style(t, `width: ${y.get(m).width ?? ""}px; height: ${y.get(m).height ?? ""}px;`);
233
+ }), y.append(e, t);
234
+ };
235
+ y.if(ie, (e) => {
236
+ y.get(m) && e(ae);
237
+ }), y.reset(Q), y.bind_this(Q, (e) => y.set(g, e), () => y.get(g)), y.action(Q, (e) => re?.(e)), y.template_effect(() => {
238
+ y.set_attribute(Q, "tabindex", p()), y.set_attribute($, "src", t.image), y.set_style($, `transform: translate(${n().x ?? ""}px, ${n().y ?? ""}px) scale(${r() ?? ""});`), y.set_attribute($, "crossorigin", d());
239
+ }), y.event("load", $, F), y.replay_events($), y.append(e, Q), y.pop();
240
+ }
241
+ //#endregion
242
+ //#region node_modules/svelte-easy-crop/dist/index.js
243
+ var I = F, L = y.from_html("<div class=\"absolute inset-0 flex items-center justify-center bg-bg-tertiary z-sticky\"><span> </span></div>"), R = y.from_html("<p> </p>"), z = y.from_html("<div><!> <!></div> <div class=\"flex-1 space-y-4\"><p> </p> <div class=\"flex items-center justify-center gap-3 max-w-xs mx-auto\"><!> <input type=\"range\" min=\"1\" max=\"3\" step=\"0.1\" class=\"flex-1 w-full h-2 bg-bg-tertiary rounded-lg appearance-none cursor-pointer accent-primary\" data-purpose=\"ui-only\"/> <!></div> <!></div>", 1), B = y.from_html("<!> <!>", 1), V = y.from_html("<div class=\"flex gap-3\"><!></div>"), H = y.from_html("<div class=\"flex flex-col gap-4 landscape:flex-row landscape:items-center landscape:gap-6\"><!></div>"), U = y.from_html("<!> <!> <!>", 1);
244
+ function W(e, o) {
245
+ y.push(o, !0);
246
+ let h = (e, n = y.noop) => {
247
+ var r = z(), i = y.first_child(r), o = y.child(i), s = (e) => {
248
+ var n = L(), r = y.child(n), i = y.child(r, !0);
249
+ y.reset(r), y.reset(n), y.template_effect(() => {
250
+ y.set_class(r, 1, y.clsx(t.smMuted)), y.set_text(i, y.get(N).loading);
251
+ }), y.append(e, n);
252
+ };
253
+ y.if(o, (e) => {
254
+ y.get(G) && e(s);
255
+ }), I(y.sibling(o, 2), {
256
+ get image() {
257
+ return D();
258
+ },
259
+ aspect: 1,
260
+ minZoom: 1,
261
+ maxZoom: 3,
262
+ showGrid: !0,
263
+ oncropcomplete: te,
264
+ get crop() {
265
+ return y.get(P);
266
+ },
267
+ set crop(e) {
268
+ y.set(P, e, !0);
269
+ },
270
+ get zoom() {
271
+ return y.get(F);
272
+ },
273
+ set zoom(e) {
274
+ y.set(F, e, !0);
275
+ }
276
+ }), y.reset(i);
277
+ var c = y.sibling(i, 2), u = y.child(c), d = y.child(u, !0);
278
+ y.reset(u);
279
+ var f = y.sibling(u, 2), p = y.child(f);
280
+ a(p, {
281
+ variant: "outline",
282
+ size: "sm",
283
+ class: "rounded-full! w-9! h-9! p-0! shrink-0",
284
+ onclick: () => y.set(F, Math.max(1, y.get(F) - .2), !0),
285
+ get "aria-label"() {
286
+ return y.get(N).zoomOut;
287
+ },
288
+ children: (e, t) => {
289
+ C(e, { class: "w-4 h-4" });
290
+ },
291
+ $$slots: { default: !0 }
292
+ });
293
+ var m = y.sibling(p, 2);
294
+ y.remove_input_defaults(m);
295
+ var h = y.sibling(m, 2);
296
+ a(h, {
297
+ variant: "outline",
298
+ size: "sm",
299
+ class: "rounded-full! w-9! h-9! p-0! shrink-0",
300
+ onclick: () => y.set(F, Math.min(3, y.get(F) + .2), !0),
301
+ get "aria-label"() {
302
+ return y.get(N).zoomIn;
303
+ },
304
+ children: (e, t) => {
305
+ l(e, { class: "w-4 h-4" });
306
+ },
307
+ $$slots: { default: !0 }
308
+ }), y.reset(f);
309
+ var g = y.sibling(f, 2), _ = (e) => {
310
+ var n = R(), r = y.child(n, !0);
311
+ y.reset(n), y.template_effect(() => {
312
+ y.set_class(n, 1, `${t.body} text-accent-danger text-center`), y.set_text(r, k());
313
+ }), y.append(e, n);
314
+ };
315
+ y.if(g, (e) => {
316
+ k() && e(_);
317
+ }), y.reset(c), y.template_effect(() => {
318
+ y.set_class(i, 1, y.clsx(n())), y.set_class(u, 1, `${t.smMuted} text-center`), y.set_text(d, y.get(N).dragToPosition), y.set_attribute(m, "aria-label", y.get(N).zoomLevel);
319
+ }), y.bind_value(m, () => y.get(F), (e) => y.set(F, e)), y.append(e, r);
320
+ }, x = (e, t = y.noop) => {
321
+ var n = B(), r = y.first_child(n);
322
+ {
323
+ let e = y.derived(() => y.get(K) || O());
324
+ a(r, {
325
+ type: "button",
326
+ variant: "alternative",
327
+ size: "md",
328
+ get class() {
329
+ return t();
330
+ },
331
+ onclick: Y,
332
+ get disabled() {
333
+ return y.get(e);
334
+ },
335
+ children: (e, t) => {
336
+ y.next();
337
+ var n = y.text();
338
+ y.template_effect(() => y.set_text(n, y.get(N).cancel)), y.append(e, n);
339
+ },
340
+ $$slots: { default: !0 }
341
+ });
342
+ }
343
+ var i = y.sibling(r, 2);
344
+ {
345
+ let e = y.derived(() => y.get(G) || y.get(K) || O());
346
+ a(i, {
347
+ type: "button",
348
+ size: "md",
349
+ get class() {
350
+ return t();
351
+ },
352
+ onclick: J,
353
+ get disabled() {
354
+ return y.get(e);
355
+ },
356
+ children: (e, t) => {
357
+ var n = y.comment(), r = y.first_child(n), i = (e) => {
358
+ var t = y.text();
359
+ y.template_effect(() => y.set_text(t, y.get(N).uploading)), y.append(e, t);
360
+ }, a = (e) => {
361
+ var t = y.text();
362
+ y.template_effect(() => y.set_text(t, y.get(N).save)), y.append(e, t);
363
+ };
364
+ y.if(r, (e) => {
365
+ y.get(K) || O() ? e(i) : e(a, -1);
366
+ }), y.append(e, n);
367
+ },
368
+ $$slots: { default: !0 }
369
+ });
370
+ }
371
+ y.append(e, n);
372
+ }, ee = n("CropImage"), S = new b("(max-width: 767px), (max-height: 500px)", !1), T = {
373
+ cropImageTitle: "Crop image",
374
+ loading: "Loading...",
375
+ dragToPosition: "Drag to position. Pinch or use slider to zoom.",
376
+ cancel: "Cancel",
377
+ uploading: "Uploading...",
378
+ save: "Save",
379
+ closeModal: "Close modal",
380
+ zoomOut: "Zoom out",
381
+ zoomIn: "Zoom in",
382
+ zoomLevel: "Zoom level",
383
+ cropFailed: "Couldn't read that photo. Please try a different one."
384
+ }, E = y.prop(o, "showModal", 15, !1), D = y.prop(o, "imageSrc", 15, ""), O = y.prop(o, "isUploadingImage", 3, !1), k = y.prop(o, "error", 15, ""), A = y.prop(o, "labels", 19, () => ({}));
385
+ o.onSave && !o.onsave && i("CropImage: prop \"onSave\" is deprecated. Use \"onsave\" instead."), o.onCancel && !o.oncancel && i("CropImage: prop \"onCancel\" is deprecated. Use \"oncancel\" instead.");
386
+ let j = y.derived(() => o.onsave ?? o.onSave ?? (() => {})), M = y.derived(() => o.oncancel ?? o.onCancel ?? (() => {})), N = y.derived(() => r(T, A())), P = y.state(y.proxy({
387
+ x: 0,
388
+ y: 0
389
+ })), F = y.state(1), W = y.state(null), G = y.state(!0), K = y.state(!1), q = D();
390
+ y.user_effect(() => {
391
+ E() && D() && (y.set(P, {
392
+ x: 0,
393
+ y: 0
394
+ }, !0), y.set(F, 1), y.set(W, null), y.set(G, !0), y.set(K, !1), D() !== q && (q = D(), k("")));
395
+ });
396
+ function te(e) {
397
+ y.set(W, e.pixels, !0), y.set(G, !1);
398
+ }
399
+ async function J() {
400
+ if (!(!y.get(W) || y.get(K))) {
401
+ y.set(K, !0), k("");
402
+ try {
403
+ let e = await ne(D(), y.get(W));
404
+ y.get(j)(e);
405
+ } catch (e) {
406
+ y.set(K, !1), k(y.get(N).cropFailed), ee.error("Crop failed:", e);
407
+ }
408
+ }
409
+ }
410
+ function Y() {
411
+ E(!1), D(""), y.set(P, {
412
+ x: 0,
413
+ y: 0
414
+ }, !0), y.set(F, 1), y.set(W, null), y.set(K, !1), k(""), y.get(M)();
415
+ }
416
+ async function ne(e, t) {
417
+ let n = await d(e), r = document.createElement("canvas"), i = r.getContext("2d"), a = 1e3;
418
+ r.width = a, r.height = a, i.imageSmoothingEnabled = !0, i.imageSmoothingQuality = "high", i.drawImage(n, t.x, t.y, t.width, t.height, 0, 0, a, a);
419
+ let o = u(), s = o ? "image/webp" : "image/jpeg", c = o ? .8 : .85, l = o ? "webp" : "jpg";
420
+ return new Promise((e) => {
421
+ r.toBlob((t) => {
422
+ e(new File([t], `cropped-image.${l}`, { type: s }));
423
+ }, s, c);
424
+ });
425
+ }
426
+ var X = y.comment(), Z = y.first_child(X), re = (e) => {
427
+ s(e, {
428
+ get open() {
429
+ return E();
430
+ },
431
+ get title() {
432
+ return y.get(N).cropImageTitle;
433
+ },
434
+ alwaysSheet: !0,
435
+ get "data-testid"() {
436
+ return o["data-testid"];
437
+ },
438
+ onclose: () => {
439
+ !y.get(K) && !O() && Y();
440
+ },
441
+ actions: (e) => {
442
+ var t = V(), n = y.child(t);
443
+ x(n, () => "flex-1"), y.reset(t), y.append(e, t);
444
+ },
445
+ children: (e, t) => {
446
+ var n = H(), r = y.child(n);
447
+ h(r, () => "relative w-full max-w-[50dvh] landscape:max-w-[35dvh] shrink-0 mx-auto aspect-square bg-bg-secondary rounded-lg overflow-hidden"), y.reset(n), y.append(e, n);
448
+ },
449
+ $$slots: {
450
+ actions: !0,
451
+ default: !0
452
+ }
453
+ });
454
+ }, Q = (e) => {
455
+ {
456
+ let n = y.derived(() => y.get(K) || O());
457
+ f(e, {
458
+ get open() {
459
+ return E();
460
+ },
461
+ variant: "dialog",
462
+ get persistent() {
463
+ return y.get(n);
464
+ },
465
+ get "data-testid"() {
466
+ return o["data-testid"];
467
+ },
468
+ oncancel: Y,
469
+ children: (e, n) => {
470
+ var r = B(), i = y.first_child(r);
471
+ p(i, {});
472
+ var a = y.sibling(i, 2);
473
+ g(a, {
474
+ class: "max-w-lg",
475
+ children: (e, n) => {
476
+ var r = U(), i = y.first_child(r);
477
+ v(i, {
478
+ class: "flex items-center justify-between gap-3 border-b border-border pb-4",
479
+ children: (e, n) => {
480
+ var r = B(), i = y.first_child(r);
481
+ c(i, {
482
+ get class() {
483
+ return t.h2;
484
+ },
485
+ children: (e, t) => {
486
+ y.next();
487
+ var n = y.text();
488
+ y.template_effect(() => y.set_text(n, y.get(N).cropImageTitle)), y.append(e, n);
489
+ },
490
+ $$slots: { default: !0 }
491
+ });
492
+ var a = y.sibling(i, 2);
493
+ {
494
+ let e = y.derived(() => y.get(K) || O()), t = y.derived(() => ({ close: y.get(N).closeModal }));
495
+ w(a, {
496
+ get disabled() {
497
+ return y.get(e);
498
+ },
499
+ get labels() {
500
+ return y.get(t);
501
+ }
502
+ });
503
+ }
504
+ y.append(e, r);
505
+ },
506
+ $$slots: { default: !0 }
507
+ });
508
+ var a = y.sibling(i, 2);
509
+ m(a, {
510
+ class: "space-y-4",
511
+ children: (e, t) => {
512
+ h(e, () => "relative w-full aspect-square sm:aspect-[4/3] max-h-80 sm:max-h-96 bg-bg-secondary rounded-lg overflow-hidden");
513
+ },
514
+ $$slots: { default: !0 }
515
+ });
516
+ var o = y.sibling(a, 2);
517
+ _(o, {
518
+ class: "border-t border-border pt-4",
519
+ children: (e, t) => {
520
+ x(e, () => "");
521
+ },
522
+ $$slots: { default: !0 }
523
+ }), y.append(e, r);
524
+ },
525
+ $$slots: { default: !0 }
526
+ }), y.append(e, r);
527
+ },
528
+ $$slots: { default: !0 }
529
+ });
530
+ }
531
+ };
532
+ y.if(Z, (e) => {
533
+ S.current ? e(re) : e(Q, -1);
534
+ }), y.append(e, X), y.pop();
535
+ }
536
+ //#endregion
537
+ export { W as default };