@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.12 → 0.1.13

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
@@ -444,7 +444,7 @@ function Fc(e) {
444
444
  g = Promise.reject(b);
445
445
  }
446
446
  Promise.resolve(g).then(u).catch((b) => {
447
- var R;
447
+ var D;
448
448
  if (s())
449
449
  return;
450
450
  const m = e.retry ?? (hi.isServer() ? 0 : 3), S = e.retryDelay ?? dh, v = typeof S == "function" ? S(n, b) : S, C = m === !0 || typeof m == "number" && n < m || typeof m == "function" && m(n, b);
@@ -452,7 +452,7 @@ function Fc(e) {
452
452
  y(b);
453
453
  return;
454
454
  }
455
- n++, (R = e.onFail) == null || R.call(e, n, b), ih(v).then(() => h() ? void 0 : p()).then(() => {
455
+ n++, (D = e.onFail) == null || D.call(e, n, b), ih(v).then(() => h() ? void 0 : p()).then(() => {
456
456
  t ? y(b) : w();
457
457
  });
458
458
  });
@@ -528,8 +528,8 @@ function hh(e) {
528
528
  const S = i === "backward", v = S ? fh : Qa, C = {
529
529
  pages: s,
530
530
  pageParams: o
531
- }, R = v(r, C);
532
- a = await m(C, R, S);
531
+ }, D = v(r, C);
532
+ a = await m(C, D, S);
533
533
  } else {
534
534
  const S = e ?? s.length;
535
535
  do {
@@ -699,7 +699,7 @@ var Rr, rr, Dr, Wt, ir, dt, bi, sr, Ut, Uc, yn, Ec, ph = (Ec = class extends zc
699
699
  get: () => (Q(this, sr, !0), r.signal)
700
700
  });
701
701
  }, s = () => {
702
- const v = Mc(this.options, n), R = (() => {
702
+ const v = Mc(this.options, n), D = (() => {
703
703
  const F = {
704
704
  client: T(this, ir),
705
705
  queryKey: this.queryKey,
@@ -709,9 +709,9 @@ var Rr, rr, Dr, Wt, ir, dt, bi, sr, Ut, Uc, yn, Ec, ph = (Ec = class extends zc
709
709
  })();
710
710
  return Q(this, sr, !1), this.options.persister ? this.options.persister(
711
711
  v,
712
- R,
712
+ D,
713
713
  this
714
- ) : v(R);
714
+ ) : v(D);
715
715
  }, a = (() => {
716
716
  const v = {
717
717
  fetchOptions: n,
@@ -1036,7 +1036,7 @@ var Lt, Ee, yi, Rt, or, Nr, vn, In, vi, Or, Lr, ar, lr, Fn, Pr, Oe, ii, uo, ho,
1036
1036
  Q(this, In, M);
1037
1037
  }
1038
1038
  T(this, In) && (w = T(this, In), p = T(this, Or), g = Date.now(), f = "error");
1039
- const m = u.fetchStatus === "fetching", S = f === "pending", v = f === "error", C = S && m, R = p !== void 0, P = {
1039
+ const m = u.fetchStatus === "fetching", S = f === "pending", v = f === "error", C = S && m, D = p !== void 0, P = {
1040
1040
  status: f,
1041
1041
  fetchStatus: u.fetchStatus,
1042
1042
  isPending: S,
@@ -1055,10 +1055,10 @@ var Lt, Ee, yi, Rt, or, Nr, vn, In, vi, Or, Lr, ar, lr, Fn, Pr, Oe, ii, uo, ho,
1055
1055
  isFetchedAfterMount: u.dataUpdateCount > h.dataUpdateCount || u.errorUpdateCount > h.errorUpdateCount,
1056
1056
  isFetching: m,
1057
1057
  isRefetching: m && !S,
1058
- isLoadingError: v && !R,
1058
+ isLoadingError: v && !D,
1059
1059
  isPaused: u.fetchStatus === "paused",
1060
1060
  isPlaceholderData: y,
1061
- isRefetchError: v && R,
1061
+ isRefetchError: v && D,
1062
1062
  isStale: ia(t, n),
1063
1063
  refetch: this.refetch,
1064
1064
  promise: T(this, vn),
@@ -1217,7 +1217,7 @@ var wi, ln, St, cr, cn, Rn, kc, bh = (kc = class extends zc {
1217
1217
  this.execute(this.state.variables);
1218
1218
  }
1219
1219
  async execute(t) {
1220
- var o, a, c, h, d, u, y, p, w, g, f, b, m, S, v, C, R, F;
1220
+ var o, a, c, h, d, u, y, p, w, g, f, b, m, S, v, C, D, F;
1221
1221
  const n = () => {
1222
1222
  me(this, cn, Rn).call(this, { type: "continue" });
1223
1223
  }, r = {
@@ -1329,8 +1329,8 @@ var wi, ln, St, cr, cn, Rn, kc, bh = (kc = class extends zc {
1329
1329
  Promise.reject(z);
1330
1330
  }
1331
1331
  try {
1332
- await ((F = (R = this.options).onSettled) == null ? void 0 : F.call(
1333
- R,
1332
+ await ((F = (D = this.options).onSettled) == null ? void 0 : F.call(
1333
+ D,
1334
1334
  void 0,
1335
1335
  P,
1336
1336
  t,
@@ -2609,18 +2609,18 @@ function Cf() {
2609
2609
  } else g = w.current;
2610
2610
  w = a(
2611
2611
  function() {
2612
- function b(R) {
2612
+ function b(D) {
2613
2613
  if (!m) {
2614
- if (m = !0, S = R, R = y(R), p !== void 0 && g.hasValue) {
2614
+ if (m = !0, S = D, D = y(D), p !== void 0 && g.hasValue) {
2615
2615
  var F = g.value;
2616
- if (p(F, R))
2616
+ if (p(F, D))
2617
2617
  return v = F;
2618
2618
  }
2619
- return v = R;
2619
+ return v = D;
2620
2620
  }
2621
- if (F = v, r(S, R)) return F;
2622
- var P = y(R);
2623
- return p !== void 0 && p(F, P) ? (S = R, F) : (S = R, v = P);
2621
+ if (F = v, r(S, D)) return F;
2622
+ var P = y(D);
2623
+ return p !== void 0 && p(F, P) ? (S = D, F) : (S = D, v = P);
2624
2624
  }
2625
2625
  var m = !1, S, v, C = u === void 0 ? null : u;
2626
2626
  return [
@@ -2896,10 +2896,12 @@ function mu(e = !1) {
2896
2896
  function Ri(e, t) {
2897
2897
  if (!ge) return;
2898
2898
  const n = e.toLowerCase(), r = window.EkTelemetry;
2899
- if (r && typeof r[n] == "function") {
2900
- r[n](cl(e, t));
2901
- return;
2902
- }
2899
+ if (r && typeof r[n] == "function")
2900
+ try {
2901
+ r[n](cl(e, t));
2902
+ return;
2903
+ } catch {
2904
+ }
2903
2905
  ai.push(cl(e, t)), ai.length >= Ap && mu();
2904
2906
  }
2905
2907
  function gu(e, t) {
@@ -3058,7 +3060,7 @@ const be = _s((e, t) => ({
3058
3060
  // Seed per-language maps from the read response (old i18n content).
3059
3061
  contentLang: "en",
3060
3062
  i18nText: (() => {
3061
- var C, R;
3063
+ var C, D;
3062
3064
  const u = n.i18nSource ?? {}, y = n.options ?? [], p = {};
3063
3065
  y.forEach((F, P) => {
3064
3066
  var z;
@@ -3073,7 +3075,7 @@ const be = _s((e, t) => ({
3073
3075
  for (const [F, P] of Object.entries(b)) {
3074
3076
  const z = P.type;
3075
3077
  if (S[F] = z, z === "video" || z === "audio") {
3076
- const M = (R = n.media) == null ? void 0 : R.find((O) => O.id === P.value);
3078
+ const M = (D = n.media) == null ? void 0 : D.find((O) => O.id === P.value);
3077
3079
  v[F] = M ? { id: M.id, src: M.src, name: M.name ?? M.id, thumbnail: M.thumbnail } : P.value ? { id: P.value, src: "", name: P.value } : null;
3078
3080
  } else z === "html" && (m[F] = P.value);
3079
3081
  }
@@ -3272,7 +3274,7 @@ function Op(e, t) {
3272
3274
  r.unshift({ id: i.id, name: i.name }), i = i.parent ? Yn(e, i.parent) : void 0;
3273
3275
  return r;
3274
3276
  }
3275
- const pe = _s((e, t) => ({
3277
+ const fe = _s((e, t) => ({
3276
3278
  treeData: [],
3277
3279
  selectedNodeId: null,
3278
3280
  treeCache: {},
@@ -4144,12 +4146,12 @@ function Cs(e, t, n) {
4144
4146
  if (c === 1 / 0)
4145
4147
  return JSON.stringify(b);
4146
4148
  const S = [];
4147
- return JSON.stringify(b, function(C, R) {
4148
- if (!A.isObject(R))
4149
- return R;
4149
+ return JSON.stringify(b, function(C, D) {
4150
+ if (!A.isObject(D))
4151
+ return D;
4150
4152
  for (; S.length && S[S.length - 1] !== this; )
4151
4153
  S.pop();
4152
- return S.push(R), y(m + S.length - 1), R;
4154
+ return S.push(D), y(m + S.length - 1), D;
4153
4155
  });
4154
4156
  }
4155
4157
  function w(b, m, S) {
@@ -4160,11 +4162,11 @@ function Cs(e, t, n) {
4160
4162
  if (A.endsWith(m, "{}"))
4161
4163
  m = r ? m : m.slice(0, -2), b = p(b, 1);
4162
4164
  else if (A.isArray(b) && Fm(b) || (A.isFileList(b) || A.endsWith(m, "[]")) && (v = A.toArray(b)))
4163
- return m = Lu(m), v.forEach(function(R, F) {
4164
- !(A.isUndefined(R) || R === null) && t.append(
4165
+ return m = Lu(m), v.forEach(function(D, F) {
4166
+ !(A.isUndefined(D) || D === null) && t.append(
4165
4167
  // eslint-disable-next-line no-nested-ternary
4166
4168
  o === !0 ? $s([m], F, s) : o === null ? m : m + "[]",
4167
- u(R)
4169
+ u(D)
4168
4170
  );
4169
4171
  }), !1;
4170
4172
  }
@@ -4179,8 +4181,8 @@ function Cs(e, t, n) {
4179
4181
  if (!A.isUndefined(b)) {
4180
4182
  if (y(S), d.indexOf(b) !== -1)
4181
4183
  throw new Error("Circular reference detected in " + m.join("."));
4182
- d.push(b), A.forEach(b, function(C, R) {
4183
- (!(A.isUndefined(C) || C === null) && i.call(t, C, A.isString(R) ? R.trim() : R, m, g)) === !0 && f(C, m ? m.concat(R) : [R], S + 1);
4184
+ d.push(b), A.forEach(b, function(C, D) {
4185
+ (!(A.isUndefined(C) || C === null) && i.call(t, C, A.isString(D) ? D.trim() : D, m, g)) === !0 && f(C, m ? m.concat(D) : [D], S + 1);
4184
4186
  }), d.pop();
4185
4187
  }
4186
4188
  }
@@ -4781,8 +4783,8 @@ const fg = typeof XMLHttpRequest < "u", pg = fg && function(e) {
4781
4783
  }, f.onabort = function() {
4782
4784
  f && (r(new J("Request aborted", J.ECONNABORTED, e, f)), g(), f = null);
4783
4785
  }, f.onerror = function(v) {
4784
- const C = v && v.message ? v.message : "Network Error", R = new J(C, J.ERR_NETWORK, e, f);
4785
- R.event = v || null, r(R), g(), f = null;
4786
+ const C = v && v.message ? v.message : "Network Error", D = new J(C, J.ERR_NETWORK, e, f);
4787
+ D.event = v || null, r(D), g(), f = null;
4786
4788
  }, f.ontimeout = function() {
4787
4789
  let v = i.timeout ? "timeout of " + i.timeout + "ms exceeded" : "timeout exceeded";
4788
4790
  const C = i.transitional || ha;
@@ -5021,7 +5023,7 @@ const pa = "1.18.1", xl = 64 * 1024, { isFunction: $i } = A, _g = (e) => encodeU
5021
5023
  method: S,
5022
5024
  data: v,
5023
5025
  signal: C,
5024
- cancelToken: R,
5026
+ cancelToken: D,
5025
5027
  timeout: F,
5026
5028
  onDownloadProgress: P,
5027
5029
  onUploadProgress: z,
@@ -5032,11 +5034,11 @@ const pa = "1.18.1", xl = 64 * 1024, { isFunction: $i } = A, _g = (e) => encodeU
5032
5034
  maxContentLength: L,
5033
5035
  maxBodyLength: H
5034
5036
  } = Bu(b);
5035
- const te = A.isNumber(L) && L > -1, ue = A.isNumber(H) && H > -1, fe = (X) => A.hasOwnProp(b, X) ? b[X] : void 0;
5037
+ const te = A.isNumber(L) && L > -1, ue = A.isNumber(H) && H > -1, pe = (X) => A.hasOwnProp(b, X) ? b[X] : void 0;
5036
5038
  let le = i || fetch;
5037
5039
  M = M ? (M + "").toLowerCase() : "text";
5038
5040
  let ke = mg(
5039
- [C, R && R.toAbortSignal()],
5041
+ [C, D && D.toAbortSignal()],
5040
5042
  F
5041
5043
  ), ne = null;
5042
5044
  const Be = ke && ke.unsubscribe && (() => {
@@ -5051,7 +5053,7 @@ const pa = "1.18.1", xl = 64 * 1024, { isFunction: $i } = A, _g = (e) => encodeU
5051
5053
  );
5052
5054
  try {
5053
5055
  let X;
5054
- const we = fe("auth");
5056
+ const we = pe("auth");
5055
5057
  if (we) {
5056
5058
  const ae = A.getSafeProp(we, "username") || "", ze = A.getSafeProp(we, "password") || "";
5057
5059
  X = {
@@ -6012,7 +6014,7 @@ async function Vg(e, t, n = "QuestionSet", r = "v1") {
6012
6014
  };
6013
6015
  }
6014
6016
  function $g({ config: e, onError: t }) {
6015
- const [n, r] = oe(!0), [i, s] = oe(null), [o, a] = oe(!1), { setEditorConfig: c, setEditorMode: h, setCategoryDefinition: d, setReviewComments: u, setLicenses: y, setChannelData: p } = re(), { setTreeData: w, selectNode: g, mergeNodeMeta: f } = pe();
6017
+ const [n, r] = oe(!0), [i, s] = oe(null), [o, a] = oe(!1), { setEditorConfig: c, setEditorMode: h, setCategoryDefinition: d, setReviewComments: u, setLicenses: y, setChannelData: p } = re(), { setTreeData: w, selectNode: g, mergeNodeMeta: f } = fe();
6016
6018
  return Ce(() => {
6017
6019
  let b = !1;
6018
6020
  async function m() {
@@ -6030,11 +6032,11 @@ function $g({ config: e, onError: t }) {
6030
6032
  !b && Object.keys(P).length > 0 && f(v.id, P);
6031
6033
  } catch {
6032
6034
  }
6033
- const C = e.config.primaryCategory ?? "Question Set", R = e.context.channel ?? "", F = e.config.categoryDefinitionApiVersion ?? "v1";
6035
+ const C = e.config.primaryCategory ?? "Question Set", D = e.context.channel ?? "", F = e.config.categoryDefinitionApiVersion ?? "v1";
6034
6036
  try {
6035
6037
  const P = await Vg(
6036
6038
  C,
6037
- R,
6039
+ D,
6038
6040
  e.config.objectType ?? "QuestionSet",
6039
6041
  F
6040
6042
  );
@@ -6198,10 +6200,10 @@ function Yg(e, t, n, r) {
6198
6200
  let C;
6199
6201
  if (S)
6200
6202
  if (v) {
6201
- const { isNew: R, ...F } = m ?? {};
6203
+ const { isNew: D, ...F } = m ?? {};
6202
6204
  C = { ...d({ ...g.metadata ?? {}, ...F }) };
6203
6205
  } else {
6204
- const { isNew: R, ...F } = m ?? {};
6206
+ const { isNew: D, ...F } = m ?? {};
6205
6207
  C = {
6206
6208
  mimeType: "application/vnd.sunbird.questionset",
6207
6209
  primaryCategory: r,
@@ -6216,13 +6218,13 @@ function Yg(e, t, n, r) {
6216
6218
  };
6217
6219
  }
6218
6220
  else if (v) {
6219
- const { isNew: R, ...F } = m ?? {};
6221
+ const { isNew: D, ...F } = m ?? {};
6220
6222
  C = { ...d({ ...g.metadata ?? {}, ...F }) };
6221
6223
  } else if (f) {
6222
- const { isNew: R, ...F } = m ?? {};
6224
+ const { isNew: D, ...F } = m ?? {};
6223
6225
  C = { name: g.name, ...d(F) };
6224
6226
  } else {
6225
- const { isNew: R, ...F } = m ?? {};
6227
+ const { isNew: D, ...F } = m ?? {};
6226
6228
  C = { name: g.name, visibility: "Parent", ...d(F) };
6227
6229
  }
6228
6230
  v && (delete C.code, delete C.visibility, delete C.identifier), i[b] = {
@@ -6270,22 +6272,22 @@ function ga() {
6270
6272
  try {
6271
6273
  const w = a.config.primaryCategory ?? "Practice Question Set", g = (P) => {
6272
6274
  for (const z of P)
6273
- !z.isQuestion && z.identifier.startsWith("temp-") && pe.getState().replaceNodeId(z.identifier, mi()), z.children && g(z.children);
6275
+ !z.isQuestion && z.identifier.startsWith("temp-") && fe.getState().replaceNodeId(z.identifier, mi()), z.children && g(z.children);
6274
6276
  };
6275
- g(pe.getState().treeData);
6276
- const { treeData: f, treeCache: b, replaceNodeId: m } = pe.getState(), { nodesModified: S, hierarchy: v } = Yg(f, b, d, w), { identifiers: C } = await qg(h, S, v, u);
6277
+ g(fe.getState().treeData);
6278
+ const { treeData: f, treeCache: b, replaceNodeId: m } = fe.getState(), { nodesModified: S, hierarchy: v } = Yg(f, b, d, w), { identifiers: C } = await qg(h, S, v, u);
6277
6279
  for (const [P, z] of Object.entries(C))
6278
6280
  m(P, z);
6279
- const R = pe.getState().treeCache, F = {};
6280
- for (const [P, z] of Object.entries(R))
6281
+ const D = fe.getState().treeCache, F = {};
6282
+ for (const [P, z] of Object.entries(D))
6281
6283
  if (z != null && z.isNew) {
6282
6284
  const { isNew: M, ...O } = z;
6283
6285
  F[P] = O;
6284
6286
  } else
6285
6287
  F[P] = z;
6286
- return pe.setState({ treeCache: F }), pe.getState().markSaved(), o((/* @__PURE__ */ new Date()).toISOString()), s(!1), (p = (y = re.getState().eventHandlers).onHierarchySaved) == null || p.call(y, { identifiers: C }), !0;
6288
+ return fe.setState({ treeCache: F }), fe.getState().markSaved(), o((/* @__PURE__ */ new Date()).toISOString()), s(!1), (p = (y = re.getState().eventHandlers).onHierarchySaved) == null || p.call(y, { identifiers: C }), !0;
6287
6289
  } catch (w) {
6288
- return console.error("[useSaveHierarchy] save failed:", w), pi(Es(w, Mt("messages.error.001", "Failed to save. Please try again."))), pe.getState().revertToSaved(), !1;
6290
+ return console.error("[useSaveHierarchy] save failed:", w), pi(Es(w, Mt("messages.error.001", "Failed to save. Please try again."))), fe.getState().revertToSaved(), !1;
6289
6291
  } finally {
6290
6292
  n.current = !1, t(!1);
6291
6293
  }
@@ -6464,8 +6466,8 @@ function eb(e) {
6464
6466
  if (!s) {
6465
6467
  const C = Io(r, n._names, v || n._formValues, !1, c.current);
6466
6468
  if (h.current) {
6467
- const R = h.current(C);
6468
- Ht(R, d.current) || (w(R), d.current = R);
6469
+ const D = h.current(C);
6470
+ Ht(D, d.current) || (w(D), d.current = D);
6469
6471
  } else
6470
6472
  w(C);
6471
6473
  }
@@ -6547,7 +6549,7 @@ function tb(e) {
6547
6549
  v && (p.current = {
6548
6550
  focus: () => xt(v.focus) && v.focus(),
6549
6551
  select: () => xt(v.select) && v.select(),
6550
- setCustomValidity: (R) => xt(v.setCustomValidity) && v.setCustomValidity(R),
6552
+ setCustomValidity: (D) => xt(v.setCustomValidity) && v.setCustomValidity(D),
6551
6553
  reportValidity: () => xt(v.reportValidity) && v.reportValidity()
6552
6554
  });
6553
6555
  const C = Y(i._fields, n);
@@ -6566,17 +6568,17 @@ function tb(e) {
6566
6568
  ...y.current.rules,
6567
6569
  ...jt(y.current.disabled) ? { disabled: y.current.disabled } : {}
6568
6570
  });
6569
- const C = (R, F) => {
6570
- const P = Y(i._fields, R);
6571
+ const C = (D, F) => {
6572
+ const P = Y(i._fields, D);
6571
6573
  P && P._f && (P._f.mount = F);
6572
6574
  };
6573
6575
  if (C(n, !0), v) {
6574
- const R = Qe(Y(s ? i._defaultValues : i._options.values || i._defaultValues, n, Y(i._options.defaultValues, n, y.current.defaultValue)));
6575
- Pe(i._defaultValues, n, R), Fe(Y(i._formValues, n)) && Pe(i._formValues, n, R);
6576
+ const D = Qe(Y(s ? i._defaultValues : i._options.values || i._defaultValues, n, Y(i._options.defaultValues, n, y.current.defaultValue)));
6577
+ Pe(i._defaultValues, n, D), Fe(Y(i._formValues, n)) && Pe(i._formValues, n, D);
6576
6578
  }
6577
6579
  if (!c && i.register(n), p.current) {
6578
- const R = Y(i._fields, n);
6579
- R && R._f && (R._f.ref = p.current);
6580
+ const D = Y(i._fields, n);
6581
+ D && D._f && (D._f.ref = p.current);
6580
6582
  }
6581
6583
  return () => {
6582
6584
  (c ? v && !i._state.action : v) ? i.unregister(n) : C(n, !1);
@@ -6852,7 +6854,7 @@ var _r = (e) => He(e) && !hs(e) ? e : {
6852
6854
  const q = jt(I) ? "" : I || "";
6853
6855
  a ? a.forEach((L) => L.setCustomValidity(q)) : S.setCustomValidity(q), S.reportValidity();
6854
6856
  }
6855
- }, C = {}, R = wa(o), F = Pi(o), P = R || F, z = (f || va(o)) && Fe(o.value) && Fe(m) || ds(o) && o.value === "" || m === "" || Array.isArray(m) && !m.length, M = ib.bind(null, g, r, C), O = (I, q, L, H = Zt.maxLength, te = Zt.minLength) => {
6857
+ }, C = {}, D = wa(o), F = Pi(o), P = D || F, z = (f || va(o)) && Fe(o.value) && Fe(m) || ds(o) && o.value === "" || m === "" || Array.isArray(m) && !m.length, M = ib.bind(null, g, r, C), O = (I, q, L, H = Zt.maxLength, te = Zt.minLength) => {
6856
6858
  const ue = I ? q : L;
6857
6859
  C[g] = {
6858
6860
  type: I ? H : te,
@@ -6861,7 +6863,7 @@ var _r = (e) => He(e) && !hs(e) ? e : {
6861
6863
  ...M(I ? H : te, ue)
6862
6864
  };
6863
6865
  };
6864
- if (s ? !Array.isArray(m) || !m.length : c && (!P && (z || bt(m)) || jt(m) && !m || F && !ud(a).isValid || R && !hd(a).isValid)) {
6866
+ if (s ? !Array.isArray(m) || !m.length : c && (!P && (z || bt(m)) || jt(m) && !m || F && !ud(a).isValid || D && !hd(a).isValid)) {
6865
6867
  const { value: I, message: q } = Ct(c) ? { value: !!c, message: c } : _r(c);
6866
6868
  if (I && (C[g] = {
6867
6869
  type: Zt.required,
@@ -6878,8 +6880,8 @@ var _r = (e) => He(e) && !hs(e) ? e : {
6878
6880
  const te = o.valueAsNumber || m && +m;
6879
6881
  bt(L.value) || (I = te > L.value), bt(H.value) || (q = te < H.value);
6880
6882
  } else {
6881
- const te = o.valueAsDate || new Date(m), ue = (ke) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ke), fe = o.type == "time", le = o.type == "week";
6882
- Ct(L.value) && m && (I = fe ? ue(m) > ue(L.value) : le ? m > L.value : te > new Date(L.value)), Ct(H.value) && m && (q = fe ? ue(m) < ue(H.value) : le ? m < H.value : te < new Date(H.value));
6883
+ const te = o.valueAsDate || new Date(m), ue = (ke) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ke), pe = o.type == "time", le = o.type == "week";
6884
+ Ct(L.value) && m && (I = pe ? ue(m) > ue(L.value) : le ? m > L.value : te > new Date(L.value)), Ct(H.value) && m && (q = pe ? ue(m) < ue(H.value) : le ? m < H.value : te < new Date(H.value));
6883
6885
  }
6884
6886
  if ((I || q) && (O(!!I, L.message, H.message, Zt.max, Zt.min), !r))
6885
6887
  return v(C[g].message), C;
@@ -6997,31 +6999,31 @@ function bb(e = {}) {
6997
6999
  });
6998
7000
  }
6999
7001
  }, v = (x, k) => {
7000
- !t.disabled && (w.isValidating || w.validatingFields || g.isValidating || g.validatingFields) && ((x || Array.from(a.mount)).forEach((D) => {
7001
- D && (k ? Pe(n.validatingFields, D, k) : nt(n.validatingFields, D));
7002
+ !t.disabled && (w.isValidating || w.validatingFields || g.isValidating || g.validatingFields) && ((x || Array.from(a.mount)).forEach((R) => {
7003
+ R && (k ? Pe(n.validatingFields, R, k) : nt(n.validatingFields, R));
7002
7004
  }), f.state.next({
7003
7005
  validatingFields: n.validatingFields,
7004
7006
  isValidating: !gt(n.validatingFields)
7005
7007
  }));
7006
7008
  }, C = () => {
7007
7009
  n.dirtyFields = Kn(i, s);
7008
- }, R = (x, k = [], D, U, B = !0, Z = !0) => {
7009
- if (U && D && !t.disabled) {
7010
+ }, D = (x, k = [], R, U, B = !0, Z = !0) => {
7011
+ if (U && R && !t.disabled) {
7010
7012
  if (o.action = !0, Z && Array.isArray(Y(r, x))) {
7011
- const $ = D(Y(r, x), U.argA, U.argB);
7013
+ const $ = R(Y(r, x), U.argA, U.argB);
7012
7014
  B && Pe(r, x, $);
7013
7015
  }
7014
7016
  if (Z && Array.isArray(Y(n.errors, x))) {
7015
- const $ = D(Y(n.errors, x), U.argA, U.argB);
7017
+ const $ = R(Y(n.errors, x), U.argA, U.argB);
7016
7018
  B && Pe(n.errors, x, $), mb(n.errors, x);
7017
7019
  }
7018
7020
  if ((w.touchedFields || g.touchedFields) && Z && Array.isArray(Y(n.touchedFields, x))) {
7019
- const $ = D(Y(n.touchedFields, x), U.argA, U.argB);
7021
+ const $ = R(Y(n.touchedFields, x), U.argA, U.argB);
7020
7022
  B && Pe(n.touchedFields, x, $);
7021
7023
  }
7022
7024
  (w.dirtyFields || g.dirtyFields) && C(), f.state.next({
7023
7025
  name: x,
7024
- isDirty: fe(x, k),
7026
+ isDirty: pe(x, k),
7025
7027
  dirtyFields: n.dirtyFields,
7026
7028
  errors: n.errors,
7027
7029
  isValid: n.isValid
@@ -7039,41 +7041,41 @@ function bb(e = {}) {
7039
7041
  });
7040
7042
  }, z = (x) => {
7041
7043
  const k = Mi(x) ? [x] : ks(x);
7042
- let D = s, U = i;
7044
+ let R = s, U = i;
7043
7045
  for (let B = 0; B < k.length - 1; B++) {
7044
7046
  const Z = k[B];
7045
- if (D = bt(D) ? D : D[Z], U = bt(U) ? U : U[Z], D === null && U !== null)
7047
+ if (R = bt(R) ? R : R[Z], U = bt(U) ? U : U[Z], R === null && U !== null)
7046
7048
  return !0;
7047
7049
  }
7048
7050
  return !1;
7049
- }, M = (x, k, D, U) => {
7051
+ }, M = (x, k, R, U) => {
7050
7052
  const B = Y(r, x);
7051
7053
  if (B) {
7052
7054
  if (z(x))
7053
7055
  return;
7054
- const Z = Fe(Y(s, x)), $ = Y(s, x, Fe(D) ? Y(i, x) : D);
7055
- Fe($) || U && U.defaultChecked || k ? Pe(s, x, k ? $ : ql(B._f)) : ne(x, $), o.mount && !o.action && (S(), Z && n.isDirty && (w.isDirty || g.isDirty) && (fe() || (n.isDirty = !1, f.state.next({ ...n }))), e.shouldUnregister && Z && !Fe(Y(s, x)) && Ks(x, a) && (o.watch = !0));
7056
+ const Z = Fe(Y(s, x)), $ = Y(s, x, Fe(R) ? Y(i, x) : R);
7057
+ Fe($) || U && U.defaultChecked || k ? Pe(s, x, k ? $ : ql(B._f)) : ne(x, $), o.mount && !o.action && (S(), Z && n.isDirty && (w.isDirty || g.isDirty) && (pe() || (n.isDirty = !1, f.state.next({ ...n }))), e.shouldUnregister && Z && !Fe(Y(s, x)) && Ks(x, a) && (o.watch = !0));
7056
7058
  }
7057
- }, O = (x, k, D, U, B) => {
7059
+ }, O = (x, k, R, U, B) => {
7058
7060
  let Z = !1, $ = !1;
7059
7061
  const ee = {
7060
7062
  name: x
7061
7063
  };
7062
7064
  if (!t.disabled) {
7063
- if (!D || U) {
7065
+ if (!R || U) {
7064
7066
  const de = Ht(Y(i, x), k);
7065
- (w.isDirty || g.isDirty) && ($ = n.isDirty, n.isDirty = ee.isDirty = !de || fe(), Z = $ !== ee.isDirty), $ = !!Y(n.dirtyFields, x), de !== n.isDirty ? n.dirtyFields = Kn(i, s) : de ? nt(n.dirtyFields, x) : Pe(n.dirtyFields, x, !0), ee.dirtyFields = n.dirtyFields, Z = Z || (w.dirtyFields || g.dirtyFields) && $ !== !de;
7067
+ (w.isDirty || g.isDirty) && ($ = n.isDirty, n.isDirty = ee.isDirty = !de || pe(), Z = $ !== ee.isDirty), $ = !!Y(n.dirtyFields, x), de !== n.isDirty ? n.dirtyFields = Kn(i, s) : de ? nt(n.dirtyFields, x) : Pe(n.dirtyFields, x, !0), ee.dirtyFields = n.dirtyFields, Z = Z || (w.dirtyFields || g.dirtyFields) && $ !== !de;
7066
7068
  }
7067
- if (D) {
7069
+ if (R) {
7068
7070
  const de = Y(n.touchedFields, x);
7069
- de || (Pe(n.touchedFields, x, D), ee.touchedFields = n.touchedFields, Z = Z || (w.touchedFields || g.touchedFields) && de !== D);
7071
+ de || (Pe(n.touchedFields, x, R), ee.touchedFields = n.touchedFields, Z = Z || (w.touchedFields || g.touchedFields) && de !== R);
7070
7072
  }
7071
7073
  Z && B && f.state.next(ee);
7072
7074
  }
7073
7075
  return Z ? ee : {};
7074
- }, I = (x, k, D, U) => {
7076
+ }, I = (x, k, R, U) => {
7075
7077
  const B = Y(n.errors, x), Z = (w.isValid || g.isValid) && jt(k) && n.isValid !== k;
7076
- if (t.delayError && D ? (c = m(() => F(x, D)), c(t.delayError)) : (clearTimeout(h), c = null, D ? Pe(n.errors, x, D) : nt(n.errors, x), n.errors = { ...n.errors }), (D ? !Ht(B, D) : B) || !gt(U) || Z) {
7078
+ if (t.delayError && R ? (c = m(() => F(x, R)), c(t.delayError)) : (clearTimeout(h), c = null, R ? Pe(n.errors, x, R) : nt(n.errors, x), n.errors = { ...n.errors }), (R ? !Ht(B, R) : B) || !gt(U) || Z) {
7077
7079
  const $ = {
7078
7080
  ...U,
7079
7081
  ...Z && jt(k) ? { isValid: k } : {},
@@ -7088,9 +7090,9 @@ function bb(e = {}) {
7088
7090
  }, q = async (x) => (v(x, !0), await t.resolver(s, t.context, cb(x || a.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), L = async (x) => {
7089
7091
  const { errors: k } = await q(x);
7090
7092
  if (v(x), x) {
7091
- for (const D of x) {
7092
- const U = Y(k, D);
7093
- U ? a.array.has(D) && He(U) && !Object.keys(U).some((B) => !Number.isNaN(Number(B))) ? zl(n.errors, { [D]: U }, D) : Pe(n.errors, D, U) : nt(n.errors, D);
7093
+ for (const R of x) {
7094
+ const U = Y(k, R);
7095
+ U ? a.array.has(R) && He(U) && !Object.keys(U).some((B) => !Number.isNaN(Number(B))) ? zl(n.errors, { [R]: U }, R) : Pe(n.errors, R, U) : nt(n.errors, R);
7094
7096
  }
7095
7097
  n.errors = { ...n.errors };
7096
7098
  } else
@@ -7098,33 +7100,33 @@ function bb(e = {}) {
7098
7100
  return k;
7099
7101
  }, H = async ({ name: x, eventType: k }) => {
7100
7102
  if (e.validate) {
7101
- const D = await e.validate({
7103
+ const R = await e.validate({
7102
7104
  formValues: s,
7103
7105
  formState: n,
7104
7106
  name: x,
7105
7107
  eventType: k
7106
7108
  });
7107
- if (He(D))
7108
- for (const U in D) {
7109
- const B = D[U];
7109
+ if (He(R))
7110
+ for (const U in R) {
7111
+ const B = R[U];
7110
7112
  B && ce(`${Ys}.${U}`, {
7111
7113
  message: Ct(B.message) ? B.message : "",
7112
7114
  type: B.type || Zt.validate
7113
7115
  });
7114
7116
  }
7115
- else Ct(D) || !D ? ce(Ys, {
7116
- message: D || "",
7117
+ else Ct(R) || !R ? ce(Ys, {
7118
+ message: R || "",
7117
7119
  type: Zt.validate
7118
7120
  }) : j(Ys);
7119
- return D;
7121
+ return R;
7120
7122
  }
7121
7123
  return !0;
7122
- }, te = async ({ fields: x, onlyCheckValid: k, name: D, eventType: U, context: B = {
7124
+ }, te = async ({ fields: x, onlyCheckValid: k, name: R, eventType: U, context: B = {
7123
7125
  valid: !0,
7124
7126
  runRootValidation: !1
7125
7127
  } }) => {
7126
7128
  if (e.validate && (B.runRootValidation = !0, !await H({
7127
- name: D,
7129
+ name: R,
7128
7130
  eventType: U
7129
7131
  }) && (B.valid = !1, k)))
7130
7132
  return B.valid;
@@ -7152,12 +7154,12 @@ function bb(e = {}) {
7152
7154
  }, ue = () => {
7153
7155
  for (const x of a.unMount) {
7154
7156
  const k = Y(r, x);
7155
- k && (k._f.refs ? k._f.refs.every((D) => !Gs(D)) : !Gs(k._f.ref)) && ae(x);
7157
+ k && (k._f.refs ? k._f.refs.every((R) => !Gs(R)) : !Gs(k._f.ref)) && ae(x);
7156
7158
  }
7157
7159
  a.unMount = /* @__PURE__ */ new Set();
7158
- }, fe = (x, k) => !t.disabled && (x && k && Pe(s, x, k), !Ht(o.mount ? s : i, i)), le = (x, k, D) => Io(x, a, {
7160
+ }, pe = (x, k) => !t.disabled && (x && k && Pe(s, x, k), !Ht(o.mount ? s : i, i)), le = (x, k, R) => Io(x, a, {
7159
7161
  ...o.mount ? s : Fe(k) ? i : Ct(x) ? { [x]: k } : k
7160
- }, D, k), ke = (x) => od(Y(o.mount ? s : i, x, t.shouldUnregister ? Y(i, x, []) : [])), ne = (x, k, D = {}, U = !1, B = !1) => {
7162
+ }, R, k), ke = (x) => od(Y(o.mount ? s : i, x, t.shouldUnregister ? Y(i, x, []) : [])), ne = (x, k, R = {}, U = !1, B = !1) => {
7161
7163
  const Z = Y(r, x);
7162
7164
  let $ = k;
7163
7165
  if (Z) {
@@ -7169,28 +7171,28 @@ function bb(e = {}) {
7169
7171
  values: U ? s : Qe(s)
7170
7172
  })));
7171
7173
  }
7172
- (D.shouldDirty || D.shouldTouch) && O(x, $, D.shouldTouch, D.shouldDirty, !B), D.shouldValidate && Ue(x);
7173
- }, Be = (x, k, D, U = !1, B = !1) => {
7174
+ (R.shouldDirty || R.shouldTouch) && O(x, $, R.shouldTouch, R.shouldDirty, !B), R.shouldValidate && Ue(x);
7175
+ }, Be = (x, k, R, U = !1, B = !1) => {
7174
7176
  for (const Z in k) {
7175
7177
  if (!k.hasOwnProperty(Z))
7176
7178
  return;
7177
7179
  const $ = k[Z], ee = x + "." + Z, de = Y(r, ee);
7178
- (a.array.has(x) || He($) || de && !de._f) && !er($) ? Be(ee, $, D, U, B) : ne(ee, $, D, U, B);
7180
+ (a.array.has(x) || He($) || de && !de._f) && !er($) ? Be(ee, $, R, U, B) : ne(ee, $, R, U, B);
7179
7181
  }
7180
- }, Le = (x, k, D, U, B = !1) => {
7182
+ }, Le = (x, k, R, U, B = !1) => {
7181
7183
  const Z = Y(r, x), $ = a.array.has(x), ee = U ? k : Qe(k), de = Y(s, x), Te = Ht(de, ee);
7182
7184
  if (Te || Pe(s, x, ee), $)
7183
7185
  f.array.next({
7184
7186
  name: x,
7185
7187
  values: U ? s : Qe(s)
7186
- }), (w.isDirty || w.dirtyFields || g.isDirty || g.dirtyFields) && D.shouldDirty && (C(), B || f.state.next({
7188
+ }), (w.isDirty || w.dirtyFields || g.isDirty || g.dirtyFields) && R.shouldDirty && (C(), B || f.state.next({
7187
7189
  name: x,
7188
7190
  dirtyFields: n.dirtyFields,
7189
- isDirty: fe(x, ee)
7191
+ isDirty: pe(x, ee)
7190
7192
  }));
7191
7193
  else {
7192
7194
  const ft = Array.isArray(ee) && !ee.length || gt(ee);
7193
- !Z || Z._f || bt(ee) || ft ? ne(x, ee, D, U, B) : Be(x, ee, D, U, B);
7195
+ !Z || Z._f || bt(ee) || ft ? ne(x, ee, R, U, B) : Be(x, ee, R, U, B);
7194
7196
  }
7195
7197
  if (!Te && !B) {
7196
7198
  const ft = Ks(x, a), mn = U ? s : Qe(s);
@@ -7200,15 +7202,15 @@ function bb(e = {}) {
7200
7202
  values: mn
7201
7203
  });
7202
7204
  }
7203
- }, qe = (x, k, D = {}) => Le(x, k, D, !1), Ze = (x, k = {}) => {
7204
- const D = xt(x) ? x(s) : x;
7205
- if (!Ht(s, D)) {
7205
+ }, qe = (x, k, R = {}) => Le(x, k, R, !1), Ze = (x, k = {}) => {
7206
+ const R = xt(x) ? x(s) : x;
7207
+ if (!Ht(s, R)) {
7206
7208
  s = {
7207
7209
  ...s,
7208
- ...D
7210
+ ...R
7209
7211
  };
7210
7212
  for (const U of a.mount)
7211
- Le(U, Y(D, U), k, !0, !0);
7213
+ Le(U, Y(R, U), k, !0, !0);
7212
7214
  f.state.next({
7213
7215
  ...n,
7214
7216
  name: void 0,
@@ -7219,71 +7221,71 @@ function bb(e = {}) {
7219
7221
  }, X = async (x) => {
7220
7222
  o.mount = !0;
7221
7223
  const k = x.target;
7222
- let D = k.name, U = !0;
7223
- const B = Y(r, D), Z = ($) => {
7224
- U = Number.isNaN($) || er($) && isNaN($.getTime()) || Ht($, Y(s, D, $));
7224
+ let R = k.name, U = !0;
7225
+ const B = Y(r, R), Z = ($) => {
7226
+ U = Number.isNaN($) || er($) && isNaN($.getTime()) || Ht($, Y(s, R, $));
7225
7227
  };
7226
7228
  if (B) {
7227
7229
  let $, ee;
7228
- const de = k.type ? ql(B._f) : qo(x), Te = x.type === Nn.BLUR || x.type === Nn.FOCUS_OUT, ft = !db(B._f) && !e.validate && !t.resolver && !Y(n.errors, D) && !B._f.deps, mn = ft || pb(Te, Y(n.touchedFields, D), n.isSubmitted, y, u), $t = Ks(D, a, Te);
7229
- Pe(s, D, de), Te ? (!k || !k.readOnly) && (B._f.onBlur && B._f.onBlur(x), c && c(0)) : B._f.onChange && B._f.onChange(x);
7230
- const gn = O(D, de, Te), Fi = !gt(gn) || $t;
7230
+ const de = k.type ? ql(B._f) : qo(x), Te = x.type === Nn.BLUR || x.type === Nn.FOCUS_OUT, ft = !db(B._f) && !e.validate && !t.resolver && !Y(n.errors, R) && !B._f.deps, mn = ft || pb(Te, Y(n.touchedFields, R), n.isSubmitted, y, u), $t = Ks(R, a, Te);
7231
+ Pe(s, R, de), Te ? (!k || !k.readOnly) && (B._f.onBlur && B._f.onBlur(x), c && c(0)) : B._f.onChange && B._f.onChange(x);
7232
+ const gn = O(R, de, Te), Fi = !gt(gn) || $t;
7231
7233
  if (!Te && f.state.next({
7232
- name: D,
7234
+ name: R,
7233
7235
  type: x.type,
7234
7236
  ...d ? { values: Qe(s) } : {}
7235
7237
  }), mn)
7236
- return (!ft || !n.isValid) && (w.isValid || g.isValid) && (t.mode === "onBlur" ? Te && S() : Te || S()), Fi && f.state.next({ name: D, ...$t ? {} : gn });
7238
+ return (!ft || !n.isValid) && (w.isValid || g.isValid) && (t.mode === "onBlur" ? Te && S() : Te || S()), Fi && f.state.next({ name: R, ...$t ? {} : gn });
7237
7239
  if (!t.resolver && e.validate && await H({
7238
- name: D,
7240
+ name: R,
7239
7241
  eventType: x.type
7240
7242
  }), !Te && $t && f.state.next({ ...n }), t.resolver) {
7241
- const { errors: $n } = await q([D]);
7242
- if (v([D]), Z(de), !U) {
7243
+ const { errors: $n } = await q([R]);
7244
+ if (v([R]), Z(de), !U) {
7243
7245
  !gt(gn) && f.state.next(gn);
7244
7246
  return;
7245
7247
  }
7246
- const gr = Fl(n.errors, r, D), Ft = Fl($n, r, gr.name || D);
7247
- $ = Ft.error, D = Ft.name, ee = gt($n);
7248
+ const gr = Fl(n.errors, r, R), Ft = Fl($n, r, gr.name || R);
7249
+ $ = Ft.error, R = Ft.name, ee = gt($n);
7248
7250
  } else
7249
- v([D], !0), $ = (await Bl(B, a.disabled, s, b, t.shouldUseNativeValidation))[D], v([D]), Z(de), U && ($ ? ee = !1 : (w.isValid || g.isValid) && (ee = await te({
7251
+ v([R], !0), $ = (await Bl(B, a.disabled, s, b, t.shouldUseNativeValidation))[R], v([R]), Z(de), U && ($ ? ee = !1 : (w.isValid || g.isValid) && (ee = await te({
7250
7252
  fields: r,
7251
7253
  onlyCheckValid: !0,
7252
- name: D,
7254
+ name: R,
7253
7255
  eventType: x.type
7254
7256
  })));
7255
- U && (B._f.deps && (!Array.isArray(B._f.deps) || B._f.deps.length > 0) && Ue(B._f.deps), I(D, ee, $, gn));
7257
+ U && (B._f.deps && (!Array.isArray(B._f.deps) || B._f.deps.length > 0) && Ue(B._f.deps), I(R, ee, $, gn));
7256
7258
  }
7257
7259
  }, we = (x, k) => {
7258
7260
  if (Y(n.errors, k) && x.focus)
7259
7261
  return x.focus(), 1;
7260
7262
  }, Ue = async (x, k = {}) => {
7261
- let D, U;
7263
+ let R, U;
7262
7264
  const B = ns(x);
7263
7265
  if (t.resolver) {
7264
7266
  const Z = await L(Fe(x) ? x : B);
7265
- D = gt(Z), U = x ? !B.some(($) => Y(Z, $)) : D;
7267
+ R = gt(Z), U = x ? !B.some(($) => Y(Z, $)) : R;
7266
7268
  } else x ? (U = (await Promise.all(B.map(async (Z) => {
7267
7269
  const $ = Y(r, Z);
7268
7270
  return await te({
7269
7271
  fields: $ && $._f ? { [Z]: $ } : $,
7270
7272
  eventType: Nn.TRIGGER
7271
7273
  });
7272
- }))).every(Boolean), !(!U && !n.isValid) && S()) : U = D = await te({
7274
+ }))).every(Boolean), !(!U && !n.isValid) && S()) : U = R = await te({
7273
7275
  fields: r,
7274
7276
  name: x,
7275
7277
  eventType: Nn.TRIGGER
7276
7278
  });
7277
7279
  return f.state.next({
7278
- ...!Ct(x) || (w.isValid || g.isValid) && D !== n.isValid ? {} : { name: x },
7279
- ...t.resolver || !x ? { isValid: D } : {},
7280
+ ...!Ct(x) || (w.isValid || g.isValid) && R !== n.isValid ? {} : { name: x },
7281
+ ...t.resolver || !x ? { isValid: R } : {},
7280
7282
  errors: n.errors
7281
7283
  }), k.shouldFocus && !U && ci(r, we, x ? B : a.mount), U;
7282
7284
  }, V = (x, k) => {
7283
- let D = {
7285
+ let R = {
7284
7286
  ...o.mount ? s : i
7285
7287
  };
7286
- return k && (D = ad(k.dirtyFields ? n.dirtyFields : n.touchedFields, D)), Fe(x) ? D : Ct(x) ? Y(D, x) : x.map((U) => Y(D, U));
7288
+ return k && (R = ad(k.dirtyFields ? n.dirtyFields : n.touchedFields, R)), Fe(x) ? R : Ct(x) ? Y(R, x) : x.map((U) => Y(R, U));
7287
7289
  }, _e = (x, k) => ({
7288
7290
  invalid: !!Y((k || n).errors, x),
7289
7291
  isDirty: !!Y((k || n).dirtyFields, x),
@@ -7292,15 +7294,15 @@ function bb(e = {}) {
7292
7294
  isTouched: !!Y((k || n).touchedFields, x)
7293
7295
  }), j = (x) => {
7294
7296
  const k = x ? ns(x) : void 0;
7295
- k == null || k.forEach((D) => nt(n.errors, D)), k ? k.forEach((D) => {
7297
+ k == null || k.forEach((R) => nt(n.errors, R)), k ? k.forEach((R) => {
7296
7298
  f.state.next({
7297
- name: D,
7299
+ name: R,
7298
7300
  errors: n.errors
7299
7301
  });
7300
7302
  }) : f.state.next({
7301
7303
  errors: {}
7302
7304
  });
7303
- }, ce = (x, k, D) => {
7305
+ }, ce = (x, k, R) => {
7304
7306
  const U = (Y(r, x, { _f: {} })._f || {}).ref, B = Y(n.errors, x) || {}, { ref: Z, message: $, type: ee, ...de } = B;
7305
7307
  Pe(n.errors, x, {
7306
7308
  ...de,
@@ -7310,25 +7312,25 @@ function bb(e = {}) {
7310
7312
  name: x,
7311
7313
  errors: n.errors,
7312
7314
  isValid: !1
7313
- }), D && D.shouldFocus && U && U.focus && U.focus();
7315
+ }), R && R.shouldFocus && U && U.focus && U.focus();
7314
7316
  }, Se = (x, k) => {
7315
7317
  if (xt(x)) {
7316
7318
  d++;
7317
- const { unsubscribe: D } = f.state.subscribe({
7319
+ const { unsubscribe: R } = f.state.subscribe({
7318
7320
  next: (B) => "values" in B && x(B.values || le(void 0, k), B)
7319
7321
  });
7320
7322
  let U = !1;
7321
7323
  return {
7322
7324
  unsubscribe: () => {
7323
- U || (U = !0, d--, D());
7325
+ U || (U = !0, d--, R());
7324
7326
  }
7325
7327
  };
7326
7328
  }
7327
7329
  return le(x, k, !0);
7328
7330
  }, Ye = (x) => {
7329
7331
  var k;
7330
- const D = !!(!((k = x.formState) === null || k === void 0) && k.values);
7331
- D && d++;
7332
+ const R = !!(!((k = x.formState) === null || k === void 0) && k.values);
7333
+ R && d++;
7332
7334
  const { unsubscribe: U } = f.state.subscribe({
7333
7335
  next: (Z) => {
7334
7336
  if (fb(x.name, Z.name, x.exact) && hb(Z, x.formState || w, Yr, x.reRenderRoot)) {
@@ -7342,7 +7344,7 @@ function bb(e = {}) {
7342
7344
  }
7343
7345
  }
7344
7346
  });
7345
- if (!D)
7347
+ if (!R)
7346
7348
  return U;
7347
7349
  let B = !1;
7348
7350
  return () => {
@@ -7358,13 +7360,13 @@ function bb(e = {}) {
7358
7360
  ...x.formState
7359
7361
  }
7360
7362
  })), ae = (x, k = {}) => {
7361
- for (const D of x ? ns(x) : a.mount)
7362
- a.mount.delete(D), a.array.delete(D), k.keepValue || (nt(r, D), nt(s, D)), !k.keepError && nt(n.errors, D), !k.keepDirty && nt(n.dirtyFields, D), !k.keepTouched && nt(n.touchedFields, D), !k.keepIsValidating && nt(n.validatingFields, D), !t.shouldUnregister && !k.keepDefaultValue && nt(i, D);
7363
+ for (const R of x ? ns(x) : a.mount)
7364
+ a.mount.delete(R), a.array.delete(R), k.keepValue || (nt(r, R), nt(s, R)), !k.keepError && nt(n.errors, R), !k.keepDirty && nt(n.dirtyFields, R), !k.keepTouched && nt(n.touchedFields, R), !k.keepIsValidating && nt(n.validatingFields, R), !t.shouldUnregister && !k.keepDefaultValue && nt(i, R);
7363
7365
  f.state.next({
7364
7366
  values: Qe(s)
7365
7367
  }), f.state.next({
7366
7368
  ...n,
7367
- ...k.keepDirty ? { isDirty: fe() } : {}
7369
+ ...k.keepDirty ? { isDirty: pe() } : {}
7368
7370
  }), !k.keepIsValid && S();
7369
7371
  }, ze = ({ disabled: x, name: k }) => {
7370
7372
  if (jt(x) && o.mount || x || a.disabled.has(k)) {
@@ -7372,17 +7374,17 @@ function bb(e = {}) {
7372
7374
  x ? a.disabled.add(k) : a.disabled.delete(k), B && o.mount && !o.action && S();
7373
7375
  }
7374
7376
  }, Ie = (x, k = {}) => {
7375
- let D = Y(r, x);
7376
- const U = jt(k.disabled) || jt(t.disabled), B = !a.registerName.has(x) && D && D._f && !D._f.mount;
7377
+ let R = Y(r, x);
7378
+ const U = jt(k.disabled) || jt(t.disabled), B = !a.registerName.has(x) && R && R._f && !R._f.mount;
7377
7379
  return Pe(r, x, {
7378
- ...D || {},
7380
+ ...R || {},
7379
7381
  _f: {
7380
- ...D && D._f ? D._f : { ref: { name: x } },
7382
+ ...R && R._f ? R._f : { ref: { name: x } },
7381
7383
  name: x,
7382
7384
  mount: !0,
7383
7385
  ...k
7384
7386
  }
7385
- }), a.mount.add(x), D && !B ? ze({
7387
+ }), a.mount.add(x), R && !B ? ze({
7386
7388
  disabled: jt(k.disabled) ? k.disabled : t.disabled,
7387
7389
  name: x
7388
7390
  }) : M(x, !0, k.value), {
@@ -7400,13 +7402,13 @@ function bb(e = {}) {
7400
7402
  onBlur: X,
7401
7403
  ref: (Z) => {
7402
7404
  if (Z) {
7403
- a.registerName.add(x), Ie(x, k), a.registerName.delete(x), D = Y(r, x);
7404
- const $ = Fe(Z.value) && Z.querySelectorAll && Z.querySelectorAll("input,select,textarea")[0] || Z, ee = sb($), de = D._f.refs || [];
7405
- if (ee ? de.find((Te) => Te === $) : $ === D._f.ref)
7405
+ a.registerName.add(x), Ie(x, k), a.registerName.delete(x), R = Y(r, x);
7406
+ const $ = Fe(Z.value) && Z.querySelectorAll && Z.querySelectorAll("input,select,textarea")[0] || Z, ee = sb($), de = R._f.refs || [];
7407
+ if (ee ? de.find((Te) => Te === $) : $ === R._f.ref)
7406
7408
  return;
7407
7409
  Pe(r, x, {
7408
7410
  _f: {
7409
- ...D._f,
7411
+ ...R._f,
7410
7412
  ...ee ? {
7411
7413
  refs: [
7412
7414
  ...de.filter(Gs),
@@ -7418,19 +7420,19 @@ function bb(e = {}) {
7418
7420
  }
7419
7421
  }), M(x, !1, void 0, $);
7420
7422
  } else
7421
- D = Y(r, x, {}), D._f && (D._f.mount = !1), (t.shouldUnregister || k.shouldUnregister) && !(ed(a.array, x) && o.action) && a.unMount.add(x);
7423
+ R = Y(r, x, {}), R._f && (R._f.mount = !1), (t.shouldUnregister || k.shouldUnregister) && !(ed(a.array, x) && o.action) && a.unMount.add(x);
7422
7424
  }
7423
7425
  };
7424
7426
  }, ot = () => t.shouldFocusError && !t.shouldUseNativeValidation && ci(r, we, a.mount), Gt = (x) => {
7425
- jt(x) && (f.state.next({ disabled: x }), ci(r, (k, D) => {
7426
- const U = Y(r, D);
7427
+ jt(x) && (f.state.next({ disabled: x }), ci(r, (k, R) => {
7428
+ const U = Y(r, R);
7427
7429
  U && (k.disabled = U._f.disabled || x, Array.isArray(U._f.refs) && U._f.refs.forEach((B) => {
7428
7430
  B.disabled = U._f.disabled || x;
7429
7431
  }));
7430
7432
  }, 0, !1));
7431
- }, et = (x, k) => async (D) => {
7433
+ }, et = (x, k) => async (R) => {
7432
7434
  let U;
7433
- D && (D.preventDefault && D.preventDefault(), D.persist && D.persist());
7435
+ R && (R.preventDefault && R.preventDefault(), R.persist && R.persist());
7434
7436
  let B = Qe(s);
7435
7437
  if (f.state.next({
7436
7438
  isSubmitting: !0
@@ -7450,12 +7452,12 @@ function bb(e = {}) {
7450
7452
  errors: {}
7451
7453
  });
7452
7454
  try {
7453
- await x(B, D);
7455
+ await x(B, R);
7454
7456
  } catch (Z) {
7455
7457
  U = Z;
7456
7458
  }
7457
7459
  } else
7458
- k && await k({ ...n.errors }, D), ot(), setTimeout(ot);
7460
+ k && await k({ ...n.errors }, R), ot(), setTimeout(ot);
7459
7461
  if (f.state.next({
7460
7462
  isSubmitted: !0,
7461
7463
  isSubmitting: !1,
@@ -7465,10 +7467,10 @@ function bb(e = {}) {
7465
7467
  }), U)
7466
7468
  throw U;
7467
7469
  }, Et = (x, k = {}) => {
7468
- Y(r, x) && (Fe(k.defaultValue) ? qe(x, Qe(Y(i, x))) : (qe(x, k.defaultValue), Pe(i, x, Qe(k.defaultValue))), k.keepTouched || nt(n.touchedFields, x), k.keepDirty || (nt(n.dirtyFields, x), n.isDirty = k.defaultValue ? fe(x, Qe(Y(i, x))) : fe()), k.keepError || (nt(n.errors, x), w.isValid && S()), f.state.next({ ...n }));
7470
+ Y(r, x) && (Fe(k.defaultValue) ? qe(x, Qe(Y(i, x))) : (qe(x, k.defaultValue), Pe(i, x, Qe(k.defaultValue))), k.keepTouched || nt(n.touchedFields, x), k.keepDirty || (nt(n.dirtyFields, x), n.isDirty = k.defaultValue ? pe(x, Qe(Y(i, x))) : pe()), k.keepError || (nt(n.errors, x), w.isValid && S()), f.state.next({ ...n }));
7469
7471
  }, je = (x, k = {}) => {
7470
- const D = x ? Qe(x) : i, U = Qe(D), B = gt(x), Z = U;
7471
- if (k.keepDefaultValues || (i = D), !k.keepValues) {
7472
+ const R = x ? Qe(x) : i, U = Qe(R), B = gt(x), Z = U;
7473
+ if (k.keepDefaultValues || (i = R), !k.keepValues) {
7472
7474
  if (k.keepDirtyValues) {
7473
7475
  const $ = /* @__PURE__ */ new Set([
7474
7476
  ...a.mount,
@@ -7522,7 +7524,7 @@ function bb(e = {}) {
7522
7524
  focus: ""
7523
7525
  }, o.mount = !w.isValid || !!k.keepIsValid || !!k.keepDirtyValues || !t.shouldUnregister && !gt(Z), o.watch = !!t.shouldUnregister, o.keepIsValid = !!k.keepIsValid, o.action = !1, k.keepErrors || (n.errors = {}), f.state.next({
7524
7526
  submitCount: k.keepSubmitCount ? n.submitCount : 0,
7525
- isDirty: B ? !1 : k.keepDirty ? n.isDirty : k.keepValues ? fe() : !!(k.keepDefaultValues && !Ht(x, i)),
7527
+ isDirty: B ? !1 : k.keepDirty ? n.isDirty : k.keepValues ? pe() : !!(k.keepDefaultValues && !Ht(x, i)),
7526
7528
  isSubmitted: k.keepIsSubmitted ? n.isSubmitted : !1,
7527
7529
  dirtyFields: B ? {} : k.keepDirtyValues ? k.keepDefaultValues && s ? Kn(i, s) : n.dirtyFields : k.keepDefaultValues && x ? Kn(i, x) : k.keepDirty ? n.dirtyFields : {},
7528
7530
  touchedFields: k.keepTouched ? n.touchedFields : {},
@@ -7532,7 +7534,7 @@ function bb(e = {}) {
7532
7534
  defaultValues: i
7533
7535
  });
7534
7536
  }, It = (x, k) => je(xt(x) ? x(s) : x, { ...t.resetOptions, ...k }), Kt = (x, k = {}) => {
7535
- const D = Y(r, x), U = D && D._f;
7537
+ const R = Y(r, x), U = R && R._f;
7536
7538
  if (U) {
7537
7539
  const B = U.refs ? U.refs[0] : U.ref;
7538
7540
  B.focus && setTimeout(() => {
@@ -7556,9 +7558,9 @@ function bb(e = {}) {
7556
7558
  _updateIsValidating: v,
7557
7559
  _focusError: ot,
7558
7560
  _getWatch: le,
7559
- _getDirty: fe,
7561
+ _getDirty: pe,
7560
7562
  _setValid: S,
7561
- _setFieldArray: R,
7563
+ _setFieldArray: D,
7562
7564
  _setDisabledField: ze,
7563
7565
  _setErrors: P,
7564
7566
  _getFieldArray: ke,
@@ -7618,8 +7620,8 @@ function bb(e = {}) {
7618
7620
  resetField: Et,
7619
7621
  resetDefaultValues: (x, k = {}) => {
7620
7622
  if (i = Qe(x), !k.keepDirty) {
7621
- const D = Kn(i, s);
7622
- n.dirtyFields = D, n.isDirty = !gt(D);
7623
+ const R = Kn(i, s);
7624
+ n.dirtyFields = R, n.isDirty = !gt(R);
7623
7625
  }
7624
7626
  k.keepIsValid || S(), f.state.next({
7625
7627
  ...n,
@@ -7771,7 +7773,7 @@ const vb = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
7771
7773
  dangerouslySetInnerHTML: { __html: o }
7772
7774
  }
7773
7775
  );
7774
- }, py = "_select_11l2a_1", my = "_textarea_11l2a_1", gy = "_input_11l2a_1", by = "_form_11l2a_37", yy = "_field_11l2a_43", vy = "_fieldFull_11l2a_48", wy = "_label_11l2a_52", _y = "_required_11l2a_61", Sy = "_inputError_11l2a_91", xy = "_error_11l2a_96", Cy = "_checkboxRow_11l2a_102", Ty = "_checkbox_11l2a_102", Ey = "_checkboxLabel_11l2a_139", Ay = "_chips_11l2a_146", ky = "_chip_11l2a_146", Ry = "_chipLabel_11l2a_179", Dy = "_chipRemove_11l2a_184", Ny = "_chipsInput_11l2a_203", Oy = "_emptyMessage_11l2a_218", Me = {
7776
+ }, py = "_select_143bx_1", my = "_textarea_143bx_1", gy = "_input_143bx_1", by = "_form_143bx_37", yy = "_field_143bx_43", vy = "_fieldFull_143bx_48", wy = "_label_143bx_52", _y = "_required_143bx_61", Sy = "_inputError_143bx_91", xy = "_error_143bx_96", Cy = "_checkboxRow_143bx_102", Ty = "_checkbox_143bx_102", Ey = "_checkboxLabel_143bx_139", Ay = "_chips_143bx_146", ky = "_chip_143bx_146", Ry = "_chipLabel_143bx_179", Dy = "_chipRemove_143bx_184", Ny = "_chipsInput_143bx_203", Oy = "_emptyMessage_143bx_218", Me = {
7775
7777
  select: py,
7776
7778
  textarea: my,
7777
7779
  input: gy,
@@ -7900,7 +7902,7 @@ function Hy(e) {
7900
7902
  }
7901
7903
  function $l({ tab: e, mediaType: t, createdBy: n, cloudStorageUrls: r, selectedUrl: i, onSelectedChange: s }) {
7902
7904
  const [o, a] = oe([]), [c, h] = oe(0), [d, u] = oe(0), [y, p] = oe(""), [w, g] = oe(!1), f = Ge(0), b = xe(async (S, v, C) => {
7903
- const R = ++f.current;
7905
+ const D = ++f.current;
7904
7906
  g(!0);
7905
7907
  try {
7906
7908
  const { items: F, count: P } = await Ly({
@@ -7910,10 +7912,10 @@ function $l({ tab: e, mediaType: t, createdBy: n, cloudStorageUrls: r, selectedU
7910
7912
  offset: S,
7911
7913
  createdBy: e === "my" ? n : void 0
7912
7914
  });
7913
- if (R !== f.current) return;
7915
+ if (D !== f.current) return;
7914
7916
  a((z) => C ? F : [...z, ...F]), h(P), u(S);
7915
7917
  } finally {
7916
- R === f.current && g(!1);
7918
+ D === f.current && g(!1);
7917
7919
  }
7918
7920
  }, [e, n, t]);
7919
7921
  Ce(() => {
@@ -8096,7 +8098,7 @@ function $y({ mediaType: e, channel: t, createdBy: n, presignedHeaders: r, cloud
8096
8098
  /* @__PURE__ */ E("div", { style: {
8097
8099
  borderTop: "1px solid var(--sb-border)",
8098
8100
  paddingTop: 12,
8099
- fontFamily: 'var(--sb-font, "Plus Jakarta Sans", system-ui, sans-serif)'
8101
+ fontFamily: 'var(--sb-font, "Rubik", system-ui, sans-serif)'
8100
8102
  }, children: [
8101
8103
  /* @__PURE__ */ E("p", { style: { fontWeight: 700, fontSize: "12px", color: "#1a1a1a", margin: "0 0 5px", lineHeight: 1.4 }, children: [
8102
8104
  "Copyright & License",
@@ -8111,12 +8113,12 @@ function Rs({ onSelect: e, onClose: t, mediaType: n = "image", preserveAbsoluteU
8111
8113
  var v;
8112
8114
  const [i, s] = oe("my"), [o, a] = oe(null), [c, h] = oe(void 0), d = Ge(null), u = re((C) => C.editorConfig), y = (u == null ? void 0 : u.context.channel) ?? "", p = Ai(u == null ? void 0 : u.context), w = r ? [] : (u == null ? void 0 : u.context.cloudStorageUrls) ?? [], g = ((v = u == null ? void 0 : u.context.cloudStorage) == null ? void 0 : v.presigned_headers) ?? {}, f = (C) => {
8113
8115
  s(C), a(null), h(void 0);
8114
- }, b = (C, R) => {
8115
- a(C), h(R);
8116
+ }, b = (C, D) => {
8117
+ a(C), h(D);
8116
8118
  };
8117
8119
  Ce(() => {
8118
- const C = (R) => {
8119
- R.key === "Escape" && t();
8120
+ const C = (D) => {
8121
+ D.key === "Escape" && t();
8120
8122
  };
8121
8123
  return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
8122
8124
  }, [t]);
@@ -8242,7 +8244,7 @@ function Rs({ onSelect: e, onClose: t, mediaType: n = "image", preserveAbsoluteU
8242
8244
  createdBy: p,
8243
8245
  presignedHeaders: g,
8244
8246
  cloudStorageUrls: w,
8245
- onUploaded: (C, R) => e(C, R),
8247
+ onUploaded: (C, D) => e(C, D),
8246
8248
  triggerRef: d
8247
8249
  }
8248
8250
  )
@@ -8521,27 +8523,27 @@ function gd() {
8521
8523
  const K = n.createElement("template");
8522
8524
  K.content && K.content.ownerDocument && (n = K.content.ownerDocument);
8523
8525
  }
8524
- let R, F = "", P, z = !1, M = 0;
8526
+ let D, F = "", P, z = !1, M = 0;
8525
8527
  const O = function() {
8526
8528
  if (M > 0)
8527
8529
  throw Wn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
8528
8530
  }, I = function(_) {
8529
8531
  O(), M++;
8530
8532
  try {
8531
- return R.createHTML(_);
8533
+ return D.createHTML(_);
8532
8534
  } finally {
8533
8535
  M--;
8534
8536
  }
8535
8537
  }, q = function(_) {
8536
8538
  O(), M++;
8537
8539
  try {
8538
- return R.createScriptURL(_);
8540
+ return D.createScriptURL(_);
8539
8541
  } finally {
8540
8542
  M--;
8541
8543
  }
8542
8544
  }, L = function() {
8543
8545
  return z || (P = Cv(u, i), z = !0), P;
8544
- }, H = n, te = H.implementation, ue = H.createNodeIterator, fe = H.createDocumentFragment, le = H.getElementsByTagName, ke = r.importNode;
8546
+ }, H = n, te = H.implementation, ue = H.createNodeIterator, pe = H.createDocumentFragment, le = H.getElementsByTagName, ke = r.importNode;
8545
8547
  let ne = sc();
8546
8548
  t.isSupported = typeof pd == "function" && typeof b == "function" && te && te.createHTMLDocument !== void 0;
8547
8549
  const Be = dv, Le = hv, qe = fv, Ze = pv, X = mv, we = gv, Ue = bv, V = vv;
@@ -8583,7 +8585,7 @@ function gd() {
8583
8585
  value: null
8584
8586
  }
8585
8587
  }));
8586
- let ot = !0, Gt = !0, et = !1, Et = !0, je = !1, It = !0, Kt = !1, Yr = !1, qi = null, Ii = null, mr = !1, x = !1, k = !1, D = !1, U = !0, B = !1;
8588
+ let ot = !0, Gt = !0, et = !1, Et = !0, je = !1, It = !0, Kt = !1, Yr = !1, qi = null, Ii = null, mr = !1, x = !1, k = !1, R = !1, U = !0, B = !1;
8587
8589
  const Z = "user-content-";
8588
8590
  let $ = !0, ee = !1, de = {}, Te = null;
8589
8591
  const ft = Re({}, [
@@ -8661,21 +8663,21 @@ function gd() {
8661
8663
  transform: $e
8662
8664
  }), ze = Tn(_, "FORBID_ATTR", kt({}), {
8663
8665
  transform: $e
8664
- }), de = ut(_, "USE_PROFILES") ? _.USE_PROFILES && typeof _.USE_PROFILES == "object" ? kt(_.USE_PROFILES) : _.USE_PROFILES : !1, ot = _.ALLOW_ARIA_ATTR !== !1, Gt = _.ALLOW_DATA_ATTR !== !1, et = _.ALLOW_UNKNOWN_PROTOCOLS || !1, Et = _.ALLOW_SELF_CLOSE_IN_ATTR !== !1, je = _.SAFE_FOR_TEMPLATES || !1, It = _.SAFE_FOR_XML !== !1, Kt = _.WHOLE_DOCUMENT || !1, x = _.RETURN_DOM || !1, k = _.RETURN_DOM_FRAGMENT || !1, D = _.RETURN_TRUSTED_TYPE || !1, mr = _.FORCE_BODY || !1, U = _.SANITIZE_DOM !== !1, B = _.SANITIZE_NAMED_PROPS || !1, $ = _.KEEP_CONTENT !== !1, ee = _.IN_PLACE || !1, _e = lv(_.ALLOWED_URI_REGEXP) ? _.ALLOWED_URI_REGEXP : rc, br = typeof _.NAMESPACE == "string" ? _.NAMESPACE : Ft, Os = ut(_, "MATHML_TEXT_INTEGRATION_POINTS") && _.MATHML_TEXT_INTEGRATION_POINTS && typeof _.MATHML_TEXT_INTEGRATION_POINTS == "object" ? kt(_.MATHML_TEXT_INTEGRATION_POINTS) : Re({}, ka), Ls = ut(_, "HTML_INTEGRATION_POINTS") && _.HTML_INTEGRATION_POINTS && typeof _.HTML_INTEGRATION_POINTS == "object" ? kt(_.HTML_INTEGRATION_POINTS) : Re({}, Ra);
8666
+ }), de = ut(_, "USE_PROFILES") ? _.USE_PROFILES && typeof _.USE_PROFILES == "object" ? kt(_.USE_PROFILES) : _.USE_PROFILES : !1, ot = _.ALLOW_ARIA_ATTR !== !1, Gt = _.ALLOW_DATA_ATTR !== !1, et = _.ALLOW_UNKNOWN_PROTOCOLS || !1, Et = _.ALLOW_SELF_CLOSE_IN_ATTR !== !1, je = _.SAFE_FOR_TEMPLATES || !1, It = _.SAFE_FOR_XML !== !1, Kt = _.WHOLE_DOCUMENT || !1, x = _.RETURN_DOM || !1, k = _.RETURN_DOM_FRAGMENT || !1, R = _.RETURN_TRUSTED_TYPE || !1, mr = _.FORCE_BODY || !1, U = _.SANITIZE_DOM !== !1, B = _.SANITIZE_NAMED_PROPS || !1, $ = _.KEEP_CONTENT !== !1, ee = _.IN_PLACE || !1, _e = lv(_.ALLOWED_URI_REGEXP) ? _.ALLOWED_URI_REGEXP : rc, br = typeof _.NAMESPACE == "string" ? _.NAMESPACE : Ft, Os = ut(_, "MATHML_TEXT_INTEGRATION_POINTS") && _.MATHML_TEXT_INTEGRATION_POINTS && typeof _.MATHML_TEXT_INTEGRATION_POINTS == "object" ? kt(_.MATHML_TEXT_INTEGRATION_POINTS) : Re({}, ka), Ls = ut(_, "HTML_INTEGRATION_POINTS") && _.HTML_INTEGRATION_POINTS && typeof _.HTML_INTEGRATION_POINTS == "object" ? kt(_.HTML_INTEGRATION_POINTS) : Re({}, Ra);
8665
8667
  const N = ut(_, "CUSTOM_ELEMENT_HANDLING") && _.CUSTOM_ELEMENT_HANDLING && typeof _.CUSTOM_ELEMENT_HANDLING == "object" ? kt(_.CUSTOM_ELEMENT_HANDLING) : Cr(null);
8666
8668
  if (ye = Cr(null), ut(N, "tagNameCheck") && Da(N.tagNameCheck) && (ye.tagNameCheck = N.tagNameCheck), ut(N, "attributeNameCheck") && Da(N.attributeNameCheck) && (ye.attributeNameCheck = N.attributeNameCheck), ut(N, "allowCustomizedBuiltInElements") && typeof N.allowCustomizedBuiltInElements == "boolean" && (ye.allowCustomizedBuiltInElements = N.allowCustomizedBuiltInElements), wt(ye), je && (Gt = !1), k && (x = !0), de && (j = Re({}, ec), Se = Cr(null), de.html === !0 && (Re(j, Zl), Re(Se, tc)), de.svg === !0 && (Re(j, Js), Re(Se, to), Re(Se, Wi)), de.svgFilters === !0 && (Re(j, Zs), Re(Se, to), Re(Se, Wi)), de.mathMl === !0 && (Re(j, eo), Re(Se, nc), Re(Se, Wi))), Ie.tagCheck = null, Ie.attributeCheck = null, ut(_, "ADD_TAGS") && (typeof _.ADD_TAGS == "function" ? Ie.tagCheck = _.ADD_TAGS : Ln(_.ADD_TAGS) && (j === ce && (j = kt(j)), Re(j, _.ADD_TAGS, $e))), ut(_, "ADD_ATTR") && (typeof _.ADD_ATTR == "function" ? Ie.attributeCheck = _.ADD_ATTR : Ln(_.ADD_ATTR) && (Se === Ye && (Se = kt(Se)), Re(Se, _.ADD_ATTR, $e))), ut(_, "ADD_URI_SAFE_ATTR") && Ln(_.ADD_URI_SAFE_ATTR) && Re(gn, _.ADD_URI_SAFE_ATTR, $e), ut(_, "FORBID_CONTENTS") && Ln(_.FORBID_CONTENTS) && (Te === ft && (Te = kt(Te)), Re(Te, _.FORBID_CONTENTS, $e)), ut(_, "ADD_FORBID_CONTENTS") && Ln(_.ADD_FORBID_CONTENTS) && (Te === ft && (Te = kt(Te)), Re(Te, _.ADD_FORBID_CONTENTS, $e)), $ && (j["#text"] = !0), Kt && Re(j, ["html", "head", "body"]), j.table && (Re(j, ["tbody"]), delete ae.tbody), _.TRUSTED_TYPES_POLICY) {
8667
8669
  if (typeof _.TRUSTED_TYPES_POLICY.createHTML != "function")
8668
8670
  throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
8669
8671
  if (typeof _.TRUSTED_TYPES_POLICY.createScriptURL != "function")
8670
8672
  throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
8671
- const G = R;
8672
- R = _.TRUSTED_TYPES_POLICY;
8673
+ const G = D;
8674
+ D = _.TRUSTED_TYPES_POLICY;
8673
8675
  try {
8674
8676
  F = I("");
8675
8677
  } catch (se) {
8676
- throw R = G, se;
8678
+ throw D = G, se;
8677
8679
  }
8678
- } else _.TRUSTED_TYPES_POLICY === null ? (R = void 0, F = "") : (R === void 0 && (R = L()), R && typeof F == "string" && (F = I("")));
8680
+ } else _.TRUSTED_TYPES_POLICY === null ? (D = void 0, F = "") : (D === void 0 && (D = L()), D && typeof F == "string" && (F = I("")));
8679
8681
  vt && vt(_), yr = _;
8680
8682
  }, Na = Re({}, [...Js, ...Zs, ...cv]), Oa = Re({}, [...eo, ...uv]), Pd = function(_, N, G) {
8681
8683
  return N.namespaceURI === Ft ? _ === "svg" : N.namespaceURI === $n ? _ === "svg" && (G === "annotation-xml" || Os[G]) : !!Na[_];
@@ -8777,7 +8779,7 @@ function gd() {
8777
8779
  G = De && De[0];
8778
8780
  }
8779
8781
  Xr === "application/xhtml+xml" && br === Ft && (_ = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + _ + "</body></html>");
8780
- const se = R ? I(_) : _;
8782
+ const se = D ? I(_) : _;
8781
8783
  if (br === Ft)
8782
8784
  try {
8783
8785
  N = new d().parseFromString(se, Xr);
@@ -8934,7 +8936,7 @@ function gd() {
8934
8936
  }, jd = Re({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Fa = function(_) {
8935
8937
  return !jd[si(_)] && mt(V, _);
8936
8938
  }, Hd = function(_, N, G, se) {
8937
- if (R && typeof u == "object" && typeof u.getAttributeType == "function" && !G)
8939
+ if (D && typeof u == "object" && typeof u.getAttributeType == "function" && !G)
8938
8940
  switch (u.getAttributeType(_, N)) {
8939
8941
  case "TrustedHTML":
8940
8942
  return I(se);
@@ -9066,9 +9068,9 @@ function gd() {
9066
9068
  else {
9067
9069
  if (!x && !je && !Kt && // eslint-disable-next-line unicorn/prefer-includes
9068
9070
  K.indexOf("<") === -1)
9069
- return R && D ? I(K) : K;
9071
+ return D && R ? I(K) : K;
9070
9072
  if (N = Pa(K), !N)
9071
- return x ? null : D ? F : "";
9073
+ return x ? null : R ? F : "";
9072
9074
  }
9073
9075
  N && mr && Sn(N.firstChild);
9074
9076
  const ct = Ma(De ? K : N);
@@ -9084,7 +9086,7 @@ function gd() {
9084
9086
  }), je && Ms(K), K;
9085
9087
  if (x) {
9086
9088
  if (je && Ms(N), k)
9087
- for (ve = fe.call(N.ownerDocument); N.firstChild; )
9089
+ for (ve = pe.call(N.ownerDocument); N.firstChild; )
9088
9090
  ve.appendChild(N.firstChild);
9089
9091
  else
9090
9092
  ve = N;
@@ -9092,12 +9094,12 @@ function gd() {
9092
9094
  }
9093
9095
  let tt = Kt ? N.outerHTML : N.innerHTML;
9094
9096
  return Kt && j["!doctype"] && N.ownerDocument && N.ownerDocument.doctype && N.ownerDocument.doctype.name && mt(yv, N.ownerDocument.doctype.name) && (tt = "<!DOCTYPE " + N.ownerDocument.doctype.name + `>
9095
- ` + tt), je && (tt = zi(tt)), R && D ? I(tt) : tt;
9097
+ ` + tt), je && (tt = zi(tt)), D && R ? I(tt) : tt;
9096
9098
  }, t.setConfig = function() {
9097
9099
  let K = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9098
9100
  Ps(K), Yr = !0, qi = j, Ii = Se;
9099
9101
  }, t.clearConfig = function() {
9100
- yr = null, Yr = !1, qi = null, Ii = null, R = P, F = "";
9102
+ yr = null, Yr = !1, qi = null, Ii = null, D = P, F = "";
9101
9103
  }, t.isValidAttribute = function(K, _, N) {
9102
9104
  yr || Ps({});
9103
9105
  const G = $e(K), se = $e(_);
@@ -9579,7 +9581,7 @@ const oi = ({
9579
9581
  "aria-label": "Metadata form",
9580
9582
  onSubmit: (m) => m.preventDefault(),
9581
9583
  children: a.map((m) => {
9582
- const S = `smf-${m.code}`, v = h[m.code], C = i || !m.editable, R = yd(m), F = m.code === "showTimer", P = ["textarea", "richtext", "keywords", "time", "appIcon"].includes(m.inputType ?? "") || m.span === "full" || F || m.code === "maxQuestions", z = [Me.field, P ? Me.fieldFull : ""].filter(Boolean).join(" "), M = F || m.inputType === "checkbox";
9584
+ const S = `smf-${m.code}`, v = h[m.code], C = i || !m.editable, D = yd(m), F = m.code === "showTimer", P = ["textarea", "richtext", "keywords", "time", "appIcon"].includes(m.inputType ?? "") || m.span === "full" || F || m.code === "maxQuestions", z = [Me.field, P ? Me.fieldFull : ""].filter(Boolean).join(" "), M = F || m.inputType === "checkbox";
9583
9585
  return /* @__PURE__ */ E("div", { className: z, children: [
9584
9586
  F && /* @__PURE__ */ l("div", { style: { gridColumn: "1 / -1", borderTop: "1px solid var(--sb-border)", margin: "8px 0 4px" } }),
9585
9587
  !M && /* @__PURE__ */ E("label", { className: Me.label, htmlFor: S, children: [
@@ -9594,7 +9596,7 @@ const oi = ({
9594
9596
  {
9595
9597
  name: m.code,
9596
9598
  control: c,
9597
- rules: { validate: R },
9599
+ rules: { validate: D },
9598
9600
  render: ({ field: O }) => {
9599
9601
  const I = m.inputType ?? "text";
9600
9602
  if (I === "richtext")
@@ -9640,8 +9642,8 @@ const oi = ({
9640
9642
  className: `${Me.select} ${v ? Me.inputError : ""}`,
9641
9643
  value: L,
9642
9644
  onChange: (te) => {
9643
- const ue = te.target.value, fe = m.code === "maxQuestions" && ue !== "" ? Number(ue) : ue;
9644
- O.onChange(fe), n(m.code, fe), b(m.code);
9645
+ const ue = te.target.value, pe = m.code === "maxQuestions" && ue !== "" ? Number(ue) : ue;
9646
+ O.onChange(pe), n(m.code, pe), b(m.code);
9645
9647
  },
9646
9648
  onBlur: O.onBlur,
9647
9649
  disabled: C,
@@ -9797,7 +9799,7 @@ const oi = ({
9797
9799
  function vd() {
9798
9800
  const { save: e } = ga(), t = Nt((r) => r.setMissingFieldGroups);
9799
9801
  return xe(async () => {
9800
- const { rootFormConfig: r, unitFormConfig: i } = re.getState(), { treeData: s, treeCache: o } = pe.getState(), a = (f) => ({ ...f.metadata ?? {}, ...o[f.id] ?? {} }), c = {
9802
+ const { rootFormConfig: r, unitFormConfig: i } = re.getState(), { treeData: s, treeCache: o } = fe.getState(), a = (f) => ({ ...f.metadata ?? {}, ...o[f.id] ?? {} }), c = {
9801
9803
  "Audience & Curriculum": Mt("ui.audience", "Audience & Curriculum"),
9802
9804
  Behaviour: Mt("ui.behaviour", "Behaviour")
9803
9805
  }, h = Mt("ui.details", "Details"), d = [], u = /* @__PURE__ */ new Map(), y = (f, b, m) => {
@@ -9823,8 +9825,8 @@ function vd() {
9823
9825
  }
9824
9826
  function no(e) {
9825
9827
  var n;
9826
- const t = (n = pe.getState().treeData[0]) == null ? void 0 : n.identifier;
9827
- t && pe.getState().hydrateNodeMeta(t, { status: e });
9828
+ const t = (n = fe.getState().treeData[0]) == null ? void 0 : n.identifier;
9829
+ t && fe.getState().hydrateNodeMeta(t, { status: e });
9828
9830
  }
9829
9831
  function qv(e) {
9830
9832
  const t = re((i) => i.editorConfig), n = re((i) => i.setButtonLoader);
@@ -9857,15 +9859,15 @@ function qv(e) {
9857
9859
  [t, e, n]
9858
9860
  ) };
9859
9861
  }
9860
- const Iv = "_button_eq1k2_1", Fv = "_buttonContent_eq1k2_104", zv = "_spinnerWrapper_eq1k2_115", En = {
9862
+ const Iv = "_button_1iui0_1", Fv = "_buttonContent_1iui0_104", zv = "_spinnerWrapper_1iui0_115", En = {
9861
9863
  button: Iv,
9862
- "button--sm": "_button--sm_eq1k2_34",
9863
- "button--md": "_button--md_eq1k2_40",
9864
- "button--primary": "_button--primary_eq1k2_46",
9865
- "button--ghost": "_button--ghost_eq1k2_60",
9866
- "button--outline": "_button--outline_eq1k2_73",
9867
- "button--danger": "_button--danger_eq1k2_86",
9868
- "button--loading": "_button--loading_eq1k2_99",
9864
+ "button--sm": "_button--sm_1iui0_34",
9865
+ "button--md": "_button--md_1iui0_40",
9866
+ "button--primary": "_button--primary_1iui0_46",
9867
+ "button--ghost": "_button--ghost_1iui0_60",
9868
+ "button--outline": "_button--outline_1iui0_73",
9869
+ "button--danger": "_button--danger_1iui0_86",
9870
+ "button--loading": "_button--loading_1iui0_99",
9869
9871
  buttonContent: Fv,
9870
9872
  spinnerWrapper: zv
9871
9873
  }, Uv = "_spinner_ag091_9", Bv = "_spinner__ring_ag091_15", ro = {
@@ -10049,18 +10051,18 @@ const Wv = Sa("Smartphone", [
10049
10051
  const _d = Sa("X", [
10050
10052
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
10051
10053
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
10052
- ]), Gv = "_overlay_dz5ra_1", Kv = "_overlayClosing_dz5ra_27", Yv = "_card_dz5ra_39", Xv = "_header_dz5ra_91", Jv = "_title_dz5ra_100", Zv = "_closeButton_dz5ra_108", ew = "_body_dz5ra_132", tw = "_footer_dz5ra_149", An = {
10054
+ ]), Gv = "_overlay_1vdl3_1", Kv = "_overlayClosing_1vdl3_27", Yv = "_card_1vdl3_39", Xv = "_header_1vdl3_91", Jv = "_title_1vdl3_100", Zv = "_closeButton_1vdl3_108", ew = "_body_1vdl3_132", tw = "_footer_1vdl3_149", An = {
10053
10055
  overlay: Gv,
10054
- "sbx-overlay-in": "_sbx-overlay-in_dz5ra_1",
10056
+ "sbx-overlay-in": "_sbx-overlay-in_1vdl3_1",
10055
10057
  overlayClosing: Kv,
10056
- "sbx-overlay-out": "_sbx-overlay-out_dz5ra_1",
10058
+ "sbx-overlay-out": "_sbx-overlay-out_1vdl3_1",
10057
10059
  card: Yv,
10058
- "sbx-card-in": "_sbx-card-in_dz5ra_1",
10059
- "card--sm": "_card--sm_dz5ra_70",
10060
- "card--md": "_card--md_dz5ra_74",
10061
- "card--lg": "_card--lg_dz5ra_78",
10062
- "card--xl": "_card--xl_dz5ra_82",
10063
- "card--full": "_card--full_dz5ra_86",
10060
+ "sbx-card-in": "_sbx-card-in_1vdl3_1",
10061
+ "card--sm": "_card--sm_1vdl3_70",
10062
+ "card--md": "_card--md_1vdl3_74",
10063
+ "card--lg": "_card--lg_1vdl3_78",
10064
+ "card--xl": "_card--xl_1vdl3_82",
10065
+ "card--full": "_card--full_1vdl3_86",
10064
10066
  header: Xv,
10065
10067
  title: Jv,
10066
10068
  closeButton: Zv,
@@ -10158,7 +10160,7 @@ function Ve() {
10158
10160
  const e = re((t) => t.labels);
10159
10161
  return (t, n) => oa(e, t, n);
10160
10162
  }
10161
- const nw = "_root_11x2q_1", rw = "_intro_11x2q_7", iw = "_checklist_11x2q_14", sw = "_item_11x2q_23", ow = "_itemLabel_11x2q_28", aw = "_checkbox_11x2q_45", lw = "_customCheck_11x2q_56", cw = "_customCheckChecked_11x2q_86", uw = "_itemText_11x2q_94", on = {
10163
+ const nw = "_root_4ufih_1", rw = "_intro_4ufih_7", iw = "_checklist_4ufih_14", sw = "_item_4ufih_23", ow = "_itemLabel_4ufih_28", aw = "_checkbox_4ufih_45", lw = "_customCheck_4ufih_56", cw = "_customCheckChecked_4ufih_86", uw = "_itemText_4ufih_94", on = {
10162
10164
  root: nw,
10163
10165
  intro: rw,
10164
10166
  checklist: iw,
@@ -10243,8 +10245,8 @@ const nw = "_root_11x2q_1", rw = "_intro_11x2q_7", iw = "_checklist_11x2q_14", s
10243
10245
  const i = t === "approve", [s, o] = oe(""), [a, c] = oe(""), [h, d] = oe(""), [u, y] = oe(""), p = i ? "Quality Review" : "Reject Content", w = i ? "Approve" : "Reject", g = i ? "primary" : "danger", f = () => {
10244
10246
  let C = !0;
10245
10247
  if (i && s !== "") {
10246
- const R = Number(s);
10247
- !Number.isFinite(R) || R < 0 || R > 100 ? (d("Score must be a number between 0 and 100."), C = !1) : d("");
10248
+ const D = Number(s);
10249
+ !Number.isFinite(D) || D < 0 || D > 100 ? (d("Score must be a number between 0 and 100."), C = !1) : d("");
10248
10250
  } else
10249
10251
  d("");
10250
10252
  return !i && a.trim() === "" ? (y("A comment is required when rejecting content."), C = !1) : y(""), C;
@@ -10307,7 +10309,7 @@ const nw = "_root_11x2q_1", rw = "_intro_11x2q_7", iw = "_checklist_11x2q_14", s
10307
10309
  u && /* @__PURE__ */ l("p", { id: "quality-comment-error", className: Ot.errorText, role: "alert", children: u })
10308
10310
  ] })
10309
10311
  ] }) });
10310
- }, Sw = "_reviewBtns_13yv6_116", xw = "_sourcingBtns_13yv6_125", Cw = "_topbarWrapper_13yv6_185", Tw = "_sbOverlay_13yv6_194", Ew = "_sbModal_13yv6_204", Aw = "_sbModalHeader_13yv6_216", kw = "_sbModalTitle_13yv6_225", Rw = "_sbModalClose_13yv6_232", Dw = "_sbModalBody_13yv6_248", Nw = "_sbModalFooter_13yv6_256", Ow = "_sbLabel_13yv6_266", Lw = "_sbTextarea_13yv6_273", Pw = "_sbError_13yv6_294", rt = {
10312
+ }, Sw = "_reviewBtns_12c05_116", xw = "_sourcingBtns_12c05_125", Cw = "_topbarWrapper_12c05_185", Tw = "_sbOverlay_12c05_194", Ew = "_sbModal_12c05_204", Aw = "_sbModalHeader_12c05_216", kw = "_sbModalTitle_12c05_225", Rw = "_sbModalClose_12c05_232", Dw = "_sbModalBody_12c05_248", Nw = "_sbModalFooter_12c05_256", Ow = "_sbLabel_12c05_266", Lw = "_sbTextarea_12c05_273", Pw = "_sbError_12c05_294", rt = {
10311
10313
  reviewBtns: Sw,
10312
10314
  sourcingBtns: xw,
10313
10315
  topbarWrapper: Cw,
@@ -10473,12 +10475,12 @@ const lc = ({
10473
10475
  onToolbarEvent: o
10474
10476
  }) => {
10475
10477
  var Le, qe, Ze;
10476
- const a = re((X) => X.reviewComments), c = re((X) => X.labels), h = (X, we) => oa(c, X, we), u = pe((X) => X.treeData)[0], y = (u == null ? void 0 : u.name) ?? "Untitled", p = Mw(((Le = u == null ? void 0 : u.metadata) == null ? void 0 : Le.status) ?? (u == null ? void 0 : u.status)), w = re(
10478
+ const a = re((X) => X.reviewComments), c = re((X) => X.labels), h = (X, we) => oa(c, X, we), u = fe((X) => X.treeData)[0], y = (u == null ? void 0 : u.name) ?? "Untitled", p = Mw(((Le = u == null ? void 0 : u.metadata) == null ? void 0 : Le.status) ?? (u == null ? void 0 : u.status)), w = re(
10477
10479
  (X) => {
10478
10480
  var we, Ue, V, _e;
10479
10481
  return ((Ue = (we = X.editorConfig) == null ? void 0 : we.context) == null ? void 0 : Ue.contentId) ?? ((_e = (V = X.editorConfig) == null ? void 0 : V.context) == null ? void 0 : _e.identifier) ?? "";
10480
10482
  }
10481
- ), g = re((X) => X.buttonLoaders), { activeModal: f, modalData: b, closeModal: m, openModal: S } = Nt(), [v, C] = oe(!1), [R, F] = oe(!1), [P, z] = oe(!1), M = re((X) => X.editorConfig), O = t === "edit", I = t === "review" || t === "orgreview", q = t === "sourcingreview", L = (t === "orgreview" || t === "sourcingreview") && !!((qe = M == null ? void 0 : M.context) != null && qe.enableReviewEdit), H = !!((Ze = M == null ? void 0 : M.config) != null && Ze.hideSubmitForReviewBtn), [te, ue] = oe(!1), fe = O ? a.filter((X) => X.text.trim()) : [], le = xe(
10483
+ ), g = re((X) => X.buttonLoaders), { activeModal: f, modalData: b, closeModal: m, openModal: S } = Nt(), [v, C] = oe(!1), [D, F] = oe(!1), [P, z] = oe(!1), M = re((X) => X.editorConfig), O = t === "edit", I = t === "review" || t === "orgreview", q = t === "sourcingreview", L = (t === "orgreview" || t === "sourcingreview") && !!((qe = M == null ? void 0 : M.context) != null && qe.enableReviewEdit), H = !!((Ze = M == null ? void 0 : M.config) != null && Ze.hideSubmitForReviewBtn), [te, ue] = oe(!1), pe = O ? a.filter((X) => X.text.trim()) : [], le = xe(
10482
10484
  (X, we) => {
10483
10485
  o({ action: X, data: we });
10484
10486
  },
@@ -10539,7 +10541,7 @@ const lc = ({
10539
10541
  ]
10540
10542
  }
10541
10543
  ) : null,
10542
- fe.length > 0 && /* @__PURE__ */ E(
10544
+ pe.length > 0 && /* @__PURE__ */ E(
10543
10545
  "button",
10544
10546
  {
10545
10547
  className: "ce-btn ghost",
@@ -10708,7 +10710,7 @@ const lc = ({
10708
10710
  }
10709
10711
  )
10710
10712
  ] }),
10711
- /* @__PURE__ */ l("div", { style: { padding: "0 24px 24px", overflow: "auto", display: "flex", flexDirection: "column", gap: 12 }, children: fe.map((X) => /* @__PURE__ */ E("div", { style: { background: "var(--sb-bg-warm)", border: "1px solid var(--sb-border-soft)", borderRadius: 12, padding: "12px 16px" }, children: [
10713
+ /* @__PURE__ */ l("div", { style: { padding: "0 24px 24px", overflow: "auto", display: "flex", flexDirection: "column", gap: 12 }, children: pe.map((X) => /* @__PURE__ */ E("div", { style: { background: "var(--sb-bg-warm)", border: "1px solid var(--sb-border-soft)", borderRadius: 12, padding: "12px 16px" }, children: [
10712
10714
  /* @__PURE__ */ E("p", { style: { fontSize: 14.5, color: "var(--sb-text-2)", lineHeight: 1.6, margin: 0 }, children: [
10713
10715
  "“",
10714
10716
  X.text,
@@ -10747,7 +10749,7 @@ const lc = ({
10747
10749
  onCancel: () => C(!1)
10748
10750
  }
10749
10751
  ),
10750
- R && /* @__PURE__ */ l(
10752
+ D && /* @__PURE__ */ l(
10751
10753
  lc,
10752
10754
  {
10753
10755
  titleText: "Reject Question Set",
@@ -11313,29 +11315,29 @@ const n0 = (e) => {
11313
11315
  onPreview: y
11314
11316
  }) => {
11315
11317
  var z, M, O;
11316
- const p = Ve(), w = Br(e), g = w === "root", f = w === "section", b = w === "question", m = e.id === t, S = n.has(e.id), v = (((z = e.children) == null ? void 0 : z.length) ?? 0) > 0, C = r === e.id, R = (g || f) && v;
11318
+ const p = Ve(), w = Br(e), g = w === "root", f = w === "section", b = w === "question", m = e.id === t, S = n.has(e.id), v = (((z = e.children) == null ? void 0 : z.length) ?? 0) > 0, C = r === e.id, D = (g || f) && v;
11317
11319
  return /* @__PURE__ */ E(ht, { children: [
11318
11320
  /* @__PURE__ */ E(
11319
11321
  "div",
11320
11322
  {
11321
11323
  className: `ce-node ${g ? "set" : f ? "section" : "question"}${m ? " active" : ""}`,
11322
11324
  onClick: () => {
11323
- s(e.id), R && o(e.id);
11325
+ s(e.id), D && o(e.id);
11324
11326
  },
11325
11327
  "aria-selected": m,
11326
11328
  role: "treeitem",
11327
11329
  tabIndex: 0,
11328
- "aria-expanded": R ? S : void 0,
11330
+ "aria-expanded": D ? S : void 0,
11329
11331
  onKeyDown: (I) => {
11330
- (I.key === "Enter" || I.key === " ") && (I.preventDefault(), s(e.id), R && o(e.id));
11332
+ (I.key === "Enter" || I.key === " ") && (I.preventDefault(), s(e.id), D && o(e.id));
11331
11333
  },
11332
11334
  children: [
11333
11335
  /* @__PURE__ */ l(
11334
11336
  "span",
11335
11337
  {
11336
- className: `twist${R ? S ? " open" : " closed" : " leaf"}`,
11338
+ className: `twist${D ? S ? " open" : " closed" : " leaf"}`,
11337
11339
  onClick: (I) => {
11338
- I.stopPropagation(), R && o(e.id);
11340
+ I.stopPropagation(), D && o(e.id);
11339
11341
  },
11340
11342
  children: /* @__PURE__ */ l(W, { name: "caret", size: 13 })
11341
11343
  }
@@ -11388,7 +11390,7 @@ const n0 = (e) => {
11388
11390
  ]
11389
11391
  }
11390
11392
  ),
11391
- R && S && /* @__PURE__ */ l("div", { className: "ce-children", role: "group", children: e.children.map((I) => /* @__PURE__ */ l(
11393
+ D && S && /* @__PURE__ */ l("div", { className: "ce-children", role: "group", children: e.children.map((I) => /* @__PURE__ */ l(
11392
11394
  xd,
11393
11395
  {
11394
11396
  node: I,
@@ -11410,8 +11412,8 @@ const n0 = (e) => {
11410
11412
  ] });
11411
11413
  }, i0 = ({ onCollapse: e }) => {
11412
11414
  var M;
11413
- const t = Ve(), n = pe((O) => O.treeData), r = pe((O) => O.selectedNodeId), i = pe((O) => O.selectNode), s = pe((O) => O.addNode);
11414
- pe((O) => O.deleteNode);
11415
+ const t = Ve(), n = fe((O) => O.treeData), r = fe((O) => O.selectedNodeId), i = fe((O) => O.selectNode), s = fe((O) => O.addNode);
11416
+ fe((O) => O.deleteNode);
11415
11417
  const o = re((O) => O.editorMode), { openModal: a } = Nt(), c = vd(), h = o === "edit", [d, u] = oe(() => {
11416
11418
  const O = /* @__PURE__ */ new Set();
11417
11419
  function I(q) {
@@ -11431,14 +11433,15 @@ const n0 = (e) => {
11431
11433
  }, [i]), f = xe(async (O) => {
11432
11434
  await c() && s(O, "section");
11433
11435
  }, [s, c]), b = xe(async (O) => {
11436
+ const I = fe.getState().selectedNodeId === O;
11434
11437
  if (!await c()) return;
11435
- const I = pe.getState().selectedNodeId ?? O;
11436
- a("questionTypeSelector", { parentId: I });
11438
+ const q = I ? fe.getState().selectedNodeId ?? O : O;
11439
+ a("questionTypeSelector", { parentId: q });
11437
11440
  }, [a, c]), m = xe((O) => {
11438
11441
  a("confirmDelete", { nodeId: O });
11439
11442
  }, [a]), S = xe((O) => {
11440
11443
  re.getState().setShowPreview(!0, O);
11441
- }, []), v = (M = n[0]) == null ? void 0 : M.id, C = r ? pe.getState().getNodeById(r) : null, R = C ? Br(C) : null, F = R === "section" || R === "question", P = R === "section" ? r : R === "question" ? (C == null ? void 0 : C.parent) ?? null : null, z = !P;
11444
+ }, []), v = (M = n[0]) == null ? void 0 : M.id, C = r ? fe.getState().getNodeById(r) : null, D = C ? Br(C) : null, F = D === "section" || D === "question", P = D === "section" ? r : null, z = !P;
11442
11445
  return /* @__PURE__ */ E(ht, { children: [
11443
11446
  /* @__PURE__ */ E("div", { className: "ce-tree-head", children: [
11444
11447
  /* @__PURE__ */ l("span", { className: "lbl", children: t("ui.hierarchy", "Hierarchy") }),
@@ -11497,7 +11500,7 @@ async function uc(e) {
11497
11500
  }
11498
11501
  function Cd() {
11499
11502
  var u, y, p, w;
11500
- const e = re((g) => g.editorConfig), t = pe((g) => {
11503
+ const e = re((g) => g.editorConfig), t = fe((g) => {
11501
11504
  var f;
11502
11505
  return (f = g.treeData[0]) == null ? void 0 : f.metadata;
11503
11506
  }), n = t != null && t.framework ? [t.framework] : (u = e == null ? void 0 : e.context) != null && u.framework ? [e.context.framework] : ((y = e == null ? void 0 : e.config) == null ? void 0 : y.framework) ?? [], r = (t == null ? void 0 : t.targetFWIds) ?? ((p = e == null ? void 0 : e.context) == null ? void 0 : p.targetFWIds) ?? ((w = e == null ? void 0 : e.config) == null ? void 0 : w.targetFWIds) ?? [], i = n[0] ?? "", s = Zc({
@@ -11515,7 +11518,7 @@ function Cd() {
11515
11518
  }).map((g) => g.data), c = a.filter(Boolean), h = a.map((g) => (g == null ? void 0 : g.identifier) ?? "").join(","), d = hr(() => {
11516
11519
  const g = /* @__PURE__ */ new Map(), f = (b) => {
11517
11520
  for (const m of (b == null ? void 0 : b.categories) ?? []) {
11518
- const S = g.get(m.code) ?? [], v = new Set(S.map((R) => R.identifier)), C = [...S, ...(m.terms ?? []).filter((R) => !v.has(R.identifier))];
11521
+ const S = g.get(m.code) ?? [], v = new Set(S.map((D) => D.identifier)), C = [...S, ...(m.terms ?? []).filter((D) => !v.has(D.identifier))];
11519
11522
  g.set(m.code, C);
11520
11523
  }
11521
11524
  };
@@ -11715,7 +11718,7 @@ function m0(e) {
11715
11718
  };
11716
11719
  }
11717
11720
  function g0() {
11718
- const e = pe((a) => a.selectedNodeId), t = re((a) => a.isCurrentNodeQuestion), n = re((a) => a.editorMode), r = re((a) => a.questionFormConfig), i = hr(
11721
+ const e = fe((a) => a.selectedNodeId), t = re((a) => a.isCurrentNodeQuestion), n = re((a) => a.editorMode), r = re((a) => a.questionFormConfig), i = hr(
11719
11722
  () => (r ?? []).map((a) => a.code).filter(Boolean),
11720
11723
  [r]
11721
11724
  ), s = !!e && t && e.startsWith("do_"), o = Zc({
@@ -11730,11 +11733,11 @@ function g0() {
11730
11733
  var c;
11731
11734
  if (!o.error || !s) return;
11732
11735
  pi(Es(o.error, Mt("messages.error.001", "Failed to load the question.")));
11733
- const a = (c = pe.getState().treeData[0]) == null ? void 0 : c.id;
11734
- a && pe.getState().selectNode(a);
11736
+ const a = (c = fe.getState().treeData[0]) == null ? void 0 : c.id;
11737
+ a && fe.getState().selectNode(a);
11735
11738
  }, [o.error, s]), Ce(() => {
11736
11739
  const a = o.data;
11737
- !a || !e || a.identifier === e && (pe.getState().hydrateNodeMeta(e, a), !be.getState().isDirty && be.getState().setActiveQuestion(m0(a)));
11740
+ !a || !e || a.identifier === e && (fe.getState().hydrateNodeMeta(e, a), !be.getState().isDirty && be.getState().setActiveQuestion(m0(a)));
11738
11741
  }, [o.data, e]), { isFetching: o.isFetching, error: o.error };
11739
11742
  }
11740
11743
  const b0 = ys(() => Promise.resolve().then(() => Ca)), y0 = ({
@@ -11745,7 +11748,7 @@ const b0 = ys(() => Promise.resolve().then(() => Ca)), y0 = ({
11745
11748
  isLoading: i = !1
11746
11749
  }) => {
11747
11750
  var d, u;
11748
- const s = pe((y) => {
11751
+ const s = fe((y) => {
11749
11752
  var p;
11750
11753
  return ((p = y.treeData[0]) == null ? void 0 : p.identifier) ?? "";
11751
11754
  }), o = Ve(), [a, c] = oe(!1), h = !!(((d = e.metadata) == null ? void 0 : d.body) ?? ((u = e.metadata) == null ? void 0 : u.editorState));
@@ -11837,17 +11840,17 @@ const C0 = ({
11837
11840
  hasContent: n = !0
11838
11841
  }) => {
11839
11842
  var Ue;
11840
- const { frameworkTerms: r } = Cd(), i = Ve(), { isFetching: s } = g0(), o = re((V) => V.editorMode), a = re((V) => V.showPreview), c = re((V) => V.previewQuestionId), h = re((V) => V.isCurrentNodeRoot), d = re((V) => V.isCurrentNodeFolder), u = re((V) => V.isCurrentNodeQuestion), y = re((V) => V.rootFormConfig), p = re((V) => V.unitFormConfig), w = re((V) => V.relationalFormConfig), g = re((V) => V.questionFormConfig), f = pe((V) => V.selectedNodeId), b = pe((V) => V.activeNodeMeta), m = pe((V) => V.breadcrumb), S = pe((V) => V.updateNode), v = pe((V) => V.selectNode), { openModal: C, pendingEditorOpen: R, setPendingEditorOpen: F } = Nt(), P = e ?? o, z = (Ue = re.getState().editorConfig) == null ? void 0 : Ue.context, M = !hu(P, z), [O, I] = oe("details"), [q, L] = oe(!1), H = Nt((V) => V.setQuestionEditorOpen);
11843
+ const { frameworkTerms: r } = Cd(), i = Ve(), { isFetching: s } = g0(), o = re((V) => V.editorMode), a = re((V) => V.showPreview), c = re((V) => V.previewQuestionId), h = re((V) => V.isCurrentNodeRoot), d = re((V) => V.isCurrentNodeFolder), u = re((V) => V.isCurrentNodeQuestion), y = re((V) => V.rootFormConfig), p = re((V) => V.unitFormConfig), w = re((V) => V.relationalFormConfig), g = re((V) => V.questionFormConfig), f = fe((V) => V.selectedNodeId), b = fe((V) => V.activeNodeMeta), m = fe((V) => V.breadcrumb), S = fe((V) => V.updateNode), v = fe((V) => V.selectNode), { openModal: C, pendingEditorOpen: D, setPendingEditorOpen: F } = Nt(), P = e ?? o, z = (Ue = re.getState().editorConfig) == null ? void 0 : Ue.context, M = !hu(P, z), [O, I] = oe("details"), [q, L] = oe(!1), H = Nt((V) => V.setQuestionEditorOpen);
11841
11844
  Ce(() => (H(u && q), u && q && aa("question_editor"), () => H(!1)), [u, q]);
11842
11845
  const [te, ue] = oe(!1);
11843
11846
  Ce(() => {
11844
- be.getState().isSaving || (I(u ? "question" : "details"), f && f === R ? (L(!0), F(null)) : L(!1));
11847
+ be.getState().isSaving || (I(u ? "question" : "details"), f && f === D ? (L(!0), F(null)) : L(!1));
11845
11848
  }, [f, u]);
11846
- const fe = xe((V, _e) => {
11849
+ const pe = xe((V, _e) => {
11847
11850
  f && (S(f, { [V]: _e }), t({ action: "onFormValueChange", data: { field: V, value: _e } }));
11848
11851
  }, [f, S, t]), le = xe((V) => {
11849
11852
  t({ action: "onFormStatusChange", data: { isValid: V } });
11850
- }, [t]), ke = re((V) => V.licenses), ne = pe(
11853
+ }, [t]), ke = re((V) => V.licenses), ne = fe(
11851
11854
  (V) => V.selectedNodeId ? V.getChildrenOf(V.selectedNodeId).filter((_e) => _e.isQuestion).length : 0
11852
11855
  ), Be = xe(
11853
11856
  (V) => (V ?? []).map((_e) => _e.code === "license" && !_e.range && ke.length ? { ..._e, range: ke } : _e.code === "maxQuestions" ? { ..._e, range: Array.from({ length: ne }, (j, ce) => String(ce + 1)) } : _e),
@@ -11861,7 +11864,7 @@ const C0 = ({
11861
11864
  return [Ye, [ye, ae].filter(Boolean).join(" ")].filter(Boolean).join(" · ");
11862
11865
  }
11863
11866
  if (d) {
11864
- const Ye = pe.getState().getNodeById(f ?? ""), ye = ((ce = Ye == null ? void 0 : Ye.children) == null ? void 0 : ce.length) ?? 0;
11867
+ const Ye = fe.getState().getNodeById(f ?? ""), ye = ((ce = Ye == null ? void 0 : Ye.children) == null ? void 0 : ce.length) ?? 0;
11865
11868
  return `${ye} ${ye === 1 ? i("ui.questionOne", "question") : i("ui.questionMany", "questions")}`;
11866
11869
  }
11867
11870
  if (u) {
@@ -11923,7 +11926,7 @@ const C0 = ({
11923
11926
  className: "ce-thumb-remove",
11924
11927
  title: "Remove icon",
11925
11928
  "aria-label": "Remove icon",
11926
- onClick: () => fe("appIcon", ""),
11929
+ onClick: () => pe("appIcon", ""),
11927
11930
  children: /* @__PURE__ */ l(W, { name: "x", size: 10 })
11928
11931
  }
11929
11932
  ) : null
@@ -11933,7 +11936,7 @@ const C0 = ({
11933
11936
  {
11934
11937
  preserveAbsoluteUrl: !0,
11935
11938
  onSelect: (V) => {
11936
- f && fe("appIcon", V), ue(!1);
11939
+ f && pe("appIcon", V), ue(!1);
11937
11940
  },
11938
11941
  onClose: () => ue(!1)
11939
11942
  }
@@ -11969,7 +11972,7 @@ const C0 = ({
11969
11972
  y0,
11970
11973
  {
11971
11974
  isLoading: s,
11972
- node: pe.getState().getNodeById(f ?? "") ?? { id: f ?? "", identifier: f ?? "", name: "" },
11975
+ node: fe.getState().getNodeById(f ?? "") ?? { id: f ?? "", identifier: f ?? "", name: "" },
11973
11976
  onOpenEditor: () => L(!0),
11974
11977
  onRemove: () => C("confirmDelete", { nodeId: f }),
11975
11978
  isEditMode: P === "edit"
@@ -11980,7 +11983,7 @@ const C0 = ({
11980
11983
  {
11981
11984
  fields: Be(g ?? w),
11982
11985
  values: b,
11983
- onChange: fe,
11986
+ onChange: pe,
11984
11987
  onValidityChange: le,
11985
11988
  readOnly: !0,
11986
11989
  frameworkTerms: r
@@ -12000,7 +12003,7 @@ const C0 = ({
12000
12003
  {
12001
12004
  fields: Be(Le),
12002
12005
  values: b,
12003
- onChange: fe,
12006
+ onChange: pe,
12004
12007
  onValidityChange: le,
12005
12008
  readOnly: M,
12006
12009
  section: "Details",
@@ -12016,7 +12019,7 @@ const C0 = ({
12016
12019
  {
12017
12020
  fields: Be(Le),
12018
12021
  values: b,
12019
- onChange: fe,
12022
+ onChange: pe,
12020
12023
  onValidityChange: le,
12021
12024
  readOnly: M,
12022
12025
  section: "Audience & Curriculum",
@@ -12038,7 +12041,7 @@ const C0 = ({
12038
12041
  {
12039
12042
  fields: Be(Le),
12040
12043
  values: b,
12041
- onChange: fe,
12044
+ onChange: pe,
12042
12045
  onValidityChange: le,
12043
12046
  readOnly: M,
12044
12047
  section: "Behaviour",
@@ -12233,7 +12236,7 @@ const C0 = ({
12233
12236
  r
12234
12237
  );
12235
12238
  }, A0 = () => {
12236
- const e = Ve(), t = Nt((c) => c.activeModal), n = Nt((c) => c.modalData), r = Nt((c) => c.closeModal), i = Nt((c) => c.setPendingEditorOpen), s = pe((c) => c.addNode);
12239
+ const e = Ve(), t = Nt((c) => c.activeModal), n = Nt((c) => c.modalData), r = Nt((c) => c.closeModal), i = Nt((c) => c.setPendingEditorOpen), s = fe((c) => c.addNode);
12237
12240
  if (t !== "questionTypeSelector") return null;
12238
12241
  const o = n.parentId ?? "", a = (c) => {
12239
12242
  const h = s(o, "question", c);
@@ -12264,7 +12267,7 @@ const C0 = ({
12264
12267
  )) })
12265
12268
  ] }) });
12266
12269
  }, k0 = () => {
12267
- const e = Nt((g) => g.activeModal), t = Nt((g) => g.modalData), n = Nt((g) => g.closeModal), r = pe((g) => g.deleteNode), i = pe((g) => g.getNodeById), s = re((g) => g.setIsDirty), o = Ve();
12270
+ const e = Nt((g) => g.activeModal), t = Nt((g) => g.modalData), n = Nt((g) => g.closeModal), r = fe((g) => g.deleteNode), i = fe((g) => g.getNodeById), s = re((g) => g.setIsDirty), o = Ve();
12268
12271
  if (Ce(() => {
12269
12272
  const g = (f) => {
12270
12273
  f.key === "Escape" && n();
@@ -12412,12 +12415,12 @@ function R0({ events: e }) {
12412
12415
  await w(), i(!1), a && (c(!1), (M = e.onToolbarEvent) == null || M.call(e, { action: "back" }));
12413
12416
  }, [w, a, e]), C = xe(() => {
12414
12417
  i(!1), c(!1);
12415
- }, []), R = Nt((M) => M.questionEditorOpen), F = pe((M) => M.treeData.length > 0), [P, z] = oe(null);
12418
+ }, []), D = Nt((M) => M.questionEditorOpen), F = fe((M) => M.treeData.length > 0), [P, z] = oe(null);
12416
12419
  return /* @__PURE__ */ l(Yu.Provider, { value: P, children: /* @__PURE__ */ E("div", { className: "ce", ref: z, children: [
12417
12420
  /* @__PURE__ */ l(
12418
12421
  Iw,
12419
12422
  {
12420
- disabled: R,
12423
+ disabled: D,
12421
12424
  editorMode: y,
12422
12425
  isSaving: g,
12423
12426
  isDirty: u,
@@ -12427,7 +12430,7 @@ function R0({ events: e }) {
12427
12430
  }
12428
12431
  ),
12429
12432
  /* @__PURE__ */ E("div", { className: "ce-body", children: [
12430
- t && !R && /* @__PURE__ */ l(
12433
+ t && !D && /* @__PURE__ */ l(
12431
12434
  "button",
12432
12435
  {
12433
12436
  className: "ce-reopen left",
@@ -12440,9 +12443,9 @@ function R0({ events: e }) {
12440
12443
  /* @__PURE__ */ l(
12441
12444
  "aside",
12442
12445
  {
12443
- className: `ce-tree${t || R ? " collapsed" : ""}`,
12444
- style: R ? { pointerEvents: "none" } : void 0,
12445
- "aria-disabled": R || void 0,
12446
+ className: `ce-tree${t || D ? " collapsed" : ""}`,
12447
+ style: D ? { pointerEvents: "none" } : void 0,
12448
+ "aria-disabled": D || void 0,
12446
12449
  children: /* @__PURE__ */ l(i0, { onCollapse: () => n(!0) })
12447
12450
  }
12448
12451
  ),
@@ -12696,7 +12699,7 @@ async function G0(e) {
12696
12699
  const K0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12697
12700
  __proto__: null,
12698
12701
  getChannelData: G0
12699
- }, Symbol.toStringTag, { value: "Module" })), Y0 = "_overlay_1ftjx_1", X0 = "_header_1ftjx_11", J0 = "_title_1ftjx_22", Z0 = "_closeBtn_1ftjx_31", e_ = "_playerContainer_1ftjx_56", t_ = "_playerHost_1ftjx_65", n_ = "_statusOverlay_1ftjx_79", Gn = {
12702
+ }, Symbol.toStringTag, { value: "Module" })), Y0 = "_overlay_17oga_1", X0 = "_header_17oga_11", J0 = "_title_17oga_22", Z0 = "_closeBtn_17oga_31", e_ = "_playerContainer_17oga_56", t_ = "_playerHost_17oga_65", n_ = "_statusOverlay_17oga_79", Gn = {
12700
12703
  overlay: Y0,
12701
12704
  header: X0,
12702
12705
  title: J0,
@@ -12742,7 +12745,7 @@ function bc(e, t) {
12742
12745
  }
12743
12746
  }
12744
12747
  const o_ = ({ questionSetId: e, singleQuestionId: t, draftQuestionMeta: n, inline: r = !1, onClose: i }) => {
12745
- const s = Ve(), o = Ge(null), [a, c] = oe("loading"), h = pe((u) => {
12748
+ const s = Ve(), o = Ge(null), [a, c] = oe("loading"), h = fe((u) => {
12746
12749
  var y;
12747
12750
  return (y = u.treeData[0]) == null ? void 0 : y.name;
12748
12751
  });
@@ -12753,7 +12756,7 @@ const o_ = ({ questionSetId: e, singleQuestionId: t, draftQuestionMeta: n, inlin
12753
12756
  try {
12754
12757
  const f = re.getState().editorConfig, b = ((p = f == null ? void 0 : f.config) == null ? void 0 : p.playerScriptUrl) ?? r_;
12755
12758
  await i_(b);
12756
- const { treeData: m, treeCache: S } = pe.getState();
12759
+ const { treeData: m, treeCache: S } = fe.getState();
12757
12760
  let v = {};
12758
12761
  if (m[0])
12759
12762
  if (t)
@@ -12810,7 +12813,7 @@ const o_ = ({ questionSetId: e, singleQuestionId: t, draftQuestionMeta: n, inlin
12810
12813
  shuffle: !1
12811
12814
  };
12812
12815
  }
12813
- const C = (g = (w = m[0]) == null ? void 0 : w.metadata) == null ? void 0 : g.maxAttempts, R = Number(C), F = Number.isFinite(R) && R > 0 ? R : void 0, z = {
12816
+ const C = (g = (w = m[0]) == null ? void 0 : w.metadata) == null ? void 0 : g.maxAttempts, D = Number(C), F = Number.isFinite(D) && D > 0 ? D : void 0, z = {
12814
12817
  context: {
12815
12818
  ...(f == null ? void 0 : f.context) ?? {},
12816
12819
  mode: "play",
@@ -14173,14 +14176,14 @@ function m_({ disabled: e = !1 }) {
14173
14176
  Ce(() => {
14174
14177
  const L = () => {
14175
14178
  var le;
14176
- const te = document.activeElement, ue = !!(te != null && te.closest("[contenteditable]")), fe = !!((le = S.current) != null && le.contains(te));
14177
- C(ue || fe);
14179
+ const te = document.activeElement, ue = !!(te != null && te.closest("[contenteditable]")), pe = !!((le = S.current) != null && le.contains(te));
14180
+ C(ue || pe);
14178
14181
  }, H = () => setTimeout(L, 0);
14179
14182
  return document.addEventListener("focusin", L), document.addEventListener("focusout", H), () => {
14180
14183
  document.removeEventListener("focusin", L), document.removeEventListener("focusout", H);
14181
14184
  };
14182
14185
  }, []);
14183
- const R = e || !v;
14186
+ const D = e || !v;
14184
14187
  Ce(() => {
14185
14188
  if (i !== "align" && i !== "size") return;
14186
14189
  const L = (te) => {
@@ -14196,20 +14199,20 @@ function m_({ disabled: e = !1 }) {
14196
14199
  }, z = (L) => {
14197
14200
  const H = F.current;
14198
14201
  if (!H) return;
14199
- const te = H.commonAncestorContainer, ue = te.nodeType === Node.ELEMENT_NODE ? te : te.parentElement, fe = ue == null ? void 0 : ue.closest("[contenteditable]");
14200
- fe && fe.focus();
14202
+ const te = H.commonAncestorContainer, ue = te.nodeType === Node.ELEMENT_NODE ? te : te.parentElement, pe = ue == null ? void 0 : ue.closest("[contenteditable]");
14203
+ pe && pe.focus();
14201
14204
  const le = window.getSelection();
14202
14205
  le && (le.removeAllRanges(), le.addRange(H)), H.deleteContents();
14203
14206
  const ke = document.createElement("div");
14204
14207
  ke.innerHTML = L;
14205
14208
  const ne = document.createDocumentFragment();
14206
14209
  for (; ke.firstChild; ) ne.appendChild(ke.firstChild);
14207
- H.insertNode(ne), H.collapse(!1), le && (le.removeAllRanges(), le.addRange(H)), fe == null || fe.dispatchEvent(new Event("input", { bubbles: !0 }));
14210
+ H.insertNode(ne), H.collapse(!1), le && (le.removeAllRanges(), le.addRange(H)), pe == null || pe.dispatchEvent(new Event("input", { bubbles: !0 }));
14208
14211
  }, M = (L) => s((H) => H === L ? null : L), O = () => {
14209
14212
  p.current && f(p.current.getBoundingClientRect()), M("chars");
14210
14213
  }, I = () => {
14211
14214
  w.current && m(w.current.getBoundingClientRect()), M("table");
14212
- }, q = ({ cmd: L, val: H, title: te, children: ue }) => /* @__PURE__ */ l("button", { type: "button", className: "re-tb", title: te, onMouseDown: Ki(L, H), disabled: R, children: ue });
14215
+ }, q = ({ cmd: L, val: H, title: te, children: ue }) => /* @__PURE__ */ l("button", { type: "button", className: "re-tb", title: te, onMouseDown: Ki(L, H), disabled: D, children: ue });
14213
14216
  return /* @__PURE__ */ E(
14214
14217
  "div",
14215
14218
  {
@@ -14218,7 +14221,7 @@ function m_({ disabled: e = !1 }) {
14218
14221
  role: "toolbar",
14219
14222
  "aria-label": "Text formatting",
14220
14223
  onMouseDown: Yi,
14221
- style: { opacity: R ? 0.4 : 1, pointerEvents: R ? "none" : void 0, transition: "opacity .15s" },
14224
+ style: { opacity: D ? 0.4 : 1, pointerEvents: D ? "none" : void 0, transition: "opacity .15s" },
14222
14225
  children: [
14223
14226
  /* @__PURE__ */ E("label", { className: "re-lang", onMouseDown: Yi, children: [
14224
14227
  /* @__PURE__ */ l("span", { children: r("ui.language", "Language") }),
@@ -14230,8 +14233,8 @@ function m_({ disabled: e = !1 }) {
14230
14233
  L.stopPropagation(), P();
14231
14234
  },
14232
14235
  onChange: (L) => {
14233
- var fe, le;
14234
- const H = L.target.value, te = ((fe = yc.find((ke) => ke.code === H)) == null ? void 0 : fe.dir) ?? "ltr";
14236
+ var pe, le;
14237
+ const H = L.target.value, te = ((pe = yc.find((ke) => ke.code === H)) == null ? void 0 : pe.dir) ?? "ltr";
14235
14238
  document.dispatchEvent(new CustomEvent("ce-lang-changed", { detail: { lang: H, dir: te } })), be.getState().switchContentLang(H.toLowerCase());
14236
14239
  const ue = F.current;
14237
14240
  if (ue) {
@@ -14277,7 +14280,7 @@ function m_({ disabled: e = !1 }) {
14277
14280
  onMouseDown: (L) => {
14278
14281
  L.preventDefault(), M("align");
14279
14282
  },
14280
- disabled: R,
14283
+ disabled: D,
14281
14284
  children: [
14282
14285
  /* @__PURE__ */ l(W, { name: "align", size: 17 }),
14283
14286
  /* @__PURE__ */ l(W, { name: "caret", size: 10 })
@@ -14313,7 +14316,7 @@ function m_({ disabled: e = !1 }) {
14313
14316
  onMouseDown: (L) => {
14314
14317
  L.preventDefault(), M("size");
14315
14318
  },
14316
- disabled: R,
14319
+ disabled: D,
14317
14320
  children: [
14318
14321
  /* @__PURE__ */ l("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-1px" }, children: "A" }),
14319
14322
  /* @__PURE__ */ l(W, { name: "caret", size: 10 })
@@ -14357,7 +14360,7 @@ function m_({ disabled: e = !1 }) {
14357
14360
  onMouseDown: (L) => {
14358
14361
  L.preventDefault(), O();
14359
14362
  },
14360
- disabled: R,
14363
+ disabled: D,
14361
14364
  children: /* @__PURE__ */ l("span", { style: { fontSize: 16, fontWeight: 600 }, children: "Ω" })
14362
14365
  }
14363
14366
  ),
@@ -14371,7 +14374,7 @@ function m_({ disabled: e = !1 }) {
14371
14374
  onMouseDown: (L) => {
14372
14375
  L.preventDefault(), P(), y.current && h(y.current.getBoundingClientRect()), a((H) => !H);
14373
14376
  },
14374
- disabled: R,
14377
+ disabled: D,
14375
14378
  children: /* @__PURE__ */ l("span", { style: { fontSize: 16, fontWeight: 700 }, children: "Σ" })
14376
14379
  }
14377
14380
  )
@@ -14386,7 +14389,7 @@ function m_({ disabled: e = !1 }) {
14386
14389
  onMouseDown: (L) => {
14387
14390
  L.preventDefault(), P(), u(!0);
14388
14391
  },
14389
- disabled: R,
14392
+ disabled: D,
14390
14393
  children: /* @__PURE__ */ l(W, { name: "image", size: 17 })
14391
14394
  }
14392
14395
  ),
@@ -14400,7 +14403,7 @@ function m_({ disabled: e = !1 }) {
14400
14403
  onMouseDown: (L) => {
14401
14404
  L.preventDefault(), I();
14402
14405
  },
14403
- disabled: R,
14406
+ disabled: D,
14404
14407
  children: /* @__PURE__ */ l(W, { name: "table", size: 17 })
14405
14408
  }
14406
14409
  ) }),
@@ -14420,8 +14423,8 @@ function m_({ disabled: e = !1 }) {
14420
14423
  Rs,
14421
14424
  {
14422
14425
  onSelect: (L) => {
14423
- var ue, fe;
14424
- const H = (ue = L.match(/(do_[A-Za-z0-9]+)/)) == null ? void 0 : ue[1], te = ((fe = L.split("/").pop()) == null ? void 0 : fe.split("?")[0]) ?? "";
14426
+ var ue, pe;
14427
+ const H = (ue = L.match(/(do_[A-Za-z0-9]+)/)) == null ? void 0 : ue[1], te = ((pe = L.split("/").pop()) == null ? void 0 : pe.split("?")[0]) ?? "";
14425
14428
  z(
14426
14429
  `<figure class="image"><img src="${ps(L)}" alt="${ps(te)}"${H ? ` data-asset-variable="${H}"` : ""}></figure>`
14427
14430
  ), u(!1);
@@ -14449,9 +14452,9 @@ function b_(e, t) {
14449
14452
  )), (t.type === "mcq" || t.type === "boolean") && t.options.some((b) => kn(Jt(t.i18n.options[b.id])))) {
14450
14453
  const b = n.options, m = (d = r == null ? void 0 : r.response1) == null ? void 0 : d.options;
14451
14454
  t.options.forEach((S, v) => {
14452
- var R;
14455
+ var D;
14453
14456
  const C = Jt(t.i18n.options[S.id]);
14454
- Object.keys(C).length && ((R = b == null ? void 0 : b[v]) != null && R.value && (b[v].value.body = xr(C)), m != null && m[v] && (m[v].label = { ...C }));
14457
+ Object.keys(C).length && ((D = b == null ? void 0 : b[v]) != null && D.value && (b[v].value.body = xr(C)), m != null && m[v] && (m[v].label = { ...C }));
14455
14458
  });
14456
14459
  }
14457
14460
  if (t.type === "mcq" || t.type === "boolean") {
@@ -14492,9 +14495,9 @@ function b_(e, t) {
14492
14495
  if (kn(f)) {
14493
14496
  e.sentence = Xn(f, "en"), n.sentence = xr(f);
14494
14497
  const b = {}, m = {};
14495
- for (const [R, F] of Object.entries(f)) {
14498
+ for (const [D, F] of Object.entries(f)) {
14496
14499
  const z = g_(F).map((O, I) => ({ value: String.fromCharCode(65 + I), label: O })), M = z.map((O) => O.value);
14497
- b[R] = { options: z, correctResponse: M }, m[R] = { correctResponse: { value: M } };
14500
+ b[D] = { options: z, correctResponse: M }, m[D] = { correctResponse: { value: M } };
14498
14501
  }
14499
14502
  n.i18n = b, r != null && r.response1 && (r.response1.i18n = b);
14500
14503
  const S = (g = e.responseDeclaration) == null ? void 0 : g.response1;
@@ -14729,9 +14732,9 @@ function kd() {
14729
14732
  evalUnordered: g,
14730
14733
  layout: f,
14731
14734
  contentLang: b
14732
- } = be.getState(), { selectedNodeId: m, treeData: S } = pe.getState(), v = re.getState().editorConfig;
14735
+ } = be.getState(), { selectedNodeId: m, treeData: S } = fe.getState(), v = re.getState().editorConfig;
14733
14736
  if (!t || !m) return null;
14734
- const C = ((Ye = v == null ? void 0 : v.context) == null ? void 0 : Ye.channel) ?? "", R = Ai(v == null ? void 0 : v.context), F = ((ye = v == null ? void 0 : v.context) == null ? void 0 : ye.framework) ?? "", P = Vr(t), z = (P == null ? void 0 : P.primaryCategory) ?? "Multiple Choice Question", M = (P == null ? void 0 : P.qType) ?? "MCQ", O = pe.getState().treeCache[m] ?? {}, I = typeof O.name == "string" && O.name.trim() ? O.name.trim() : void 0, q = Number(O.maxScore), L = (e == null ? void 0 : e.identifier) && !e.identifier.startsWith("temp-"), H = fn(n || "").slice(0, 60).trim() || "Untitled Question", te = I ?? (L ? e == null ? void 0 : e.name : void 0) ?? H, ue = t === "ftb" ? Ta(n).length : t === "mtf" ? i.length : 0, fe = Number.isFinite(q) && q > 0 ? q : p ?? 1, le = (t === "ftb" || t === "mtf" && w) && ue > 1 ? "multiple" : "single", ke = !!(P != null && P.interactionType), ne = be.getState().getI18nSnapshot(), Be = (et) => `<div class='answer-container'><div class='answer-body'>${et}</div></div>`, Le = ((ae = v == null ? void 0 : v.context) == null ? void 0 : ae.host) || window.location.origin, qe = w_(
14737
+ const C = ((Ye = v == null ? void 0 : v.context) == null ? void 0 : Ye.channel) ?? "", D = Ai(v == null ? void 0 : v.context), F = ((ye = v == null ? void 0 : v.context) == null ? void 0 : ye.framework) ?? "", P = Vr(t), z = (P == null ? void 0 : P.primaryCategory) ?? "Multiple Choice Question", M = (P == null ? void 0 : P.qType) ?? "MCQ", O = fe.getState().treeCache[m] ?? {}, I = typeof O.name == "string" && O.name.trim() ? O.name.trim() : void 0, q = Number(O.maxScore), L = (e == null ? void 0 : e.identifier) && !e.identifier.startsWith("temp-"), H = fn(n || "").slice(0, 60).trim() || "Untitled Question", te = I ?? (L ? e == null ? void 0 : e.name : void 0) ?? H, ue = t === "ftb" ? Ta(n).length : t === "mtf" ? i.length : 0, pe = Number.isFinite(q) && q > 0 ? q : p ?? 1, le = (t === "ftb" || t === "mtf" && w) && ue > 1 ? "multiple" : "single", ke = !!(P != null && P.interactionType), ne = be.getState().getI18nSnapshot(), Be = (et) => `<div class='answer-container'><div class='answer-body'>${et}</div></div>`, Le = ((ae = v == null ? void 0 : v.context) == null ? void 0 : ae.host) || window.location.origin, qe = w_(
14735
14738
  [
14736
14739
  n,
14737
14740
  u,
@@ -14802,7 +14805,7 @@ function kd() {
14802
14805
  scoringMode: "responseProcessing",
14803
14806
  responseProcessing: { template: "MATCH_CORRECT" }
14804
14807
  } : {},
14805
- maxScore: fe,
14808
+ maxScore: pe,
14806
14809
  name: te,
14807
14810
  qType: M,
14808
14811
  primaryCategory: z,
@@ -14822,7 +14825,7 @@ function kd() {
14822
14825
  maxScore: {
14823
14826
  cardinality: le,
14824
14827
  type: "integer",
14825
- defaultValue: fe
14828
+ defaultValue: pe
14826
14829
  },
14827
14830
  hint: {
14828
14831
  cardinality: "single",
@@ -14831,7 +14834,7 @@ function kd() {
14831
14834
  }
14832
14835
  },
14833
14836
  solutions: we,
14834
- createdBy: R,
14837
+ createdBy: D,
14835
14838
  channel: C,
14836
14839
  framework: F,
14837
14840
  ...ce
@@ -14852,7 +14855,7 @@ function kd() {
14852
14855
  }), { questionName: te, questionMeta: Se };
14853
14856
  }
14854
14857
  function T_() {
14855
- const { selectedNodeId: e, updateNode: t, replaceNodeId: n } = pe(), { save: r } = ga();
14858
+ const { selectedNodeId: e, updateNode: t, replaceNodeId: n } = fe(), { save: r } = ga();
14856
14859
  return { save: xe(async () => {
14857
14860
  var h, d, u, y;
14858
14861
  if (!e || be.getState().isSaving) return !1;
@@ -15091,10 +15094,10 @@ function D_({ editorMode: e, onBack: t }) {
15091
15094
  sequence: c,
15092
15095
  answerText: h,
15093
15096
  sentence: d
15094
- } = be(), { save: u } = T_(), y = re((j) => j.labels), p = (j, ce) => oa(y, j, ce), w = (_e = re.getState().editorConfig) == null ? void 0 : _e.context, g = !hu(e, w), f = n, b = Vr(f), m = b ? p(b.labelKey, b.label) : p("ui.question", "Question"), S = (b == null ? void 0 : b.icon) ?? "help", v = f ? f === "ftb" ? p("ui.ftbHint", _c.ftb) : p("ui.richTextHint", _c[f] ?? "") : "", C = (j) => fn(j ?? "").trim() || (/<(img|figure)\b/i.test(j ?? "") ? "[image]" : ""), R = be((j) => j.i18nText), F = (j, ce) => C(ce) ? ce : Object.values(j ?? {}).find((Se) => C(Se)) ?? "", P = re((j) => j.questionFormConfig), z = pe((j) => j.activeNodeMeta), M = pe((j) => j.updateNode), O = pe((j) => j.selectedNodeId), { frameworkTerms: I } = Cd(), q = (j, ce) => {
15097
+ } = be(), { save: u } = T_(), y = re((j) => j.labels), p = (j, ce) => oa(y, j, ce), w = (_e = re.getState().editorConfig) == null ? void 0 : _e.context, g = !hu(e, w), f = n, b = Vr(f), m = b ? p(b.labelKey, b.label) : p("ui.question", "Question"), S = (b == null ? void 0 : b.icon) ?? "help", v = f ? f === "ftb" ? p("ui.ftbHint", _c.ftb) : p("ui.richTextHint", _c[f] ?? "") : "", C = (j) => fn(j ?? "").trim() || (/<(img|figure)\b/i.test(j ?? "") ? "[image]" : ""), D = be((j) => j.i18nText), F = (j, ce) => C(ce) ? ce : Object.values(j ?? {}).find((Se) => C(Se)) ?? "", P = re((j) => j.questionFormConfig), z = fe((j) => j.activeNodeMeta), M = fe((j) => j.updateNode), O = fe((j) => j.selectedNodeId), { frameworkTerms: I } = Cd(), q = (j, ce) => {
15095
15098
  O && M(O, { [j]: ce });
15096
15099
  }, L = z ?? {}, [H, te] = oe(!0), ue = (() => {
15097
- const j = F(R.questionBody, r);
15100
+ const j = F(D.questionBody, r);
15098
15101
  if (!C(j)) return p("ui.invalidEnterQuestion", "Enter the question first");
15099
15102
  if (!String((z == null ? void 0 : z.name) ?? "").trim())
15100
15103
  return p("ui.invalidEnterTitle", "Enter the title in Details");
@@ -15104,30 +15107,30 @@ function D_({ editorMode: e, onBack: t }) {
15104
15107
  switch (f) {
15105
15108
  case "mcq":
15106
15109
  case "boolean":
15107
- return o.some((ce) => !C(F(R.options[ce.id], ce.body))) ? p("ui.invalidFillOptions", "Fill in all options") : o.some((ce) => ce.isCorrect) ? null : p("ui.invalidMarkCorrect", "Mark one option as the correct answer");
15110
+ return o.some((ce) => !C(F(D.options[ce.id], ce.body))) ? p("ui.invalidFillOptions", "Fill in all options") : o.some((ce) => ce.isCorrect) ? null : p("ui.invalidMarkCorrect", "Mark one option as the correct answer");
15108
15111
  case "ftb":
15109
15112
  return /\[\[.+?\]\]/.test(j) ? null : p("ui.invalidAddBlank", "Add at least one [[blank]] with its answer");
15110
15113
  case "sa":
15111
- return C(F(R.answerText, h)) ? null : p("ui.invalidEnterAnswer", "Enter the answer");
15114
+ return C(F(D.answerText, h)) ? null : p("ui.invalidEnterAnswer", "Enter the answer");
15112
15115
  case "mtf":
15113
- return a.length < 2 || a.some((ce) => !C(F(R.pairsLeft[ce.id], ce.left)) || !C(F(R.pairsRight[ce.id], ce.right))) ? p("ui.invalidFillPairs", "Fill in all matching pairs") : null;
15116
+ return a.length < 2 || a.some((ce) => !C(F(D.pairsLeft[ce.id], ce.left)) || !C(F(D.pairsRight[ce.id], ce.right))) ? p("ui.invalidFillPairs", "Fill in all matching pairs") : null;
15114
15117
  case "seq":
15115
- return c.length < 2 || c.some((ce, Se) => !C(F(R.sequence[Se], ce))) ? p("ui.invalidFillSequence", "Fill in all sequence items") : null;
15118
+ return c.length < 2 || c.some((ce, Se) => !C(F(D.sequence[Se], ce))) ? p("ui.invalidFillSequence", "Fill in all sequence items") : null;
15116
15119
  case "reo":
15117
- return C(F(R.sentence, d)).split(/\s+/).filter(Boolean).length < 2 ? p("ui.invalidSentence", "Enter a sentence with at least two words") : null;
15120
+ return C(F(D.sentence, d)).split(/\s+/).filter(Boolean).length < 2 ? p("ui.invalidSentence", "Enter a sentence with at least two words") : null;
15118
15121
  default:
15119
15122
  return null;
15120
15123
  }
15121
- })(), fe = be((j) => j.isDirty), le = be((j) => j.activeQuestion), [ke, ne] = oe(!1), [Be, Le] = oe(!1), [qe, Ze] = oe(void 0), X = pe((j) => j.selectedNodeId), we = () => {
15124
+ })(), pe = be((j) => j.isDirty), le = be((j) => j.activeQuestion), [ke, ne] = oe(!1), [Be, Le] = oe(!1), [qe, Ze] = oe(void 0), X = fe((j) => j.selectedNodeId), we = () => {
15122
15125
  var ce;
15123
15126
  const j = !!((ce = le == null ? void 0 : le.identifier) != null && ce.startsWith("temp-"));
15124
- !g && (fe || j) ? ne(!0) : t == null || t();
15127
+ !g && (pe || j) ? ne(!0) : t == null || t();
15125
15128
  }, Ue = () => {
15126
15129
  var j;
15127
- ne(!1), (j = le == null ? void 0 : le.identifier) != null && j.startsWith("temp-") && pe.getState().deleteNode(le.identifier), t == null || t();
15130
+ ne(!1), (j = le == null ? void 0 : le.identifier) != null && j.startsWith("temp-") && fe.getState().deleteNode(le.identifier), t == null || t();
15128
15131
  }, V = async () => {
15129
15132
  const j = le == null ? void 0 : le.identifier;
15130
- (await u() || j && !pe.getState().getNodeById(j)) && (t == null || t());
15133
+ (await u() || j && !fe.getState().getNodeById(j)) && (t == null || t());
15131
15134
  };
15132
15135
  return /* @__PURE__ */ E("div", { className: "ce-ed", children: [
15133
15136
  /* @__PURE__ */ E("button", { className: "ce-ed-back", type: "button", onClick: we, children: [
@@ -15311,6 +15314,6 @@ export {
15311
15314
  Og as setApiSlug,
15312
15315
  re as useEditorStore,
15313
15316
  be as useQuestionStore,
15314
- pe as useTreeStore,
15317
+ fe as useTreeStore,
15315
15318
  Nt as useUiStore
15316
15319
  };