@rulecms/widget-svelte 0.8.2 → 0.8.3

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.
package/dist/index.js CHANGED
@@ -1,146 +1,146 @@
1
- var zt = Object.defineProperty;
2
- var Ht = (e, t, r) => t in e ? zt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var Fe = (e, t, r) => Ht(e, typeof t != "symbol" ? t + "" : t, r);
1
+ var Ht = Object.defineProperty;
2
+ var Gt = (e, t, o) => t in e ? Ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var Ke = (e, t, o) => Gt(e, typeof t != "symbol" ? t + "" : t, o);
4
4
  import "svelte/internal/disclose-version";
5
5
  import * as n from "svelte/internal/client";
6
- import { setContext as Gt, getContext as Yt, untrack as Xt } from "svelte";
6
+ import { setContext as Yt, getContext as Xt, untrack as Jt } from "svelte";
7
7
  const re = "default";
8
8
  function rt(e, t) {
9
9
  return !(e != null && e.length) || e === re ? t : `${e}/${t}`;
10
10
  }
11
- const Jt = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;
12
- function Ke(e) {
11
+ const qt = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;
12
+ function Be(e) {
13
13
  if (!e || typeof e != "object")
14
14
  return !1;
15
15
  const t = e;
16
16
  return !!t.manifest && typeof t.manifest == "object" && !!t.components && typeof t.components == "object" && !Array.isArray(t.components);
17
17
  }
18
- function qt(e) {
19
- if (Ke(e))
18
+ function Zt(e) {
19
+ if (Be(e))
20
20
  return e;
21
21
  const t = e;
22
- return Ke(t == null ? void 0 : t.default) ? t.default : null;
22
+ return Be(t == null ? void 0 : t.default) ? t.default : null;
23
23
  }
24
- function he(e) {
24
+ function be(e) {
25
25
  return e.usesDefaultLibrary ? [re, ...e.libraryIds] : [...e.libraryIds];
26
26
  }
27
- function Be({ registrations: e, referenced: t }) {
27
+ function Ue({ registrations: e, referenced: t }) {
28
28
  if (t.usesDefaultLibrary && !(e != null && e[re]))
29
- throw new Error(Jt);
29
+ throw new Error(qt);
30
30
  }
31
- function Zt(e) {
32
- const t = [], r = /* @__PURE__ */ new Set();
33
- for (const o of e.values()) {
34
- if (typeof o.stylesheet != "string")
31
+ function Qt(e) {
32
+ const t = [], o = /* @__PURE__ */ new Set();
33
+ for (const r of e.values()) {
34
+ if (typeof r.stylesheet != "string")
35
35
  continue;
36
- const s = o.stylesheet.trim();
37
- !s || r.has(s) || (r.add(s), t.push(s));
36
+ const s = r.stylesheet.trim();
37
+ !s || o.has(s) || (o.add(s), t.push(s));
38
38
  }
39
39
  return t.length > 0 ? t : void 0;
40
40
  }
41
- function Qt(e) {
41
+ function $t(e) {
42
42
  const t = {};
43
- for (const [o, s] of e) {
44
- const i = o === re;
45
- for (const [l, a] of Object.entries(s.components))
46
- t[i ? l : `${o}/${l}`] = a;
43
+ for (const [r, s] of e) {
44
+ const i = r === re;
45
+ for (const [l, c] of Object.entries(s.components))
46
+ t[i ? l : `${r}/${l}`] = c;
47
47
  }
48
- const r = Zt(e);
49
- return r ? { components: t, stylesheets: r } : { components: t };
48
+ const o = Qt(e);
49
+ return o ? { components: t, stylesheets: o } : { components: t };
50
50
  }
51
- function de() {
52
- const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
51
+ function fe() {
52
+ const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
53
53
  let s = 0;
54
- function i(u, c) {
55
- var f;
56
- e.get(u) !== c && ((f = c.manifest) != null && f.id && c.manifest.id !== u && console.warn(
57
- `RuleCMS widget: component library registered as "${u}" declares manifest id "${c.manifest.id}". The registered id wins for resolution.`
58
- ), e.set(u, c), s += 1);
59
- }
60
- function l(u) {
61
- const c = he(u), f = [...c].sort().join("|"), p = o.get(f);
62
- if (p && p.loadedVersion === s)
63
- return p.plugin;
64
- const g = /* @__PURE__ */ new Map();
65
- for (const w of c) {
66
- const b = e.get(w);
67
- b && g.set(w, b);
54
+ function i(d, u) {
55
+ var g;
56
+ e.get(d) !== u && ((g = u.manifest) != null && g.id && u.manifest.id !== d && console.warn(
57
+ `RuleCMS widget: component library registered as "${d}" declares manifest id "${u.manifest.id}". The registered id wins for resolution.`
58
+ ), e.set(d, u), s += 1);
59
+ }
60
+ function l(d) {
61
+ const u = be(d), g = [...u].sort().join("|"), m = r.get(g);
62
+ if (m && m.loadedVersion === s)
63
+ return m.plugin;
64
+ const f = /* @__PURE__ */ new Map();
65
+ for (const E of u) {
66
+ const h = e.get(E);
67
+ h && f.set(E, h);
68
68
  }
69
- const A = Qt(g);
70
- return o.set(f, { loadedVersion: s, plugin: A }), A;
71
- }
72
- function a(u) {
73
- Be(u);
74
- const { registrations: c, referenced: f } = u;
75
- for (const p of he(f)) {
76
- if (e.has(p) || r.has(p))
69
+ const w = $t(f);
70
+ return r.set(g, { loadedVersion: s, plugin: w }), w;
71
+ }
72
+ function c(d) {
73
+ Ue(d);
74
+ const { registrations: u, referenced: g } = d;
75
+ for (const m of be(g)) {
76
+ if (e.has(m) || o.has(m))
77
77
  continue;
78
- const g = c == null ? void 0 : c[p];
79
- if (!g) {
78
+ const f = u == null ? void 0 : u[m];
79
+ if (!f) {
80
80
  console.error(
81
- `RuleCMS widget: no component library registered for libraryId "${p}"; its components will not render.`
82
- ), r.set(p, new Error(`No registration for libraryId "${p}"`));
81
+ `RuleCMS widget: no component library registered for libraryId "${m}"; its components will not render.`
82
+ ), o.set(m, new Error(`No registration for libraryId "${m}"`));
83
83
  continue;
84
84
  }
85
- if (typeof g == "function")
85
+ if (typeof f == "function")
86
86
  return null;
87
- i(p, g);
87
+ i(m, f);
88
88
  }
89
- return l(f);
89
+ return l(g);
90
90
  }
91
- async function d(u) {
92
- Be(u);
93
- const { registrations: c, referenced: f } = u, p = he(f);
91
+ async function a(d) {
92
+ Ue(d);
93
+ const { registrations: u, referenced: g } = d, m = be(g);
94
94
  return await Promise.all(
95
- p.map(async (g) => {
96
- if (e.has(g) || r.has(g))
95
+ m.map(async (f) => {
96
+ if (e.has(f) || o.has(f))
97
97
  return;
98
- const A = c == null ? void 0 : c[g];
99
- if (!A) {
98
+ const w = u == null ? void 0 : u[f];
99
+ if (!w) {
100
100
  console.error(
101
- `RuleCMS widget: no component library registered for libraryId "${g}"; its components will not render.`
102
- ), r.set(g, new Error(`No registration for libraryId "${g}"`));
101
+ `RuleCMS widget: no component library registered for libraryId "${f}"; its components will not render.`
102
+ ), o.set(f, new Error(`No registration for libraryId "${f}"`));
103
103
  return;
104
104
  }
105
- if (typeof A != "function") {
106
- i(g, A);
105
+ if (typeof w != "function") {
106
+ i(f, w);
107
107
  return;
108
108
  }
109
- let w = t.get(g);
110
- w || (w = A().then((b) => {
111
- const v = qt(b);
112
- if (!v)
109
+ let E = t.get(f);
110
+ E || (E = w().then((h) => {
111
+ const A = Zt(h);
112
+ if (!A)
113
113
  throw new Error(
114
- `Registration for libraryId "${g}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
114
+ `Registration for libraryId "${f}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
115
115
  );
116
- i(g, v);
117
- }).catch((b) => {
118
- r.set(g, b), console.error(
119
- `RuleCMS widget: failed to load component library "${g}":`,
120
- b
116
+ i(f, A);
117
+ }).catch((h) => {
118
+ o.set(f, h), console.error(
119
+ `RuleCMS widget: failed to load component library "${f}":`,
120
+ h
121
121
  );
122
122
  }).finally(() => {
123
- t.delete(g);
124
- }), t.set(g, w)), await w;
123
+ t.delete(f);
124
+ }), t.set(f, E)), await E;
125
125
  })
126
- ), l(f);
126
+ ), l(g);
127
127
  }
128
- return { resolveSync: a, resolve: d };
128
+ return { resolveSync: c, resolve: a };
129
129
  }
130
- const Ue = {
130
+ const ze = {
131
131
  Preview: "Preview",
132
132
  Compose: "Compose",
133
133
  RenderedPage: "RenderedPage"
134
- }, Ie = {
134
+ }, Pe = {
135
135
  DroppableBox: "droppable-box"
136
- }, ze = {
136
+ }, He = {
137
137
  FlexStart: "flex-start",
138
138
  FlexEnd: "flex-end",
139
139
  Center: "center",
140
140
  SpaceBetween: "space-between",
141
141
  SpaceAround: "space-around",
142
142
  SpaceEvenly: "space-evenly"
143
- }, Ki = {
143
+ }, Bi = {
144
144
  FlexStart: "flex-start",
145
145
  FlexEnd: "flex-end",
146
146
  Center: "center",
@@ -148,56 +148,56 @@ const Ue = {
148
148
  SpaceAround: "space-around",
149
149
  SpaceEvenly: "space-evenly",
150
150
  Stretch: "stretch"
151
- }, _e = "cssAttrArray", Bi = {
151
+ }, we = "cssAttrArray", Ui = {
152
152
  Phone: "phone",
153
153
  Tablet: "tablet",
154
154
  Desktop: "desktop"
155
- }, ot = {
155
+ }, st = {
156
156
  ComposerComponent: "ComposerWidget",
157
157
  Collection: "Collection",
158
158
  MoveComponentHandle: "MoveWidgetHandle"
159
- }, st = `${ot.Collection}_`, $t = "dev.", en = "https://rulecms.com", tn = "https://widget-cache.rulecms.com", nn = "/api/v1/c/widget/get", rn = "/api/v1/c/dev/widget/get", on = "/api/v1/c/widget/resolve", sn = "/api/v1/c/dev/widget/resolve";
160
- function H(e) {
161
- return typeof e == "string" && e.startsWith($t);
159
+ }, it = `${st.Collection}_`, en = "dev.", tn = "https://rulecms.com", nn = "https://widget-cache.rulecms.com", on = "/api/v1/c/widget/get", rn = "/api/v1/c/dev/widget/get", sn = "/api/v1/c/widget/resolve", ln = "/api/v1/c/dev/widget/resolve";
160
+ function G(e) {
161
+ return typeof e == "string" && e.startsWith(en);
162
162
  }
163
- function it(e, t) {
164
- return t ? t.replace(/\/$/, "") : H(e) ? en : tn;
163
+ function lt(e, t) {
164
+ return t ? t.replace(/\/$/, "") : G(e) ? tn : nn;
165
165
  }
166
- function lt({
166
+ function ct({
167
167
  publishedKey: e,
168
168
  token: t,
169
- endpoint: r
169
+ endpoint: o
170
170
  }) {
171
- const o = H(t), s = o ? rn : nn, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
172
- return `${it(t, r)}${s}?${i.toString()}`;
171
+ const r = G(t), s = r ? rn : on, i = r ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
172
+ return `${lt(t, o)}${s}?${i.toString()}`;
173
173
  }
174
174
  function at({
175
175
  token: e,
176
176
  endpoint: t
177
177
  }) {
178
- const r = H(e) ? sn : on;
179
- return `${it(e, t)}${r}`;
178
+ const o = G(e) ? ln : sn;
179
+ return `${lt(e, t)}${o}`;
180
180
  }
181
- const Ui = ({ id: e, prefix: t }) => `${t}_${e}`, ln = (e) => {
181
+ const zi = ({ id: e, prefix: t }) => `${t}_${e}`, cn = (e) => {
182
182
  if (!(e != null && e.length) || !e.includes("_")) {
183
183
  console.error(`Invalid drag item id: ${e}. Type does not exist.`);
184
184
  return;
185
185
  }
186
186
  return an(e);
187
- }, ct = (e) => e.includes("_"), an = (e) => {
188
- const t = e.indexOf("_"), r = e.substring(0, t), o = e.substring(t + 1);
187
+ }, ut = (e) => e.includes("_"), an = (e) => {
188
+ const t = e.indexOf("_"), o = e.substring(0, t), r = e.substring(t + 1);
189
189
  return {
190
- prefix: r,
191
- id: o
190
+ prefix: o,
191
+ id: r
192
192
  };
193
- }, ut = (e) => {
194
- if (!ct(e))
193
+ }, dt = (e) => {
194
+ if (!ut(e))
195
195
  return;
196
- const r = ln(e);
197
- return (r == null ? void 0 : r.prefix) === ot.Collection || console.error(
196
+ const o = cn(e);
197
+ return (o == null ? void 0 : o.prefix) === st.Collection || console.error(
198
198
  "getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."
199
- ), r == null ? void 0 : r.id;
200
- }, zi = (e) => {
199
+ ), o == null ? void 0 : o.id;
200
+ }, Hi = (e) => {
201
201
  if (!(e != null && e.length)) {
202
202
  console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");
203
203
  return;
@@ -207,18 +207,18 @@ const Ui = ({ id: e, prefix: t }) => `${t}_${e}`, ln = (e) => {
207
207
  console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");
208
208
  return;
209
209
  }
210
- const r = t[0];
210
+ const o = t[0];
211
211
  if (!t[1].includes("@"))
212
- return { name: r, instanceId: t[1] };
212
+ return { name: o, instanceId: t[1] };
213
213
  const s = t[1].split("@");
214
- return { name: r, instanceId: s[0], parentId: s[1] };
215
- }, Hi = (e) => {
214
+ return { name: o, instanceId: s[0], parentId: s[1] };
215
+ }, Gi = (e) => {
216
216
  if (!(e != null && e.length))
217
217
  return { errorMessage: "getNameFromWidgetKey: Missing widget key" };
218
218
  const t = e.split("$");
219
219
  return t.length < 2 ? { errorMessage: "getNameFromWidgetKey: Invalid widget key format" } : { name: t[0] };
220
- }, cn = (e) => {
221
- var s, i, l, a;
220
+ }, un = (e) => {
221
+ var s, i, l, c;
222
222
  if (!e)
223
223
  return { error: "getWidgetKeyForCollection: Missing collection" };
224
224
  if (!((s = e.name) != null && s.length))
@@ -226,10 +226,10 @@ const Ui = ({ id: e, prefix: t }) => `${t}_${e}`, ln = (e) => {
226
226
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
227
227
  if (!((l = e.id) != null && l.length))
228
228
  return { error: "getWidgetKeyForCollection: Missing collection id" };
229
- const o = ((a = e.parentId) == null ? void 0 : a.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
230
- return { data: `${t}$${o}` };
231
- }, un = (e) => {
232
- var s, i, l, a;
229
+ const r = ((c = e.parentId) == null ? void 0 : c.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
230
+ return { data: `${t}$${r}` };
231
+ }, dn = (e) => {
232
+ var s, i, l, c;
233
233
  if (!e)
234
234
  return { error: "getWidgetKeyForPublishedCollection: Missing collection" };
235
235
  if (!((s = e.name) != null && s.length))
@@ -237,151 +237,151 @@ const Ui = ({ id: e, prefix: t }) => `${t}_${e}`, ln = (e) => {
237
237
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
238
238
  if (!((l = e.publishedKey) != null && l.length))
239
239
  return { error: "getWidgetKeyForPublishedCollection: Missing collection publishedKey" };
240
- const o = ((a = e.parentId) == null ? void 0 : a.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
241
- return { data: `${t}$${o}` };
242
- }, Gi = (e) => {
243
- const t = cn(e);
244
- return `${st}${t.data}`;
240
+ const r = ((c = e.parentId) == null ? void 0 : c.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
241
+ return { data: `${t}$${r}` };
245
242
  }, Yi = (e) => {
246
243
  const t = un(e);
247
- return `${st}${t.data}`;
248
- }, we = "---", dn = "___";
249
- function fn(e, t) {
250
- return `${e}${we}${t}`;
251
- }
252
- function Xi(e, t, r) {
253
- return `${fn(e, t)}${dn}${r}`;
254
- }
255
- function Ji(e) {
244
+ return `${it}${t.data}`;
245
+ }, Xi = (e) => {
246
+ const t = dn(e);
247
+ return `${it}${t.data}`;
248
+ }, Ae = "---", fn = "___";
249
+ function gn(e, t) {
250
+ return `${e}${Ae}${t}`;
251
+ }
252
+ function Ji(e, t, o) {
253
+ return `${gn(e, t)}${fn}${o}`;
254
+ }
255
+ function qi(e) {
256
256
  const t = e.split(".");
257
257
  if (t.length !== 3)
258
258
  throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);
259
- const r = t[0], o = t[1], s = parseInt(t[2], 10);
259
+ const o = t[0], r = t[1], s = parseInt(t[2], 10);
260
260
  if (isNaN(s))
261
261
  throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);
262
- return `${r}.${o}.${s + 1}`;
262
+ return `${o}.${r}.${s + 1}`;
263
263
  }
264
- function Pe({
264
+ function De({
265
265
  displayItemList: e,
266
266
  widgetCollections: t
267
267
  }) {
268
- const r = /* @__PURE__ */ new Set();
269
- let o = !1;
268
+ const o = /* @__PURE__ */ new Set();
269
+ let r = !1;
270
270
  const s = (i) => {
271
- var l, a, d;
271
+ var l, c, a;
272
272
  if ((l = i == null ? void 0 : i.rows) != null && l.length) {
273
- for (const u of i.rows)
274
- if ((a = u == null ? void 0 : u.columns) != null && a.length)
275
- for (const c of u.columns)
276
- c.collection && s(c.collection.collectionRows), !(!c.type || c.type === Ie.DroppableBox) && (ct(c.type) || (!((d = c.libraryId) != null && d.length) || c.libraryId === re ? o = !0 : r.add(c.libraryId)));
273
+ for (const d of i.rows)
274
+ if ((c = d == null ? void 0 : d.columns) != null && c.length)
275
+ for (const u of d.columns)
276
+ u.collection && s(u.collection.collectionRows), !(!u.type || u.type === Pe.DroppableBox) && (ut(u.type) || (!((a = u.libraryId) != null && a.length) || u.libraryId === re ? r = !0 : o.add(u.libraryId)));
277
277
  }
278
278
  };
279
279
  s(e);
280
280
  for (const i of Object.values(t ?? {}))
281
281
  s(i == null ? void 0 : i.collectionRows);
282
- return { libraryIds: Array.from(r), usesDefaultLibrary: o };
282
+ return { libraryIds: Array.from(o), usesDefaultLibrary: r };
283
283
  }
284
- const dt = Symbol("rulecms-widget-context");
285
- function gn() {
284
+ const ft = Symbol("rulecms-widget-context");
285
+ function pn() {
286
286
  return {
287
287
  token: "",
288
288
  endpoint: void 0,
289
289
  libraries: void 0,
290
- libraryRegistry: de()
290
+ libraryRegistry: fe()
291
291
  };
292
292
  }
293
- function qi(e, t) {
293
+ function Zi(e, t) {
294
294
  n.push(t, !0);
295
- const r = n.proxy(gn());
296
- function o() {
297
- r.token = t.token, r.endpoint = t.endpoint, r.libraries = t.libraries;
295
+ const o = n.proxy(pn());
296
+ function r() {
297
+ o.token = t.token, o.endpoint = t.endpoint, o.libraries = t.libraries;
298
298
  }
299
- o(), n.user_effect(o), Gt(dt, r);
299
+ r(), n.user_effect(r), Yt(ft, o);
300
300
  var s = n.comment(), i = n.first_child(s);
301
301
  n.snippet(i, () => t.children), n.append(e, s), n.pop();
302
302
  }
303
- const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1920, hn = {
303
+ const mn = "1200px", gt = "500px", pt = "820px", Qi = mn, yn = "rulecms", hn = 1920, bn = {
304
304
  f: "auto",
305
305
  q: "auto",
306
306
  c: "limit"
307
- }, bn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, vn = 300, Cn = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, _n = 100, wn = /^https:\/\/[^\s"'()\\<>]+$/, An = 2e3, En = /^[A-Za-z0-9_,.:\-/]*$/, Sn = 300, Tn = (e) => typeof e == "string" && e.length <= vn && bn.test(e), In = (e) => typeof e == "string" && e.length <= _n && Cn.test(e), Pn = (e) => typeof e == "string" && e.length <= An && wn.test(e), Dn = (e) => typeof e == "string" && e.length <= Sn && En.test(e), xn = (e) => Object.entries(e).map(([t, r]) => `${t}_${r}`).join(","), kn = (e) => {
307
+ }, vn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, Cn = 300, _n = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, wn = 100, An = /^https:\/\/[^\s"'()\\<>]+$/, En = 2e3, Sn = /^[A-Za-z0-9_,.:\-/]*$/, Tn = 300, In = (e) => typeof e == "string" && e.length <= Cn && vn.test(e), Pn = (e) => typeof e == "string" && e.length <= wn && _n.test(e), Dn = (e) => typeof e == "string" && e.length <= En && An.test(e), kn = (e) => typeof e == "string" && e.length <= Tn && Sn.test(e), xn = (e) => Object.entries(e).map(([t, o]) => `${t}_${o}`).join(","), Ln = (e) => {
308
308
  const t = {};
309
- for (const r of e.split(",")) {
310
- const o = r.trim(), s = o.indexOf("_");
311
- s <= 0 || (t[o.slice(0, s)] = o.slice(s + 1));
309
+ for (const o of e.split(",")) {
310
+ const r = o.trim(), s = r.indexOf("_");
311
+ s <= 0 || (t[r.slice(0, s)] = r.slice(s + 1));
312
312
  }
313
313
  return t;
314
- }, Ln = ({
314
+ }, Rn = ({
315
315
  publicId: e,
316
- cloudName: t = mn,
317
- transformations: r,
318
- width: o = yn
316
+ cloudName: t = yn,
317
+ transformations: o,
318
+ width: r = hn
319
319
  }) => {
320
- const s = typeof r == "string" ? kn(r) : r, i = {
321
- ...hn,
320
+ const s = typeof o == "string" ? Ln(o) : o, i = {
321
+ ...bn,
322
322
  ...s,
323
- w: o
323
+ w: r
324
324
  };
325
325
  return encodeURI(
326
326
  `https://res.cloudinary.com/${t}/image/upload/${xn(i)}/${e}`
327
327
  );
328
- }, Rn = /^--[A-Za-z0-9_-]+$/, On = 200, $ = (e) => {
328
+ }, On = /^--[A-Za-z0-9_-]+$/, jn = 200, ee = (e) => {
329
329
  if (typeof e != "string")
330
330
  return !1;
331
331
  const t = e.trim();
332
- return t.length <= On && Rn.test(t);
333
- }, B = (e) => `var(${e.trim()})`, k = (e) => {
332
+ return t.length <= jn && On.test(t);
333
+ }, U = (e) => `var(${e.trim()})`, k = (e) => {
334
334
  if (typeof e != "object" || e === null || Array.isArray(e))
335
335
  return;
336
336
  const t = e.cssVariable;
337
337
  if (t != null)
338
- return $(t) ? t.trim() : void 0;
339
- }, z = (e) => {
338
+ return ee(t) ? t.trim() : void 0;
339
+ }, H = (e) => {
340
340
  if (typeof e != "object" || e === null || Array.isArray(e))
341
341
  return !1;
342
342
  const t = e.cssVariable;
343
- return t == null ? !1 : !$(t);
344
- }, Qi = (e, t) => {
345
- const r = k(e);
346
- return r ? { [t]: B(r) } : void 0;
347
- }, jn = (e) => {
348
- if (typeof e != "object" || e === null || Array.isArray(e) || z(e))
343
+ return t == null ? !1 : !ee(t);
344
+ }, $i = (e, t) => {
345
+ const o = k(e);
346
+ return o ? { [t]: U(o) } : void 0;
347
+ }, Nn = (e) => {
348
+ if (typeof e != "object" || e === null || Array.isArray(e) || H(e))
349
349
  return !1;
350
350
  if (k(e))
351
351
  return !0;
352
352
  const t = e;
353
- return t.source === "none" ? !0 : t.source === "url" ? Pn(t.url) : t.source === "cloudinary" ? !Tn(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !In(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || Dn(t.transformations) : !1;
354
- }, Nn = ["px", "%", "em", "rem", "vh", "vw"], De = ["inherit", "unset"], Mn = ["allSides", "top", "right", "bottom", "left"], Z = (e, t = {}) => {
353
+ return t.source === "none" ? !0 : t.source === "url" ? Dn(t.url) : t.source === "cloudinary" ? !In(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !Pn(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || kn(t.transformations) : !1;
354
+ }, Mn = ["px", "%", "em", "rem", "vh", "vw"], ke = ["inherit", "unset"], Wn = ["allSides", "top", "right", "bottom", "left"], Q = (e, t = {}) => {
355
355
  if (typeof e != "object" || e === null || Array.isArray(e))
356
356
  return !1;
357
- const r = e;
358
- return z(e) ? !1 : k(e) ? !0 : r.unit === "auto" ? t.allowAuto !== !1 : r.unit === "keyword" ? t.allowKeywords !== !1 && De.includes(r.keyword) : Nn.includes(r.unit) ? typeof r.value != "number" || !Number.isFinite(r.value) ? !1 : t.allowNegative !== !1 || r.value >= 0 : !1;
359
- }, Wn = (e, t = {}) => {
357
+ const o = e;
358
+ return H(e) ? !1 : k(e) ? !0 : o.unit === "auto" ? t.allowAuto !== !1 : o.unit === "keyword" ? t.allowKeywords !== !1 && ke.includes(o.keyword) : Mn.includes(o.unit) ? typeof o.value != "number" || !Number.isFinite(o.value) ? !1 : t.allowNegative !== !1 || o.value >= 0 : !1;
359
+ }, Vn = (e, t = {}) => {
360
360
  if (typeof e != "object" || e === null || Array.isArray(e))
361
361
  return !1;
362
- const r = e;
363
- for (const o of Mn) {
364
- const s = r[o];
365
- if (s != null && !Z(s, t))
362
+ const o = e;
363
+ for (const r of Wn) {
364
+ const s = o[r];
365
+ if (s != null && !Q(s, t))
366
366
  return !1;
367
367
  }
368
368
  return !0;
369
- }, Vn = [...De, "transparent", "currentColor"], Fn = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, xe = (e) => {
369
+ }, Fn = [...ke, "transparent", "currentColor"], Kn = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, xe = (e) => {
370
370
  if (typeof e != "object" || e === null || Array.isArray(e))
371
371
  return !1;
372
372
  const t = e;
373
- return z(e) ? !1 : k(e) ? !0 : t.unit === "keyword" ? Vn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Fn.test(t.value.trim()) : !1;
374
- }, ke = (e) => {
373
+ return H(e) ? !1 : k(e) ? !0 : t.unit === "keyword" ? Fn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Kn.test(t.value.trim()) : !1;
374
+ }, Le = (e) => {
375
375
  const t = k(e);
376
- return t ? B(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
377
- }, Kn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : De.includes(e), Bn = [
376
+ return t ? U(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
377
+ }, Bn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !H(e) && !!k(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : ke.includes(e), Un = [
378
378
  'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
379
379
  'Georgia, "Times New Roman", Times, serif',
380
380
  "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
381
381
  "Arial, Helvetica, sans-serif",
382
382
  '"Helvetica Neue", Helvetica, Arial, sans-serif',
383
383
  "Verdana, Geneva, sans-serif"
384
- ], Un = [
384
+ ], zn = [
385
385
  "normal",
386
386
  "bold",
387
387
  "100",
@@ -393,43 +393,43 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
393
393
  "700",
394
394
  "800",
395
395
  "900"
396
- ], zn = ["normal", "italic", "oblique"], Hn = [
396
+ ], Hn = ["normal", "italic", "oblique"], Gn = [
397
397
  "left",
398
398
  "center",
399
399
  "right",
400
400
  "justify",
401
401
  "start",
402
402
  "end"
403
- ], Gn = [
403
+ ], Yn = [
404
404
  "none",
405
405
  "underline",
406
406
  "line-through",
407
407
  "overline"
408
- ], Yn = [
408
+ ], Xn = [
409
409
  "none",
410
410
  "uppercase",
411
411
  "lowercase",
412
412
  "capitalize"
413
- ], be = [
413
+ ], ve = [
414
414
  "visible",
415
415
  "hidden",
416
416
  "scroll",
417
417
  "auto",
418
418
  "clip"
419
- ], Xn = ["auto", "none"], Jn = [
419
+ ], Jn = ["auto", "none"], qn = [
420
420
  "flex-start",
421
421
  "flex-end",
422
422
  "center",
423
423
  "space-between",
424
424
  "space-around",
425
425
  "space-evenly"
426
- ], qn = [
426
+ ], Zn = [
427
427
  "flex-start",
428
428
  "flex-end",
429
429
  "center",
430
430
  "baseline",
431
431
  "stretch"
432
- ], Zn = ["wrap", "nowrap"], Qn = [
432
+ ], Qn = ["wrap", "nowrap"], $n = [
433
433
  "flex-start",
434
434
  "flex-end",
435
435
  "center",
@@ -437,12 +437,12 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
437
437
  "space-around",
438
438
  "space-evenly",
439
439
  "stretch"
440
- ], $n = [
440
+ ], eo = [
441
441
  "row",
442
442
  "row-reverse",
443
443
  "column",
444
444
  "column-reverse"
445
- ], er = ["cover", "contain", "auto"], tr = [
445
+ ], to = ["cover", "contain", "auto"], no = [
446
446
  "center center",
447
447
  "center top",
448
448
  "center bottom",
@@ -452,20 +452,20 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
452
452
  "right center",
453
453
  "right top",
454
454
  "right bottom"
455
- ], nr = [
455
+ ], oo = [
456
456
  "no-repeat",
457
457
  "repeat",
458
458
  "repeat-x",
459
459
  "repeat-y",
460
460
  "space",
461
461
  "round"
462
- ], rr = [
462
+ ], ro = [
463
463
  "justifyContent",
464
464
  "alignItems",
465
465
  "flexWrap",
466
466
  "alignContent",
467
467
  "flexDirection"
468
- ], or = [
468
+ ], so = [
469
469
  "none",
470
470
  "solid",
471
471
  "dashed",
@@ -475,107 +475,107 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
475
475
  "ridge",
476
476
  "inset",
477
477
  "outset"
478
- ], sr = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : or.includes(e), ir = (e) => {
478
+ ], io = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !H(e) && !!k(e) : so.includes(e), lo = (e) => {
479
479
  if (typeof e != "object" || e === null || Array.isArray(e))
480
480
  return !1;
481
481
  const t = e;
482
- return z(e) ? !1 : k(e) ? !0 : !(t.width !== void 0 && t.width !== null && !Z(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !sr(t.style) || t.color !== void 0 && t.color !== null && !xe(t.color));
483
- }, lr = {
482
+ return H(e) ? !1 : k(e) ? !0 : !(t.width !== void 0 && t.width !== null && !Q(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !io(t.style) || t.color !== void 0 && t.color !== null && !xe(t.color));
483
+ }, co = {
484
484
  allowAuto: !1,
485
485
  allowKeywords: !1,
486
486
  allowNegative: !0
487
- }, ar = {
487
+ }, ao = {
488
488
  allowAuto: !1,
489
489
  allowKeywords: !1,
490
490
  allowNegative: !1
491
- }, cr = (e) => {
491
+ }, uo = (e) => {
492
492
  if (typeof e != "object" || e === null || Array.isArray(e))
493
493
  return !1;
494
494
  const t = e;
495
- if (z(e))
495
+ if (H(e))
496
496
  return !1;
497
497
  if (k(e))
498
498
  return !0;
499
- for (const r of ["offsetX", "offsetY", "spread"]) {
500
- const o = t[r];
501
- if (o != null && !Z(o, lr))
499
+ for (const o of ["offsetX", "offsetY", "spread"]) {
500
+ const r = t[o];
501
+ if (r != null && !Q(r, co))
502
502
  return !1;
503
503
  }
504
- return !(t.blur !== void 0 && t.blur !== null && !Z(t.blur, ar) || t.color !== void 0 && t.color !== null && !xe(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
505
- }, ur = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, dr = (e) => {
504
+ return !(t.blur !== void 0 && t.blur !== null && !Q(t.blur, ao) || t.color !== void 0 && t.color !== null && !xe(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
505
+ }, fo = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, go = (e) => {
506
506
  if (typeof e != "object" || e === null || Array.isArray(e))
507
507
  return !1;
508
508
  const t = e;
509
- return z(e) ? !1 : k(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : Z(e, { allowAuto: !1, allowNegative: !1 });
510
- }, fr = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !z(e) && !!k(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, gr = (e) => {
511
- if (!jn(e))
509
+ return H(e) ? !1 : k(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : Q(e, { allowAuto: !1, allowNegative: !1 });
510
+ }, po = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !H(e) && !!k(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, mo = (e) => {
511
+ if (!Nn(e))
512
512
  return {};
513
513
  const t = k(e);
514
514
  if (t)
515
- return { backgroundImage: B(t) };
516
- const r = e;
517
- return r.source === "none" ? { backgroundImage: "none" } : r.source === "url" ? { backgroundImage: `url("${r.url}")` } : {
518
- backgroundImage: `url("${Ln({
519
- publicId: r.publicId,
520
- cloudName: r.cloudName,
521
- transformations: r.transformations
515
+ return { backgroundImage: U(t) };
516
+ const o = e;
517
+ return o.source === "none" ? { backgroundImage: "none" } : o.source === "url" ? { backgroundImage: `url("${o.url}")` } : {
518
+ backgroundImage: `url("${Rn({
519
+ publicId: o.publicId,
520
+ cloudName: o.cloudName,
521
+ transformations: o.transformations
522
522
  })}")`
523
523
  };
524
- }, Q = (e) => {
524
+ }, $ = (e) => {
525
525
  const t = k(e);
526
- return t ? B(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
527
- }, pr = (e) => {
528
- if (!ir(e))
526
+ return t ? U(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
527
+ }, yo = (e) => {
528
+ if (!lo(e))
529
529
  return {};
530
530
  const t = k(e);
531
531
  if (t)
532
- return { border: B(t) };
533
- const r = {};
534
- if (e.width && (r.borderWidth = Q(e.width)), e.style) {
535
- const o = k(e.style);
536
- r.borderStyle = o ? B(o) : e.style;
537
- }
538
- return e.color && (r.borderColor = ke(e.color)), r;
539
- }, le = (e) => e ? Q(e) : "0px", mr = (e) => {
540
- if (!cr(e) || !ur(e))
532
+ return { border: U(t) };
533
+ const o = {};
534
+ if (e.width && (o.borderWidth = $(e.width)), e.style) {
535
+ const r = k(e.style);
536
+ o.borderStyle = r ? U(r) : e.style;
537
+ }
538
+ return e.color && (o.borderColor = Le(e.color)), o;
539
+ }, ce = (e) => e ? $(e) : "0px", ho = (e) => {
540
+ if (!uo(e) || !fo(e))
541
541
  return {};
542
542
  const t = k(e);
543
543
  if (t)
544
- return { boxShadow: B(t) };
545
- const r = [
546
- le(e.offsetX),
547
- le(e.offsetY),
548
- le(e.blur),
549
- le(e.spread)
544
+ return { boxShadow: U(t) };
545
+ const o = [
546
+ ce(e.offsetX),
547
+ ce(e.offsetY),
548
+ ce(e.blur),
549
+ ce(e.spread)
550
550
  ];
551
- return e.color && r.push(ke(e.color)), e.inset && r.unshift("inset"), { boxShadow: r.join(" ") };
552
- }, yr = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, hr = (e, t) => {
553
- if (!Wn(e))
551
+ return e.color && o.push(Le(e.color)), e.inset && o.unshift("inset"), { boxShadow: o.join(" ") };
552
+ }, bo = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, vo = (e, t) => {
553
+ if (!Vn(e))
554
554
  return {};
555
555
  if (e.allSides)
556
- return { [t]: Q(e.allSides) };
557
- const r = {};
558
- for (const o of ["top", "right", "bottom", "left"]) {
559
- const s = e[o];
560
- s && (r[`${t}${yr(o)}`] = Q(s));
556
+ return { [t]: $(e.allSides) };
557
+ const o = {};
558
+ for (const r of ["top", "right", "bottom", "left"]) {
559
+ const s = e[r];
560
+ s && (o[`${t}${bo(r)}`] = $(s));
561
561
  }
562
- return r;
563
- }, br = (e, t) => xe(e) ? { [t]: ke(e) } : {}, vr = (e, t, r) => {
564
- if (!Kn(e, r))
562
+ return o;
563
+ }, Co = (e, t) => xe(e) ? { [t]: Le(e) } : {}, _o = (e, t, o) => {
564
+ if (!Bn(e, o))
565
565
  return {};
566
- const o = k(e);
567
- return o ? { [t]: B(o) } : { [t]: e };
568
- }, Cr = (e, t, r = {}) => Z(e, r) ? { [t]: Q(e) } : {}, _r = (e) => {
569
- if (!dr(e))
566
+ const r = k(e);
567
+ return r ? { [t]: U(r) } : { [t]: e };
568
+ }, wo = (e, t, o = {}) => Q(e, o) ? { [t]: $(e) } : {}, Ao = (e) => {
569
+ if (!go(e))
570
570
  return {};
571
571
  const t = k(e);
572
- return t ? { lineHeight: B(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: Q(e) };
573
- }, wr = (e) => {
574
- if (!fr(e))
572
+ return t ? { lineHeight: U(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: $(e) };
573
+ }, Eo = (e) => {
574
+ if (!po(e))
575
575
  return {};
576
576
  const t = k(e);
577
- return t ? { opacity: B(t) } : { opacity: e };
578
- }, Le = {
577
+ return t ? { opacity: U(t) } : { opacity: e };
578
+ }, Re = {
579
579
  // Box spacing (4-sided)
580
580
  "margin-3-resolutions": { kind: "boxSpacing", cssProperty: "margin" },
581
581
  "padding-3-resolutions": { kind: "boxSpacing", cssProperty: "padding" },
@@ -629,44 +629,44 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
629
629
  "justify-content-3-resolutions": {
630
630
  kind: "enum",
631
631
  cssProperty: "justifyContent",
632
- allowedValues: Jn
632
+ allowedValues: qn
633
633
  },
634
634
  "align-items-3-resolutions": {
635
635
  kind: "enum",
636
636
  cssProperty: "alignItems",
637
- allowedValues: qn
637
+ allowedValues: Zn
638
638
  },
639
639
  "flex-wrap-3-resolutions": {
640
640
  kind: "enum",
641
641
  cssProperty: "flexWrap",
642
- allowedValues: Zn
642
+ allowedValues: Qn
643
643
  },
644
644
  "align-content-3-resolutions": {
645
645
  kind: "enum",
646
646
  cssProperty: "alignContent",
647
- allowedValues: Qn
647
+ allowedValues: $n
648
648
  },
649
649
  "flex-direction-3-resolutions": {
650
650
  kind: "enum",
651
651
  cssProperty: "flexDirection",
652
- allowedValues: $n
652
+ allowedValues: eo
653
653
  },
654
654
  // Overflow — shorthand and longhands are independent attributes; when
655
655
  // both are set, the browser's cascade decides the effective overflow.
656
656
  "overflow-3-resolutions": {
657
657
  kind: "enum",
658
658
  cssProperty: "overflow",
659
- allowedValues: be
659
+ allowedValues: ve
660
660
  },
661
661
  "overflow-x-3-resolutions": {
662
662
  kind: "enum",
663
663
  cssProperty: "overflowX",
664
- allowedValues: be
664
+ allowedValues: ve
665
665
  },
666
666
  "overflow-y-3-resolutions": {
667
667
  kind: "enum",
668
668
  cssProperty: "overflowY",
669
- allowedValues: be
669
+ allowedValues: ve
670
670
  },
671
671
  // Color
672
672
  // Pointer input. On an overlay layer this is lifted onto the absolutely
@@ -674,7 +674,7 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
674
674
  "pointer-events-3-resolutions": {
675
675
  kind: "enum",
676
676
  cssProperty: "pointerEvents",
677
- allowedValues: Xn
677
+ allowedValues: Jn
678
678
  },
679
679
  "background-color-3-resolutions": { kind: "color", cssProperty: "backgroundColor" },
680
680
  "color-3-resolutions": { kind: "color", cssProperty: "color" },
@@ -685,17 +685,17 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
685
685
  "background-size-3-resolutions": {
686
686
  kind: "enum",
687
687
  cssProperty: "backgroundSize",
688
- allowedValues: er
688
+ allowedValues: to
689
689
  },
690
690
  "background-position-3-resolutions": {
691
691
  kind: "enum",
692
692
  cssProperty: "backgroundPosition",
693
- allowedValues: tr
693
+ allowedValues: no
694
694
  },
695
695
  "background-repeat-3-resolutions": {
696
696
  kind: "enum",
697
697
  cssProperty: "backgroundRepeat",
698
- allowedValues: nr
698
+ allowedValues: oo
699
699
  },
700
700
  // Opacity (0–1 number)
701
701
  "opacity-3-resolutions": { kind: "opacity" },
@@ -703,7 +703,7 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
703
703
  "font-family-3-resolutions": {
704
704
  kind: "enum",
705
705
  cssProperty: "fontFamily",
706
- allowedValues: Bn
706
+ allowedValues: Un
707
707
  },
708
708
  "font-size-3-resolutions": {
709
709
  kind: "length",
@@ -713,12 +713,12 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
713
713
  "font-weight-3-resolutions": {
714
714
  kind: "enum",
715
715
  cssProperty: "fontWeight",
716
- allowedValues: Un
716
+ allowedValues: zn
717
717
  },
718
718
  "font-style-3-resolutions": {
719
719
  kind: "enum",
720
720
  cssProperty: "fontStyle",
721
- allowedValues: zn
721
+ allowedValues: Hn
722
722
  },
723
723
  "line-height-3-resolutions": { kind: "lineHeight" },
724
724
  "letter-spacing-3-resolutions": {
@@ -729,176 +729,176 @@ const pn = "1200px", ft = "500px", gt = "820px", Zi = pn, mn = "rulecms", yn = 1
729
729
  "text-align-3-resolutions": {
730
730
  kind: "enum",
731
731
  cssProperty: "textAlign",
732
- allowedValues: Hn
732
+ allowedValues: Gn
733
733
  },
734
734
  "text-decoration-3-resolutions": {
735
735
  kind: "enum",
736
736
  cssProperty: "textDecoration",
737
- allowedValues: Gn
737
+ allowedValues: Yn
738
738
  },
739
739
  "text-transform-3-resolutions": {
740
740
  kind: "enum",
741
741
  cssProperty: "textTransform",
742
- allowedValues: Yn
742
+ allowedValues: Xn
743
743
  }
744
- }, Ar = (e, t) => {
745
- const r = Le[e];
746
- if (!r)
744
+ }, So = (e, t) => {
745
+ const o = Re[e];
746
+ if (!o)
747
747
  return {};
748
- switch (r.kind) {
748
+ switch (o.kind) {
749
749
  case "boxSpacing":
750
- return hr(t, r.cssProperty);
750
+ return vo(t, o.cssProperty);
751
751
  case "length":
752
- return Cr(t, r.cssProperty, r.capabilities);
752
+ return wo(t, o.cssProperty, o.capabilities);
753
753
  case "border":
754
- return pr(t);
754
+ return yo(t);
755
755
  case "boxShadow":
756
- return mr(t);
756
+ return ho(t);
757
757
  case "color":
758
- return br(t, r.cssProperty);
758
+ return Co(t, o.cssProperty);
759
759
  case "opacity":
760
- return wr(t);
760
+ return Eo(t);
761
761
  case "enum":
762
- return vr(t, r.cssProperty, r.allowedValues);
762
+ return _o(t, o.cssProperty, o.allowedValues);
763
763
  case "lineHeight":
764
- return _r(t);
764
+ return Ao(t);
765
765
  case "backgroundImage":
766
- return gr(t);
766
+ return mo(t);
767
767
  default:
768
768
  return {};
769
769
  }
770
- }, $i = Object.fromEntries(
771
- Object.entries(Le).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
770
+ }, el = Object.fromEntries(
771
+ Object.entries(Re).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
772
772
  e,
773
773
  t.cssProperty
774
774
  ])
775
- ), Er = (e) => e != null && e !== "", Sr = (e) => e ? !rr.some(
776
- (r) => Er(e[r])
777
- ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, Tr = ({
775
+ ), To = (e) => e != null && e !== "", Io = (e) => e ? !ro.some(
776
+ (o) => To(e[o])
777
+ ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, Po = ({
778
778
  dbEntryType: e,
779
779
  libraryId: t,
780
- sourceComponentsPlugin: r
780
+ sourceComponentsPlugin: o
781
781
  }) => {
782
782
  if (!(e != null && e.length))
783
783
  return;
784
- const o = r.components[rt(t, e)];
785
- if (!o || !("defaultAttributeValues" in o))
784
+ const r = o.components[rt(t, e)];
785
+ if (!r || !("defaultAttributeValues" in r))
786
786
  return;
787
- const i = o.defaultAttributeValues;
787
+ const i = r.defaultAttributeValues;
788
788
  if (i != null && i.length)
789
- return i.reduce((l, a) => ({
789
+ return i.reduce((l, c) => ({
790
790
  ...l,
791
- [a.name]: a.defaultValues
791
+ [c.name]: c.defaultValues
792
792
  }), {});
793
- }, G = ({
793
+ }, Y = ({
794
794
  deviceDisplayType: e,
795
795
  componentAttributes: t
796
796
  }) => {
797
797
  if (!t)
798
798
  return;
799
- const r = {}, o = {};
799
+ const o = {}, r = {};
800
800
  for (const [s, i] of Object.entries(
801
801
  t
802
802
  )) {
803
803
  if (!s.includes("3-resolutions") || !i)
804
804
  continue;
805
- const l = i.all, a = l ?? i[e.toLowerCase()];
806
- o[s] = a, Le[s] && Object.assign(r, Ar(s, a));
805
+ const l = i.all, c = l ?? i[e.toLowerCase()];
806
+ r[s] = c, Re[s] && Object.assign(o, So(s, c));
807
807
  }
808
- return Object.keys(r).length || Object.keys(o).length ? {
809
- styles: Object.keys(r).length ? r : void 0,
808
+ return Object.keys(o).length || Object.keys(r).length ? {
809
+ styles: Object.keys(o).length ? o : void 0,
810
810
  componentAttributesSpecificToDeviceType: Object.keys(
811
- o
812
- ).length ? o : void 0
811
+ r
812
+ ).length ? r : void 0
813
813
  } : void 0;
814
- }, Ir = ({
814
+ }, Do = ({
815
815
  defaultAttributes: e,
816
816
  userModifiedAttributes: t
817
817
  }) => e ? t ? { ...e, ...t } : e : t;
818
- function ce(e) {
818
+ function ue(e) {
819
819
  return e.componentAttributes ?? e.widgetAttributes;
820
820
  }
821
- function He({
821
+ function Ge({
822
822
  col: e,
823
823
  deviceDisplayType: t,
824
- isComposeMode: r,
825
- sourceComponentsPlugin: o
824
+ isComposeMode: o,
825
+ sourceComponentsPlugin: r
826
826
  }) {
827
- const s = ce(e), i = Tr({
827
+ const s = ue(e), i = Po({
828
828
  dbEntryType: e.type,
829
829
  libraryId: e.libraryId,
830
- sourceComponentsPlugin: o
831
- }) || [], l = Ir({
830
+ sourceComponentsPlugin: r
831
+ }) || [], l = Do({
832
832
  defaultAttributes: i,
833
833
  userModifiedAttributes: s
834
- }), { styles: a, componentAttributesSpecificToDeviceType: d } = G({
834
+ }), { styles: c, componentAttributesSpecificToDeviceType: a } = Y({
835
835
  deviceDisplayType: t,
836
836
  componentAttributes: l
837
837
  }) || {
838
838
  styles: void 0,
839
839
  componentAttributesSpecificToDeviceType: void 0
840
840
  };
841
- let u = {};
842
- const c = {};
843
- if (a)
844
- for (const [g, A] of Object.entries(a))
845
- r && c[g] || (u = {
846
- ...u,
847
- [g]: A
841
+ let d = {};
842
+ const u = {};
843
+ if (c)
844
+ for (const [f, w] of Object.entries(c))
845
+ o && u[f] || (d = {
846
+ ...d,
847
+ [f]: w
848
848
  });
849
- let f = ce(e);
850
- for (const g in d)
851
- if (g.includes("3-resolutions")) {
852
- f = {
853
- ...ce(e) || {},
854
- ...d || {}
849
+ let g = ue(e);
850
+ for (const f in a)
851
+ if (f.includes("3-resolutions")) {
852
+ g = {
853
+ ...ue(e) || {},
854
+ ...a || {}
855
855
  };
856
856
  break;
857
857
  }
858
- const p = Sr(u);
859
- if (r && p.pointerEvents !== void 0) {
860
- const g = { ...p };
861
- return delete g.pointerEvents, {
862
- componentAttributesBasedOnDevice: f,
863
- componentStyles: g
858
+ const m = Io(d);
859
+ if (o && m.pointerEvents !== void 0) {
860
+ const f = { ...m };
861
+ return delete f.pointerEvents, {
862
+ componentAttributesBasedOnDevice: g,
863
+ componentStyles: f
864
864
  };
865
865
  }
866
866
  return {
867
- componentAttributesBasedOnDevice: f,
868
- componentStyles: p
867
+ componentAttributesBasedOnDevice: g,
868
+ componentStyles: m
869
869
  };
870
870
  }
871
- const Pr = (e) => {
871
+ const ko = (e) => {
872
872
  const t = (e == null ? void 0 : e.rows) || [];
873
- for (const r of t)
874
- if (((r == null ? void 0 : r.columns) || []).length > 0)
873
+ for (const o of t)
874
+ if (((o == null ? void 0 : o.columns) || []).length > 0)
875
875
  return !0;
876
876
  return (e == null ? void 0 : e.containerAttributes) && Object.keys(e.containerAttributes).length > 0;
877
- }, Dr = "var(--sl-spacing-x-small)";
878
- function xr(e) {
877
+ }, xo = "var(--sl-spacing-x-small)";
878
+ function Lo(e) {
879
879
  return e != null && e.horizontalAlignment || e != null && e.verticalAlignment || e != null && e.flexWrap || e != null && e.gap || e != null && e.alignContent ? !0 : !!(e != null && e.rowAttributes && Object.keys(e.rowAttributes).length > 0);
880
880
  }
881
- function kr({
881
+ function Ro({
882
882
  row: e,
883
883
  deviceDisplayType: t
884
884
  }) {
885
- var o;
886
- const r = G({
885
+ var r;
886
+ const o = Y({
887
887
  deviceDisplayType: t,
888
888
  componentAttributes: e.rowAttributes
889
889
  });
890
- return ((o = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : o["hide-component-3-resolutions"]) === "true";
890
+ return ((r = o == null ? void 0 : o.componentAttributesSpecificToDeviceType) == null ? void 0 : r["hide-component-3-resolutions"]) === "true";
891
891
  }
892
- function Lr({
892
+ function Oo({
893
893
  row: e,
894
894
  deviceDisplayType: t,
895
- isComposeMode: r
895
+ isComposeMode: o
896
896
  }) {
897
- var g;
898
- const o = ((g = G({
897
+ var f;
898
+ const r = ((f = Y({
899
899
  deviceDisplayType: t,
900
900
  componentAttributes: e.rowAttributes
901
- })) == null ? void 0 : g.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? ze.Center, i = o.alignItems ?? e.verticalAlignment ?? ze.Center, l = o.flexDirection ?? "row", a = o.gap ?? e.gap ?? Dr, d = r ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", u = o.alignContent ?? e.alignContent ?? void 0, c = /* @__PURE__ */ new Set([
901
+ })) == null ? void 0 : f.styles) || {}, s = r.justifyContent ?? e.horizontalAlignment ?? He.Center, i = r.alignItems ?? e.verticalAlignment ?? He.Center, l = r.flexDirection ?? "row", c = r.gap ?? e.gap ?? xo, a = o ? "nowrap" : r.flexWrap ?? e.flexWrap ?? "nowrap", d = r.alignContent ?? e.alignContent ?? void 0, u = /* @__PURE__ */ new Set([
902
902
  "justifyContent",
903
903
  "alignItems",
904
904
  "flexDirection",
@@ -906,39 +906,39 @@ function Lr({
906
906
  "flexWrap",
907
907
  "alignContent",
908
908
  "display"
909
- ]), f = {};
910
- for (const [A, w] of Object.entries(o))
911
- c.has(A) || (f[A] = w);
912
- const p = {
909
+ ]), g = {};
910
+ for (const [w, E] of Object.entries(r))
911
+ u.has(w) || (g[w] = E);
912
+ const m = {
913
913
  display: "flex",
914
914
  flexDirection: l,
915
- gap: a,
916
- flexWrap: d,
915
+ gap: c,
916
+ flexWrap: a,
917
917
  justifyContent: s,
918
918
  alignItems: i,
919
- ...f
919
+ ...g
920
920
  };
921
- return u !== void 0 && (p.alignContent = u), p;
921
+ return d !== void 0 && (m.alignContent = d), m;
922
922
  }
923
- const Re = "css-classes-3-resolutions", Rr = 500, Or = /[\x00-\x1f\x7f]/g, Oe = (e) => {
923
+ const Oe = "css-classes-3-resolutions", jo = 500, No = /[\x00-\x1f\x7f]/g, je = (e) => {
924
924
  if (typeof e != "string")
925
925
  return;
926
- const t = /* @__PURE__ */ new Set(), r = [];
926
+ const t = /* @__PURE__ */ new Set(), o = [];
927
927
  for (const s of e.split(/\s+/)) {
928
- const i = s.replace(Or, "");
929
- i && (t.has(i) || (t.add(i), r.push(i)));
928
+ const i = s.replace(No, "");
929
+ i && (t.has(i) || (t.add(i), o.push(i)));
930
930
  }
931
- if (!r.length)
931
+ if (!o.length)
932
932
  return;
933
- let o = "";
934
- for (const s of r) {
935
- const i = o ? `${o} ${s}` : s;
936
- if (i.length > Rr)
933
+ let r = "";
934
+ for (const s of o) {
935
+ const i = r ? `${r} ${s}` : s;
936
+ if (i.length > jo)
937
937
  break;
938
- o = i;
938
+ r = i;
939
939
  }
940
- return o.length ? o : void 0;
941
- }, pt = "hide-component-3-resolutions", jr = "pointer-events-3-resolutions", Nr = [
940
+ return r.length ? r : void 0;
941
+ }, mt = "hide-component-3-resolutions", Mo = "pointer-events-3-resolutions", Wo = [
942
942
  "width-3-resolutions",
943
943
  "min-width-3-resolutions",
944
944
  "max-width-3-resolutions",
@@ -953,107 +953,107 @@ const Re = "css-classes-3-resolutions", Rr = 500, Or = /[\x00-\x1f\x7f]/g, Oe =
953
953
  "overflow-3-resolutions",
954
954
  "overflow-x-3-resolutions",
955
955
  "overflow-y-3-resolutions",
956
- pt,
957
- jr
958
- ], Mr = new Set(
959
- Nr
956
+ mt,
957
+ Mo
958
+ ], Vo = new Set(
959
+ Wo
960
960
  );
961
- function je({
961
+ function Ne({
962
962
  containerAttributes: e,
963
963
  deviceDisplayType: t
964
964
  }) {
965
- var o;
966
- const r = G({
965
+ var r;
966
+ const o = Y({
967
967
  deviceDisplayType: t,
968
968
  componentAttributes: e
969
969
  });
970
- return ((o = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : o[pt]) === "true";
970
+ return ((r = o == null ? void 0 : o.componentAttributesSpecificToDeviceType) == null ? void 0 : r[mt]) === "true";
971
971
  }
972
- function mt({
972
+ function yt({
973
973
  containerAttributes: e,
974
974
  deviceDisplayType: t,
975
- isComposeMode: r
975
+ isComposeMode: o
976
976
  }) {
977
977
  var i;
978
978
  if (!e)
979
979
  return { styles: {} };
980
- const o = r ? Object.fromEntries(
980
+ const r = o ? Object.fromEntries(
981
981
  Object.entries(e).filter(
982
- ([l]) => !Mr.has(l)
982
+ ([l]) => !Vo.has(l)
983
983
  )
984
- ) : e, s = G({
984
+ ) : e, s = Y({
985
985
  deviceDisplayType: t,
986
- componentAttributes: o
986
+ componentAttributes: r
987
987
  });
988
988
  return {
989
989
  styles: (s == null ? void 0 : s.styles) ?? {},
990
- cssClasses: Oe(
991
- (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Re]
990
+ cssClasses: je(
991
+ (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Oe]
992
992
  )
993
993
  };
994
994
  }
995
- function Wr(e) {
995
+ function Fo(e) {
996
996
  return Object.keys(e.styles).length > 0 || !!e.cssClasses;
997
997
  }
998
- function yt({
998
+ function ht({
999
999
  containerAttributes: e,
1000
1000
  widgetContainerStyles: t
1001
1001
  }) {
1002
- return ((e == null ? void 0 : e[_e]) || []).some(
1003
- (o) => o.toLowerCase().startsWith("height:")
1002
+ return ((e == null ? void 0 : e[we]) || []).some(
1003
+ (r) => r.toLowerCase().startsWith("height:")
1004
1004
  ) || t.styles.height !== void 0;
1005
1005
  }
1006
- const Vr = "z-index-3-resolutions", ht = 0;
1007
- function Fr(e) {
1008
- var t, r;
1009
- return !!((r = (t = e == null ? void 0 : e.overlayLayers) == null ? void 0 : t.layers) != null && r.length);
1006
+ const Ko = "z-index-3-resolutions", bt = 0;
1007
+ function Bo(e) {
1008
+ var t, o;
1009
+ return !!((o = (t = e == null ? void 0 : e.overlayLayers) == null ? void 0 : t.layers) != null && o.length);
1010
1010
  }
1011
- function Ge({
1011
+ function Ye({
1012
1012
  containerAttributes: e,
1013
1013
  deviceDisplayType: t
1014
1014
  }) {
1015
1015
  var s;
1016
- const r = G({
1016
+ const o = Y({
1017
1017
  deviceDisplayType: t,
1018
1018
  componentAttributes: e
1019
- }), o = (s = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Vr];
1020
- if (typeof o == "number" && Number.isFinite(o))
1021
- return o;
1022
- if (typeof o == "string" && o.trim().length) {
1023
- const i = Number(o);
1019
+ }), r = (s = o == null ? void 0 : o.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Ko];
1020
+ if (typeof r == "number" && Number.isFinite(r))
1021
+ return r;
1022
+ if (typeof r == "string" && r.trim().length) {
1023
+ const i = Number(r);
1024
1024
  if (Number.isFinite(i))
1025
1025
  return i;
1026
1026
  }
1027
- return ht;
1027
+ return bt;
1028
1028
  }
1029
- function Kr(e, t) {
1029
+ function Uo(e, t) {
1030
1030
  return e + t + 1;
1031
1031
  }
1032
- function Br({
1032
+ function zo({
1033
1033
  containerAttributes: e,
1034
1034
  deviceDisplayType: t
1035
1035
  }) {
1036
1036
  var s;
1037
- const r = G({
1037
+ const o = Y({
1038
1038
  deviceDisplayType: t,
1039
1039
  componentAttributes: e
1040
- }), o = (s = r == null ? void 0 : r.styles) == null ? void 0 : s.pointerEvents;
1041
- return typeof o == "string" ? o : void 0;
1040
+ }), r = (s = o == null ? void 0 : o.styles) == null ? void 0 : s.pointerEvents;
1041
+ return typeof r == "string" ? r : void 0;
1042
1042
  }
1043
- function Ur({
1043
+ function Ho({
1044
1044
  layer: e,
1045
1045
  deviceDisplayType: t
1046
1046
  }) {
1047
- var r;
1048
- return (r = e == null ? void 0 : e.rows) != null && r.length ? je({
1047
+ var o;
1048
+ return (o = e == null ? void 0 : e.rows) != null && o.length ? Ne({
1049
1049
  containerAttributes: e.containerAttributes,
1050
1050
  deviceDisplayType: t
1051
1051
  }) : !0;
1052
1052
  }
1053
- function zr({
1053
+ function Go({
1054
1054
  isWithinCollection: e,
1055
1055
  baseDeclaresOwnHeight: t,
1056
- baseZIndex: r
1056
+ baseZIndex: o
1057
1057
  }) {
1058
1058
  return {
1059
1059
  position: "relative",
@@ -1061,10 +1061,10 @@ function zr({
1061
1061
  display: "flex",
1062
1062
  flexDirection: "column",
1063
1063
  ...t ? {} : { height: e ? "auto" : "100%" },
1064
- ...r === ht ? {} : { zIndex: r }
1064
+ ...o === bt ? {} : { zIndex: o }
1065
1065
  };
1066
1066
  }
1067
- function Hr({
1067
+ function Yo({
1068
1068
  zIndex: e,
1069
1069
  pointerEvents: t
1070
1070
  }) {
@@ -1083,160 +1083,170 @@ function N(e) {
1083
1083
  if (!e)
1084
1084
  return;
1085
1085
  const t = [];
1086
- for (const [r, o] of Object.entries(e)) {
1087
- if (o == null || o === "")
1086
+ for (const [o, r] of Object.entries(e)) {
1087
+ if (r == null || r === "")
1088
1088
  continue;
1089
- const s = r.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
1090
- t.push(`${s}: ${o}`);
1089
+ const s = o.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
1090
+ t.push(`${s}: ${r}`);
1091
1091
  }
1092
1092
  return t.length > 0 ? t.join("; ") : void 0;
1093
1093
  }
1094
- const fe = "/";
1095
- function Gr({
1094
+ const ge = "/";
1095
+ function Xo({
1096
1096
  componentProps: e,
1097
1097
  ancestorColumnIds: t,
1098
- columnId: r
1098
+ columnId: o
1099
1099
  }) {
1100
- if (!e || !r)
1100
+ if (!e || !o)
1101
1101
  return;
1102
- const o = [...t ?? [], r];
1103
- for (let s = 0; s < o.length; s += 1) {
1104
- const i = o.slice(s).join(fe), l = e[i];
1102
+ const r = [...t ?? [], o];
1103
+ for (let s = 0; s < r.length; s += 1) {
1104
+ const i = r.slice(s).join(ge), l = e[i];
1105
1105
  if (l)
1106
1106
  return l;
1107
1107
  }
1108
1108
  }
1109
- const Ye = "placeholderValues";
1110
- function Yr({
1109
+ const Xe = "placeholderValues";
1110
+ function Jo({
1111
1111
  widgetInstanceProps: e,
1112
1112
  placeholderValues: t
1113
1113
  }) {
1114
- return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e, Ye) ? e : {
1114
+ return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e, Xe) ? e : {
1115
1115
  ...e,
1116
- [Ye]: t
1116
+ [Xe]: t
1117
1117
  };
1118
1118
  }
1119
- function Xr({
1119
+ function qo({
1120
1120
  displayItemList: e,
1121
1121
  widgetCollections: t
1122
1122
  }) {
1123
- const r = [], o = (s, i) => {
1123
+ const o = [], r = (s, i) => {
1124
1124
  var l;
1125
1125
  if ((l = s == null ? void 0 : s.rows) != null && l.length)
1126
- for (const a of s.rows)
1127
- for (const d of a.columns) {
1128
- if (!d.id || d.type === Ie.DroppableBox)
1126
+ for (const c of s.rows)
1127
+ for (const a of c.columns) {
1128
+ if (!a.id || a.type === Pe.DroppableBox)
1129
1129
  continue;
1130
- const u = ut(d.type);
1131
- if (u != null && u.length) {
1132
- const c = d.collection ?? (t == null ? void 0 : t[u]);
1133
- c && !i.includes(d.id) && o(c.collectionRows, [...i, d.id]);
1130
+ const d = dt(a.type);
1131
+ if (d != null && d.length) {
1132
+ const u = a.collection ?? (t == null ? void 0 : t[d]);
1133
+ u && !i.includes(a.id) && r(u.collectionRows, [...i, a.id]);
1134
1134
  continue;
1135
1135
  }
1136
- r.push(
1137
- [...i, d.id].join(fe)
1136
+ o.push(
1137
+ [...i, a.id].join(ge)
1138
1138
  );
1139
1139
  }
1140
1140
  };
1141
- return o(e, []), r;
1141
+ return r(e, []), o;
1142
1142
  }
1143
- function Jr(e, t) {
1144
- const r = `${fe}${e}`;
1145
- return t.some((o) => o === e || o.endsWith(r));
1143
+ function Zo(e, t) {
1144
+ const o = `${ge}${e}`;
1145
+ return t.some((r) => r === e || r.endsWith(o));
1146
1146
  }
1147
- function qr({
1147
+ function Qo({
1148
1148
  componentProps: e,
1149
1149
  displayItemList: t,
1150
- widgetCollections: r
1150
+ widgetCollections: o
1151
1151
  }) {
1152
- const o = e ? Object.keys(e) : [];
1153
- if (!o.length)
1152
+ const r = e ? Object.keys(e) : [];
1153
+ if (!r.length)
1154
1154
  return [];
1155
- const s = Xr({
1155
+ const s = qo({
1156
1156
  displayItemList: t,
1157
- widgetCollections: r
1157
+ widgetCollections: o
1158
1158
  });
1159
- return o.filter((i) => !Jr(i, s));
1159
+ return r.filter((i) => !Zo(i, s));
1160
1160
  }
1161
- function Zr({
1161
+ function $o({
1162
1162
  componentProps: e,
1163
1163
  displayItemList: t,
1164
- widgetCollections: r,
1165
- publishedKey: o
1164
+ widgetCollections: o,
1165
+ publishedKey: r
1166
1166
  }) {
1167
1167
  if (process.env.NODE_ENV === "production")
1168
1168
  return;
1169
- const s = qr({
1169
+ const s = Qo({
1170
1170
  componentProps: e,
1171
1171
  displayItemList: t,
1172
- widgetCollections: r
1172
+ widgetCollections: o
1173
1173
  });
1174
1174
  s.length && console.warn(
1175
- `RuleCMSWidget "${o}": componentProps ${s.map((i) => `"${i}"`).join(", ")} ${s.length === 1 ? "matches" : "match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`
1175
+ `RuleCMSWidget "${r}": componentProps ${s.map((i) => `"${i}"`).join(", ")} ${s.length === 1 ? "matches" : "match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`
1176
1176
  );
1177
1177
  }
1178
- function Qr(e) {
1178
+ function er(e) {
1179
1179
  return typeof e == "object" && e !== null && !Array.isArray(e);
1180
1180
  }
1181
- function $r(e) {
1181
+ function tr(e) {
1182
1182
  if (e.all !== void 0 && e.all !== null)
1183
1183
  return !1;
1184
- const t = e.phone, r = e.tablet, o = e.desktop;
1185
- return t !== r || t !== o || r !== o;
1184
+ const t = e.phone, o = e.tablet, r = e.desktop;
1185
+ return t !== o || t !== r || o !== r;
1186
1186
  }
1187
- function Ae(e) {
1188
- var t, r;
1187
+ function Ee(e) {
1188
+ var t, o;
1189
1189
  if (!((t = e == null ? void 0 : e.rows) != null && t.length))
1190
1190
  return !1;
1191
- if (ve(e.containerAttributes))
1191
+ if (Ce(e.containerAttributes))
1192
1192
  return !0;
1193
- for (const o of e.rows) {
1194
- if (ve(o.rowAttributes))
1193
+ for (const r of e.rows) {
1194
+ if (Ce(r.rowAttributes))
1195
1195
  return !0;
1196
- for (const s of o.columns)
1197
- if (ve(ce(s)))
1196
+ for (const s of r.columns)
1197
+ if (Ce(ue(s)))
1198
1198
  return !0;
1199
1199
  }
1200
- for (const o of ((r = e.overlayLayers) == null ? void 0 : r.layers) ?? [])
1201
- if (Ae(o))
1200
+ for (const r of ((o = e.overlayLayers) == null ? void 0 : o.layers) ?? [])
1201
+ if (Ee(r))
1202
1202
  return !0;
1203
1203
  return !1;
1204
1204
  }
1205
- function ve(e) {
1205
+ function Ce(e) {
1206
1206
  if (!e)
1207
1207
  return !1;
1208
- for (const [t, r] of Object.entries(e))
1209
- if (!(!t.includes("3-resolutions") || !Qr(r))) {
1208
+ for (const [t, o] of Object.entries(e))
1209
+ if (!(!t.includes("3-resolutions") || !er(o))) {
1210
1210
  if (t === "hide-component-3-resolutions") {
1211
- const o = r, s = (i) => i === "true" || i === !0;
1212
- if (s(o.phone) !== s(o.tablet) || s(o.phone) !== s(o.desktop))
1211
+ const r = o, s = (i) => i === "true" || i === !0;
1212
+ if (s(r.phone) !== s(r.tablet) || s(r.phone) !== s(r.desktop))
1213
1213
  return !0;
1214
1214
  continue;
1215
1215
  }
1216
- if ($r(r))
1216
+ if (tr(o))
1217
1217
  return !0;
1218
1218
  }
1219
1219
  return !1;
1220
1220
  }
1221
- function eo(e, t) {
1222
- if (Ae(e))
1221
+ function nr(e, t) {
1222
+ if (Ee(e))
1223
1223
  return !0;
1224
- for (const r of Object.values(t))
1225
- if (Ae(r.collectionRows))
1224
+ for (const o of Object.values(t))
1225
+ if (Ee(o.collectionRows))
1226
1226
  return !0;
1227
1227
  return !1;
1228
1228
  }
1229
- const bt = parseInt(ft, 10), vt = parseInt(gt, 10), to = bt + 1, no = vt + 1;
1230
- function ro(e) {
1231
- const t = `.${e}-phone`, r = `.${e}-tablet`, o = `.${e}-desktop`;
1229
+ const vt = parseInt(gt, 10), Ct = parseInt(pt, 10), or = vt + 1, rr = Ct + 1;
1230
+ function sr(e) {
1231
+ const t = `.${e}-phone`, o = `.${e}-tablet`, r = `.${e}-desktop`;
1232
1232
  return `
1233
- ${t}, ${r}, ${o} { display: none; }
1234
- @media (max-width: ${bt}px) { ${t} { display: block; } }
1235
- @media (min-width: ${to}px) and (max-width: ${vt}px) { ${r} { display: block; } }
1236
- @media (min-width: ${no}px) { ${o} { display: block; } }
1233
+ ${t}, ${o}, ${r} { display: none; }
1234
+ @media (max-width: ${vt}px) { ${t} { display: block; } }
1235
+ @media (min-width: ${or}px) and (max-width: ${Ct}px) { ${o} { display: block; } }
1236
+ @media (min-width: ${rr}px) { ${r} { display: block; } }
1237
1237
  `.trim();
1238
1238
  }
1239
- function Ce(e) {
1239
+ const ir = /(<\/|<)(s)(tyle)/gi;
1240
+ function lr(e) {
1241
+ return e.replace(
1242
+ ir,
1243
+ (t, o, r, s) => `${o}${r === "s" ? "\\73 " : "\\53 "}${s}`
1244
+ );
1245
+ }
1246
+ function K(e, t) {
1247
+ return `<style${t ? ` ${t}=""` : ""}>${lr(e)}</style>`;
1248
+ }
1249
+ function _e(e) {
1240
1250
  if (!e)
1241
1251
  throw new Error("Source components plugin is required, but no plugins were provided");
1242
1252
  const t = e.sourceComponents;
@@ -1250,96 +1260,93 @@ function Ce(e) {
1250
1260
  );
1251
1261
  return t;
1252
1262
  }
1253
- let oo = 0;
1254
- var so = n.from_html("<div><!> <!></div>");
1255
- function io(e, t) {
1263
+ var cr = n.from_html("<div><!> <!></div>");
1264
+ function ar(e, t) {
1265
+ const o = n.props_id();
1256
1266
  n.push(t, !0);
1257
- let r = n.prop(t, "isComposeMode", 3, !1), o = n.prop(t, "showDropContainers", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "deviceDisplayType", 3, "Desktop");
1258
- const l = `rulecms-vc-${++oo}`;
1259
- function a(h, _, C) {
1260
- const E = h && !C ? 3 : 1;
1261
- return !!(_ != null && _.length) && _.length > E;
1267
+ let r = n.prop(t, "isComposeMode", 3, !1), s = n.prop(t, "showDropContainers", 3, !1), i = n.prop(t, "isWithinCollection", 3, !1), l = n.prop(t, "deviceDisplayType", 3, "Desktop");
1268
+ const c = `rulecms-vc-${o.replace(/[^a-zA-Z0-9_-]/g, "")}`;
1269
+ function a(C, b, _) {
1270
+ const I = C && !_ ? 3 : 1;
1271
+ return !!(b != null && b.length) && b.length > I;
1262
1272
  }
1263
1273
  const d = n.derived(() => {
1264
- var h;
1265
- return (((h = t.displayItemList.containerAttributes) == null ? void 0 : h[_e]) || []).join(`;
1274
+ var C;
1275
+ return (((C = t.displayItemList.containerAttributes) == null ? void 0 : C[we]) || []).join(`;
1266
1276
  `);
1267
- }), u = n.derived(() => n.get(d) ? `.${l} {
1277
+ }), u = n.derived(() => n.get(d) ? `.${c} {
1268
1278
  ${n.get(d)}
1269
- }` : ""), c = n.derived(() => !r() && je({
1279
+ }` : ""), g = n.derived(() => !r() && Ne({
1270
1280
  containerAttributes: t.displayItemList.containerAttributes,
1271
- deviceDisplayType: i()
1272
- })), f = n.derived(() => mt({
1281
+ deviceDisplayType: l()
1282
+ })), m = n.derived(() => yt({
1273
1283
  containerAttributes: t.displayItemList.containerAttributes,
1274
- deviceDisplayType: i(),
1284
+ deviceDisplayType: l(),
1275
1285
  isComposeMode: r()
1276
- })), p = n.derived(() => {
1277
- var C;
1278
- const h = ((C = t.displayItemList.containerAttributes) == null ? void 0 : C[_e]) || [], _ = Wr(n.get(f));
1279
- return r() && !s() || o() || h.length > 0 || _ || a(r(), t.displayItemList.rows, s());
1280
- }), g = n.derived(() => [
1281
- n.get(d) ? l : void 0,
1282
- n.get(f).cssClasses
1283
- ].filter(Boolean).join(" ")), A = n.derived(() => ({
1284
- ...yt({
1286
+ })), f = n.derived(() => {
1287
+ var _;
1288
+ const C = ((_ = t.displayItemList.containerAttributes) == null ? void 0 : _[we]) || [], b = Fo(n.get(m));
1289
+ return r() && !i() || s() || C.length > 0 || b || a(r(), t.displayItemList.rows, i());
1290
+ }), w = n.derived(() => [
1291
+ n.get(d) ? c : void 0,
1292
+ n.get(m).cssClasses
1293
+ ].filter(Boolean).join(" ")), E = n.derived(() => ({
1294
+ ...ht({
1285
1295
  containerAttributes: t.displayItemList.containerAttributes,
1286
- widgetContainerStyles: n.get(f)
1287
- }) ? {} : { height: s() ? "auto" : "100%" },
1296
+ widgetContainerStyles: n.get(m)
1297
+ }) ? {} : { height: i() ? "auto" : "100%" },
1288
1298
  display: "flex",
1289
1299
  flexDirection: "column",
1290
- ...n.get(f).styles
1291
- })), w = n.derived(() => n.get(p) ? n.get(g) : ""), b = n.derived(() => n.get(c) ? { display: "none" } : n.get(p) ? n.get(A) : { display: "contents" });
1292
- var v = so(), T = n.child(v);
1300
+ ...n.get(m).styles
1301
+ })), h = n.derived(() => n.get(f) ? n.get(w) : ""), A = n.derived(() => n.get(g) ? { display: "none" } : n.get(f) ? n.get(E) : { display: "contents" });
1302
+ var T = cr(), x = n.child(T);
1293
1303
  {
1294
- var j = (h) => {
1295
- var _ = n.comment(), C = n.first_child(_);
1296
- n.element(C, () => "style", !1, (E, I) => {
1297
- var P = n.text();
1298
- n.template_effect(() => n.set_text(P, n.get(u))), n.append(I, P);
1299
- }), n.append(h, _);
1304
+ var z = (C) => {
1305
+ var b = n.comment(), _ = n.first_child(b);
1306
+ n.html(_, () => K(n.get(u))), n.append(C, b);
1300
1307
  };
1301
- n.if(T, (h) => {
1302
- n.get(d) && h(j);
1308
+ n.if(x, (C) => {
1309
+ n.get(d) && C(z);
1303
1310
  });
1304
1311
  }
1305
- var U = n.sibling(T, 2);
1306
- n.snippet(U, () => t.children), n.reset(v), n.template_effect(
1307
- (h) => {
1308
- n.set_attribute(v, "hidden", n.get(c) || void 0), n.set_class(v, 1, n.clsx(n.get(w) || void 0)), n.set_style(v, h);
1312
+ var v = n.sibling(x, 2);
1313
+ n.snippet(v, () => t.children), n.reset(T), n.template_effect(
1314
+ (C) => {
1315
+ n.set_attribute(T, "hidden", n.get(g) || void 0), n.set_class(T, 1, n.clsx(n.get(h) || void 0)), n.set_style(T, C);
1309
1316
  },
1310
- [() => N(n.get(b))]
1311
- ), n.append(e, v), n.pop();
1317
+ [() => N(n.get(A))]
1318
+ ), n.append(e, T), n.pop();
1312
1319
  }
1313
- var lo = n.from_html("<div><!></div>");
1314
- function ao(e, t) {
1320
+ var ur = n.from_html("<div><!></div>");
1321
+ function dr(e, t) {
1315
1322
  n.push(t, !0);
1316
- let r = n.prop(t, "isComposeMode", 3, !1), o = n.prop(t, "showDropContainers", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "deviceDisplayType", 3, "Desktop");
1317
- function l(w, b, v) {
1318
- var j;
1319
- const T = w && !v ? 3 : 1;
1320
- return !!((j = b == null ? void 0 : b.columns) != null && j.length) && b.columns.length > T;
1323
+ let o = n.prop(t, "isComposeMode", 3, !1), r = n.prop(t, "showDropContainers", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "deviceDisplayType", 3, "Desktop");
1324
+ function l(E, h, A) {
1325
+ var x;
1326
+ const T = E && !A ? 3 : 1;
1327
+ return !!((x = h == null ? void 0 : h.columns) != null && x.length) && h.columns.length > T;
1321
1328
  }
1322
- const a = n.derived(() => !r() && kr({ row: t.row, deviceDisplayType: i() })), d = n.derived(() => o() || xr(t.row) || l(r(), t.row, s())), u = n.derived(() => Lr({
1329
+ const c = n.derived(() => !o() && Ro({ row: t.row, deviceDisplayType: i() })), a = n.derived(() => r() || Lo(t.row) || l(o(), t.row, s())), d = n.derived(() => Oo({
1323
1330
  row: t.row,
1324
1331
  deviceDisplayType: i(),
1325
- isComposeMode: r()
1326
- })), c = n.derived(() => {
1327
- var b;
1328
- const w = G({
1332
+ isComposeMode: o()
1333
+ })), u = n.derived(() => {
1334
+ var h;
1335
+ const E = Y({
1329
1336
  deviceDisplayType: i(),
1330
1337
  componentAttributes: t.row.rowAttributes
1331
1338
  });
1332
- return Oe((b = w == null ? void 0 : w.componentAttributesSpecificToDeviceType) == null ? void 0 : b[Re]) ?? "";
1333
- }), f = n.derived(() => n.get(d) ? n.get(c) : ""), p = n.derived(() => n.get(a) ? { display: "none" } : n.get(d) ? n.get(u) : { display: "contents" });
1334
- var g = lo(), A = n.child(g);
1335
- n.snippet(A, () => t.children), n.reset(g), n.template_effect(
1336
- (w) => {
1337
- n.set_attribute(g, "hidden", n.get(a) || void 0), n.set_class(g, 1, n.clsx(n.get(f) || void 0)), n.set_style(g, w);
1339
+ return je((h = E == null ? void 0 : E.componentAttributesSpecificToDeviceType) == null ? void 0 : h[Oe]) ?? "";
1340
+ }), g = n.derived(() => n.get(a) ? n.get(u) : ""), m = n.derived(() => n.get(c) ? { display: "none" } : n.get(a) ? n.get(d) : { display: "contents" });
1341
+ var f = ur(), w = n.child(f);
1342
+ n.snippet(w, () => t.children), n.reset(f), n.template_effect(
1343
+ (E) => {
1344
+ n.set_attribute(f, "hidden", n.get(c) || void 0), n.set_class(f, 1, n.clsx(n.get(g) || void 0)), n.set_style(f, E);
1338
1345
  },
1339
- [() => N(n.get(p))]
1340
- ), n.append(e, g), n.pop();
1346
+ [() => N(n.get(m))]
1347
+ ), n.append(e, f), n.pop();
1341
1348
  }
1342
- const Ct = [
1349
+ const _t = [
1343
1350
  "minWidth",
1344
1351
  "maxWidth",
1345
1352
  "minHeight",
@@ -1391,127 +1398,127 @@ const Ct = [
1391
1398
  "textAlign",
1392
1399
  "textDecoration",
1393
1400
  "textTransform"
1394
- ], co = (e) => e != null && e !== "", uo = (e) => e ? Ct.reduce(
1395
- (t, r) => {
1396
- const o = e[r];
1397
- return co(o) && (t[r] = o), t;
1401
+ ], fr = (e) => e != null && e !== "", gr = (e) => e ? _t.reduce(
1402
+ (t, o) => {
1403
+ const r = e[o];
1404
+ return fr(r) && (t[o] = r), t;
1398
1405
  },
1399
1406
  {}
1400
- ) : {}, fo = (e) => {
1407
+ ) : {}, pr = (e) => {
1401
1408
  if (!e)
1402
1409
  return;
1403
1410
  const t = { ...e };
1404
- for (const r of Ct)
1405
- delete t[r];
1411
+ for (const o of _t)
1412
+ delete t[o];
1406
1413
  return Object.keys(t).length ? t : void 0;
1407
- }, go = (e) => Object.keys(e).length > 0, po = (e, t) => {
1408
- const r = (e == null ? void 0 : e.noContainer) ?? !1, o = e == null ? void 0 : e.resolveNoContainer;
1409
- if (typeof o != "function")
1410
- return r;
1414
+ }, mr = (e) => Object.keys(e).length > 0, yr = (e, t) => {
1415
+ const o = (e == null ? void 0 : e.noContainer) ?? !1, r = e == null ? void 0 : e.resolveNoContainer;
1416
+ if (typeof r != "function")
1417
+ return o;
1411
1418
  try {
1412
- const s = o(t);
1419
+ const s = r(t);
1413
1420
  if (typeof s == "boolean")
1414
1421
  return s;
1415
1422
  console.error(
1416
- `resolveNoContainer: component "${e == null ? void 0 : e.id}" returned ${typeof s} instead of a boolean; falling back to noContainer=${r}`
1423
+ `resolveNoContainer: component "${e == null ? void 0 : e.id}" returned ${typeof s} instead of a boolean; falling back to noContainer=${o}`
1417
1424
  );
1418
1425
  } catch (s) {
1419
1426
  console.error(
1420
- `resolveNoContainer: component "${e == null ? void 0 : e.id}" threw; falling back to noContainer=${r}`,
1427
+ `resolveNoContainer: component "${e == null ? void 0 : e.id}" threw; falling back to noContainer=${o}`,
1421
1428
  s
1422
1429
  );
1423
1430
  }
1424
- return r;
1425
- }, mo = (e, t) => {
1426
- const r = e == null ? void 0 : e.resolveRendersOwnElement;
1427
- if (typeof r != "function")
1431
+ return o;
1432
+ }, hr = (e, t) => {
1433
+ const o = e == null ? void 0 : e.resolveRendersOwnElement;
1434
+ if (typeof o != "function")
1428
1435
  return !1;
1429
1436
  try {
1430
- const o = r(t);
1431
- if (typeof o == "boolean")
1432
- return o;
1437
+ const r = o(t);
1438
+ if (typeof r == "boolean")
1439
+ return r;
1433
1440
  console.error(
1434
- `resolveRendersOwnElement: component "${e == null ? void 0 : e.id}" returned ${typeof o} instead of a boolean; falling back to false`
1441
+ `resolveRendersOwnElement: component "${e == null ? void 0 : e.id}" returned ${typeof r} instead of a boolean; falling back to false`
1435
1442
  );
1436
- } catch (o) {
1443
+ } catch (r) {
1437
1444
  console.error(
1438
1445
  `resolveRendersOwnElement: component "${e == null ? void 0 : e.id}" threw; falling back to false`,
1439
- o
1446
+ r
1440
1447
  );
1441
1448
  }
1442
1449
  return !1;
1443
1450
  };
1444
- var Xe = n.from_html("<div><!></div>");
1445
- function yo(e, t) {
1451
+ var Je = n.from_html("<div><!></div>");
1452
+ function br(e, t) {
1446
1453
  n.push(t, !0);
1447
- const r = n.derived(() => t.components[rt(t.libraryId, t.componentType)]), o = n.derived(() => {
1448
- var v;
1449
- const b = (v = n.get(r)) == null ? void 0 : v.card;
1450
- return b || (console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`), null);
1454
+ const o = n.derived(() => t.components[rt(t.libraryId, t.componentType)]), r = n.derived(() => {
1455
+ var A;
1456
+ const h = (A = n.get(o)) == null ? void 0 : A.card;
1457
+ return h || (console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`), null);
1451
1458
  }), s = n.derived(() => ({
1452
1459
  componentAttributes: t.componentAttributes,
1453
1460
  styleProps: t.styleProps
1454
- })), i = n.derived(() => n.get(r) ? po(n.get(r), n.get(s)) : !1), l = n.derived(() => uo(t.styleProps)), a = n.derived(() => n.get(i) ? fo(t.styleProps) : t.styleProps), d = n.derived(() => {
1455
- var b;
1456
- return Oe((b = t.componentAttributes) == null ? void 0 : b[Re]);
1457
- }), u = n.derived(() => n.get(i) && go(n.get(l))), c = n.derived(() => !n.get(i) || (n.get(r) ? mo(n.get(r), n.get(s)) : !1)), f = n.derived(() => !n.get(u) && n.get(c) ? n.get(d) : void 0), p = n.derived(() => ({
1461
+ })), i = n.derived(() => n.get(o) ? yr(n.get(o), n.get(s)) : !1), l = n.derived(() => gr(t.styleProps)), c = n.derived(() => n.get(i) ? pr(t.styleProps) : t.styleProps), a = n.derived(() => {
1462
+ var h;
1463
+ return je((h = t.componentAttributes) == null ? void 0 : h[Oe]);
1464
+ }), d = n.derived(() => n.get(i) && mr(n.get(l))), u = n.derived(() => !n.get(i) || (n.get(o) ? hr(n.get(o), n.get(s)) : !1)), g = n.derived(() => !n.get(d) && n.get(u) ? n.get(a) : void 0), m = n.derived(() => ({
1458
1465
  componentAttributes: t.componentAttributes,
1459
- styleProps: n.get(a),
1460
- className: n.get(f),
1466
+ styleProps: n.get(c),
1467
+ className: n.get(g),
1461
1468
  widgetInstanceProps: t.widgetInstanceProps,
1462
1469
  pageViewType: t.pageViewType,
1463
1470
  columnPath: t.columnPath,
1464
1471
  mounts: t.mounts
1465
1472
  }));
1466
- var g = n.comment(), A = n.first_child(g);
1473
+ var f = n.comment(), w = n.first_child(f);
1467
1474
  {
1468
- var w = (b) => {
1469
- const v = n.derived(() => n.get(o));
1470
- var T = n.comment(), j = n.first_child(T);
1475
+ var E = (h) => {
1476
+ const A = n.derived(() => n.get(r));
1477
+ var T = n.comment(), x = n.first_child(T);
1471
1478
  {
1472
- var U = (C) => {
1473
- var E = Xe(), I = n.child(E);
1474
- n.component(I, () => n.get(v), (P, L) => {
1475
- L(P, n.spread_props(() => n.get(p)));
1476
- }), n.reset(E), n.template_effect(
1477
- (P) => {
1478
- n.set_class(E, 1, n.clsx(n.get(d) || void 0)), n.set_style(E, P);
1479
+ var z = (b) => {
1480
+ var _ = Je(), I = n.child(_);
1481
+ n.component(I, () => n.get(A), (L, R) => {
1482
+ R(L, n.spread_props(() => n.get(m)));
1483
+ }), n.reset(_), n.template_effect(
1484
+ (L) => {
1485
+ n.set_class(_, 1, n.clsx(n.get(a) || void 0)), n.set_style(_, L);
1479
1486
  },
1480
1487
  [() => N(n.get(l))]
1481
- ), n.append(C, E);
1482
- }, h = (C) => {
1483
- var E = Xe(), I = n.child(E);
1484
- n.component(I, () => n.get(v), (P, L) => {
1485
- L(P, n.spread_props(() => n.get(p)));
1486
- }), n.reset(E), n.template_effect(() => n.set_class(E, 1, n.clsx(n.get(d)))), n.append(C, E);
1487
- }, _ = (C) => {
1488
- var E = n.comment(), I = n.first_child(E);
1489
- n.component(I, () => n.get(v), (P, L) => {
1490
- L(P, n.spread_props(() => n.get(p)));
1491
- }), n.append(C, E);
1488
+ ), n.append(b, _);
1489
+ }, v = (b) => {
1490
+ var _ = Je(), I = n.child(_);
1491
+ n.component(I, () => n.get(A), (L, R) => {
1492
+ R(L, n.spread_props(() => n.get(m)));
1493
+ }), n.reset(_), n.template_effect(() => n.set_class(_, 1, n.clsx(n.get(a)))), n.append(b, _);
1494
+ }, C = (b) => {
1495
+ var _ = n.comment(), I = n.first_child(_);
1496
+ n.component(I, () => n.get(A), (L, R) => {
1497
+ R(L, n.spread_props(() => n.get(m)));
1498
+ }), n.append(b, _);
1492
1499
  };
1493
- n.if(j, (C) => {
1494
- n.get(u) ? C(U) : !n.get(c) && n.get(d) ? C(h, 1) : C(_, -1);
1500
+ n.if(x, (b) => {
1501
+ n.get(d) ? b(z) : !n.get(u) && n.get(a) ? b(v, 1) : b(C, -1);
1495
1502
  });
1496
1503
  }
1497
- n.append(b, T);
1504
+ n.append(h, T);
1498
1505
  };
1499
- n.if(A, (b) => {
1500
- n.get(o) && b(w);
1506
+ n.if(w, (h) => {
1507
+ n.get(r) && h(E);
1501
1508
  });
1502
1509
  }
1503
- n.append(e, g), n.pop();
1510
+ n.append(e, f), n.pop();
1504
1511
  }
1505
- var ho = n.from_html("<div><!></div>"), bo = n.from_html("<div><!> <!></div>");
1506
- function Ee(e, t) {
1512
+ var vr = n.from_html("<div><!></div>"), Cr = n.from_html("<div><!> <!></div>");
1513
+ function Se(e, t) {
1507
1514
  n.push(t, !0);
1508
- const r = (h) => {
1509
- io(h, {
1515
+ const o = (v) => {
1516
+ ar(v, {
1510
1517
  get displayItemList() {
1511
1518
  return t.displayItemList;
1512
1519
  },
1513
1520
  get isComposeMode() {
1514
- return o();
1521
+ return r();
1515
1522
  },
1516
1523
  get showDropContainers() {
1517
1524
  return i();
@@ -1522,15 +1529,15 @@ function Ee(e, t) {
1522
1529
  get deviceDisplayType() {
1523
1530
  return t.deviceDisplayType;
1524
1531
  },
1525
- children: (_, C) => {
1526
- var E = n.comment(), I = n.first_child(E);
1527
- n.each(I, 17, () => t.displayItemList.rows, (P) => P.id, (P, L) => {
1528
- ao(P, {
1532
+ children: (C, b) => {
1533
+ var _ = n.comment(), I = n.first_child(_);
1534
+ n.each(I, 17, () => t.displayItemList.rows, (L) => L.id, (L, R) => {
1535
+ dr(L, {
1529
1536
  get row() {
1530
- return n.get(L);
1537
+ return n.get(R);
1531
1538
  },
1532
1539
  get isComposeMode() {
1533
- return o();
1540
+ return r();
1534
1541
  },
1535
1542
  get showDropContainers() {
1536
1543
  return i();
@@ -1541,24 +1548,24 @@ function Ee(e, t) {
1541
1548
  get deviceDisplayType() {
1542
1549
  return t.deviceDisplayType;
1543
1550
  },
1544
- children: (J, ee) => {
1545
- var te = n.comment(), oe = n.first_child(te);
1546
- n.each(oe, 17, () => n.get(L).columns, (q) => q.id, (q, V) => {
1547
- var se = n.comment(), pe = n.first_child(se);
1551
+ children: (q, te) => {
1552
+ var ne = n.comment(), se = n.first_child(ne);
1553
+ n.each(se, 17, () => n.get(R).columns, (Z) => Z.id, (Z, V) => {
1554
+ var ie = n.comment(), me = n.first_child(ie);
1548
1555
  {
1549
- var me = (y) => {
1550
- const m = n.derived(() => p(n.get(V)));
1551
- var S = n.comment(), D = n.first_child(S);
1556
+ var ye = (y) => {
1557
+ const p = n.derived(() => m(n.get(V)));
1558
+ var S = n.comment(), P = n.first_child(S);
1552
1559
  {
1553
- var M = (O) => {
1560
+ var M = (j) => {
1554
1561
  {
1555
- let Y = n.derived(() => g(n.get(V).id));
1556
- Ee(O, {
1562
+ let X = n.derived(() => f(n.get(V).id));
1563
+ Se(j, {
1557
1564
  get displayItemList() {
1558
- return n.get(m);
1565
+ return n.get(p);
1559
1566
  },
1560
1567
  get isComposeMode() {
1561
- return o();
1568
+ return r();
1562
1569
  },
1563
1570
  isWithinCollection: !0,
1564
1571
  get widgetCollections() {
@@ -1586,14 +1593,14 @@ function Ee(e, t) {
1586
1593
  return t.placeholderValues;
1587
1594
  },
1588
1595
  get ancestorColumnIds() {
1589
- return n.get(Y);
1596
+ return n.get(X);
1590
1597
  }
1591
1598
  });
1592
1599
  }
1593
- }, R = (O) => {
1600
+ }, O = (j) => {
1594
1601
  {
1595
- let Y = n.derived(() => f(n.get(V)).componentAttributes), ie = n.derived(() => f(n.get(V)).styleProps), ne = n.derived(() => b(n.get(V).id)), We = n.derived(A), Ve = n.derived(() => w(n.get(V).id));
1596
- yo(O, {
1602
+ let X = n.derived(() => g(n.get(V)).componentAttributes), le = n.derived(() => g(n.get(V)).styleProps), oe = n.derived(() => h(n.get(V).id)), Ve = n.derived(w), Fe = n.derived(() => E(n.get(V).id));
1603
+ br(j, {
1597
1604
  get componentType() {
1598
1605
  return n.get(V).type;
1599
1606
  },
@@ -1601,22 +1608,22 @@ function Ee(e, t) {
1601
1608
  return n.get(V).libraryId;
1602
1609
  },
1603
1610
  get componentAttributes() {
1604
- return n.get(Y);
1611
+ return n.get(X);
1605
1612
  },
1606
1613
  get components() {
1607
1614
  return n.get(l);
1608
1615
  },
1609
1616
  get styleProps() {
1610
- return n.get(ie);
1617
+ return n.get(le);
1611
1618
  },
1612
1619
  get widgetInstanceProps() {
1613
- return n.get(ne);
1620
+ return n.get(oe);
1614
1621
  },
1615
1622
  get pageViewType() {
1616
- return n.get(We);
1623
+ return n.get(Ve);
1617
1624
  },
1618
1625
  get columnPath() {
1619
- return n.get(Ve);
1626
+ return n.get(Fe);
1620
1627
  },
1621
1628
  get mounts() {
1622
1629
  return t.mounts;
@@ -1624,133 +1631,133 @@ function Ee(e, t) {
1624
1631
  });
1625
1632
  }
1626
1633
  };
1627
- n.if(D, (O) => {
1628
- n.get(m) ? O(M) : O(R, -1);
1634
+ n.if(P, (j) => {
1635
+ n.get(p) ? j(M) : j(O, -1);
1629
1636
  });
1630
1637
  }
1631
1638
  n.append(y, S);
1632
- }, ye = n.derived(() => c(n.get(V)));
1633
- n.if(pe, (y) => {
1634
- n.get(ye) && y(me);
1639
+ }, he = n.derived(() => u(n.get(V)));
1640
+ n.if(me, (y) => {
1641
+ n.get(he) && y(ye);
1635
1642
  });
1636
1643
  }
1637
- n.append(q, se);
1638
- }), n.append(J, te);
1644
+ n.append(Z, ie);
1645
+ }), n.append(q, ne);
1639
1646
  },
1640
1647
  $$slots: { default: !0 }
1641
1648
  });
1642
- }), n.append(_, E);
1649
+ }), n.append(C, _);
1643
1650
  },
1644
1651
  $$slots: { default: !0 }
1645
1652
  });
1646
1653
  };
1647
- let o = n.prop(t, "isComposeMode", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "showDropContainers", 3, !1);
1648
- const l = n.derived(() => Ce(t.plugins).components), a = n.derived(() => !o() && Fr(t.displayItemList) && !je({
1654
+ let r = n.prop(t, "isComposeMode", 3, !1), s = n.prop(t, "isWithinCollection", 3, !1), i = n.prop(t, "showDropContainers", 3, !1);
1655
+ const l = n.derived(() => _e(t.plugins).components), c = n.derived(() => !r() && Bo(t.displayItemList) && !Ne({
1649
1656
  containerAttributes: t.displayItemList.containerAttributes,
1650
1657
  deviceDisplayType: t.deviceDisplayType
1651
- })), d = n.derived(() => {
1652
- const h = Ge({
1658
+ })), a = n.derived(() => {
1659
+ const v = Ye({
1653
1660
  containerAttributes: t.displayItemList.containerAttributes,
1654
1661
  deviceDisplayType: t.deviceDisplayType
1655
1662
  });
1656
- return zr({
1663
+ return Go({
1657
1664
  isWithinCollection: s(),
1658
- baseDeclaresOwnHeight: yt({
1665
+ baseDeclaresOwnHeight: ht({
1659
1666
  containerAttributes: t.displayItemList.containerAttributes,
1660
- widgetContainerStyles: mt({
1667
+ widgetContainerStyles: yt({
1661
1668
  containerAttributes: t.displayItemList.containerAttributes,
1662
1669
  deviceDisplayType: t.deviceDisplayType,
1663
- isComposeMode: o()
1670
+ isComposeMode: r()
1664
1671
  })
1665
1672
  }),
1666
- baseZIndex: h
1673
+ baseZIndex: v
1667
1674
  });
1668
- }), u = n.derived(() => {
1669
- var C;
1670
- const h = ((C = t.displayItemList.overlayLayers) == null ? void 0 : C.layers) ?? [], _ = Ge({
1675
+ }), d = n.derived(() => {
1676
+ var b;
1677
+ const v = ((b = t.displayItemList.overlayLayers) == null ? void 0 : b.layers) ?? [], C = Ye({
1671
1678
  containerAttributes: t.displayItemList.containerAttributes,
1672
1679
  deviceDisplayType: t.deviceDisplayType
1673
1680
  });
1674
- return h.flatMap((E, I) => Ur({ layer: E, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1681
+ return v.flatMap((_, I) => Ho({ layer: _, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1675
1682
  {
1676
1683
  index: I,
1677
- layer: E,
1678
- boxStyles: Hr({
1679
- zIndex: Kr(_, I),
1680
- pointerEvents: Br({
1681
- containerAttributes: E.containerAttributes,
1684
+ layer: _,
1685
+ boxStyles: Yo({
1686
+ zIndex: Uo(C, I),
1687
+ pointerEvents: zo({
1688
+ containerAttributes: _.containerAttributes,
1682
1689
  deviceDisplayType: t.deviceDisplayType
1683
1690
  })
1684
1691
  })
1685
1692
  }
1686
1693
  ]);
1687
1694
  });
1688
- function c(h) {
1689
- if (o() && h.type === Ie.DroppableBox)
1695
+ function u(v) {
1696
+ if (r() && v.type === Pe.DroppableBox)
1690
1697
  return !1;
1691
- const { componentAttributesBasedOnDevice: _ } = He({
1692
- col: h,
1698
+ const { componentAttributesBasedOnDevice: C } = Ge({
1699
+ col: v,
1693
1700
  deviceDisplayType: t.deviceDisplayType,
1694
- isComposeMode: o(),
1695
- sourceComponentsPlugin: Ce(t.plugins)
1696
- }), C = !!_ && _["hide-component-3-resolutions"] === "true";
1697
- return !(!o() && C);
1698
- }
1699
- function f(h) {
1700
- const { componentAttributesBasedOnDevice: _, componentStyles: C } = He({
1701
- col: h,
1701
+ isComposeMode: r(),
1702
+ sourceComponentsPlugin: _e(t.plugins)
1703
+ }), b = !!C && C["hide-component-3-resolutions"] === "true";
1704
+ return !(!r() && b);
1705
+ }
1706
+ function g(v) {
1707
+ const { componentAttributesBasedOnDevice: C, componentStyles: b } = Ge({
1708
+ col: v,
1702
1709
  deviceDisplayType: t.deviceDisplayType,
1703
- isComposeMode: o(),
1704
- sourceComponentsPlugin: Ce(t.plugins)
1710
+ isComposeMode: r(),
1711
+ sourceComponentsPlugin: _e(t.plugins)
1705
1712
  });
1706
1713
  return {
1707
- componentAttributes: _,
1708
- styleProps: C
1714
+ componentAttributes: C,
1715
+ styleProps: b
1709
1716
  };
1710
1717
  }
1711
- function p(h) {
1712
- const _ = ut(h.type);
1713
- if (!(_ != null && _.length))
1718
+ function m(v) {
1719
+ const C = dt(v.type);
1720
+ if (!(C != null && C.length))
1714
1721
  return null;
1715
- const C = h.collection ?? t.widgetCollections[_];
1716
- if (!C)
1717
- throw new Error(`DisplayCollection - Collection with ID ${_} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);
1718
- return !C.collectionRows || !Pr(C.collectionRows) ? null : C.collectionRows;
1722
+ const b = v.collection ?? t.widgetCollections[C];
1723
+ if (!b)
1724
+ throw new Error(`DisplayCollection - Collection with ID ${C} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);
1725
+ return !b.collectionRows || !ko(b.collectionRows) ? null : b.collectionRows;
1719
1726
  }
1720
- function g(h) {
1721
- return [...t.ancestorColumnIds ?? [], h];
1727
+ function f(v) {
1728
+ return [...t.ancestorColumnIds ?? [], v];
1722
1729
  }
1723
- function A() {
1724
- return o() ? Ue.Compose : Ue.RenderedPage;
1730
+ function w() {
1731
+ return r() ? ze.Compose : ze.RenderedPage;
1725
1732
  }
1726
- function w(h) {
1727
- if (!(o() || !h))
1728
- return [...t.ancestorColumnIds ?? [], h].join(fe);
1733
+ function E(v) {
1734
+ if (!(r() || !v))
1735
+ return [...t.ancestorColumnIds ?? [], v].join(ge);
1729
1736
  }
1730
- function b(h) {
1731
- return Yr({
1732
- widgetInstanceProps: Gr({
1737
+ function h(v) {
1738
+ return Jo({
1739
+ widgetInstanceProps: Xo({
1733
1740
  componentProps: t.componentProps,
1734
1741
  ancestorColumnIds: t.ancestorColumnIds,
1735
- columnId: h
1742
+ columnId: v
1736
1743
  }),
1737
- placeholderValues: o() ? void 0 : t.placeholderValues
1744
+ placeholderValues: r() ? void 0 : t.placeholderValues
1738
1745
  });
1739
1746
  }
1740
- var v = n.comment(), T = n.first_child(v);
1747
+ var A = n.comment(), T = n.first_child(A);
1741
1748
  {
1742
- var j = (h) => {
1743
- var _ = bo(), C = n.child(_);
1744
- r(C);
1745
- var E = n.sibling(C, 2);
1746
- n.each(E, 17, () => n.get(u), (I) => I.index, (I, P) => {
1747
- var L = ho(), J = n.child(L);
1748
- Ee(J, {
1749
+ var x = (v) => {
1750
+ var C = Cr(), b = n.child(C);
1751
+ o(b);
1752
+ var _ = n.sibling(b, 2);
1753
+ n.each(_, 17, () => n.get(d), (I) => I.index, (I, L) => {
1754
+ var R = vr(), q = n.child(R);
1755
+ Se(q, {
1749
1756
  get displayItemList() {
1750
- return n.get(P).layer;
1757
+ return n.get(L).layer;
1751
1758
  },
1752
1759
  get isComposeMode() {
1753
- return o();
1760
+ return r();
1754
1761
  },
1755
1762
  isWithinCollection: !1,
1756
1763
  get widgetCollections() {
@@ -1778,28 +1785,28 @@ function Ee(e, t) {
1778
1785
  get ancestorColumnIds() {
1779
1786
  return t.ancestorColumnIds;
1780
1787
  }
1781
- }), n.reset(L), n.template_effect(
1782
- (ee) => {
1783
- n.set_attribute(L, "data-rulecms-overlay-layer", n.get(P).index), n.set_style(L, ee);
1788
+ }), n.reset(R), n.template_effect(
1789
+ (te) => {
1790
+ n.set_attribute(R, "data-rulecms-overlay-layer", n.get(L).index), n.set_style(R, te);
1784
1791
  },
1785
- [() => N(n.get(P).boxStyles)]
1786
- ), n.append(I, L);
1787
- }), n.reset(_), n.template_effect((I) => n.set_style(_, I), [() => N(n.get(d))]), n.append(h, _);
1788
- }, U = (h) => {
1789
- r(h);
1792
+ [() => N(n.get(L).boxStyles)]
1793
+ ), n.append(I, R);
1794
+ }), n.reset(C), n.template_effect((I) => n.set_style(C, I), [() => N(n.get(a))]), n.append(v, C);
1795
+ }, z = (v) => {
1796
+ o(v);
1790
1797
  };
1791
- n.if(T, (h) => {
1792
- n.get(a) ? h(j) : h(U, -1);
1798
+ n.if(T, (v) => {
1799
+ n.get(c) ? v(x) : v(z, -1);
1793
1800
  });
1794
1801
  }
1795
- n.append(e, v), n.pop();
1802
+ n.append(e, A), n.pop();
1796
1803
  }
1797
- function Se(e, t) {
1804
+ function Te(e, t) {
1798
1805
  n.push(t, !0);
1799
- var r = n.comment(), o = n.first_child(r);
1806
+ var o = n.comment(), r = n.first_child(o);
1800
1807
  {
1801
1808
  var s = (i) => {
1802
- Ee(i, {
1809
+ Se(i, {
1803
1810
  get displayItemList() {
1804
1811
  return t.displayItemList;
1805
1812
  },
@@ -1838,51 +1845,48 @@ function Se(e, t) {
1838
1845
  }
1839
1846
  });
1840
1847
  };
1841
- n.if(o, (i) => {
1842
- var l, a;
1843
- (a = (l = t.displayItemList) == null ? void 0 : l.rows) != null && a.length && i(s);
1848
+ n.if(r, (i) => {
1849
+ var l, c;
1850
+ (c = (l = t.displayItemList) == null ? void 0 : l.rows) != null && c.length && i(s);
1844
1851
  });
1845
1852
  }
1846
- n.append(e, r), n.pop();
1853
+ n.append(e, o), n.pop();
1847
1854
  }
1848
- function _t(e, t) {
1849
- var r = n.comment(), o = n.first_child(r);
1855
+ function wt(e, t) {
1856
+ n.push(t, !0);
1857
+ var o = n.comment(), r = n.first_child(o);
1850
1858
  n.each(
1851
- o,
1859
+ r,
1852
1860
  17,
1853
1861
  () => t.stylesheets ?? [],
1854
1862
  n.index,
1855
1863
  (s, i) => {
1856
- var l = n.comment(), a = n.first_child(l);
1857
- n.element(a, () => "style", !1, (d, u) => {
1858
- n.attribute_effect(d, () => ({ "data-rulecms-library-stylesheet": "" }));
1859
- var c = n.text();
1860
- n.template_effect(() => n.set_text(c, n.get(i))), n.append(u, c);
1861
- }), n.append(s, l);
1864
+ var l = n.comment(), c = n.first_child(l);
1865
+ n.html(c, () => K(n.get(i), "data-rulecms-library-stylesheet")), n.append(s, l);
1862
1866
  }
1863
- ), n.append(e, r);
1867
+ ), n.append(e, o), n.pop();
1864
1868
  }
1865
- let vo = 0;
1866
- var Co = n.from_html("<div><!></div>"), Je = n.from_html("<!> <!>", 1);
1867
- function _o(e, t) {
1869
+ var _r = n.from_html("<div><!></div>"), qe = n.from_html("<!> <!>", 1);
1870
+ function wr(e, t) {
1871
+ const o = n.props_id();
1868
1872
  n.push(t, !0);
1869
- const r = ["Phone", "Tablet", "Desktop"], o = `rulecms-bp-${++vo}`, s = n.derived(() => t.scopeIdInput ?? o), i = n.derived(() => eo(t.displayItemList, t.widgetCollections)), l = n.derived(() => ro(n.get(s)));
1870
- var a = Je(), d = n.first_child(a);
1873
+ const r = ["Phone", "Tablet", "Desktop"], s = `rulecms-bp-${o.replace(/[^a-zA-Z0-9_-]/g, "")}`, i = n.derived(() => t.scopeIdInput ?? s), l = n.derived(() => nr(t.displayItemList, t.widgetCollections)), c = n.derived(() => sr(n.get(i)));
1874
+ var a = qe(), d = n.first_child(a);
1871
1875
  {
1872
- let p = n.derived(() => {
1873
- var g;
1874
- return (g = t.plugins.sourceComponents) == null ? void 0 : g.stylesheets;
1876
+ let f = n.derived(() => {
1877
+ var w;
1878
+ return (w = t.plugins.sourceComponents) == null ? void 0 : w.stylesheets;
1875
1879
  });
1876
- _t(d, {
1880
+ wt(d, {
1877
1881
  get stylesheets() {
1878
- return n.get(p);
1882
+ return n.get(f);
1879
1883
  }
1880
1884
  });
1881
1885
  }
1882
1886
  var u = n.sibling(d, 2);
1883
1887
  {
1884
- var c = (p) => {
1885
- Se(p, {
1888
+ var g = (f) => {
1889
+ Te(f, {
1886
1890
  get displayItemList() {
1887
1891
  return t.displayItemList;
1888
1892
  },
@@ -1907,16 +1911,13 @@ function _o(e, t) {
1907
1911
  return t.placeholderValues;
1908
1912
  }
1909
1913
  });
1910
- }, f = (p) => {
1911
- var g = Je(), A = n.first_child(g);
1912
- n.element(A, () => "style", !1, (b, v) => {
1913
- var T = n.text();
1914
- n.template_effect(() => n.set_text(T, n.get(l))), n.append(v, T);
1915
- });
1916
- var w = n.sibling(A, 2);
1917
- n.each(w, 16, () => r, (b) => b, (b, v) => {
1918
- var T = Co(), j = n.child(T);
1919
- Se(j, {
1914
+ }, m = (f) => {
1915
+ var w = qe(), E = n.first_child(w);
1916
+ n.html(E, () => K(n.get(c)));
1917
+ var h = n.sibling(E, 2);
1918
+ n.each(h, 16, () => r, (A) => A, (A, T) => {
1919
+ var x = _r(), z = n.child(x);
1920
+ Te(z, {
1920
1921
  get displayItemList() {
1921
1922
  return t.displayItemList;
1922
1923
  },
@@ -1928,7 +1929,7 @@ function _o(e, t) {
1928
1929
  showDropContainers: !1,
1929
1930
  reduxDeviceDisplayType: "desktop",
1930
1931
  get deviceDisplayType() {
1931
- return v;
1932
+ return T;
1932
1933
  },
1933
1934
  get plugins() {
1934
1935
  return t.plugins;
@@ -1942,55 +1943,55 @@ function _o(e, t) {
1942
1943
  get placeholderValues() {
1943
1944
  return t.placeholderValues;
1944
1945
  }
1945
- }), n.reset(T), n.template_effect((U) => n.set_class(T, 1, U), [() => `${n.get(s)}-${v.toLowerCase()}`]), n.append(b, T);
1946
- }), n.append(p, g);
1946
+ }), n.reset(x), n.template_effect((v) => n.set_class(x, 1, v), [() => `${n.get(i)}-${T.toLowerCase()}`]), n.append(A, x);
1947
+ }), n.append(f, w);
1947
1948
  };
1948
- n.if(u, (p) => {
1949
- n.get(i) ? p(f, -1) : p(c);
1949
+ n.if(u, (f) => {
1950
+ n.get(l) ? f(m, -1) : f(g);
1950
1951
  });
1951
1952
  }
1952
1953
  n.append(e, a), n.pop();
1953
1954
  }
1954
- function wo(e, t, r) {
1955
+ function Ar(e, t, o) {
1955
1956
  if (e)
1956
1957
  return "Phone";
1957
1958
  if (t)
1958
1959
  return "Tablet";
1959
- const o = (r == null ? void 0 : r.toLowerCase()) || "desktop";
1960
- return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
1960
+ const r = (o == null ? void 0 : o.toLowerCase()) || "desktop";
1961
+ return r === "phone" ? "Phone" : r === "tablet" ? "Tablet" : "Desktop";
1961
1962
  }
1962
- const Ao = `(max-width: ${ft})`, Eo = `(max-width: ${gt})`;
1963
- var So = n.from_html("<!> <!>", 1);
1964
- function To(e, t) {
1963
+ const Er = `(max-width: ${gt})`, Sr = `(max-width: ${pt})`;
1964
+ var Tr = n.from_html("<!> <!>", 1);
1965
+ function Ir(e, t) {
1965
1966
  n.push(t, !0);
1966
- let r = n.state("Desktop"), o, s;
1967
+ let o = n.state("Desktop"), r, s;
1967
1968
  function i() {
1968
- n.set(r, wo((o == null ? void 0 : o.matches) ?? !1, (s == null ? void 0 : s.matches) ?? !1, t.reduxDeviceDisplayType), !0);
1969
+ n.set(o, Ar((r == null ? void 0 : r.matches) ?? !1, (s == null ? void 0 : s.matches) ?? !1, t.reduxDeviceDisplayType), !0);
1969
1970
  }
1970
- n.user_effect(() => (typeof matchMedia == "function" && (o = matchMedia(Ao), s = matchMedia(Eo), o.addEventListener("change", i), s.addEventListener("change", i)), i(), () => {
1971
- o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
1971
+ n.user_effect(() => (typeof matchMedia == "function" && (r = matchMedia(Er), s = matchMedia(Sr), r.addEventListener("change", i), s.addEventListener("change", i)), i(), () => {
1972
+ r == null || r.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
1972
1973
  }));
1973
- var l = So(), a = n.first_child(l);
1974
+ var l = Tr(), c = n.first_child(l);
1974
1975
  {
1975
- var d = (c) => {
1976
+ var a = (u) => {
1976
1977
  {
1977
- let f = n.derived(() => {
1978
- var p;
1979
- return (p = t.plugins.sourceComponents) == null ? void 0 : p.stylesheets;
1978
+ let g = n.derived(() => {
1979
+ var m;
1980
+ return (m = t.plugins.sourceComponents) == null ? void 0 : m.stylesheets;
1980
1981
  });
1981
- _t(c, {
1982
+ wt(u, {
1982
1983
  get stylesheets() {
1983
- return n.get(f);
1984
+ return n.get(g);
1984
1985
  }
1985
1986
  });
1986
1987
  }
1987
1988
  };
1988
- n.if(a, (c) => {
1989
- t.isWithinCollection || c(d);
1989
+ n.if(c, (u) => {
1990
+ t.isWithinCollection || u(a);
1990
1991
  });
1991
1992
  }
1992
- var u = n.sibling(a, 2);
1993
- Se(u, {
1993
+ var d = n.sibling(c, 2);
1994
+ Te(d, {
1994
1995
  get displayItemList() {
1995
1996
  return t.displayItemList;
1996
1997
  },
@@ -2010,7 +2011,7 @@ function To(e, t) {
2010
2011
  return t.reduxDeviceDisplayType;
2011
2012
  },
2012
2013
  get deviceDisplayType() {
2013
- return n.get(r);
2014
+ return n.get(o);
2014
2015
  },
2015
2016
  get plugins() {
2016
2017
  return t.plugins;
@@ -2026,81 +2027,80 @@ function To(e, t) {
2026
2027
  }
2027
2028
  }), n.append(e, l), n.pop();
2028
2029
  }
2029
- function wt(e) {
2030
+ function At(e) {
2030
2031
  return e !== !1;
2031
2032
  }
2032
- const Io = ["utilities", "components"], Po = new Set(Io), At = (e) => typeof e == "string" && Po.has(e), Do = (e) => e.split(`
2033
+ const Pr = ["utilities", "components"], Dr = new Set(Pr), Et = (e) => typeof e == "string" && Dr.has(e), kr = (e) => e.split(`
2033
2034
  `).map((t) => t.length > 0 ? ` ${t}` : t).join(`
2034
- `), xo = (e, t) => e ? At(t) ? `@layer ${t} {
2035
- ${Do(e)}
2036
- }` : e : null, ko = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Lo = (e) => e.replace(/[^A-Za-z0-9_-]/g, (t) => `\\${t}`), Ro = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], Oo = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, jo = /[\s{};"]/, No = /^[A-Za-z0-9_:%./[\]%-]+$/, Mo = (e) => {
2035
+ `), xr = (e, t) => e ? Et(t) ? `@layer ${t} {
2036
+ ${kr(e)}
2037
+ }` : e : null, Lr = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Rr = (e) => {
2038
+ const t = e.replace(/[^A-Za-z0-9_-]/g, (o) => `\\${o}`);
2039
+ return /^[0-9]/.test(t) ? `\\3${t[0]} ${t.slice(1)}` : /^-[0-9]/.test(t) ? `-\\3${t[1]} ${t.slice(2)}` : t;
2040
+ }, Or = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], jr = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Nr = /[\s{};"]/, Mr = /^[A-Za-z0-9_:%./[\]%-]+$/, Wr = (e) => {
2037
2041
  let t = 0;
2038
- for (const r of e)
2039
- if (r === "{")
2042
+ for (const o of e)
2043
+ if (o === "{")
2040
2044
  t += 1;
2041
- else if (r === "}" && (t -= 1, t < 0))
2045
+ else if (o === "}" && (t -= 1, t < 0))
2042
2046
  return !1;
2043
2047
  return t === 0;
2044
- }, Wo = (e) => {
2048
+ }, Vr = (e) => {
2045
2049
  const t = e.startsWith(".") ? e.slice(1) : e;
2046
- return !t || t.length > 200 || t.startsWith(".") || jo.test(t) ? !1 : No.test(t);
2047
- }, Vo = (e) => {
2050
+ return !t || t.length > 200 || t.startsWith(".") || Nr.test(t) ? !1 : Mr.test(t);
2051
+ }, Fr = (e) => {
2048
2052
  const t = e.trim();
2049
- if (!t || t.length > 4e3 || Oo.test(t) || !Mo(t))
2053
+ if (!t || t.length > 4e3 || jr.test(t) || !Wr(t))
2050
2054
  return !1;
2051
- const r = t.toLowerCase();
2052
- return !Ro.some((o) => r.includes(o));
2053
- }, Fo = (e) => {
2055
+ const o = t.toLowerCase();
2056
+ return !Or.some((r) => o.includes(r));
2057
+ }, Kr = (e) => {
2054
2058
  if (!e)
2055
2059
  return {};
2056
2060
  const t = {};
2057
- for (const [r, o] of Object.entries(e)) {
2058
- const s = r.startsWith(".") ? r.slice(1) : r.trim();
2059
- if (!Wo(s) || typeof o != "string")
2061
+ for (const [o, r] of Object.entries(e)) {
2062
+ const s = o.startsWith(".") ? o.slice(1) : o.trim();
2063
+ if (!Vr(s) || typeof r != "string")
2060
2064
  continue;
2061
- const i = o.trim();
2062
- Vo(i) && (t[s] = i);
2065
+ const i = r.trim();
2066
+ Fr(i) && (t[s] = i);
2063
2067
  }
2064
2068
  return t;
2065
- }, Ko = (e) => e.split(`
2069
+ }, Br = (e) => e.split(`
2066
2070
  `).map((t) => ` ${t}`).join(`
2067
- `), Bo = (e, t, r, o) => {
2068
- if (!wt(r))
2071
+ `), Ur = (e, t, o, r) => {
2072
+ if (!At(o))
2069
2073
  return null;
2070
- const s = Fo(t), i = Object.keys(s);
2074
+ const s = Kr(t), i = Object.keys(s);
2071
2075
  if (i.length === 0 || !e)
2072
2076
  return null;
2073
- const l = `[data-rulecms-published-key="${ko(e)}"]`, a = i.sort((d, u) => d.localeCompare(u)).map(
2074
- (d) => `${l} .${Lo(d)} {
2075
- ${Ko(s[d])}
2077
+ const l = `[data-rulecms-published-key="${Lr(e)}"]`, c = i.map(
2078
+ (a) => `${l} .${Rr(a)} {
2079
+ ${Br(s[a])}
2076
2080
  }`
2077
2081
  ).join(`
2078
2082
  `);
2079
- return xo(a, o);
2083
+ return xr(c, r);
2080
2084
  };
2081
- function Uo(e, t) {
2085
+ function zr(e, t) {
2082
2086
  n.push(t, !0);
2083
- const r = n.derived(() => Bo(t.publishedKey, t.classes, void 0, t.classLayer));
2084
- var o = n.comment(), s = n.first_child(o);
2087
+ const o = n.derived(() => Ur(t.publishedKey, t.classes, void 0, t.classLayer));
2088
+ var r = n.comment(), s = n.first_child(r);
2085
2089
  {
2086
2090
  var i = (l) => {
2087
- var a = n.comment(), d = n.first_child(a);
2088
- n.element(d, () => "style", !1, (u, c) => {
2089
- n.attribute_effect(u, () => ({ "data-rulecms-project-class-definitions": "" }));
2090
- var f = n.text();
2091
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2092
- }), n.append(l, a);
2091
+ var c = n.comment(), a = n.first_child(c);
2092
+ n.html(a, () => K(n.get(o), "data-rulecms-project-class-definitions")), n.append(l, c);
2093
2093
  };
2094
2094
  n.if(s, (l) => {
2095
- n.get(r) && l(i);
2095
+ n.get(o) && l(i);
2096
2096
  });
2097
2097
  }
2098
- n.append(e, o), n.pop();
2098
+ n.append(e, r), n.pop();
2099
2099
  }
2100
- function Ne(e) {
2100
+ function Me(e) {
2101
2101
  return e !== !1;
2102
2102
  }
2103
- const Et = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), zo = /* @__PURE__ */ new Set([
2103
+ const St = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Hr = /* @__PURE__ */ new Set([
2104
2104
  "serif",
2105
2105
  "sans-serif",
2106
2106
  "monospace",
@@ -2114,87 +2114,87 @@ const Et = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), zo = /* @__PURE
2114
2114
  "emoji",
2115
2115
  "math",
2116
2116
  "fangsong"
2117
- ]), Ho = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, Go = /url\(|@|[{};\\<>]|javascript:/i, Yo = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Xo = /^--[A-Za-z_][\w-]*$/, Jo = /^[A-Za-z0-9 ]+$/, qo = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), Zo = 4, Qo = 8, $o = 255, Te = (e) => zo.has(e.toLowerCase()) || Ho.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, qe = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !Go.test(e), es = (e) => typeof e == "string" && Xo.test(e.trim()) && e.trim().length <= 80, ts = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Yo.test(e), ns = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > $o ? null : e, rs = (e, t, r) => {
2117
+ ]), Gr = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, Yr = /url\(|@|[{};\\<>]|javascript:/i, Xr = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Jr = /^--[A-Za-z_][\w-]*$/, qr = /^[A-Za-z0-9 ]+$/, Zr = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), Qr = 4, $r = 8, es = 255, Ie = (e) => Hr.has(e.toLowerCase()) || Gr.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, Ze = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !Yr.test(e), ts = (e) => typeof e == "string" && Jr.test(e.trim()) && e.trim().length <= 80, ns = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Xr.test(e), os = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > es ? null : e, rs = (e, t, o) => {
2118
2118
  if (!Array.isArray(e))
2119
2119
  return [];
2120
- const o = [];
2120
+ const r = [];
2121
2121
  for (const s of e) {
2122
- if (!s || typeof s != "object" || o.length >= Zo)
2122
+ if (!s || typeof s != "object" || r.length >= Qr)
2123
2123
  continue;
2124
2124
  const i = s;
2125
- if (!es(i.name))
2125
+ if (!ts(i.name))
2126
2126
  continue;
2127
2127
  const l = i.name.trim();
2128
2128
  if (t.has(l))
2129
2129
  continue;
2130
- const a = [], d = /* @__PURE__ */ new Set();
2131
- for (const c of i.overrideColors ?? []) {
2132
- if (a.length >= Qo)
2130
+ const c = [], a = /* @__PURE__ */ new Set();
2131
+ for (const u of i.overrideColors ?? []) {
2132
+ if (c.length >= $r)
2133
2133
  break;
2134
- const f = ns(c == null ? void 0 : c.index);
2135
- f === null || d.has(f) || !ts(c == null ? void 0 : c.color) || (d.add(f), a.push({ index: f, color: c.color.trim() }));
2134
+ const g = os(u == null ? void 0 : u.index);
2135
+ g === null || a.has(g) || !ns(u == null ? void 0 : u.color) || (a.add(g), c.push({ index: g, color: u.color.trim() }));
2136
2136
  }
2137
- a.sort((c, f) => c.index - f.index);
2138
- const u = i.applyToWidget === !0 && !r.current;
2139
- u && (r.current = !0), t.add(l), o.push({
2137
+ c.sort((u, g) => u.index - g.index);
2138
+ const d = i.applyToWidget === !0 && !o.current;
2139
+ d && (o.current = !0), t.add(l), r.push({
2140
2140
  name: l,
2141
- ...a.length > 0 ? { overrideColors: a } : {},
2142
- ...u ? { applyToWidget: !0 } : {}
2141
+ ...c.length > 0 ? { overrideColors: c } : {},
2142
+ ...d ? { applyToWidget: !0 } : {}
2143
2143
  });
2144
2144
  }
2145
- return o;
2146
- }, ge = (e) => {
2145
+ return r;
2146
+ }, pe = (e) => {
2147
2147
  var l;
2148
2148
  if (!Array.isArray(e))
2149
2149
  return [];
2150
- const t = [], r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = { current: !1 };
2150
+ const t = [], o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = { current: !1 };
2151
2151
  let i = !1;
2152
- for (const a of e) {
2153
- if (!a || !qe(a.family))
2152
+ for (const c of e) {
2153
+ if (!c || !Ze(c.family))
2154
2154
  continue;
2155
- const d = a.family.trim(), u = d.toLowerCase();
2156
- if (r.has(u) || t.length >= 12)
2155
+ const a = c.family.trim(), d = a.toLowerCase();
2156
+ if (o.has(d) || t.length >= 12)
2157
2157
  continue;
2158
- const c = (a.fallbacks ?? []).filter(qe).slice(0, 8), f = typeof a.cssVariable == "string" && $(a.cssVariable.trim()) ? a.cssVariable.trim() : void 0;
2159
- let p = { kind: "stack-only" };
2160
- if (((l = a.source) == null ? void 0 : l.kind) === "google") {
2161
- if (!Jo.test(d))
2158
+ const u = (c.fallbacks ?? []).filter(Ze).slice(0, 8), g = typeof c.cssVariable == "string" && ee(c.cssVariable.trim()) ? c.cssVariable.trim() : void 0;
2159
+ let m = { kind: "stack-only" };
2160
+ if (((l = c.source) == null ? void 0 : l.kind) === "google") {
2161
+ if (!qr.test(a))
2162
2162
  continue;
2163
- const b = (Array.isArray(a.source.weights) ? a.source.weights : []).filter((v) => typeof v == "number" && qo.has(v)).filter((v, T, j) => j.indexOf(v) === T).sort((v, T) => v - T);
2164
- if (b.length === 0)
2163
+ const h = (Array.isArray(c.source.weights) ? c.source.weights : []).filter((A) => typeof A == "number" && Zr.has(A)).filter((A, T, x) => x.indexOf(A) === T).sort((A, T) => A - T);
2164
+ if (h.length === 0)
2165
2165
  continue;
2166
- p = { kind: "google", weights: b };
2166
+ m = { kind: "google", weights: h };
2167
2167
  }
2168
- r.add(u);
2169
- const g = a.applyToWidget === !0 && !i;
2170
- g && (i = !0);
2171
- const A = rs(a.palettes, o, s);
2168
+ o.add(d);
2169
+ const f = c.applyToWidget === !0 && !i;
2170
+ f && (i = !0);
2171
+ const w = rs(c.palettes, r, s);
2172
2172
  t.push({
2173
- family: d,
2174
- ...f ? { cssVariable: f } : {},
2175
- fallbacks: c,
2176
- applyToWidget: g,
2177
- source: p,
2178
- ...A.length > 0 ? { palettes: A } : {}
2173
+ family: a,
2174
+ ...g ? { cssVariable: g } : {},
2175
+ fallbacks: u,
2176
+ applyToWidget: f,
2177
+ source: m,
2178
+ ...w.length > 0 ? { palettes: w } : {}
2179
2179
  });
2180
2180
  }
2181
2181
  return t;
2182
- }, os = (e) => {
2183
- const t = ge(e).filter((r) => r.source.kind === "google").map((r) => {
2184
- const o = r.source.kind === "google" ? r.source.weights.join(";") : "400";
2185
- return `family=${r.family.replace(/ /g, "+")}:wght@${o}`;
2182
+ }, ss = (e) => {
2183
+ const t = pe(e).filter((o) => o.source.kind === "google").map((o) => {
2184
+ const r = o.source.kind === "google" ? o.source.weights.join(";") : "400";
2185
+ return `family=${o.family.replace(/ /g, "+")}:wght@${r}`;
2186
2186
  });
2187
2187
  return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`;
2188
- }, ss = (e) => [Te(e.family), ...(e.fallbacks ?? []).map(Te)].join(", "), is = (e) => {
2188
+ }, is = (e) => [Ie(e.family), ...(e.fallbacks ?? []).map(Ie)].join(", "), ls = (e) => {
2189
2189
  const t = [];
2190
- for (const r of e)
2191
- for (const o of r.palettes ?? []) {
2192
- const s = [` font-family: ${Te(r.family)};`];
2193
- if (o.overrideColors && o.overrideColors.length > 0) {
2194
- const i = o.overrideColors.map((l) => `${l.index} ${l.color}`).join(", ");
2190
+ for (const o of e)
2191
+ for (const r of o.palettes ?? []) {
2192
+ const s = [` font-family: ${Ie(o.family)};`];
2193
+ if (r.overrideColors && r.overrideColors.length > 0) {
2194
+ const i = r.overrideColors.map((l) => `${l.index} ${l.color}`).join(", ");
2195
2195
  s.push(` override-colors: ${i};`);
2196
2196
  }
2197
- t.push(`@font-palette-values ${o.name} {
2197
+ t.push(`@font-palette-values ${r.name} {
2198
2198
  ${s.join(`
2199
2199
  `)}
2200
2200
  }`);
@@ -2202,65 +2202,61 @@ ${s.join(`
2202
2202
  return t.length > 0 ? t.join(`
2203
2203
 
2204
2204
  `) : null;
2205
- }, ls = (e) => {
2205
+ }, cs = (e) => {
2206
2206
  for (const t of e)
2207
- for (const r of t.palettes ?? [])
2208
- if (r.applyToWidget)
2209
- return r.name;
2210
- }, as = (e, t, r) => {
2211
- if (!Ne(r) || !e)
2207
+ for (const o of t.palettes ?? [])
2208
+ if (o.applyToWidget)
2209
+ return o.name;
2210
+ }, as = (e, t, o) => {
2211
+ if (!Me(o) || !e)
2212
2212
  return null;
2213
- const o = ge(t), s = [];
2214
- for (const u of o) {
2215
- const c = ss(u);
2216
- u.cssVariable && s.push(` ${u.cssVariable}: ${c};`), u.applyToWidget && s.push(
2217
- ` font-family: ${u.cssVariable ? `var(${u.cssVariable})` : c};`
2213
+ const r = pe(t), s = [];
2214
+ for (const d of r) {
2215
+ const u = is(d);
2216
+ d.cssVariable && s.push(` ${d.cssVariable}: ${u};`), d.applyToWidget && s.push(
2217
+ ` font-family: ${d.cssVariable ? `var(${d.cssVariable})` : u};`
2218
2218
  );
2219
2219
  }
2220
- const i = ls(o);
2220
+ const i = cs(r);
2221
2221
  i && s.push(` font-palette: ${i};`);
2222
- const l = is(o), a = `[data-rulecms-published-key="${Et(e)}"] > *`, d = s.length > 0 ? `${a} {
2222
+ const l = ls(r), c = `[data-rulecms-published-key="${St(e)}"] > *`, a = s.length > 0 ? `${c} {
2223
2223
  ${s.join(`
2224
2224
  `)}
2225
2225
  }` : null;
2226
- return !l && !d ? null : l ? d ? `${l}
2226
+ return !l && !a ? null : l ? a ? `${l}
2227
2227
 
2228
- ${d}` : l : d;
2228
+ ${a}` : l : a;
2229
2229
  };
2230
- var cs = n.from_html('<link rel="stylesheet" data-rulecms-project-fonts=""/>'), us = n.from_html("<!> <!>", 1);
2231
- function ds(e, t) {
2230
+ var us = n.from_html('<link rel="stylesheet" data-rulecms-project-fonts=""/>'), ds = n.from_html("<!> <!>", 1);
2231
+ function fs(e, t) {
2232
2232
  n.push(t, !0);
2233
- const r = n.derived(() => ge(t.fonts)), o = n.derived(() => Ne(t.includeFontFaces) ? os(n.get(r)) : null), s = n.derived(() => as(t.publishedKey, n.get(r), t.includeFontFaces));
2234
- var i = us(), l = n.first_child(i);
2233
+ const o = n.derived(() => pe(t.fonts)), r = n.derived(() => Me(t.includeFontFaces) ? ss(n.get(o)) : null), s = n.derived(() => as(t.publishedKey, n.get(o), t.includeFontFaces));
2234
+ var i = ds(), l = n.first_child(i);
2235
2235
  {
2236
- var a = (c) => {
2237
- var f = cs();
2238
- n.template_effect(() => n.set_attribute(f, "href", n.get(o))), n.append(c, f);
2236
+ var c = (u) => {
2237
+ var g = us();
2238
+ n.template_effect(() => n.set_attribute(g, "href", n.get(r))), n.append(u, g);
2239
2239
  };
2240
- n.if(l, (c) => {
2241
- n.get(o) && c(a);
2240
+ n.if(l, (u) => {
2241
+ n.get(r) && u(c);
2242
2242
  });
2243
2243
  }
2244
- var d = n.sibling(l, 2);
2244
+ var a = n.sibling(l, 2);
2245
2245
  {
2246
- var u = (c) => {
2247
- var f = n.comment(), p = n.first_child(f);
2248
- n.element(p, () => "style", !1, (g, A) => {
2249
- n.attribute_effect(g, () => ({ "data-rulecms-project-fonts": "" }));
2250
- var w = n.text();
2251
- n.template_effect(() => n.set_text(w, n.get(s))), n.append(A, w);
2252
- }), n.append(c, f);
2246
+ var d = (u) => {
2247
+ var g = n.comment(), m = n.first_child(g);
2248
+ n.html(m, () => K(n.get(s), "data-rulecms-project-fonts")), n.append(u, g);
2253
2249
  };
2254
- n.if(d, (c) => {
2255
- n.get(s) && c(u);
2250
+ n.if(a, (u) => {
2251
+ n.get(s) && u(d);
2256
2252
  });
2257
2253
  }
2258
2254
  n.append(e, i), n.pop();
2259
2255
  }
2260
- function St(e) {
2256
+ function Tt(e) {
2261
2257
  return e !== !1;
2262
2258
  }
2263
- const fs = 80, gs = 4e3, ps = 32, Tt = [
2259
+ const gs = 80, ps = 4e3, ms = 32, It = [
2264
2260
  "url(",
2265
2261
  "@import",
2266
2262
  "@font-face",
@@ -2271,171 +2267,163 @@ const fs = 80, gs = 4e3, ps = 32, Tt = [
2271
2267
  "javascript:",
2272
2268
  "expression(",
2273
2269
  "behavior:"
2274
- ], ms = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, ys = /^[A-Za-z_][\w-]*$/, hs = (e) => {
2270
+ ], ys = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, hs = /^[A-Za-z_][\w-]*$/, bs = (e) => {
2275
2271
  let t = 0;
2276
- for (const r of e)
2277
- if (r === "{")
2272
+ for (const o of e)
2273
+ if (o === "{")
2278
2274
  t += 1;
2279
- else if (r === "}" && (t -= 1, t < 0))
2275
+ else if (o === "}" && (t -= 1, t < 0))
2280
2276
  return !1;
2281
2277
  return t === 0;
2282
- }, bs = (e) => {
2283
- if (!e || e.length > fs || e.includes("@") || e.includes(".") || /\s/.test(e))
2278
+ }, vs = (e) => {
2279
+ if (!e || e.length > gs || e.includes("@") || e.includes(".") || /\s/.test(e))
2284
2280
  return !1;
2285
2281
  const t = e.toLowerCase();
2286
- return Tt.some((r) => t.includes(r)) ? !1 : ys.test(e);
2287
- }, vs = (e) => {
2282
+ return It.some((o) => t.includes(o)) ? !1 : hs.test(e);
2283
+ }, Cs = (e) => {
2288
2284
  const t = e.trim();
2289
2285
  if (t === "")
2290
2286
  return !1;
2291
- const r = t.toLowerCase();
2292
- if (r === "from" || r === "to")
2287
+ const o = t.toLowerCase();
2288
+ if (o === "from" || o === "to")
2293
2289
  return !0;
2294
- const o = t.match(/^(\d{1,3}(?:\.\d+)?)%$/);
2295
- if (!o)
2290
+ const r = t.match(/^(\d{1,3}(?:\.\d+)?)%$/);
2291
+ if (!r)
2296
2292
  return !1;
2297
- const s = Number(o[1]);
2293
+ const s = Number(r[1]);
2298
2294
  return s >= 0 && s <= 100;
2299
- }, Cs = (e) => {
2295
+ }, _s = (e) => {
2300
2296
  let t = 0;
2301
- const r = e.length;
2302
- let o = 0;
2297
+ const o = e.length;
2298
+ let r = 0;
2303
2299
  const s = () => {
2304
- for (; t < r && /\s/.test(e[t]); )
2300
+ for (; t < o && /\s/.test(e[t]); )
2305
2301
  t += 1;
2306
2302
  };
2307
- for (s(); t < r; ) {
2303
+ for (s(); t < o; ) {
2308
2304
  const i = e.indexOf("{", t);
2309
- if (i === -1 || !e.slice(t, i).trim().split(",").every((u) => vs(u)))
2305
+ if (i === -1 || !e.slice(t, i).trim().split(",").every((d) => Cs(d)))
2310
2306
  return !1;
2311
2307
  t = i + 1;
2312
- const a = e.indexOf("}", t);
2313
- if (a === -1)
2308
+ const c = e.indexOf("}", t);
2309
+ if (c === -1)
2314
2310
  return !1;
2315
- const d = e.slice(t, a);
2316
- if (d.includes("{") || d.includes("}") || d.includes("@"))
2311
+ const a = e.slice(t, c);
2312
+ if (a.includes("{") || a.includes("}") || a.includes("@"))
2317
2313
  return !1;
2318
- t = a + 1, o += 1, s();
2314
+ t = c + 1, r += 1, s();
2319
2315
  }
2320
- return o > 0;
2321
- }, _s = (e) => {
2316
+ return r > 0;
2317
+ }, ws = (e) => {
2322
2318
  const t = e.trim();
2323
- if (!t || t.length > gs || ms.test(t) || !hs(t))
2319
+ if (!t || t.length > ps || ys.test(t) || !bs(t))
2324
2320
  return !1;
2325
- const r = t.toLowerCase();
2326
- return Tt.some((o) => r.includes(o)) || t.includes("@") ? !1 : Cs(t);
2327
- }, It = (e) => {
2321
+ const o = t.toLowerCase();
2322
+ return It.some((r) => o.includes(r)) || t.includes("@") ? !1 : _s(t);
2323
+ }, Pt = (e) => {
2328
2324
  if (!e)
2329
2325
  return {};
2330
2326
  const t = {};
2331
- for (const [r, o] of Object.entries(e)) {
2332
- const s = r.trim();
2333
- if (!bs(s) || t[s] !== void 0 || typeof o != "string")
2327
+ for (const [o, r] of Object.entries(e)) {
2328
+ const s = o.trim();
2329
+ if (!vs(s) || t[s] !== void 0 || typeof r != "string")
2334
2330
  continue;
2335
- const i = o.trim();
2336
- if (_s(i) && (t[s] = i, Object.keys(t).length === ps))
2331
+ const i = r.trim();
2332
+ if (ws(i) && (t[s] = i, Object.keys(t).length === ms))
2337
2333
  break;
2338
2334
  }
2339
2335
  return Object.fromEntries(
2340
- Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
2336
+ Object.entries(t).sort(([o], [r]) => o.localeCompare(r))
2341
2337
  );
2342
- }, ws = (e) => e.split(`
2338
+ }, As = (e) => e.split(`
2343
2339
  `).map((t) => ` ${t}`).join(`
2344
- `), As = (e, t, r) => {
2345
- if (!St(r))
2340
+ `), Es = (e, t, o) => {
2341
+ if (!Tt(o))
2346
2342
  return null;
2347
- const o = It(t), s = Object.keys(o);
2343
+ const r = Pt(t), s = Object.keys(r);
2348
2344
  return s.length === 0 ? null : s.map((i) => `@keyframes ${i} {
2349
- ${ws(o[i])}
2345
+ ${As(r[i])}
2350
2346
  }`).join(`
2351
2347
 
2352
2348
  `);
2353
2349
  };
2354
- function Es(e, t) {
2350
+ function Ss(e, t) {
2355
2351
  n.push(t, !0);
2356
- const r = n.derived(() => As(t.publishedKey, t.keyframes));
2357
- var o = n.comment(), s = n.first_child(o);
2352
+ const o = n.derived(() => Es(t.publishedKey, t.keyframes));
2353
+ var r = n.comment(), s = n.first_child(r);
2358
2354
  {
2359
2355
  var i = (l) => {
2360
- var a = n.comment(), d = n.first_child(a);
2361
- n.element(d, () => "style", !1, (u, c) => {
2362
- n.attribute_effect(u, () => ({ "data-rulecms-project-keyframes": "" }));
2363
- var f = n.text();
2364
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2365
- }), n.append(l, a);
2356
+ var c = n.comment(), a = n.first_child(c);
2357
+ n.html(a, () => K(n.get(o), "data-rulecms-project-keyframes")), n.append(l, c);
2366
2358
  };
2367
2359
  n.if(s, (l) => {
2368
- n.get(r) && l(i);
2360
+ n.get(o) && l(i);
2369
2361
  });
2370
2362
  }
2371
- n.append(e, o), n.pop();
2363
+ n.append(e, r), n.pop();
2372
2364
  }
2373
- const Pt = (e) => e !== !1, Ss = 80, Ts = 2e3, Is = 16, Dt = ["url(", "@", "</", "<script", "javascript:", "expression("], Ps = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Ds = /^--[A-Za-z_][\w-]*$/, xs = (e) => {
2365
+ const Dt = (e) => e !== !1, Ts = 80, Is = 2e3, Ps = 16, kt = ["url(", "@", "</", "<script", "javascript:", "expression("], Ds = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, ks = /^--[A-Za-z_][\w-]*$/, xs = (e) => {
2374
2366
  for (const t of e)
2375
2367
  if (t === "{" || t === "}")
2376
2368
  return !1;
2377
2369
  return !0;
2378
- }, ks = (e) => {
2379
- if (!e || e.length > Ss || e.includes("@") || e.includes(".") || /\s/.test(e))
2370
+ }, Ls = (e) => {
2371
+ if (!e || e.length > Ts || e.includes("@") || e.includes(".") || /\s/.test(e))
2380
2372
  return !1;
2381
2373
  const t = e.toLowerCase();
2382
- return Dt.some((r) => t.includes(r)) ? !1 : Ds.test(e);
2383
- }, Ls = (e) => {
2374
+ return kt.some((o) => t.includes(o)) ? !1 : ks.test(e);
2375
+ }, Rs = (e) => {
2384
2376
  const t = e.trim();
2385
- if (!t || t.length > Ts || Ps.test(t) || !xs(t))
2377
+ if (!t || t.length > Is || Ds.test(t) || !xs(t))
2386
2378
  return !1;
2387
- const r = t.toLowerCase();
2388
- return !Dt.some((o) => r.includes(o));
2379
+ const o = t.toLowerCase();
2380
+ return !kt.some((r) => o.includes(r));
2389
2381
  }, xt = (e) => {
2390
2382
  if (!e)
2391
2383
  return {};
2392
2384
  const t = {};
2393
- for (const [r, o] of Object.entries(e)) {
2394
- const s = r.trim();
2395
- if (!ks(s) || t[s] !== void 0 || typeof o != "string")
2385
+ for (const [o, r] of Object.entries(e)) {
2386
+ const s = o.trim();
2387
+ if (!Ls(s) || t[s] !== void 0 || typeof r != "string")
2396
2388
  continue;
2397
- const i = o.trim();
2398
- if (Ls(i) && (t[s] = i, Object.keys(t).length === Is))
2389
+ const i = r.trim();
2390
+ if (Rs(i) && (t[s] = i, Object.keys(t).length === Ps))
2399
2391
  break;
2400
2392
  }
2401
2393
  return Object.fromEntries(
2402
- Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
2394
+ Object.entries(t).sort(([o], [r]) => o.localeCompare(r))
2403
2395
  );
2404
- }, Rs = (e) => e.split(`
2396
+ }, Os = (e) => e.split(`
2405
2397
  `).map((t) => ` ${t}`).join(`
2406
- `), Os = (e, t, r) => {
2407
- if (!Pt(r))
2398
+ `), js = (e, t, o) => {
2399
+ if (!Dt(o))
2408
2400
  return null;
2409
- const o = xt(t), s = Object.keys(o);
2401
+ const r = xt(t), s = Object.keys(r);
2410
2402
  return s.length === 0 ? null : s.map((i) => `@position-try ${i} {
2411
- ${Rs(o[i])}
2403
+ ${Os(r[i])}
2412
2404
  }`).join(`
2413
2405
 
2414
2406
  `);
2415
2407
  };
2416
- function js(e, t) {
2408
+ function Ns(e, t) {
2417
2409
  n.push(t, !0);
2418
- const r = n.derived(() => Os(t.publishedKey, t.positionTry));
2419
- var o = n.comment(), s = n.first_child(o);
2410
+ const o = n.derived(() => js(t.publishedKey, t.positionTry));
2411
+ var r = n.comment(), s = n.first_child(r);
2420
2412
  {
2421
2413
  var i = (l) => {
2422
- var a = n.comment(), d = n.first_child(a);
2423
- n.element(d, () => "style", !1, (u, c) => {
2424
- n.attribute_effect(u, () => ({ "data-rulecms-project-position-try": "" }));
2425
- var f = n.text();
2426
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2427
- }), n.append(l, a);
2414
+ var c = n.comment(), a = n.first_child(c);
2415
+ n.html(a, () => K(n.get(o), "data-rulecms-project-position-try")), n.append(l, c);
2428
2416
  };
2429
2417
  n.if(s, (l) => {
2430
- n.get(r) && l(i);
2418
+ n.get(o) && l(i);
2431
2419
  });
2432
2420
  }
2433
- n.append(e, o), n.pop();
2421
+ n.append(e, r), n.pop();
2434
2422
  }
2435
- function kt(e) {
2423
+ function Lt(e) {
2436
2424
  return e !== !1;
2437
2425
  }
2438
- const Ns = [
2426
+ const Ms = [
2439
2427
  "*",
2440
2428
  "<number>",
2441
2429
  "<integer>",
@@ -2447,26 +2435,26 @@ const Ns = [
2447
2435
  "<time>",
2448
2436
  "<transform-function>",
2449
2437
  "<transform-list>"
2450
- ], Ms = new Set(Ns), Ws = /[{};]/, Vs = 40, Fs = 200, Ks = (e) => typeof e == "string" && Ms.has(e), Bs = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > Fs || Ws.test(e) || e.includes("url(") || e.includes("@")), Lt = (e) => {
2438
+ ], Ws = new Set(Ms), Vs = /[{};]/, Fs = 200, Ks = 200, Bs = (e) => typeof e == "string" && Ws.has(e), Us = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > Ks || Vs.test(e) || e.includes("url(") || e.includes("@")), Rt = (e) => {
2451
2439
  if (!Array.isArray(e))
2452
2440
  return [];
2453
- const t = [], r = /* @__PURE__ */ new Set();
2454
- for (const o of e) {
2455
- if (!o || typeof o.name != "string" || !$(o.name.trim()))
2441
+ const t = [], o = /* @__PURE__ */ new Set();
2442
+ for (const r of e) {
2443
+ if (!r || typeof r.name != "string" || !ee(r.name.trim()))
2456
2444
  continue;
2457
- const s = o.name.trim();
2458
- if (r.has(s) || t.length >= Vs || !Ks(o.syntax) || typeof o.inherits != "boolean")
2445
+ const s = r.name.trim();
2446
+ if (o.has(s) || t.length >= Fs || !Bs(r.syntax) || typeof r.inherits != "boolean")
2459
2447
  continue;
2460
- const i = typeof o.initialValue == "string" ? o.initialValue.trim() : "";
2461
- Bs(i, o.syntax) && (r.add(s), t.push({
2448
+ const i = typeof r.initialValue == "string" ? r.initialValue.trim() : "";
2449
+ Us(i, r.syntax) && (o.add(s), t.push({
2462
2450
  name: s,
2463
- syntax: o.syntax,
2464
- inherits: o.inherits,
2451
+ syntax: r.syntax,
2452
+ inherits: r.inherits,
2465
2453
  initialValue: i
2466
2454
  }));
2467
2455
  }
2468
2456
  return t;
2469
- }, Us = (e) => {
2457
+ }, zs = (e) => {
2470
2458
  const t = [
2471
2459
  `@property ${e.name} {`,
2472
2460
  ` syntax: "${e.syntax}";`,
@@ -2474,393 +2462,377 @@ const Ns = [
2474
2462
  ];
2475
2463
  return e.initialValue !== "" && t.push(` initial-value: ${e.initialValue};`), t.push("}"), t.join(`
2476
2464
  `);
2477
- }, zs = (e, t, r) => {
2478
- if (!kt(r))
2465
+ }, Hs = (e, t, o) => {
2466
+ if (!Lt(o))
2479
2467
  return null;
2480
- const o = Lt(t);
2481
- return o.length === 0 ? null : o.map(Us).join(`
2468
+ const r = Rt(t);
2469
+ return r.length === 0 ? null : r.map(zs).join(`
2482
2470
 
2483
2471
  `);
2484
2472
  };
2485
- function Hs(e, t) {
2473
+ function Gs(e, t) {
2486
2474
  n.push(t, !0);
2487
- const r = n.derived(() => zs(t.publishedKey, t.cssProperties));
2488
- var o = n.comment(), s = n.first_child(o);
2475
+ const o = n.derived(() => Hs(t.publishedKey, t.cssProperties));
2476
+ var r = n.comment(), s = n.first_child(r);
2489
2477
  {
2490
2478
  var i = (l) => {
2491
- var a = n.comment(), d = n.first_child(a);
2492
- n.element(d, () => "style", !1, (u, c) => {
2493
- n.attribute_effect(u, () => ({ "data-rulecms-project-css-properties": "" }));
2494
- var f = n.text();
2495
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2496
- }), n.append(l, a);
2479
+ var c = n.comment(), a = n.first_child(c);
2480
+ n.html(a, () => K(n.get(o), "data-rulecms-project-css-properties")), n.append(l, c);
2497
2481
  };
2498
2482
  n.if(s, (l) => {
2499
- n.get(r) && l(i);
2483
+ n.get(o) && l(i);
2500
2484
  });
2501
2485
  }
2502
- n.append(e, o), n.pop();
2486
+ n.append(e, r), n.pop();
2503
2487
  }
2504
- function Rt(e) {
2488
+ function Ot(e) {
2505
2489
  return e !== !1;
2506
2490
  }
2507
- const Ot = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Gs = /[{};]/, Ys = (e) => {
2491
+ const jt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Ys = /[{};]/, Xs = (e) => {
2508
2492
  if (!e)
2509
2493
  return {};
2510
2494
  const t = {};
2511
- for (const [r, o] of Object.entries(e)) {
2512
- if (!$(r) || typeof o != "string")
2495
+ for (const [o, r] of Object.entries(e)) {
2496
+ if (!ee(o) || typeof r != "string")
2513
2497
  continue;
2514
- const s = o.trim();
2515
- s === "" || Gs.test(s) || (t[r.trim()] = s);
2498
+ const s = r.trim();
2499
+ s === "" || Ys.test(s) || (t[o.trim()] = s);
2516
2500
  }
2517
2501
  return t;
2518
- }, Xs = (e, t, r) => {
2519
- if (!Rt(r))
2502
+ }, Js = (e, t, o) => {
2503
+ if (!Ot(o))
2520
2504
  return null;
2521
- const o = Ys(t), s = Object.keys(o);
2505
+ const r = Xs(t), s = Object.keys(r);
2522
2506
  if (s.length === 0 || !e)
2523
2507
  return null;
2524
- const i = `[data-rulecms-published-key="${Ot(e)}"] > *`, l = s.sort((a, d) => a.localeCompare(d)).map((a) => ` ${a}: ${o[a]};`).join(`
2508
+ const i = `[data-rulecms-published-key="${jt(e)}"] > *`, l = s.sort((c, a) => c.localeCompare(a)).map((c) => ` ${c}: ${r[c]};`).join(`
2525
2509
  `);
2526
2510
  return `${i} {
2527
2511
  ${l}
2528
2512
  }`;
2529
2513
  };
2530
- function jt(e) {
2514
+ function Nt(e) {
2531
2515
  return e !== !1;
2532
2516
  }
2533
- const Js = 5, qs = 200, Zs = [
2517
+ const qs = 5, Zs = 200, Qs = [
2534
2518
  { kind: "prefers-color-scheme", value: "dark" },
2535
2519
  { kind: "prefers-color-scheme", value: "light" },
2536
2520
  { kind: "html-class", value: "dark" },
2537
2521
  { kind: "data-theme", value: "dark" },
2538
2522
  { kind: "data-theme", value: "light" }
2539
- ], Qs = /[{};]/, $s = (e) => {
2523
+ ], $s = /[{};]/, ei = (e) => {
2540
2524
  if (typeof e != "object" || e === null || Array.isArray(e))
2541
2525
  return !1;
2542
2526
  const t = e;
2543
- return Zs.some(
2544
- (r) => r.kind === t.kind && r.value === t.value
2527
+ return Qs.some(
2528
+ (o) => o.kind === t.kind && o.value === t.value
2545
2529
  );
2546
- }, ei = (e) => {
2530
+ }, ti = (e) => {
2547
2531
  if (!e || typeof e != "object" || Array.isArray(e))
2548
2532
  return {};
2549
2533
  const t = {};
2550
- for (const [r, o] of Object.entries(e)) {
2551
- if (!$(r) || typeof o != "string")
2534
+ for (const [o, r] of Object.entries(e)) {
2535
+ if (!ee(o) || typeof r != "string")
2552
2536
  continue;
2553
- const s = o.trim();
2554
- s === "" || Qs.test(s) || s.includes("url(") || s.includes("@") || (t[r.trim()] = s);
2537
+ const s = r.trim();
2538
+ s === "" || $s.test(s) || s.includes("url(") || s.includes("@") || (t[o.trim()] = s);
2555
2539
  }
2556
2540
  return Object.fromEntries(
2557
- Object.entries(t).sort(([r], [o]) => r.localeCompare(o))
2541
+ Object.entries(t).sort(([o], [r]) => o.localeCompare(r))
2558
2542
  );
2559
- }, Nt = (e) => {
2543
+ }, Mt = (e) => {
2560
2544
  if (!Array.isArray(e))
2561
2545
  return [];
2562
- const t = [], r = /* @__PURE__ */ new Set();
2563
- let o = 0;
2546
+ const t = [], o = /* @__PURE__ */ new Set();
2547
+ let r = 0;
2564
2548
  for (const s of e) {
2565
- if (!s || !$s(s.condition))
2549
+ if (!s || !ei(s.condition))
2566
2550
  continue;
2567
2551
  const i = `${s.condition.kind}:${s.condition.value}`;
2568
- if (r.has(i))
2552
+ if (o.has(i))
2569
2553
  continue;
2570
- const l = ei(s.variables), a = o + Object.keys(l).length;
2571
- if (!(Object.keys(l).length === 0 || a > qs) && (r.add(i), o = a, t.push({ condition: s.condition, variables: l }), t.length === Js))
2554
+ const l = ti(s.variables), c = r + Object.keys(l).length;
2555
+ if (!(Object.keys(l).length === 0 || c > Zs) && (o.add(i), r = c, t.push({ condition: s.condition, variables: l }), t.length === qs))
2572
2556
  break;
2573
2557
  }
2574
2558
  return t;
2575
- }, ti = (e, t) => {
2576
- const r = Object.entries(e).map(([o, s]) => ` ${o}: ${s};`);
2559
+ }, ni = (e, t) => {
2560
+ const o = Object.entries(e).map(([r, s]) => ` ${r}: ${s};`);
2577
2561
  return `${t} {
2578
- ${r.join(`
2562
+ ${o.join(`
2579
2563
  `)}
2580
2564
  }`;
2581
- }, ni = (e) => e.split(`
2565
+ }, oi = (e) => e.split(`
2582
2566
  `).map((t) => ` ${t}`).join(`
2583
2567
  `), ri = (e, t) => {
2584
- const r = ti(e.variables, t), { kind: o, value: s } = e.condition;
2585
- return o === "prefers-color-scheme" ? `@media (prefers-color-scheme: ${s}) {
2586
- ${ni(r)}
2587
- }` : o === "html-class" ? `html.${s} ${r}` : `[data-theme="${s}"] ${r}`;
2588
- }, oi = (e, t, r) => {
2589
- if (!jt(r) || !e)
2568
+ const o = ni(e.variables, t), { kind: r, value: s } = e.condition;
2569
+ return r === "prefers-color-scheme" ? `@media (prefers-color-scheme: ${s}) {
2570
+ ${oi(o)}
2571
+ }` : r === "html-class" ? `html.${s} ${o}` : `[data-theme="${s}"] ${o}`;
2572
+ }, si = (e, t, o) => {
2573
+ if (!Nt(o) || !e)
2590
2574
  return null;
2591
- const o = Nt(t);
2592
- if (o.length === 0)
2575
+ const r = Mt(t);
2576
+ if (r.length === 0)
2593
2577
  return null;
2594
- const s = `[data-rulecms-published-key="${Ot(e)}"] > *`;
2595
- return o.map((i) => ri(i, s)).join(`
2578
+ const s = `[data-rulecms-published-key="${jt(e)}"] > *`;
2579
+ return r.map((i) => ri(i, s)).join(`
2596
2580
 
2597
2581
  `);
2598
2582
  };
2599
- function si(e, t) {
2583
+ function ii(e, t) {
2600
2584
  n.push(t, !0);
2601
- const r = n.derived(() => oi(t.publishedKey, t.themes));
2602
- var o = n.comment(), s = n.first_child(o);
2585
+ const o = n.derived(() => si(t.publishedKey, t.themes));
2586
+ var r = n.comment(), s = n.first_child(r);
2603
2587
  {
2604
2588
  var i = (l) => {
2605
- var a = n.comment(), d = n.first_child(a);
2606
- n.element(d, () => "style", !1, (u, c) => {
2607
- n.attribute_effect(u, () => ({ "data-rulecms-project-themes": "" }));
2608
- var f = n.text();
2609
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2610
- }), n.append(l, a);
2589
+ var c = n.comment(), a = n.first_child(c);
2590
+ n.html(a, () => K(n.get(o), "data-rulecms-project-themes")), n.append(l, c);
2611
2591
  };
2612
2592
  n.if(s, (l) => {
2613
- n.get(r) && l(i);
2593
+ n.get(o) && l(i);
2614
2594
  });
2615
2595
  }
2616
- n.append(e, o), n.pop();
2596
+ n.append(e, r), n.pop();
2617
2597
  }
2618
- function ii(e, t) {
2598
+ function li(e, t) {
2619
2599
  n.push(t, !0);
2620
- const r = n.derived(() => Xs(t.publishedKey, t.variables));
2621
- var o = n.comment(), s = n.first_child(o);
2600
+ const o = n.derived(() => Js(t.publishedKey, t.variables));
2601
+ var r = n.comment(), s = n.first_child(r);
2622
2602
  {
2623
2603
  var i = (l) => {
2624
- var a = n.comment(), d = n.first_child(a);
2625
- n.element(d, () => "style", !1, (u, c) => {
2626
- n.attribute_effect(u, () => ({ "data-rulecms-project-css-variables": "" }));
2627
- var f = n.text();
2628
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2629
- }), n.append(l, a);
2604
+ var c = n.comment(), a = n.first_child(c);
2605
+ n.html(a, () => K(n.get(o), "data-rulecms-project-css-variables")), n.append(l, c);
2630
2606
  };
2631
2607
  n.if(s, (l) => {
2632
- n.get(r) && l(i);
2608
+ n.get(o) && l(i);
2633
2609
  });
2634
2610
  }
2635
- n.append(e, o), n.pop();
2611
+ n.append(e, r), n.pop();
2636
2612
  }
2637
- function Mt(e) {
2613
+ function Wt(e) {
2638
2614
  return e !== !1;
2639
2615
  }
2640
- const li = [
2616
+ const ci = [
2641
2617
  "light",
2642
2618
  "dark",
2643
2619
  "light dark"
2644
- ], ai = ["auto", "thin", "none"], ci = new Set(li), ui = new Set(ai), di = /[{};]|url\(|@/i, fi = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !di.test(e), ae = (e) => fi(e) ? e.trim() : void 0, Wt = (e) => {
2620
+ ], ai = ["auto", "thin", "none"], ui = new Set(ci), di = new Set(ai), fi = /[{};]|url\(|@/i, gi = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !fi.test(e), ae = (e) => gi(e) ? e.trim() : void 0, Vt = (e) => {
2645
2621
  if (!e || typeof e != "object" || Array.isArray(e))
2646
2622
  return null;
2647
- const t = ae(e.selectionBackground), r = ae(e.selectionColor), o = ae(e.caretColor), s = ae(e.scrollbarColor), i = {
2648
- ...typeof e.colorScheme == "string" && ci.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2623
+ const t = ae(e.selectionBackground), o = ae(e.selectionColor), r = ae(e.caretColor), s = ae(e.scrollbarColor), i = {
2624
+ ...typeof e.colorScheme == "string" && ui.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2649
2625
  ...t ? { selectionBackground: t } : {},
2650
- ...r ? { selectionColor: r } : {},
2651
- ...o ? { caretColor: o } : {},
2626
+ ...o ? { selectionColor: o } : {},
2627
+ ...r ? { caretColor: r } : {},
2652
2628
  ...s ? { scrollbarColor: s } : {},
2653
- ...typeof e.scrollbarWidth == "string" && ui.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2629
+ ...typeof e.scrollbarWidth == "string" && di.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2654
2630
  };
2655
2631
  return Object.keys(i).length > 0 ? i : null;
2656
- }, gi = (e, t, r) => {
2657
- if (!Mt(r) || !e)
2632
+ }, pi = (e, t, o) => {
2633
+ if (!Wt(o) || !e)
2658
2634
  return null;
2659
- const o = Wt(t);
2660
- if (!o)
2635
+ const r = Vt(t);
2636
+ if (!r)
2661
2637
  return null;
2662
- const s = `[data-rulecms-published-key="${Et(e)}"]`, i = [];
2663
- o.colorScheme && i.push(` color-scheme: ${o.colorScheme};`), o.caretColor && i.push(` caret-color: ${o.caretColor};`), o.scrollbarWidth && i.push(` scrollbar-width: ${o.scrollbarWidth};`), o.scrollbarColor && i.push(` scrollbar-color: ${o.scrollbarColor};`);
2638
+ const s = `[data-rulecms-published-key="${St(e)}"]`, i = [];
2639
+ r.colorScheme && i.push(` color-scheme: ${r.colorScheme};`), r.caretColor && i.push(` caret-color: ${r.caretColor};`), r.scrollbarWidth && i.push(` scrollbar-width: ${r.scrollbarWidth};`), r.scrollbarColor && i.push(` scrollbar-color: ${r.scrollbarColor};`);
2664
2640
  const l = [];
2665
- o.selectionBackground && l.push(` background: ${o.selectionBackground};`), o.selectionColor && l.push(` color: ${o.selectionColor};`);
2666
- const a = [];
2667
- return i.length > 0 && a.push(`${s} > * {
2641
+ r.selectionBackground && l.push(` background: ${r.selectionBackground};`), r.selectionColor && l.push(` color: ${r.selectionColor};`);
2642
+ const c = [];
2643
+ return i.length > 0 && c.push(`${s} > * {
2668
2644
  ${i.join(`
2669
2645
  `)}
2670
- }`), l.length > 0 && a.push(`${s} > * ::selection {
2646
+ }`), l.length > 0 && c.push(`${s} > * ::selection {
2671
2647
  ${l.join(`
2672
2648
  `)}
2673
- }`), a.length > 0 ? a.join(`
2649
+ }`), c.length > 0 ? c.join(`
2674
2650
  `) : null;
2675
2651
  };
2676
- function pi(e, t) {
2652
+ function mi(e, t) {
2677
2653
  n.push(t, !0);
2678
- const r = n.derived(() => gi(t.publishedKey, t.widgetChrome));
2679
- var o = n.comment(), s = n.first_child(o);
2654
+ const o = n.derived(() => pi(t.publishedKey, t.widgetChrome));
2655
+ var r = n.comment(), s = n.first_child(r);
2680
2656
  {
2681
2657
  var i = (l) => {
2682
- var a = n.comment(), d = n.first_child(a);
2683
- n.element(d, () => "style", !1, (u, c) => {
2684
- n.attribute_effect(u, () => ({ "data-rulecms-project-widget-chrome": "" }));
2685
- var f = n.text();
2686
- n.template_effect(() => n.set_text(f, n.get(r))), n.append(c, f);
2687
- }), n.append(l, a);
2658
+ var c = n.comment(), a = n.first_child(c);
2659
+ n.html(a, () => K(n.get(o), "data-rulecms-project-widget-chrome")), n.append(l, c);
2688
2660
  };
2689
2661
  n.if(s, (l) => {
2690
- n.get(r) && l(i);
2662
+ n.get(o) && l(i);
2691
2663
  });
2692
2664
  }
2693
- n.append(e, o), n.pop();
2665
+ n.append(e, r), n.pop();
2694
2666
  }
2695
- function mi(e) {
2667
+ function yi(e) {
2696
2668
  return e !== !1;
2697
2669
  }
2698
- function yi(e) {
2670
+ function hi(e) {
2699
2671
  const t = {};
2700
- return Object.entries(e).forEach(([r, o]) => {
2701
- const s = { ...o };
2672
+ return Object.entries(e).forEach(([o, r]) => {
2673
+ const s = { ...r };
2702
2674
  if (s.itemList)
2703
2675
  try {
2704
2676
  s.collectionRows = typeof s.itemList == "string" ? JSON.parse(s.itemList) : s.itemList;
2705
2677
  } catch (l) {
2706
- console.error(`Failed to parse itemList for collection ${r}:`, l), s.collectionRows = { rows: [] };
2678
+ console.error(`Failed to parse itemList for collection ${o}:`, l), s.collectionRows = { rows: [] };
2707
2679
  }
2708
- let i = `${s.name}$${r}`;
2680
+ let i = `${s.name}$${o}`;
2709
2681
  s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
2710
2682
  }), t;
2711
2683
  }
2712
- function hi(e) {
2684
+ function bi(e) {
2713
2685
  return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
2714
2686
  }
2715
- function Me(e) {
2716
- const t = ge(e.fontFaces), r = It(e.keyframes), o = Nt(e.themes), s = Lt(e.cssProperties), i = Wt(e.widgetChrome), l = xt(e.positionTry), a = mi(e.includeClassLayer) && At(e.classLayer) ? e.classLayer : void 0;
2687
+ function We(e) {
2688
+ const t = pe(e.fontFaces), o = Pt(e.keyframes), r = Mt(e.themes), s = Rt(e.cssProperties), i = Vt(e.widgetChrome), l = xt(e.positionTry), c = yi(e.includeClassLayer) && Et(e.classLayer) ? e.classLayer : void 0;
2717
2689
  return {
2718
- displayItemList: hi(e.widget),
2719
- widgetCollections: yi(e.childCollections),
2690
+ displayItemList: bi(e.widget),
2691
+ widgetCollections: hi(e.childCollections),
2720
2692
  ...e.libraries ? { libraries: e.libraries } : {},
2721
- ...Rt(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2722
- ...wt(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2723
- ...Ne(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2724
- ...St(e.includeKeyframes) && Object.keys(r).length > 0 ? { keyframes: r } : {},
2725
- ...jt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
2726
- ...kt(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2727
- ...Mt(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2728
- ...a ? { classLayer: a } : {},
2729
- ...Pt(e.includePositionTry) && Object.keys(l).length > 0 ? { positionTry: l } : {}
2693
+ ...Ot(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2694
+ ...At(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2695
+ ...Me(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2696
+ ...Tt(e.includeKeyframes) && Object.keys(o).length > 0 ? { keyframes: o } : {},
2697
+ ...Nt(e.includeThemes) && r.length > 0 ? { themes: r } : {},
2698
+ ...Lt(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2699
+ ...Wt(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2700
+ ...c ? { classLayer: c } : {},
2701
+ ...Dt(e.includePositionTry) && Object.keys(l).length > 0 ? { positionTry: l } : {}
2730
2702
  };
2731
2703
  }
2732
- function bi(e) {
2733
- const t = e.registry ?? de(), r = Pe({
2704
+ function vi(e) {
2705
+ const t = e.registry ?? fe(), o = De({
2734
2706
  displayItemList: e.displayItemList,
2735
2707
  widgetCollections: e.widgetCollections
2736
2708
  });
2737
- return t.resolveSync({ registrations: e.libraries, referenced: r });
2709
+ return t.resolveSync({ registrations: e.libraries, referenced: o });
2738
2710
  }
2739
- function vi(e) {
2740
- const t = e.registry ?? de(), r = Pe({
2711
+ function Ci(e) {
2712
+ const t = e.registry ?? fe(), o = De({
2741
2713
  displayItemList: e.displayItemList,
2742
2714
  widgetCollections: e.widgetCollections
2743
2715
  });
2744
- return t.resolve({ registrations: e.libraries, referenced: r });
2716
+ return t.resolve({ registrations: e.libraries, referenced: o });
2745
2717
  }
2746
- function Ci(e) {
2747
- const t = e.lastIndexOf(we);
2748
- return t === -1 ? e : e.slice(t + we.length);
2718
+ function _i(e) {
2719
+ const t = e.lastIndexOf(Ae);
2720
+ return t === -1 ? e : e.slice(t + Ae.length);
2749
2721
  }
2750
- const _i = "text/plain";
2751
- function wi({
2722
+ const wi = "text/plain";
2723
+ function Ai({
2752
2724
  token: e,
2753
2725
  rulesetPublishedKey: t,
2754
- params: r
2726
+ params: o
2755
2727
  }) {
2756
- return H(e) ? {
2728
+ return G(e) ? {
2757
2729
  token: e,
2758
- rulesetKey: Ci(t),
2759
- ...r ? { params: r } : {}
2730
+ rulesetKey: _i(t),
2731
+ ...o ? { params: o } : {}
2760
2732
  } : {
2761
2733
  token: e,
2762
2734
  rulesetPublishedKey: t,
2763
- ...r ? { params: r } : {},
2735
+ ...o ? { params: o } : {},
2764
2736
  mode: "payload"
2765
2737
  };
2766
2738
  }
2767
- function Vt({
2768
- contentType: e = _i,
2739
+ function Ft({
2740
+ contentType: e = wi,
2769
2741
  ...t
2770
2742
  }) {
2771
2743
  return {
2772
2744
  method: "POST",
2773
2745
  headers: { "Content-Type": e },
2774
- body: JSON.stringify(wi(t))
2746
+ body: JSON.stringify(Ai(t))
2775
2747
  };
2776
2748
  }
2777
- const Ze = "rulecms_anon_id";
2778
- function Qe() {
2749
+ const Qe = "rulecms_anon_id";
2750
+ function $e() {
2779
2751
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
2780
2752
  const t = Math.random() * 16 | 0;
2781
2753
  return (e === "x" ? t : t & 3 | 8).toString(16);
2782
2754
  });
2783
2755
  }
2784
- function Ai() {
2756
+ function Ei() {
2785
2757
  if (!(typeof window > "u"))
2786
2758
  try {
2787
- const e = window.localStorage.getItem(Ze);
2759
+ const e = window.localStorage.getItem(Qe);
2788
2760
  if (e)
2789
2761
  return e;
2790
- const t = Qe();
2791
- return window.localStorage.setItem(Ze, t), t;
2762
+ const t = $e();
2763
+ return window.localStorage.setItem(Qe, t), t;
2792
2764
  } catch {
2793
- return Qe();
2765
+ return $e();
2794
2766
  }
2795
2767
  }
2796
- function Ft(e) {
2768
+ function Kt(e) {
2797
2769
  return e >= 500;
2798
2770
  }
2799
- function Ei(e) {
2771
+ function Si(e) {
2800
2772
  if (!(e != null && e.success) || !e.data)
2801
2773
  return null;
2802
- const { selection: t, ...r } = e.data;
2803
- return { raw: r, selection: t };
2774
+ const { selection: t, ...o } = e.data;
2775
+ return { raw: o, selection: t };
2804
2776
  }
2805
- function Si(e, t) {
2777
+ function Ti(e, t) {
2806
2778
  if (!(e != null && e.resolution) || !e.widget)
2807
2779
  return null;
2808
- const { resolution: r, ...o } = e, s = {
2780
+ const { resolution: o, ...r } = e, s = {
2809
2781
  rulesetPublishedKey: t,
2810
- outcome: r.outcome,
2811
- ruleId: r.ruleId ?? null,
2812
- variantId: r.variantId ?? null,
2813
- widgetKey: r.widgetKey,
2814
- widgetPublishedKey: r.widgetPublishedKey
2782
+ outcome: o.outcome,
2783
+ ruleId: o.ruleId ?? null,
2784
+ variantId: o.variantId ?? null,
2785
+ widgetKey: o.widgetKey,
2786
+ widgetPublishedKey: o.widgetPublishedKey
2815
2787
  };
2816
- return { raw: o, selection: s };
2788
+ return { raw: r, selection: s };
2817
2789
  }
2818
- function Kt({
2790
+ function Bt({
2819
2791
  token: e,
2820
2792
  rulesetPublishedKey: t,
2821
- body: r
2793
+ body: o
2822
2794
  }) {
2823
- return H(e) ? Si(r, t) : Ei(r);
2795
+ return G(e) ? Ti(o, t) : Si(o);
2824
2796
  }
2825
- function Ti(e) {
2826
- return JSON.stringify(e, (t, r) => {
2827
- if (r === null || typeof r != "object" || Array.isArray(r))
2828
- return r;
2829
- const o = {};
2830
- for (const s of Object.keys(r).sort())
2831
- o[s] = r[s];
2832
- return o;
2797
+ function Ii(e) {
2798
+ return JSON.stringify(e, (t, o) => {
2799
+ if (o === null || typeof o != "object" || Array.isArray(o))
2800
+ return o;
2801
+ const r = {};
2802
+ for (const s of Object.keys(o).sort())
2803
+ r[s] = o[s];
2804
+ return r;
2833
2805
  });
2834
2806
  }
2835
- const Ii = {
2807
+ const Pi = {
2836
2808
  display: "flex",
2837
2809
  justifyContent: "center",
2838
2810
  alignItems: "center",
2839
2811
  padding: "3rem",
2840
2812
  color: "#e2e8f0"
2841
- }, Pi = {
2813
+ }, Di = {
2842
2814
  display: "flex",
2843
2815
  alignItems: "center",
2844
2816
  gap: "1rem"
2845
- }, Di = {
2817
+ }, ki = {
2846
2818
  width: "40px",
2847
2819
  height: "40px",
2848
2820
  border: "4px solid #4a5568",
2849
2821
  borderTopColor: "#63b3ed",
2850
2822
  borderRadius: "50%",
2851
2823
  animation: "spin 1s linear infinite"
2852
- }, $e = {
2824
+ }, et = {
2853
2825
  padding: "1.5rem",
2854
2826
  backgroundColor: "#742a2a",
2855
2827
  border: "1px solid #9b2c2c",
2856
2828
  borderRadius: "8px",
2857
2829
  color: "#fed7d7"
2858
- }, et = {
2830
+ }, tt = {
2859
2831
  fontSize: "16px",
2860
2832
  fontWeight: "600",
2861
2833
  marginBottom: "0.5rem",
2862
2834
  color: "#feb2b2"
2863
- }, tt = {
2835
+ }, nt = {
2864
2836
  fontSize: "14px",
2865
2837
  color: "#fed7d7"
2866
2838
  }, xi = `
@@ -2872,343 +2844,343 @@ const Ii = {
2872
2844
  transform: rotate(360deg);
2873
2845
  }
2874
2846
  }
2875
- `, el = "data-rulecms-published-key";
2876
- var ki = n.from_html("<div><div><div></div></div></div>"), Li = n.from_html("<div><div>Error Loading Widget</div> <div> </div></div>"), Ri = n.from_html("<div><div>No Widget Data</div> <div>No widget data available</div></div>"), Oi = n.from_html('<span style="display: contents"><!> <!> <!> <!> <!> <!> <!> <!> <!></span>');
2877
- function tl(e, t) {
2847
+ `, tl = "data-rulecms-published-key";
2848
+ var Li = n.from_html("<div><div><div></div></div></div>"), Ri = n.from_html("<div><div>Error Loading Widget</div> <div> </div></div>"), Oi = n.from_html("<div><div>No Widget Data</div> <div>No widget data available</div></div>"), ji = n.from_html('<span style="display: contents"><!> <!> <!> <!> <!> <!> <!> <!> <!></span>');
2849
+ function nl(e, t) {
2878
2850
  n.push(t, !0);
2879
- let r = n.prop(t, "mode", 3, "client-fetch");
2880
- const o = Yt(dt);
2881
- let s = n.state(!0), i = n.state(null), l = n.state(null), a = n.state(null), d = n.state("");
2882
- const u = n.derived(() => r() === "pre-fetched"), c = n.derived(() => ({ sourceComponents: n.get(a) ?? void 0 })), f = n.derived(() => t.publishedKey || n.get(d));
2883
- let p = null, g = null, A = !1, w = 0;
2884
- class b extends Error {
2885
- constructor(m) {
2886
- super(m), this.name = "FetchWidgetMessage";
2851
+ let o = n.prop(t, "mode", 3, "client-fetch");
2852
+ const r = Xt(ft);
2853
+ let s = n.state(!0), i = n.state(null), l = n.state(null), c = n.state(null), a = n.state("");
2854
+ const d = n.derived(() => o() === "pre-fetched"), u = n.derived(() => ({ sourceComponents: n.get(c) ?? void 0 })), g = n.derived(() => t.publishedKey || n.get(a));
2855
+ let m = null, f = null, w = !1, E = 0;
2856
+ class h extends Error {
2857
+ constructor(p) {
2858
+ super(p), this.name = "FetchWidgetMessage";
2887
2859
  }
2888
2860
  }
2889
- function v() {
2861
+ function A() {
2890
2862
  if (!n.get(l)) {
2891
- n.set(a, null);
2863
+ n.set(c, null);
2892
2864
  return;
2893
2865
  }
2894
- const y = t.libraries ?? (o == null ? void 0 : o.libraries), m = o == null ? void 0 : o.libraryRegistry, S = bi({
2866
+ const y = t.libraries ?? (r == null ? void 0 : r.libraries), p = r == null ? void 0 : r.libraryRegistry, S = vi({
2895
2867
  displayItemList: n.get(l).displayItemList,
2896
2868
  widgetCollections: n.get(l).widgetCollections,
2897
2869
  libraries: y,
2898
- registry: m
2870
+ registry: p
2899
2871
  });
2900
2872
  if (S) {
2901
- n.set(a, S, !0);
2873
+ n.set(c, S, !0);
2902
2874
  return;
2903
2875
  }
2904
- vi({
2876
+ Ci({
2905
2877
  displayItemList: n.get(l).displayItemList,
2906
2878
  widgetCollections: n.get(l).widgetCollections,
2907
2879
  libraries: y,
2908
- registry: m
2909
- }).then((D) => {
2910
- n.set(a, D, !0);
2880
+ registry: p
2881
+ }).then((P) => {
2882
+ n.set(c, P, !0);
2911
2883
  });
2912
2884
  }
2913
2885
  function T() {
2914
- n.get(l) && Zr({
2886
+ n.get(l) && $o({
2915
2887
  componentProps: t.componentProps,
2916
2888
  displayItemList: n.get(l).displayItemList,
2917
2889
  widgetCollections: n.get(l).widgetCollections,
2918
- publishedKey: n.get(f)
2890
+ publishedKey: n.get(g)
2919
2891
  });
2920
2892
  }
2921
- function j() {
2922
- if (A || typeof document > "u")
2893
+ function x() {
2894
+ if (w || typeof document > "u")
2923
2895
  return;
2924
2896
  const y = "rulecms-widget-spinner-styles";
2925
2897
  if (!document.getElementById(y)) {
2926
- const m = document.createElement("style");
2927
- m.id = y, m.textContent = xi, document.head.appendChild(m);
2898
+ const p = document.createElement("style");
2899
+ p.id = y, p.textContent = xi, document.head.appendChild(p);
2928
2900
  }
2929
- A = !0;
2901
+ w = !0;
2930
2902
  }
2931
- function U() {
2932
- const y = t.token ?? (o == null ? void 0 : o.token), m = t.endpoint ?? (o == null ? void 0 : o.endpoint), S = H(y), D = t.rulesetPublishedKey;
2933
- if (!t.publishedKey && !D || !y) {
2934
- !t.publishedKey && !D ? n.set(
2903
+ function z() {
2904
+ const y = t.token ?? (r == null ? void 0 : r.token), p = t.endpoint ?? (r == null ? void 0 : r.endpoint), S = G(y), P = t.rulesetPublishedKey;
2905
+ if (!t.publishedKey && !P || !y) {
2906
+ !t.publishedKey && !P ? n.set(
2935
2907
  i,
2936
- D !== void 0 ? S ? "Ruleset key is required" : "Ruleset published key is required" : S ? "Widget key is required" : "Published key is required",
2908
+ P !== void 0 ? S ? "Ruleset key is required" : "Ruleset published key is required" : S ? "Widget key is required" : "Published key is required",
2937
2909
  !0
2938
2910
  ) : n.set(i, "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider."), n.set(l, null), n.set(s, !1);
2939
2911
  return;
2940
2912
  }
2941
- const M = Ti(t.params), R = JSON.stringify({
2913
+ const M = Ii(t.params), O = JSON.stringify({
2942
2914
  publishedKey: t.publishedKey,
2943
- rulesetPublishedKey: D,
2915
+ rulesetPublishedKey: P,
2944
2916
  token: y,
2945
- endpoint: m,
2917
+ endpoint: p,
2946
2918
  paramsKey: M,
2947
2919
  anonymousId: t.anonymousId,
2948
2920
  fallbackPublishedKey: t.fallbackPublishedKey,
2949
2921
  contentType: t.contentType
2950
2922
  });
2951
- if (g === R && n.get(l)) {
2952
- n.set(s, !1), v();
2923
+ if (f === O && n.get(l)) {
2924
+ n.set(s, !1), A();
2953
2925
  return;
2954
2926
  }
2955
- p == null || p.abort(), p = new AbortController();
2956
- const O = p.signal;
2957
- g = R, n.set(s, !0), n.set(i, null);
2958
- const Y = ++w, ie = async (x) => (await x.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${x.status}`, ne = async (x) => {
2959
- const F = lt({
2960
- publishedKey: x,
2927
+ m == null || m.abort(), m = new AbortController();
2928
+ const j = m.signal;
2929
+ f = O, n.set(s, !0), n.set(i, null);
2930
+ const X = ++E, le = async (D) => (await D.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${D.status}`, oe = async (D) => {
2931
+ const F = ct({
2932
+ publishedKey: D,
2961
2933
  token: y,
2962
- endpoint: m
2963
- }), K = await fetch(F, { method: "GET", ...S ? { cache: "no-store" } : {}, signal: O });
2964
- if (!K.ok)
2965
- throw new b(await ie(K));
2966
- const W = await K.json();
2934
+ endpoint: p
2935
+ }), B = await fetch(F, { method: "GET", ...S ? { cache: "no-store" } : {}, signal: j });
2936
+ if (!B.ok)
2937
+ throw new h(await le(B));
2938
+ const W = await B.json();
2967
2939
  if (!W.success)
2968
- throw new b("Failed to fetch widget data");
2940
+ throw new h("Failed to fetch widget data");
2969
2941
  return W.data;
2970
2942
  };
2971
- (D ? (async () => {
2972
- const x = M ? JSON.parse(M) : {};
2943
+ (P ? (async () => {
2944
+ const D = M ? JSON.parse(M) : {};
2973
2945
  if (t.anonymousId !== !1) {
2974
2946
  if (typeof t.anonymousId == "string")
2975
- x.anonId = x.anonId ?? t.anonymousId;
2976
- else if (x.anonId == null) {
2977
- const W = Ai();
2978
- W && (x.anonId = W);
2947
+ D.anonId = D.anonId ?? t.anonymousId;
2948
+ else if (D.anonId == null) {
2949
+ const W = Ei();
2950
+ W && (D.anonId = W);
2979
2951
  }
2980
2952
  }
2981
2953
  let F;
2982
2954
  try {
2983
- F = await fetch(at({ token: y, endpoint: m }), {
2984
- ...Vt({
2955
+ F = await fetch(at({ token: y, endpoint: p }), {
2956
+ ...Ft({
2985
2957
  token: y,
2986
- rulesetPublishedKey: D,
2987
- params: x,
2958
+ rulesetPublishedKey: P,
2959
+ params: D,
2988
2960
  contentType: t.contentType
2989
2961
  }),
2990
- signal: O
2962
+ signal: j
2991
2963
  });
2992
2964
  } catch (W) {
2993
2965
  if (W instanceof DOMException && W.name === "AbortError")
2994
2966
  throw W;
2995
2967
  if (t.fallbackPublishedKey)
2996
2968
  return {
2997
- raw: await ne(t.fallbackPublishedKey),
2969
+ raw: await oe(t.fallbackPublishedKey),
2998
2970
  selection: null
2999
2971
  };
3000
2972
  throw W;
3001
2973
  }
3002
2974
  if (!F.ok) {
3003
- if (t.fallbackPublishedKey && Ft(F.status))
2975
+ if (t.fallbackPublishedKey && Kt(F.status))
3004
2976
  return {
3005
- raw: await ne(t.fallbackPublishedKey),
2977
+ raw: await oe(t.fallbackPublishedKey),
3006
2978
  selection: null
3007
2979
  };
3008
- throw new b(await ie(F));
2980
+ throw new h(await le(F));
3009
2981
  }
3010
- const K = Kt({
2982
+ const B = Bt({
3011
2983
  token: y,
3012
- rulesetPublishedKey: D,
2984
+ rulesetPublishedKey: P,
3013
2985
  body: await F.json()
3014
2986
  });
3015
- if (!K)
3016
- throw new b("Failed to fetch widget data");
3017
- return { raw: K.raw, selection: K.selection };
3018
- })() : ne(t.publishedKey).then((x) => ({ raw: x, selection: null }))).then(({ raw: x, selection: F }) => {
3019
- var K, W;
3020
- n.set(l, Me(x), !0), n.set(d, ((K = x.widget) == null ? void 0 : K.publishedKey) ?? "", !0), n.set(i, null), v(), T(), F && ((W = t.onSelection) == null || W.call(t, F));
3021
- }).catch((x) => {
3022
- x instanceof DOMException && x.name === "AbortError" || (console.error("Error fetching widget:", x), n.set(i, x instanceof b ? x.message : "Failed to fetch widget", !0), n.set(l, null));
2987
+ if (!B)
2988
+ throw new h("Failed to fetch widget data");
2989
+ return { raw: B.raw, selection: B.selection };
2990
+ })() : oe(t.publishedKey).then((D) => ({ raw: D, selection: null }))).then(({ raw: D, selection: F }) => {
2991
+ var B, W;
2992
+ n.set(l, We(D), !0), n.set(a, ((B = D.widget) == null ? void 0 : B.publishedKey) ?? "", !0), n.set(i, null), A(), T(), F && ((W = t.onSelection) == null || W.call(t, F));
2993
+ }).catch((D) => {
2994
+ D instanceof DOMException && D.name === "AbortError" || (console.error("Error fetching widget:", D), n.set(i, D instanceof h ? D.message : "Failed to fetch widget", !0), n.set(l, null));
3023
2995
  }).finally(() => {
3024
- w === Y && n.set(s, !1);
2996
+ E === X && n.set(s, !1);
3025
2997
  });
3026
2998
  }
3027
- function h() {
3028
- n.set(l, t.initialData ?? null, !0), n.set(s, !1), n.set(i, null), v(), T();
2999
+ function v() {
3000
+ n.set(l, t.initialData ?? null, !0), n.set(s, !1), n.set(i, null), A(), T();
3029
3001
  }
3030
- function _() {
3031
- if (r() === "pre-fetched") {
3032
- h();
3002
+ function C() {
3003
+ if (o() === "pre-fetched") {
3004
+ v();
3033
3005
  return;
3034
3006
  }
3035
- j(), U();
3007
+ x(), z();
3036
3008
  }
3037
- function C() {
3038
- r() === "pre-fetched" && h();
3009
+ function b() {
3010
+ o() === "pre-fetched" && v();
3039
3011
  }
3040
- C(), n.user_effect(() => (t.publishedKey, t.rulesetPublishedKey, t.params, t.anonymousId, t.fallbackPublishedKey, t.contentType, t.token, t.endpoint, r(), t.initialData, t.libraries, t.componentProps, Xt(() => _()), () => {
3041
- p == null || p.abort();
3012
+ b(), n.user_effect(() => (t.publishedKey, t.rulesetPublishedKey, t.params, t.anonymousId, t.fallbackPublishedKey, t.contentType, t.token, t.endpoint, o(), t.initialData, t.libraries, t.componentProps, Jt(() => C()), () => {
3013
+ m == null || m.abort();
3042
3014
  }));
3043
- var E = Oi(), I = n.child(E);
3015
+ var _ = ji(), I = n.child(_);
3044
3016
  {
3045
3017
  let y = n.derived(() => {
3046
- var m;
3047
- return (m = n.get(l)) == null ? void 0 : m.fontFaces;
3018
+ var p;
3019
+ return (p = n.get(l)) == null ? void 0 : p.fontFaces;
3048
3020
  });
3049
- ds(I, {
3021
+ fs(I, {
3050
3022
  get publishedKey() {
3051
- return n.get(f);
3023
+ return n.get(g);
3052
3024
  },
3053
3025
  get fonts() {
3054
3026
  return n.get(y);
3055
3027
  }
3056
3028
  });
3057
3029
  }
3058
- var P = n.sibling(I, 2);
3030
+ var L = n.sibling(I, 2);
3059
3031
  {
3060
3032
  let y = n.derived(() => {
3061
- var m;
3062
- return (m = n.get(l)) == null ? void 0 : m.keyframes;
3033
+ var p;
3034
+ return (p = n.get(l)) == null ? void 0 : p.keyframes;
3063
3035
  });
3064
- Es(P, {
3036
+ Ss(L, {
3065
3037
  get publishedKey() {
3066
- return n.get(f);
3038
+ return n.get(g);
3067
3039
  },
3068
3040
  get keyframes() {
3069
3041
  return n.get(y);
3070
3042
  }
3071
3043
  });
3072
3044
  }
3073
- var L = n.sibling(P, 2);
3045
+ var R = n.sibling(L, 2);
3074
3046
  {
3075
3047
  let y = n.derived(() => {
3076
- var m;
3077
- return (m = n.get(l)) == null ? void 0 : m.themes;
3048
+ var p;
3049
+ return (p = n.get(l)) == null ? void 0 : p.themes;
3078
3050
  });
3079
- si(L, {
3051
+ ii(R, {
3080
3052
  get publishedKey() {
3081
- return n.get(f);
3053
+ return n.get(g);
3082
3054
  },
3083
3055
  get themes() {
3084
3056
  return n.get(y);
3085
3057
  }
3086
3058
  });
3087
3059
  }
3088
- var J = n.sibling(L, 2);
3060
+ var q = n.sibling(R, 2);
3089
3061
  {
3090
3062
  let y = n.derived(() => {
3091
- var m;
3092
- return (m = n.get(l)) == null ? void 0 : m.cssProperties;
3063
+ var p;
3064
+ return (p = n.get(l)) == null ? void 0 : p.cssProperties;
3093
3065
  });
3094
- Hs(J, {
3066
+ Gs(q, {
3095
3067
  get publishedKey() {
3096
- return n.get(f);
3068
+ return n.get(g);
3097
3069
  },
3098
3070
  get cssProperties() {
3099
3071
  return n.get(y);
3100
3072
  }
3101
3073
  });
3102
3074
  }
3103
- var ee = n.sibling(J, 2);
3075
+ var te = n.sibling(q, 2);
3104
3076
  {
3105
3077
  let y = n.derived(() => {
3106
- var m;
3107
- return (m = n.get(l)) == null ? void 0 : m.widgetChrome;
3078
+ var p;
3079
+ return (p = n.get(l)) == null ? void 0 : p.widgetChrome;
3108
3080
  });
3109
- pi(ee, {
3081
+ mi(te, {
3110
3082
  get publishedKey() {
3111
- return n.get(f);
3083
+ return n.get(g);
3112
3084
  },
3113
3085
  get widgetChrome() {
3114
3086
  return n.get(y);
3115
3087
  }
3116
3088
  });
3117
3089
  }
3118
- var te = n.sibling(ee, 2);
3090
+ var ne = n.sibling(te, 2);
3119
3091
  {
3120
3092
  let y = n.derived(() => {
3121
- var m;
3122
- return (m = n.get(l)) == null ? void 0 : m.positionTry;
3093
+ var p;
3094
+ return (p = n.get(l)) == null ? void 0 : p.positionTry;
3123
3095
  });
3124
- js(te, {
3096
+ Ns(ne, {
3125
3097
  get publishedKey() {
3126
- return n.get(f);
3098
+ return n.get(g);
3127
3099
  },
3128
3100
  get positionTry() {
3129
3101
  return n.get(y);
3130
3102
  }
3131
3103
  });
3132
3104
  }
3133
- var oe = n.sibling(te, 2);
3105
+ var se = n.sibling(ne, 2);
3134
3106
  {
3135
3107
  let y = n.derived(() => {
3136
- var m;
3137
- return (m = n.get(l)) == null ? void 0 : m.cssVariables;
3108
+ var p;
3109
+ return (p = n.get(l)) == null ? void 0 : p.cssVariables;
3138
3110
  });
3139
- ii(oe, {
3111
+ li(se, {
3140
3112
  get publishedKey() {
3141
- return n.get(f);
3113
+ return n.get(g);
3142
3114
  },
3143
3115
  get variables() {
3144
3116
  return n.get(y);
3145
3117
  }
3146
3118
  });
3147
3119
  }
3148
- var q = n.sibling(oe, 2);
3120
+ var Z = n.sibling(se, 2);
3149
3121
  {
3150
3122
  let y = n.derived(() => {
3151
3123
  var S;
3152
3124
  return (S = n.get(l)) == null ? void 0 : S.classDefinitions;
3153
- }), m = n.derived(() => {
3125
+ }), p = n.derived(() => {
3154
3126
  var S;
3155
3127
  return (S = n.get(l)) == null ? void 0 : S.classLayer;
3156
3128
  });
3157
- Uo(q, {
3129
+ zr(Z, {
3158
3130
  get publishedKey() {
3159
- return n.get(f);
3131
+ return n.get(g);
3160
3132
  },
3161
3133
  get classes() {
3162
3134
  return n.get(y);
3163
3135
  },
3164
3136
  get classLayer() {
3165
- return n.get(m);
3137
+ return n.get(p);
3166
3138
  }
3167
3139
  });
3168
3140
  }
3169
- var V = n.sibling(q, 2);
3141
+ var V = n.sibling(Z, 2);
3170
3142
  {
3171
- var se = (y) => {
3172
- var m = ki(), S = n.child(m), D = n.child(S);
3173
- n.reset(S), n.reset(m), n.template_effect(
3174
- (M, R, O) => {
3175
- n.set_style(m, M), n.set_style(S, R), n.set_style(D, O);
3143
+ var ie = (y) => {
3144
+ var p = Li(), S = n.child(p), P = n.child(S);
3145
+ n.reset(S), n.reset(p), n.template_effect(
3146
+ (M, O, j) => {
3147
+ n.set_style(p, M), n.set_style(S, O), n.set_style(P, j);
3176
3148
  },
3177
3149
  [
3178
- () => N(Ii),
3179
3150
  () => N(Pi),
3180
- () => N(Di)
3151
+ () => N(Di),
3152
+ () => N(ki)
3181
3153
  ]
3182
- ), n.append(y, m);
3183
- }, pe = (y) => {
3184
- var m = Li(), S = n.child(m), D = n.sibling(S, 2), M = n.child(D, !0);
3185
- n.reset(D), n.reset(m), n.template_effect(
3186
- (R, O, Y) => {
3187
- n.set_style(m, R), n.set_style(S, O), n.set_style(D, Y), n.set_text(M, n.get(i));
3154
+ ), n.append(y, p);
3155
+ }, me = (y) => {
3156
+ var p = Ri(), S = n.child(p), P = n.sibling(S, 2), M = n.child(P, !0);
3157
+ n.reset(P), n.reset(p), n.template_effect(
3158
+ (O, j, X) => {
3159
+ n.set_style(p, O), n.set_style(S, j), n.set_style(P, X), n.set_text(M, n.get(i));
3188
3160
  },
3189
3161
  [
3190
- () => N($e),
3191
3162
  () => N(et),
3192
- () => N(tt)
3163
+ () => N(tt),
3164
+ () => N(nt)
3193
3165
  ]
3194
- ), n.append(y, m);
3195
- }, me = (y) => {
3196
- var m = Ri(), S = n.child(m), D = n.sibling(S, 2);
3197
- n.reset(m), n.template_effect(
3198
- (M, R, O) => {
3199
- n.set_style(m, M), n.set_style(S, R), n.set_style(D, O);
3166
+ ), n.append(y, p);
3167
+ }, ye = (y) => {
3168
+ var p = Oi(), S = n.child(p), P = n.sibling(S, 2);
3169
+ n.reset(p), n.template_effect(
3170
+ (M, O, j) => {
3171
+ n.set_style(p, M), n.set_style(S, O), n.set_style(P, j);
3200
3172
  },
3201
3173
  [
3202
- () => N($e),
3203
3174
  () => N(et),
3204
- () => N(tt)
3175
+ () => N(tt),
3176
+ () => N(nt)
3205
3177
  ]
3206
- ), n.append(y, m);
3207
- }, ye = (y) => {
3208
- var m = n.comment(), S = n.first_child(m);
3178
+ ), n.append(y, p);
3179
+ }, he = (y) => {
3180
+ var p = n.comment(), S = n.first_child(p);
3209
3181
  {
3210
- var D = (R) => {
3211
- _o(R, {
3182
+ var P = (O) => {
3183
+ wr(O, {
3212
3184
  get displayItemList() {
3213
3185
  return n.get(l).displayItemList;
3214
3186
  },
@@ -3216,7 +3188,7 @@ function tl(e, t) {
3216
3188
  return n.get(l).widgetCollections;
3217
3189
  },
3218
3190
  get plugins() {
3219
- return n.get(c);
3191
+ return n.get(u);
3220
3192
  },
3221
3193
  get componentProps() {
3222
3194
  return t.componentProps;
@@ -3228,8 +3200,8 @@ function tl(e, t) {
3228
3200
  return t.placeholderValues;
3229
3201
  }
3230
3202
  });
3231
- }, M = (R) => {
3232
- To(R, {
3203
+ }, M = (O) => {
3204
+ Ir(O, {
3233
3205
  get displayItemList() {
3234
3206
  return n.get(l).displayItemList;
3235
3207
  },
@@ -3241,7 +3213,7 @@ function tl(e, t) {
3241
3213
  showDropContainers: !1,
3242
3214
  reduxDeviceDisplayType: "desktop",
3243
3215
  get plugins() {
3244
- return n.get(c);
3216
+ return n.get(u);
3245
3217
  },
3246
3218
  get componentProps() {
3247
3219
  return t.componentProps;
@@ -3254,292 +3226,292 @@ function tl(e, t) {
3254
3226
  }
3255
3227
  });
3256
3228
  };
3257
- n.if(S, (R) => {
3258
- n.get(u) ? R(D) : R(M, -1);
3229
+ n.if(S, (O) => {
3230
+ n.get(d) ? O(P) : O(M, -1);
3259
3231
  });
3260
3232
  }
3261
- n.append(y, m);
3233
+ n.append(y, p);
3262
3234
  };
3263
3235
  n.if(V, (y) => {
3264
- r() !== "pre-fetched" && n.get(s) ? y(se) : r() !== "pre-fetched" && n.get(i) ? y(pe, 1) : r() !== "pre-fetched" && !n.get(l) ? y(me, 2) : n.get(a) && n.get(l) && y(ye, 3);
3236
+ o() !== "pre-fetched" && n.get(s) ? y(ie) : o() !== "pre-fetched" && n.get(i) ? y(me, 1) : o() !== "pre-fetched" && !n.get(l) ? y(ye, 2) : n.get(c) && n.get(l) && y(he, 3);
3265
3237
  });
3266
3238
  }
3267
- n.reset(E), n.template_effect(() => n.set_attribute(E, "data-rulecms-published-key", n.get(f))), n.append(e, E), n.pop();
3239
+ n.reset(_), n.template_effect(() => n.set_attribute(_, "data-rulecms-published-key", n.get(g))), n.append(e, _), n.pop();
3268
3240
  }
3269
- const ji = 6e4;
3270
- class X extends Error {
3271
- constructor(r, o) {
3272
- super(r);
3273
- Fe(this, "status");
3274
- this.name = "FetchRuleCMSWidgetError", this.status = o;
3241
+ const Ni = 6e4;
3242
+ class J extends Error {
3243
+ constructor(o, r) {
3244
+ super(o);
3245
+ Ke(this, "status");
3246
+ this.name = "FetchRuleCMSWidgetError", this.status = r;
3275
3247
  }
3276
3248
  }
3277
- const ue = /* @__PURE__ */ new Map();
3278
- function nl() {
3279
- ue.clear();
3249
+ const de = /* @__PURE__ */ new Map();
3250
+ function ol() {
3251
+ de.clear();
3280
3252
  }
3281
- function nt(e) {
3253
+ function ot(e) {
3282
3254
  const t = e == null ? void 0 : e.cache;
3283
3255
  return t === "no-store" || t === "reload" || t === "no-cache";
3284
3256
  }
3285
- function Ni(e, t) {
3286
- const r = ue.get(e);
3287
- if (r) {
3288
- if (r.expiresAt <= t) {
3289
- ue.delete(e);
3257
+ function Mi(e, t) {
3258
+ const o = de.get(e);
3259
+ if (o) {
3260
+ if (o.expiresAt <= t) {
3261
+ de.delete(e);
3290
3262
  return;
3291
3263
  }
3292
- return r.data;
3264
+ return o.data;
3293
3265
  }
3294
3266
  }
3295
- async function Bt(e) {
3267
+ async function Ut(e) {
3296
3268
  return (await e.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${e.status}`;
3297
3269
  }
3298
- async function Ut({
3270
+ async function zt({
3299
3271
  publishedKey: e,
3300
3272
  token: t,
3301
- endpoint: r,
3302
- fetchOptions: o
3273
+ endpoint: o,
3274
+ fetchOptions: r
3303
3275
  }) {
3304
- const s = lt({ publishedKey: e, token: t, endpoint: r }), i = H(t), l = Date.now();
3305
- if (!i && !nt(o)) {
3306
- const c = Ni(s, l);
3307
- if (c)
3308
- return c;
3276
+ const s = ct({ publishedKey: e, token: t, endpoint: o }), i = G(t), l = Date.now();
3277
+ if (!i && !ot(r)) {
3278
+ const u = Mi(s, l);
3279
+ if (u)
3280
+ return u;
3309
3281
  }
3310
- const a = await fetch(s, {
3282
+ const c = await fetch(s, {
3311
3283
  method: "GET",
3312
3284
  ...i ? { cache: "no-store" } : {},
3313
- ...o
3285
+ ...r
3314
3286
  });
3315
- if (!a.ok)
3316
- throw new X(await Bt(a), a.status);
3317
- const d = await a.json();
3318
- if (!d.success)
3319
- throw new X("Failed to fetch widget data");
3320
- const u = Me(d.data);
3321
- return !i && !nt(o) && ue.set(s, {
3322
- expiresAt: l + ji,
3323
- data: u
3324
- }), u;
3325
- }
3326
- async function Mi(e) {
3327
- const { rulesetPublishedKey: t, params: r, fallbackPublishedKey: o, contentType: s, token: i, endpoint: l, fetchOptions: a } = e, d = () => Ut({
3328
- publishedKey: o,
3287
+ if (!c.ok)
3288
+ throw new J(await Ut(c), c.status);
3289
+ const a = await c.json();
3290
+ if (!a.success)
3291
+ throw new J("Failed to fetch widget data");
3292
+ const d = We(a.data);
3293
+ return !i && !ot(r) && de.set(s, {
3294
+ expiresAt: l + Ni,
3295
+ data: d
3296
+ }), d;
3297
+ }
3298
+ async function Wi(e) {
3299
+ const { rulesetPublishedKey: t, params: o, fallbackPublishedKey: r, contentType: s, token: i, endpoint: l, fetchOptions: c } = e, a = () => zt({
3300
+ publishedKey: r,
3329
3301
  token: i,
3330
3302
  endpoint: l,
3331
- fetchOptions: a
3303
+ fetchOptions: c
3332
3304
  });
3333
- let u;
3305
+ let d;
3334
3306
  try {
3335
- u = await fetch(at({ token: i, endpoint: l }), {
3336
- ...Vt({
3307
+ d = await fetch(at({ token: i, endpoint: l }), {
3308
+ ...Ft({
3337
3309
  token: i,
3338
3310
  rulesetPublishedKey: t,
3339
- params: r,
3311
+ params: o,
3340
3312
  contentType: s
3341
3313
  }),
3342
- ...a
3314
+ ...c
3343
3315
  });
3344
- } catch (f) {
3345
- if (o)
3346
- return d();
3347
- throw f;
3316
+ } catch (g) {
3317
+ if (r)
3318
+ return a();
3319
+ throw g;
3348
3320
  }
3349
- if (!u.ok) {
3350
- if (o && Ft(u.status))
3351
- return d();
3352
- throw new X(await Bt(u), u.status);
3321
+ if (!d.ok) {
3322
+ if (r && Kt(d.status))
3323
+ return a();
3324
+ throw new J(await Ut(d), d.status);
3353
3325
  }
3354
- const c = Kt({
3326
+ const u = Bt({
3355
3327
  token: i,
3356
3328
  rulesetPublishedKey: t,
3357
- body: await u.json()
3329
+ body: await d.json()
3358
3330
  });
3359
- if (!c)
3360
- throw new X("Failed to fetch widget data");
3361
- return { ...Me(c.raw), selection: c.selection };
3331
+ if (!u)
3332
+ throw new J("Failed to fetch widget data");
3333
+ return { ...We(u.raw), selection: u.selection };
3362
3334
  }
3363
3335
  async function rl(e) {
3364
- const { publishedKey: t, rulesetPublishedKey: r, token: o } = e;
3365
- if (!t && !r) {
3366
- const s = H(o);
3367
- throw r !== void 0 ? new X(
3336
+ const { publishedKey: t, rulesetPublishedKey: o, token: r } = e;
3337
+ if (!t && !o) {
3338
+ const s = G(r);
3339
+ throw o !== void 0 ? new J(
3368
3340
  s ? "Ruleset key is required" : "Ruleset published key is required"
3369
- ) : new X(
3341
+ ) : new J(
3370
3342
  s ? "Widget key is required" : "Published key is required"
3371
3343
  );
3372
3344
  }
3373
- if (!o)
3374
- throw new X("Token is required");
3375
- return e.rulesetPublishedKey ? Mi(e) : Ut(e);
3345
+ if (!r)
3346
+ throw new J("Token is required");
3347
+ return e.rulesetPublishedKey ? Wi(e) : zt(e);
3376
3348
  }
3377
- async function ol(e) {
3378
- const { data: t, libraries: r } = e, o = Pe({
3349
+ async function sl(e) {
3350
+ const { data: t, libraries: o } = e, r = De({
3379
3351
  displayItemList: t.displayItemList,
3380
3352
  widgetCollections: t.widgetCollections
3381
3353
  });
3382
- return de().resolve({ registrations: r, referenced: o });
3354
+ return fe().resolve({ registrations: o, referenced: r });
3383
3355
  }
3384
3356
  export {
3385
- Ki as AlignContentTypes,
3386
- _o as BreakpointVariantRender,
3387
- st as COLLECTION_TYPE_PREFIX,
3388
- fe as COMPONENT_PROPS_PATH_SEPARATOR,
3389
- Re as CSS_CLASSES_ATTRIBUTE_NAME,
3390
- On as CSS_VARIABLE_NAME_MAX_LENGTH,
3391
- Rn as CSS_VARIABLE_NAME_PATTERN,
3392
- ht as DEFAULT_BASE_Z_INDEX,
3393
- mn as DEFAULT_CLOUDINARY_CLOUD_NAME,
3357
+ Bi as AlignContentTypes,
3358
+ wr as BreakpointVariantRender,
3359
+ it as COLLECTION_TYPE_PREFIX,
3360
+ ge as COMPONENT_PROPS_PATH_SEPARATOR,
3361
+ Oe as CSS_CLASSES_ATTRIBUTE_NAME,
3362
+ jn as CSS_VARIABLE_NAME_MAX_LENGTH,
3363
+ On as CSS_VARIABLE_NAME_PATTERN,
3364
+ bt as DEFAULT_BASE_Z_INDEX,
3365
+ yn as DEFAULT_CLOUDINARY_CLOUD_NAME,
3394
3366
  re as DEFAULT_LIBRARY_ID,
3395
- ji as DEFAULT_PUBLISHED_WIDGET_CACHE_MS,
3396
- Dr as DEFAULT_ROW_GAP,
3397
- $t as DEV_CLIENT_TOKEN_PREFIX,
3367
+ Ni as DEFAULT_PUBLISHED_WIDGET_CACHE_MS,
3368
+ xo as DEFAULT_ROW_GAP,
3369
+ en as DEV_CLIENT_TOKEN_PREFIX,
3398
3370
  rn as DEV_WIDGET_API_PATH,
3399
- sn as DEV_WIDGET_RESOLVE_API_PATH,
3400
- Bi as DeviceDisplayTypes,
3401
- yo as DisplayComponent,
3402
- Ie as DisplayItemTypes,
3403
- ot as DragItemIdPrefixTypes,
3404
- dn as EMBEDDED_KEY_SEPARATOR,
3405
- rr as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
3406
- X as FetchRuleCMSWidgetError,
3407
- pt as HIDE_WIDGET_ATTRIBUTE_NAME,
3408
- ze as JustifyContentTypes,
3409
- jr as POINTER_EVENTS_ATTRIBUTE_NAME,
3410
- we as PUBLISHED_KEY_SEPARATOR,
3411
- nn as PUBLISHED_WIDGET_API_PATH,
3412
- on as PUBLISHED_WIDGET_RESOLVE_API_PATH,
3413
- Ue as PageViewTypes,
3414
- Ze as RULECMS_ANONYMOUS_ID_STORAGE_KEY,
3415
- en as RULECMS_API_ORIGIN,
3416
- el as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
3417
- dt as RULECMS_WIDGET_CONTEXT_KEY,
3418
- To as RenderComponents,
3419
- Se as RenderComponentsForDevice,
3420
- Ee as RenderComponentsInner,
3421
- tl as RuleCMSWidget,
3422
- qi as RuleCMSWidgetProvider,
3423
- Nr as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
3424
- tn as WIDGET_CACHE_API_ORIGIN,
3425
- Ye as WIDGET_PLACEHOLDER_VALUES_KEY,
3426
- Vr as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
3427
- Qn as alignContentAllowlist,
3428
- qn as alignItemsAllowlist,
3429
- tr as backgroundPositionAllowlist,
3430
- nr as backgroundRepeatAllowlist,
3431
- er as backgroundSizeAllowlist,
3432
- or as borderStyleKeywords,
3433
- Mn as boxSpacingSideKeys,
3434
- $i as boxSpacingStyleAttributeEntries,
3435
- Ln as buildCloudinaryBackgroundUrl,
3436
- Hr as buildOverlayLayerBoxStyles,
3437
- zr as buildOverlayStackStyles,
3438
- lt as buildWidgetFetchUrl,
3371
+ ln as DEV_WIDGET_RESOLVE_API_PATH,
3372
+ Ui as DeviceDisplayTypes,
3373
+ br as DisplayComponent,
3374
+ Pe as DisplayItemTypes,
3375
+ st as DragItemIdPrefixTypes,
3376
+ fn as EMBEDDED_KEY_SEPARATOR,
3377
+ ro as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
3378
+ J as FetchRuleCMSWidgetError,
3379
+ mt as HIDE_WIDGET_ATTRIBUTE_NAME,
3380
+ He as JustifyContentTypes,
3381
+ Mo as POINTER_EVENTS_ATTRIBUTE_NAME,
3382
+ Ae as PUBLISHED_KEY_SEPARATOR,
3383
+ on as PUBLISHED_WIDGET_API_PATH,
3384
+ sn as PUBLISHED_WIDGET_RESOLVE_API_PATH,
3385
+ ze as PageViewTypes,
3386
+ Qe as RULECMS_ANONYMOUS_ID_STORAGE_KEY,
3387
+ tn as RULECMS_API_ORIGIN,
3388
+ tl as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
3389
+ ft as RULECMS_WIDGET_CONTEXT_KEY,
3390
+ Ir as RenderComponents,
3391
+ Te as RenderComponentsForDevice,
3392
+ Se as RenderComponentsInner,
3393
+ nl as RuleCMSWidget,
3394
+ Zi as RuleCMSWidgetProvider,
3395
+ Wo as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
3396
+ nn as WIDGET_CACHE_API_ORIGIN,
3397
+ Xe as WIDGET_PLACEHOLDER_VALUES_KEY,
3398
+ Ko as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
3399
+ $n as alignContentAllowlist,
3400
+ Zn as alignItemsAllowlist,
3401
+ no as backgroundPositionAllowlist,
3402
+ oo as backgroundRepeatAllowlist,
3403
+ to as backgroundSizeAllowlist,
3404
+ so as borderStyleKeywords,
3405
+ Wn as boxSpacingSideKeys,
3406
+ el as boxSpacingStyleAttributeEntries,
3407
+ Rn as buildCloudinaryBackgroundUrl,
3408
+ Yo as buildOverlayLayerBoxStyles,
3409
+ Go as buildOverlayStackStyles,
3410
+ ct as buildWidgetFetchUrl,
3439
3411
  at as buildWidgetResolveUrl,
3440
- nl as clearPublishedWidgetFetchCache,
3441
- Xr as collectComponentInstancePaths,
3442
- Pe as collectReferencedLibraryIds,
3443
- Qt as composeSourceComponentsPlugin,
3444
- de as createComponentLibraryRegistry,
3445
- _e as cssAttrArrayKey,
3446
- pn as defaultPageWidth,
3447
- Sr as deriveDisplayFlexIfNeeded,
3448
- Zi as desktopModeWidth,
3412
+ ol as clearPublishedWidgetFetchCache,
3413
+ qo as collectComponentInstancePaths,
3414
+ De as collectReferencedLibraryIds,
3415
+ $t as composeSourceComponentsPlugin,
3416
+ fe as createComponentLibraryRegistry,
3417
+ we as cssAttrArrayKey,
3418
+ mn as defaultPageWidth,
3419
+ Io as deriveDisplayFlexIfNeeded,
3420
+ Qi as desktopModeWidth,
3449
3421
  rl as fetchRuleCMSWidget,
3450
- qr as findUnmatchedComponentPropsKeys,
3451
- $n as flexDirectionAllowlist,
3452
- Zn as flexWrapAllowlist,
3453
- Bn as fontFamilyAllowlist,
3454
- zn as fontStyleAllowlist,
3455
- Un as fontWeightAllowlist,
3456
- gr as formatBackgroundImageStyles,
3457
- pr as formatBorderStyles,
3458
- mr as formatBoxShadowStyles,
3459
- hr as formatBoxSpacingStyles,
3460
- br as formatCssColorStyles,
3461
- ke as formatCssColorValue,
3462
- vr as formatCssEnumStyles,
3463
- Cr as formatCssLengthStyles,
3464
- B as formatCssVariable,
3465
- Qi as formatCssVariableStyles,
3466
- _r as formatLineHeightStyles,
3467
- Ar as formatObjectStyleAttribute,
3468
- wr as formatOpacityStyles,
3469
- Q as formatSpacingSideValue,
3470
- fn as generatePublishedKey,
3471
- Xi as generatePublishedKeyForEmbedded,
3472
- ut as getCollectionIdForCollectionType,
3473
- ce as getColumnAttributes,
3474
- He as getComponentAttributesAndStyles,
3475
- Ce as getComponentsPluginFromPlugins,
3422
+ Qo as findUnmatchedComponentPropsKeys,
3423
+ eo as flexDirectionAllowlist,
3424
+ Qn as flexWrapAllowlist,
3425
+ Un as fontFamilyAllowlist,
3426
+ Hn as fontStyleAllowlist,
3427
+ zn as fontWeightAllowlist,
3428
+ mo as formatBackgroundImageStyles,
3429
+ yo as formatBorderStyles,
3430
+ ho as formatBoxShadowStyles,
3431
+ vo as formatBoxSpacingStyles,
3432
+ Co as formatCssColorStyles,
3433
+ Le as formatCssColorValue,
3434
+ _o as formatCssEnumStyles,
3435
+ wo as formatCssLengthStyles,
3436
+ U as formatCssVariable,
3437
+ $i as formatCssVariableStyles,
3438
+ Ao as formatLineHeightStyles,
3439
+ So as formatObjectStyleAttribute,
3440
+ Eo as formatOpacityStyles,
3441
+ $ as formatSpacingSideValue,
3442
+ gn as generatePublishedKey,
3443
+ Ji as generatePublishedKeyForEmbedded,
3444
+ dt as getCollectionIdForCollectionType,
3445
+ ue as getColumnAttributes,
3446
+ Ge as getComponentAttributesAndStyles,
3447
+ _e as getComponentsPluginFromPlugins,
3476
3448
  k as getCssVariableFromLeaf,
3477
- Tr as getDefaultDimensionAttributes,
3478
- G as getDeviceTypeBasedAttributes,
3479
- Ui as getDragItemId,
3480
- ln as getDragItemPrefixAndId,
3449
+ Po as getDefaultDimensionAttributes,
3450
+ Y as getDeviceTypeBasedAttributes,
3451
+ zi as getDragItemId,
3452
+ cn as getDragItemPrefixAndId,
3481
3453
  an as getIdAndPrefix,
3482
- Ir as getMergedAttributes,
3483
- zi as getNameAndInstanceIdFromWidgetKey,
3484
- Hi as getNameFromWidgetKey,
3485
- Ai as getOrCreateAnonymousId,
3486
- Kr as getOverlayLayerZIndex,
3487
- cn as getWidgetKeyForCollection,
3488
- Gi as getWidgetKeyForCollectionWithPrefix,
3489
- un as getWidgetKeyForPublishedCollection,
3490
- Yi as getWidgetKeyForPublishedCollectionWithPrefix,
3491
- ur as hasBoxShadowLeaf,
3492
- eo as hasDeviceDivergentValues,
3493
- z as hasInvalidCssVariable,
3494
- Pr as hasItems,
3495
- Fr as hasOverlayLayers,
3496
- Ji as incrementVersion,
3497
- jn as isBackgroundImageValue,
3498
- sr as isBorderStyleValue,
3499
- ir as isBorderValue,
3500
- cr as isBoxShadowValue,
3501
- Wn as isBoxSpacingValue,
3502
- In as isCloudinaryCloudName,
3503
- Tn as isCloudinaryPublicId,
3504
- Dn as isCloudinaryTransformationString,
3454
+ Do as getMergedAttributes,
3455
+ Hi as getNameAndInstanceIdFromWidgetKey,
3456
+ Gi as getNameFromWidgetKey,
3457
+ Ei as getOrCreateAnonymousId,
3458
+ Uo as getOverlayLayerZIndex,
3459
+ un as getWidgetKeyForCollection,
3460
+ Yi as getWidgetKeyForCollectionWithPrefix,
3461
+ dn as getWidgetKeyForPublishedCollection,
3462
+ Xi as getWidgetKeyForPublishedCollectionWithPrefix,
3463
+ fo as hasBoxShadowLeaf,
3464
+ nr as hasDeviceDivergentValues,
3465
+ H as hasInvalidCssVariable,
3466
+ ko as hasItems,
3467
+ Bo as hasOverlayLayers,
3468
+ qi as incrementVersion,
3469
+ Nn as isBackgroundImageValue,
3470
+ io as isBorderStyleValue,
3471
+ lo as isBorderValue,
3472
+ uo as isBoxShadowValue,
3473
+ Vn as isBoxSpacingValue,
3474
+ Pn as isCloudinaryCloudName,
3475
+ In as isCloudinaryPublicId,
3476
+ kn as isCloudinaryTransformationString,
3505
3477
  xe as isCssColorValue,
3506
- Kn as isCssEnumValue,
3507
- $ as isCssVariableName,
3508
- H as isDevClientToken,
3509
- dr as isLineHeightValue,
3510
- fr as isOpacityValue,
3511
- Ur as isOverlayLayerEmptyForDevice,
3512
- kr as isRowHiddenForDevice,
3513
- Pn as isSafeImageUrl,
3514
- Z as isSpacingSideValue,
3515
- je as isWidgetHiddenForDevice,
3516
- Jn as justifyContentAllowlist,
3517
- Oe as normalizeCssClasses,
3518
- Le as objectStyleAttributeRegistry,
3519
- be as overflowAllowlist,
3520
- ft as phoneModeWidth,
3521
- Xn as pointerEventsAllowlist,
3522
- Me as prepareRuleCMSWidgetData,
3523
- Ge as resolveBaseZIndex,
3478
+ Bn as isCssEnumValue,
3479
+ ee as isCssVariableName,
3480
+ G as isDevClientToken,
3481
+ go as isLineHeightValue,
3482
+ po as isOpacityValue,
3483
+ Ho as isOverlayLayerEmptyForDevice,
3484
+ Ro as isRowHiddenForDevice,
3485
+ Dn as isSafeImageUrl,
3486
+ Q as isSpacingSideValue,
3487
+ Ne as isWidgetHiddenForDevice,
3488
+ qn as justifyContentAllowlist,
3489
+ je as normalizeCssClasses,
3490
+ Re as objectStyleAttributeRegistry,
3491
+ ve as overflowAllowlist,
3492
+ gt as phoneModeWidth,
3493
+ Jn as pointerEventsAllowlist,
3494
+ We as prepareRuleCMSWidgetData,
3495
+ Ye as resolveBaseZIndex,
3524
3496
  rt as resolveKey,
3525
- Br as resolveOverlayLayerPointerEvents,
3526
- Lr as resolveRowStyles,
3527
- it as resolveWidgetApiOrigin,
3528
- mt as resolveWidgetContainerStyles,
3529
- Gr as resolveWidgetInstanceProps,
3530
- ol as resolveWidgetLibraries,
3531
- xr as rowBasedPropertiesAreAssigned,
3532
- De as spacingKeywords,
3533
- Nn as spacingLengthUnits,
3534
- Ti as stableJsonStringify,
3535
- gt as tabletModeWidth,
3536
- Hn as textAlignAllowlist,
3537
- Gn as textDecorationAllowlist,
3538
- Yn as textTransformAllowlist,
3497
+ zo as resolveOverlayLayerPointerEvents,
3498
+ Oo as resolveRowStyles,
3499
+ lt as resolveWidgetApiOrigin,
3500
+ yt as resolveWidgetContainerStyles,
3501
+ Xo as resolveWidgetInstanceProps,
3502
+ sl as resolveWidgetLibraries,
3503
+ Lo as rowBasedPropertiesAreAssigned,
3504
+ ke as spacingKeywords,
3505
+ Mn as spacingLengthUnits,
3506
+ Ii as stableJsonStringify,
3507
+ pt as tabletModeWidth,
3508
+ Gn as textAlignAllowlist,
3509
+ Yn as textDecorationAllowlist,
3510
+ Xn as textTransformAllowlist,
3539
3511
  N as toStyleAttr,
3540
- ct as typeHasPrefix,
3541
- Zr as warnUnmatchedComponentProps,
3542
- Wr as widgetBasedPropertiesAreAssigned,
3543
- yt as widgetDeclaresOwnHeight,
3544
- Yr as withWidgetPlaceholderValues
3512
+ ut as typeHasPrefix,
3513
+ $o as warnUnmatchedComponentProps,
3514
+ Fo as widgetBasedPropertiesAreAssigned,
3515
+ ht as widgetDeclaresOwnHeight,
3516
+ Jo as withWidgetPlaceholderValues
3545
3517
  };