@farris/x-ui 0.2.0 → 0.2.1

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.
@@ -4248,8 +4248,8 @@ function Ws() {
4248
4248
  CUSTOM_ELEMENT: L
4249
4249
  } = ca;
4250
4250
  let {
4251
- IS_ALLOWED_URI: U
4252
- } = ca, W = null;
4251
+ IS_ALLOWED_URI: W
4252
+ } = ca, U = null;
4253
4253
  const B = se({}, [...oa, ...nr, ...ur, ...ir, ...aa]);
4254
4254
  let P = null;
4255
4255
  const R = se({}, [...sa, ...rr, ...la, ...Ru]);
@@ -4308,7 +4308,7 @@ function Ws() {
4308
4308
  let E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4309
4309
  if (!(bn && bn === E)) {
4310
4310
  if ((!E || typeof E != "object") && (E = {}), E = Dt(E), $n = // eslint-disable-next-line unicorn/prefer-includes
4311
- Ll.indexOf(E.PARSER_MEDIA_TYPE) === -1 ? Rl : E.PARSER_MEDIA_TYPE, Se = $n === "application/xhtml+xml" ? er : Hu, W = et(E, "ALLOWED_TAGS") ? se({}, E.ALLOWED_TAGS, Se) : B, P = et(E, "ALLOWED_ATTR") ? se({}, E.ALLOWED_ATTR, Se) : R, Hi = et(E, "ALLOWED_NAMESPACES") ? se({}, E.ALLOWED_NAMESPACES, er) : Il, Ni = et(E, "ADD_URI_SAFE_ATTR") ? se(Dt(wo), E.ADD_URI_SAFE_ATTR, Se) : wo, yo = et(E, "ADD_DATA_URI_TAGS") ? se(Dt(xo), E.ADD_DATA_URI_TAGS, Se) : xo, Et = et(E, "FORBID_CONTENTS") ? se({}, E.FORBID_CONTENTS, Se) : zi, q = et(E, "FORBID_TAGS") ? se({}, E.FORBID_TAGS, Se) : Dt({}), ee = et(E, "FORBID_ATTR") ? se({}, E.FORBID_ATTR, Se) : Dt({}), mn = et(E, "USE_PROFILES") ? E.USE_PROFILES : !1, Q = E.ALLOW_ARIA_ATTR !== !1, ae = E.ALLOW_DATA_ATTR !== !1, pe = E.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = E.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = E.SAFE_FOR_TEMPLATES || !1, pt = E.SAFE_FOR_XML !== !1, je = E.WHOLE_DOCUMENT || !1, zt = E.RETURN_DOM || !1, Cu = E.RETURN_DOM_FRAGMENT || !1, _u = E.RETURN_TRUSTED_TYPE || !1, Gt = E.FORCE_BODY || !1, bo = E.SANITIZE_DOM !== !1, vo = E.SANITIZE_NAMED_PROPS || !1, Bi = E.KEEP_CONTENT !== !1, Hn = E.IN_PLACE || !1, U = E.ALLOWED_URI_REGEXP || $s, gn = E.NAMESPACE || Nt, Du = E.MATHML_TEXT_INTEGRATION_POINTS || Du, Fu = E.HTML_INTEGRATION_POINTS || Fu, z = E.CUSTOM_ELEMENT_HANDLING || {}, E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = E.CUSTOM_ELEMENT_HANDLING.tagNameCheck), E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), E.CUSTOM_ELEMENT_HANDLING && typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (ae = !1), Cu && (zt = !0), mn && (W = se({}, aa), P = ju(null), mn.html === !0 && (se(W, oa), se(P, sa)), mn.svg === !0 && (se(W, nr), se(P, rr), se(P, Ru)), mn.svgFilters === !0 && (se(W, ur), se(P, rr), se(P, Ru)), mn.mathMl === !0 && (se(W, ir), se(P, la), se(P, Ru))), et(E, "ADD_TAGS") || (Z.tagCheck = null), et(E, "ADD_ATTR") || (Z.attributeCheck = null), E.ADD_TAGS && (typeof E.ADD_TAGS == "function" ? Z.tagCheck = E.ADD_TAGS : (W === B && (W = Dt(W)), se(W, E.ADD_TAGS, Se))), E.ADD_ATTR && (typeof E.ADD_ATTR == "function" ? Z.attributeCheck = E.ADD_ATTR : (P === R && (P = Dt(P)), se(P, E.ADD_ATTR, Se))), E.ADD_URI_SAFE_ATTR && se(Ni, E.ADD_URI_SAFE_ATTR, Se), E.FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.FORBID_CONTENTS, Se)), E.ADD_FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.ADD_FORBID_CONTENTS, Se)), Bi && (W["#text"] = !0), je && se(W, ["html", "head", "body"]), W.table && (se(W, ["tbody"]), delete q.tbody), E.TRUSTED_TYPES_POLICY) {
4311
+ Ll.indexOf(E.PARSER_MEDIA_TYPE) === -1 ? Rl : E.PARSER_MEDIA_TYPE, Se = $n === "application/xhtml+xml" ? er : Hu, U = et(E, "ALLOWED_TAGS") ? se({}, E.ALLOWED_TAGS, Se) : B, P = et(E, "ALLOWED_ATTR") ? se({}, E.ALLOWED_ATTR, Se) : R, Hi = et(E, "ALLOWED_NAMESPACES") ? se({}, E.ALLOWED_NAMESPACES, er) : Il, Ni = et(E, "ADD_URI_SAFE_ATTR") ? se(Dt(wo), E.ADD_URI_SAFE_ATTR, Se) : wo, yo = et(E, "ADD_DATA_URI_TAGS") ? se(Dt(xo), E.ADD_DATA_URI_TAGS, Se) : xo, Et = et(E, "FORBID_CONTENTS") ? se({}, E.FORBID_CONTENTS, Se) : zi, q = et(E, "FORBID_TAGS") ? se({}, E.FORBID_TAGS, Se) : Dt({}), ee = et(E, "FORBID_ATTR") ? se({}, E.FORBID_ATTR, Se) : Dt({}), mn = et(E, "USE_PROFILES") ? E.USE_PROFILES : !1, Q = E.ALLOW_ARIA_ATTR !== !1, ae = E.ALLOW_DATA_ATTR !== !1, pe = E.ALLOW_UNKNOWN_PROTOCOLS || !1, Te = E.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = E.SAFE_FOR_TEMPLATES || !1, pt = E.SAFE_FOR_XML !== !1, je = E.WHOLE_DOCUMENT || !1, zt = E.RETURN_DOM || !1, Cu = E.RETURN_DOM_FRAGMENT || !1, _u = E.RETURN_TRUSTED_TYPE || !1, Gt = E.FORCE_BODY || !1, bo = E.SANITIZE_DOM !== !1, vo = E.SANITIZE_NAMED_PROPS || !1, Bi = E.KEEP_CONTENT !== !1, Hn = E.IN_PLACE || !1, W = E.ALLOWED_URI_REGEXP || $s, gn = E.NAMESPACE || Nt, Du = E.MATHML_TEXT_INTEGRATION_POINTS || Du, Fu = E.HTML_INTEGRATION_POINTS || Fu, z = E.CUSTOM_ELEMENT_HANDLING || {}, E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = E.CUSTOM_ELEMENT_HANDLING.tagNameCheck), E.CUSTOM_ELEMENT_HANDLING && Ao(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), E.CUSTOM_ELEMENT_HANDLING && typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (ae = !1), Cu && (zt = !0), mn && (U = se({}, aa), P = ju(null), mn.html === !0 && (se(U, oa), se(P, sa)), mn.svg === !0 && (se(U, nr), se(P, rr), se(P, Ru)), mn.svgFilters === !0 && (se(U, ur), se(P, rr), se(P, Ru)), mn.mathMl === !0 && (se(U, ir), se(P, la), se(P, Ru))), et(E, "ADD_TAGS") || (Z.tagCheck = null), et(E, "ADD_ATTR") || (Z.attributeCheck = null), E.ADD_TAGS && (typeof E.ADD_TAGS == "function" ? Z.tagCheck = E.ADD_TAGS : (U === B && (U = Dt(U)), se(U, E.ADD_TAGS, Se))), E.ADD_ATTR && (typeof E.ADD_ATTR == "function" ? Z.attributeCheck = E.ADD_ATTR : (P === R && (P = Dt(P)), se(P, E.ADD_ATTR, Se))), E.ADD_URI_SAFE_ATTR && se(Ni, E.ADD_URI_SAFE_ATTR, Se), E.FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.FORBID_CONTENTS, Se)), E.ADD_FORBID_CONTENTS && (Et === zi && (Et = Dt(Et)), se(Et, E.ADD_FORBID_CONTENTS, Se)), Bi && (U["#text"] = !0), je && se(U, ["html", "head", "body"]), U.table && (se(U, ["tbody"]), delete q.tbody), E.TRUSTED_TYPES_POLICY) {
4312
4312
  if (typeof E.TRUSTED_TYPES_POLICY.createHTML != "function")
4313
4313
  throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
4314
4314
  if (typeof E.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -4407,10 +4407,10 @@ function Ws() {
4407
4407
  const te = Se(E.nodeName);
4408
4408
  if (jt(N.uponSanitizeElement, E, {
4409
4409
  tagName: te,
4410
- allowedTags: W
4410
+ allowedTags: U
4411
4411
  }), pt && E.hasChildNodes() && !So(E.firstElementChild) && Ge(/<[/\w!]/g, E.innerHTML) && Ge(/<[/\w!]/g, E.textContent) || E.nodeType === qn.progressingInstruction || pt && E.nodeType === qn.comment && Ge(/<[/\w]/g, E.data))
4412
4412
  return St(E), !0;
4413
- if (!(Z.tagCheck instanceof Function && Z.tagCheck(te)) && (!W[te] || q[te])) {
4413
+ if (!(Z.tagCheck instanceof Function && Z.tagCheck(te)) && (!U[te] || q[te])) {
4414
4414
  if (!q[te] && To(te) && (z.tagNameCheck instanceof RegExp && Ge(z.tagNameCheck, te) || z.tagNameCheck instanceof Function && z.tagNameCheck(te)))
4415
4415
  return !1;
4416
4416
  if (Bi && !Et[te]) {
@@ -4446,7 +4446,7 @@ function Ws() {
4446
4446
  G === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && Ge(z.tagNameCheck, te) || z.tagNameCheck instanceof Function && z.tagNameCheck(te)))
4447
4447
  ) return !1;
4448
4448
  } else if (!Ni[G]) {
4449
- if (!Ge(U, Wn(te, F, ""))) {
4449
+ if (!Ge(W, Wn(te, F, ""))) {
4450
4450
  if (!((G === "src" || G === "xlink:href" || G === "href") && E !== "script" && yf(te, "data:") === 0 && yo[E])) {
4451
4451
  if (!(pe && !Ge(I, Wn(te, F, "")))) {
4452
4452
  if (te)
@@ -4548,7 +4548,7 @@ function Ws() {
4548
4548
  if (pn || $i(E), t.removed = [], typeof ne == "string" && (Hn = !1), Hn) {
4549
4549
  if (ne.nodeName) {
4550
4550
  const Ht = Se(ne.nodeName);
4551
- if (!W[Ht] || q[Ht])
4551
+ if (!U[Ht] || q[Ht])
4552
4552
  throw Gn("root node is forbidden and cannot be sanitized in-place");
4553
4553
  }
4554
4554
  } else if (ne instanceof a)
@@ -4575,7 +4575,7 @@ function Ws() {
4575
4575
  return (P.shadowroot || P.shadowrootmode) && (He = H.call(u, He, !0)), He;
4576
4576
  }
4577
4577
  let Ke = je ? G.outerHTML : G.innerHTML;
4578
- return je && W["!doctype"] && G.ownerDocument && G.ownerDocument.doctype && G.ownerDocument.doctype.name && Ge(Us, G.ownerDocument.doctype.name) && (Ke = "<!DOCTYPE " + G.ownerDocument.doctype.name + `>
4578
+ return je && U["!doctype"] && G.ownerDocument && G.ownerDocument.doctype && G.ownerDocument.doctype.name && Ge(Us, G.ownerDocument.doctype.name) && (Ke = "<!DOCTYPE " + G.ownerDocument.doctype.name + `>
4579
4579
  ` + Ke), Ie && Lu([$, O, V], (Ht) => {
4580
4580
  Ke = Wn(Ke, Ht, " ");
4581
4581
  }), y && _u ? y.createHTML(Ke) : Ke;
@@ -5789,13 +5789,13 @@ var Pr = { exports: {} };
5789
5789
  return yield F({ scripts: { dependencies: [], entry: B, umd: R.umd, crossOrigin: R.crossOrigin } });
5790
5790
  });
5791
5791
  }
5792
- function U(B) {
5792
+ function W(B) {
5793
5793
  return h(this, null, function* () {
5794
5794
  return yield F({ scripts: { dependencies: [], entry: "" }, styles: { urls: [B] } });
5795
5795
  });
5796
5796
  }
5797
- const W = F;
5798
- n.importComponent = F, n.importModule = W, n.importScript = L, n.importStyle = U, Object.defineProperty(n, Symbol.toStringTag, { value: "Module" });
5797
+ const U = F;
5798
+ n.importComponent = F, n.importModule = U, n.importScript = L, n.importStyle = W, Object.defineProperty(n, Symbol.toStringTag, { value: "Module" });
5799
5799
  });
5800
5800
  })(Pr, Pr.exports);
5801
5801
  var Lh = Pr.exports;
@@ -6590,7 +6590,7 @@ function Yh(e, t, n, u) {
6590
6590
  const ae = Math.min(Z, Q);
6591
6591
  return { popoverLeft: ee, popoverTop: ae, arrowLeft: 0, maxHeight: 0 };
6592
6592
  }
6593
- const U = /* @__PURE__ */ new Map([
6593
+ const W = /* @__PURE__ */ new Map([
6594
6594
  ["top", H],
6595
6595
  ["top-left", V],
6596
6596
  ["bottom", _],
@@ -6599,14 +6599,14 @@ function Yh(e, t, n, u) {
6599
6599
  ["right-top", L],
6600
6600
  ["auto", I]
6601
6601
  ]);
6602
- function W(R) {
6602
+ function U(R) {
6603
6603
  var Q;
6604
6604
  e.keepWidthWithReference && D(R);
6605
6605
  const z = R.getBoundingClientRect();
6606
6606
  s.value = z.top, c.value = z.left;
6607
6607
  const q = t.value ? t.value.getBoundingClientRect() : { height: 4, width: 4 }, ee = (Q = n.value) == null ? void 0 : Q.getBoundingClientRect();
6608
6608
  o.value = ee.width;
6609
- const Z = U.get(d.value);
6609
+ const Z = W.get(d.value);
6610
6610
  if (Z) {
6611
6611
  const { arrowLeft: ae, popoverLeft: pe, popoverTop: Te, maxHeight: Ie } = Z(ee, z, q);
6612
6612
  l.value = ae, h.value = pe, m.value = Te, a.value = Ie || -1;
@@ -6615,7 +6615,7 @@ function Yh(e, t, n, u) {
6615
6615
  function B(R) {
6616
6616
  if (R) {
6617
6617
  const z = R.getBoundingClientRect();
6618
- (z.left !== c.value || z.top !== s.value) && W(R);
6618
+ (z.left !== c.value || z.top !== s.value) && U(R);
6619
6619
  }
6620
6620
  }
6621
6621
  function P() {
@@ -6628,7 +6628,7 @@ function Yh(e, t, n, u) {
6628
6628
  popoverWidth: o,
6629
6629
  fitToReference: D,
6630
6630
  followToReferencePosition: B,
6631
- locateToReference: W,
6631
+ locateToReference: U,
6632
6632
  resetPosition: P
6633
6633
  };
6634
6634
  }
@@ -7438,10 +7438,10 @@ const Xu = /* @__PURE__ */ ie({
7438
7438
  showDivider: V
7439
7439
  } = e.content.structuredContent, _ = (L) => {
7440
7440
  const {
7441
- content: U,
7442
- label: W
7441
+ content: W,
7442
+ label: U
7443
7443
  } = L;
7444
- return W || U && typeof U == "string" ? f(at, null, [f("span", {
7444
+ return U || W && typeof W == "string" ? f(at, null, [f("span", {
7445
7445
  class: "f-chat-bubble-structured-section-item-dot"
7446
7446
  }, null), L.label && f("span", {
7447
7447
  class: "f-chat-bubble-structured-section-item-label"
@@ -7453,8 +7453,8 @@ const Xu = /* @__PURE__ */ ie({
7453
7453
  class: ["f-chat-bubble-structured", {
7454
7454
  "structure-content-divider": V
7455
7455
  }]
7456
- }, [O.map((L, U) => f("div", {
7457
- key: U,
7456
+ }, [O.map((L, W) => f("div", {
7457
+ key: W,
7458
7458
  class: ["f-chat-bubble-structured-section", {
7459
7459
  "section-divider": L.showDivider
7460
7460
  }]
@@ -7471,10 +7471,10 @@ const Xu = /* @__PURE__ */ ie({
7471
7471
  class: "f-chat-bubble-structured-section-title"
7472
7472
  }, [L.title])]), L.items && L.items.length > 0 && f("div", {
7473
7473
  class: "f-chat-bubble-structured-section-items"
7474
- }, [L.items.map((W, B) => f("div", {
7474
+ }, [L.items.map((U, B) => f("div", {
7475
7475
  key: B,
7476
7476
  class: "f-chat-bubble-structured-section-item"
7477
- }, [_(W)]))])]))]);
7477
+ }, [_(U)]))])]))]);
7478
7478
  }, X = () => {
7479
7479
  const O = p.value;
7480
7480
  if (!O) return null;
@@ -9490,8 +9490,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9490
9490
  g.push(C), C.classList.add("medium-zoom-image");
9491
9491
  }), y.forEach(function(C) {
9492
9492
  var I = C.type, F = C.listener, L = C.options;
9493
- _.forEach(function(U) {
9494
- U.addEventListener(I, F, L);
9493
+ _.forEach(function(W) {
9494
+ W.addEventListener(I, F, L);
9495
9495
  });
9496
9496
  }), H;
9497
9497
  }, d = function() {
@@ -9534,9 +9534,9 @@ See: https://github.com/francoischalifour/medium-zoom`);
9534
9534
  if (D.container instanceof Object)
9535
9535
  C = cn({}, C, D.container), I = C.width - C.left - C.right - D.margin * 2, F = C.height - C.top - C.bottom - D.margin * 2;
9536
9536
  else {
9537
- var L = Ju(D.container) ? D.container : document.querySelector(D.container), U = L.getBoundingClientRect(), W = U.width, B = U.height, P = U.left, R = U.top;
9537
+ var L = Ju(D.container) ? D.container : document.querySelector(D.container), W = L.getBoundingClientRect(), U = W.width, B = W.height, P = W.left, R = W.top;
9538
9538
  C = cn({}, C, {
9539
- width: W,
9539
+ width: U,
9540
9540
  height: B,
9541
9541
  left: P,
9542
9542
  top: R
@@ -9551,8 +9551,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9551
9551
  _(H);
9552
9552
  return;
9553
9553
  }
9554
- var C = function W() {
9555
- k = !1, S.zoomed.removeEventListener("transitionend", W), S.original.dispatchEvent(xn("medium-zoom:opened", {
9554
+ var C = function U() {
9555
+ k = !1, S.zoomed.removeEventListener("transitionend", U), S.original.dispatchEvent(xn("medium-zoom:opened", {
9556
9556
  detail: { zoom: H }
9557
9557
  })), _(H);
9558
9558
  };
@@ -9586,8 +9586,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
9586
9586
  }, 10);
9587
9587
  } else if (S.original.hasAttribute("srcset")) {
9588
9588
  S.zoomedHd = S.zoomed.cloneNode(), S.zoomedHd.removeAttribute("sizes"), S.zoomedHd.removeAttribute("loading");
9589
- var U = S.zoomedHd.addEventListener("load", function() {
9590
- S.zoomedHd.removeEventListener("load", U), S.zoomedHd.classList.add("medium-zoom-image--opened"), S.zoomedHd.addEventListener("click", p), document.body.appendChild(S.zoomedHd), V();
9589
+ var W = S.zoomedHd.addEventListener("load", function() {
9590
+ S.zoomedHd.removeEventListener("load", W), S.zoomedHd.classList.add("medium-zoom-image--opened"), S.zoomedHd.addEventListener("click", p), document.body.appendChild(S.zoomedHd), V();
9591
9591
  });
9592
9592
  } else
9593
9593
  V();
@@ -10059,16 +10059,16 @@ const tn = {
10059
10059
  return "";
10060
10060
  const v = (I = t.usedLanguageTextRef.value) == null ? void 0 : I.copyCode.text, A = t.customIconRef.value.copy || v, b = !!t.customIconRef.value.copy, g = `<span class="${K}-collapse-tips">${Tt("collapse-tips", t.customIconRef.value)}</span>`, [y] = a(l[h]);
10061
10061
  if (y === null) {
10062
- const { open: F, tagContainer: L, tagHeader: U } = c(l[h]), W = [["class", `${K}-code`]];
10063
- F && W.push(["open", ""]);
10062
+ const { open: F, tagContainer: L, tagHeader: W } = c(l[h]), U = [["class", `${K}-code`]];
10063
+ F && U.push(["open", ""]);
10064
10064
  const B = {
10065
- attrs: Zr(l[h], W)
10065
+ attrs: Zr(l[h], U)
10066
10066
  };
10067
10067
  l[h].info = l[h].info.replace(i, "");
10068
10068
  const P = n(l, h, m, p, x);
10069
10069
  return `
10070
10070
  <${L} ${x.renderAttrs(B)}>
10071
- <${U} class="${K}-code-head">
10071
+ <${W} class="${K}-code-head">
10072
10072
  <div class="${K}-code-flag"><span></span><span></span><span></span></div>
10073
10073
  <div class="${K}-code-action">
10074
10074
  <span class="${K}-code-lang">${e.utils.escapeHtml(l[h].info.trim())}</span>
@@ -10076,7 +10076,7 @@ const tn = {
10076
10076
  ${t.extraTools instanceof Function ? t.extraTools({ lang: l[h].info.trim() }) : t.extraTools || ""}
10077
10077
  ${L === "details" ? g : ""}
10078
10078
  </div>
10079
- </${U}>
10079
+ </${W}>
10080
10080
  ${P}
10081
10081
  </${L}>
10082
10082
  `;
@@ -10413,9 +10413,9 @@ const tn = {
10413
10413
  g.set({
10414
10414
  highlight: (_, C, I) => {
10415
10415
  if (k) {
10416
- const U = k(_, C, I);
10417
- if (U)
10418
- return U;
10416
+ const W = k(_, C, I);
10417
+ if (W)
10418
+ return W;
10419
10419
  }
10420
10420
  let F;
10421
10421
  !e.noHighlight && m.value ? m.value.getLanguage(C) ? F = m.value.highlight(_, {
@@ -11413,24 +11413,24 @@ function vl() {
11413
11413
  function L(B) {
11414
11414
  return F ? !0 : n.indexOf(C, B) !== -1;
11415
11415
  }
11416
- var U = [], W = !1;
11416
+ var W = [], U = !1;
11417
11417
  return {
11418
11418
  onIgnoreTag: function(B, P, R) {
11419
11419
  if (L(B))
11420
11420
  if (R.isClosing) {
11421
11421
  var z = "[/removed]", q = R.position + z.length;
11422
- return U.push([
11423
- W !== !1 ? W : R.position,
11422
+ return W.push([
11423
+ U !== !1 ? U : R.position,
11424
11424
  q
11425
- ]), W = !1, z;
11425
+ ]), U = !1, z;
11426
11426
  } else
11427
- return W || (W = R.position), "[removed]";
11427
+ return U || (U = R.position), "[removed]";
11428
11428
  else
11429
11429
  return I(B, P, R);
11430
11430
  },
11431
11431
  remove: function(B) {
11432
11432
  var P = "", R = 0;
11433
- return n.forEach(U, function(z) {
11433
+ return n.forEach(W, function(z) {
11434
11434
  P += B.slice(R, z[0]), R = z[1];
11435
11435
  }), P += B.slice(R), P;
11436
11436
  }
@@ -11444,10 +11444,10 @@ function vl() {
11444
11444
  break;
11445
11445
  }
11446
11446
  I += C.slice(F, L);
11447
- var U = C.indexOf("-->", L);
11448
- if (U === -1)
11447
+ var W = C.indexOf("-->", L);
11448
+ if (W === -1)
11449
11449
  break;
11450
- F = U + 3;
11450
+ F = W + 3;
11451
11451
  }
11452
11452
  return I;
11453
11453
  }
@@ -11641,9 +11641,9 @@ function qp() {
11641
11641
  if (V.isWhite) {
11642
11642
  if (V.isClosing)
11643
11643
  return "</" + N + ">";
11644
- var C = a($), I = p[N], F = r(C.html, function(L, U) {
11645
- var W = i.indexOf(I, L) !== -1, B = A(N, L, U, W);
11646
- return o(B) ? W ? (U = g(N, L, U, T), U ? L + "=" + k + U + k : L) : (B = b(N, L, U, W), o(B) ? void 0 : B) : B;
11644
+ var C = a($), I = p[N], F = r(C.html, function(L, W) {
11645
+ var U = i.indexOf(I, L) !== -1, B = A(N, L, W, U);
11646
+ return o(B) ? U ? (W = g(N, L, W, T), W ? L + "=" + k + W + k : L) : (B = b(N, L, W, U), o(B) ? void 0 : B) : B;
11647
11647
  });
11648
11648
  return $ = "<" + N, F && ($ += " " + F), C.closing && ($ += " /"), $ += ">", $;
11649
11649
  } else
@@ -11768,14 +11768,14 @@ const ni = /* @__PURE__ */ ie({
11768
11768
  const C = n.value;
11769
11769
  if (!C) return;
11770
11770
  h.value = !1, r.value = !1, i.value = !1;
11771
- const I = Date.now(), F = 200, L = 300, U = 1e4;
11772
- let W = !1, B = null, P = null;
11771
+ const I = Date.now(), F = 200, L = 300, W = 1e4;
11772
+ let U = !1, B = null, P = null;
11773
11773
  P = window.setTimeout(() => {
11774
- P = null, W || (i.value = !0);
11774
+ P = null, U || (i.value = !0);
11775
11775
  }, F);
11776
11776
  const R = () => {
11777
- if (W) return;
11778
- if (W = !0, B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null), h.value = !0, O(C), i.value) {
11777
+ if (U) return;
11778
+ if (U = !0, B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null), h.value = !0, O(C), i.value) {
11779
11779
  const ee = Date.now() - I, Z = Math.max(0, L - ee);
11780
11780
  setTimeout(() => {
11781
11781
  r.value = !0;
@@ -11789,11 +11789,11 @@ const ni = /* @__PURE__ */ ie({
11789
11789
  q(), window.setTimeout(q, 0), window.setTimeout(q, 120);
11790
11790
  }, z = () => {
11791
11791
  var q;
11792
- W || (W = !0, P && (window.clearTimeout(P), P = null), console.warn("ChatPreview: iframe load timeout"), h.value = !0, r.value = !0, (q = e.onIframeLoad) == null || q.call(e));
11792
+ U || (U = !0, P && (window.clearTimeout(P), P = null), console.warn("ChatPreview: iframe load timeout"), h.value = !0, r.value = !0, (q = e.onIframeLoad) == null || q.call(e));
11793
11793
  };
11794
11794
  C.addEventListener("load", R, {
11795
11795
  once: !0
11796
- }), B = window.setTimeout(z, U), m = () => {
11796
+ }), B = window.setTimeout(z, W), m = () => {
11797
11797
  C.removeEventListener("load", R), B && (window.clearTimeout(B), B = null), P && (window.clearTimeout(P), P = null);
11798
11798
  };
11799
11799
  }, {
@@ -11913,10 +11913,10 @@ const ni = /* @__PURE__ */ ie({
11913
11913
  background: rgba(0, 0, 0, 0.2);
11914
11914
  }
11915
11915
  `, (I.head || I.documentElement).appendChild(L);
11916
- const U = "f-chat-preview-injected-scrollbar-script";
11917
- if (I.getElementById(U)) return;
11918
- const W = I.createElement("script");
11919
- W.id = U, W.textContent = `
11916
+ const W = "f-chat-preview-injected-scrollbar-script";
11917
+ if (I.getElementById(W)) return;
11918
+ const U = I.createElement("script");
11919
+ U.id = W, U.textContent = `
11920
11920
  (function() {
11921
11921
  var hideTimer = null;
11922
11922
  var HIDE_DELAY = 800;
@@ -11937,7 +11937,7 @@ const ni = /* @__PURE__ */ ie({
11937
11937
  document.addEventListener('mouseenter', show);
11938
11938
  document.addEventListener('mouseleave', scheduleHide);
11939
11939
  })();
11940
- `, (I.head || I.documentElement).appendChild(W);
11940
+ `, (I.head || I.documentElement).appendChild(U);
11941
11941
  } catch {
11942
11942
  }
11943
11943
  }
@@ -14655,11 +14655,11 @@ const kr = /* @__PURE__ */ ie({
14655
14655
  else if (L === "multi_select")
14656
14656
  C[F.id] = F.default_value ? JSON.parse(F.default_value) : [];
14657
14657
  else if (L === "form") {
14658
- const U = {};
14658
+ const W = {};
14659
14659
  if (Array.isArray(F.fields))
14660
- for (const W of F.fields)
14661
- U[W.name] = W.default_value ?? "";
14662
- C[F.id] = U;
14660
+ for (const U of F.fields)
14661
+ W[U.name] = U.default_value ?? "";
14662
+ C[F.id] = W;
14663
14663
  } else C[F.id] = F.default_value ?? "";
14664
14664
  I[F.id] = {
14665
14665
  active: !1,
@@ -14681,7 +14681,7 @@ const kr = /* @__PURE__ */ ie({
14681
14681
  };
14682
14682
  for (const F of _) {
14683
14683
  C[F.id] = F.answer;
14684
- const L = e.content.questions.find((U) => U.id === F.id);
14684
+ const L = e.content.questions.find((W) => W.id === F.id);
14685
14685
  L && kn(L.ui_type) === "select" && typeof F.answer == "string" && !(L.options ?? []).some((B) => B.label === F.answer) && F.answer !== "" && (I[F.id] = {
14686
14686
  active: !0,
14687
14687
  text: F.answer
@@ -14711,10 +14711,10 @@ const kr = /* @__PURE__ */ ie({
14711
14711
  if (F === "text" && (typeof L != "string" || L.trim() === "") || F === "select" && (typeof L != "string" || L.trim() === "" || L === $t && (((C = (_ = r.value[I.id]) == null ? void 0 : _.text) == null ? void 0 : C.trim()) ?? "") === "") || F === "confirm" && typeof L != "boolean" || F === "multi_select" && (!Array.isArray(L) || L.length === 0))
14712
14712
  return !1;
14713
14713
  if (F === "form") {
14714
- const U = I.fields ?? [], W = L;
14715
- for (const B of U)
14714
+ const W = I.fields ?? [], U = L;
14715
+ for (const B of W)
14716
14716
  if (B.required) {
14717
- const P = W[B.name];
14717
+ const P = U[B.name];
14718
14718
  if (typeof P != "string" || P.trim() === "") return !1;
14719
14719
  }
14720
14720
  }
@@ -14762,11 +14762,11 @@ const kr = /* @__PURE__ */ ie({
14762
14762
  if (!m.value) return;
14763
14763
  const _ = [];
14764
14764
  for (const L of e.content.questions) {
14765
- const U = kn(L.ui_type);
14766
- let W = u.value[L.id];
14767
- U === "select" && W === $t && (W = ((I = (C = r.value[L.id]) == null ? void 0 : C.text) == null ? void 0 : I.trim()) ?? ""), U === "number" && (W = Number(W)), _.push({
14765
+ const W = kn(L.ui_type);
14766
+ let U = u.value[L.id];
14767
+ W === "select" && U === $t && (U = ((I = (C = r.value[L.id]) == null ? void 0 : C.text) == null ? void 0 : I.trim()) ?? ""), W === "number" && (U = Number(U)), _.push({
14768
14768
  id: L.id,
14769
- answer: W
14769
+ answer: U
14770
14770
  });
14771
14771
  }
14772
14772
  t.value = !0, (F = e.onSubmitAnswers) == null || F.call(e, _);
@@ -14783,10 +14783,10 @@ const kr = /* @__PURE__ */ ie({
14783
14783
  }, null)]);
14784
14784
  }
14785
14785
  function y(_, C, I, F, L) {
14786
- const U = (P) => {
14786
+ const W = (P) => {
14787
14787
  let R = Number(_) || 0;
14788
14788
  R += P, F !== void 0 && (R = Math.max(F, R)), L !== void 0 && (R = Math.min(L, R)), I(String(R));
14789
- }, W = L !== void 0 && Number(_ || 0) >= L, B = F !== void 0 && Number(_ || 0) <= F;
14789
+ }, U = L !== void 0 && Number(_ || 0) >= L, B = F !== void 0 && Number(_ || 0) <= F;
14790
14790
  return f("div", {
14791
14791
  class: "f-hitl-num-wrap"
14792
14792
  }, [f("input", {
@@ -14802,15 +14802,15 @@ const kr = /* @__PURE__ */ ie({
14802
14802
  }, [f("button", {
14803
14803
  type: "button",
14804
14804
  class: "f-hitl-num-btn",
14805
- disabled: C || W,
14806
- onClick: () => U(1)
14805
+ disabled: C || U,
14806
+ onClick: () => W(1)
14807
14807
  }, [f("span", {
14808
14808
  class: "fx-icon fx-icon-foldup"
14809
14809
  }, null)]), f("button", {
14810
14810
  type: "button",
14811
14811
  class: "f-hitl-num-btn",
14812
14812
  disabled: C || B,
14813
- onClick: () => U(-1)
14813
+ onClick: () => W(-1)
14814
14814
  }, [f("span", {
14815
14815
  class: "fx-icon fx-icon-expanddown"
14816
14816
  }, null)])])]);
@@ -14844,18 +14844,18 @@ const kr = /* @__PURE__ */ ie({
14844
14844
  }, [_.label]), C]);
14845
14845
  }
14846
14846
  function D(_, C, I) {
14847
- const F = u.value[_.id] ?? "", L = u.value[_.id] ?? [], U = r.value[_.id] ?? {
14847
+ const F = u.value[_.id] ?? "", L = u.value[_.id] ?? [], W = r.value[_.id] ?? {
14848
14848
  active: !1,
14849
14849
  text: ""
14850
- }, W = I === "single", B = W && F === $t || U.active, P = _.allow_other && B, R = (Z) => W ? F === Z.label && !U.active : L.includes(Z.label), z = (Z) => () => {
14851
- i.value || (W ? v(_, Z.label) : A(_, Z.label));
14850
+ }, U = I === "single", B = U && F === $t || W.active, P = _.allow_other && B, R = (Z) => U ? F === Z.label && !W.active : L.includes(Z.label), z = (Z) => () => {
14851
+ i.value || (U ? v(_, Z.label) : A(_, Z.label));
14852
14852
  }, q = () => {
14853
14853
  if (!i.value)
14854
- if (W)
14854
+ if (U)
14855
14855
  v(_, $t);
14856
14856
  else {
14857
- const Z = U.text;
14858
- U.active ? (p(_.id, L.filter((Q) => Q !== Z)), r.value = {
14857
+ const Z = W.text;
14858
+ W.active ? (p(_.id, L.filter((Q) => Q !== Z)), r.value = {
14859
14859
  ...r.value,
14860
14860
  [_.id]: {
14861
14861
  active: !1,
@@ -14865,9 +14865,9 @@ const kr = /* @__PURE__ */ ie({
14865
14865
  ...r.value,
14866
14866
  [_.id]: {
14867
14867
  active: !0,
14868
- text: U.text
14868
+ text: W.text
14869
14869
  }
14870
- }, U.text && !L.includes(U.text) && p(_.id, [...L, U.text]));
14870
+ }, W.text && !L.includes(W.text) && p(_.id, [...L, W.text]));
14871
14871
  }
14872
14872
  }, ee = (Z) => {
14873
14873
  const Q = Z.target.value;
@@ -14877,7 +14877,7 @@ const kr = /* @__PURE__ */ ie({
14877
14877
  active: !0,
14878
14878
  text: Q
14879
14879
  }
14880
- }, W ? p(_.id, $t) : p(_.id, [...L.filter((ae) => ae !== U.text), Q]);
14880
+ }, U ? p(_.id, $t) : p(_.id, [...L.filter((ae) => ae !== W.text), Q]);
14881
14881
  };
14882
14882
  return f("div", {
14883
14883
  key: _.id
@@ -14900,7 +14900,7 @@ const kr = /* @__PURE__ */ ie({
14900
14900
  }, null) : null])]) : null]), P ? f("input", {
14901
14901
  class: "f-hitl-input f-hitl-input--other",
14902
14902
  type: "text",
14903
- value: U.text,
14903
+ value: W.text,
14904
14904
  placeholder: "请输入自定义内容",
14905
14905
  disabled: i.value,
14906
14906
  onInput: ee
@@ -14917,21 +14917,24 @@ const kr = /* @__PURE__ */ ie({
14917
14917
  const L = C[F.name] ?? "";
14918
14918
  return F.type === "select" ? T(F, f("div", {
14919
14919
  class: "f-hitl-select-group"
14920
- }, [(F.options ?? []).map((U) => f("button", {
14921
- key: U,
14922
- type: "button",
14923
- class: ["f-hitl-opt", {
14924
- "f-hitl-opt--active": L === U
14925
- }],
14926
- disabled: i.value,
14927
- onClick: () => x(_.id, F.name, U)
14928
- }, [U]))])) : F.type === "number" ? T(F, y(L, i.value, (U) => x(_.id, F.name, U), F.min, F.max)) : F.type === "date" ? T(F, g(L, i.value, (U) => x(_.id, F.name, U))) : T(F, f("input", {
14920
+ }, [(F.options ?? []).map((W) => {
14921
+ const U = typeof W == "string" ? W : W.label ?? "";
14922
+ return f("button", {
14923
+ key: U,
14924
+ type: "button",
14925
+ class: ["f-hitl-opt", {
14926
+ "f-hitl-opt--active": L === U
14927
+ }],
14928
+ disabled: i.value,
14929
+ onClick: () => x(_.id, F.name, U)
14930
+ }, [U]);
14931
+ })])) : F.type === "number" ? T(F, y(L, i.value, (W) => x(_.id, F.name, W), F.min, F.max)) : F.type === "date" ? T(F, g(L, i.value, (W) => x(_.id, F.name, W))) : T(F, f("input", {
14929
14932
  class: "f-hitl-input",
14930
14933
  type: "text",
14931
14934
  value: L,
14932
14935
  placeholder: F.default_value ?? "请输入",
14933
14936
  disabled: i.value,
14934
- onInput: (U) => x(_.id, F.name, U.target.value)
14937
+ onInput: (W) => x(_.id, F.name, W.target.value)
14935
14938
  }, null));
14936
14939
  })])]);
14937
14940
  }
@@ -15016,13 +15019,13 @@ const kr = /* @__PURE__ */ ie({
15016
15019
  }, [ce("暂不支持 ui_type「"), String(_.ui_type), ce("」,请升级前端。")])]);
15017
15020
  }
15018
15021
  function H(_) {
15019
- const C = kn(_.ui_type), I = (L, U, W) => f("input", {
15022
+ const C = kn(_.ui_type), I = (L, W, U) => f("input", {
15020
15023
  class: "f-hitl-input",
15021
15024
  type: L,
15022
- value: U,
15025
+ value: W,
15023
15026
  readonly: !0,
15024
- min: W == null ? void 0 : W.min,
15025
- max: W == null ? void 0 : W.max
15027
+ min: U == null ? void 0 : U.min,
15028
+ max: U == null ? void 0 : U.max
15026
15029
  }, null);
15027
15030
  if (C === "text") {
15028
15031
  const L = u.value[_.id] ?? "";
@@ -15032,12 +15035,12 @@ const kr = /* @__PURE__ */ ie({
15032
15035
  }, [I("text", L)]);
15033
15036
  }
15034
15037
  if (C === "multi_select") {
15035
- const L = u.value[_.id] ?? [], U = Array.isArray(_.options) ? _.options : [], W = new Set(U.map((P) => P.label)), B = L.filter((P) => !W.has(P));
15038
+ const L = u.value[_.id] ?? [], W = Array.isArray(_.options) ? _.options : [], U = new Set(W.map((P) => P.label)), B = L.filter((P) => !U.has(P));
15036
15039
  return f("div", {
15037
15040
  key: _.id
15038
15041
  }, [f("div", {
15039
15042
  class: "f-hitl-option-list"
15040
- }, [U.filter((P) => L.includes(P.label)).map((P) => f("div", {
15043
+ }, [W.filter((P) => L.includes(P.label)).map((P) => f("div", {
15041
15044
  class: "f-hitl-opt-row",
15042
15045
  key: P.label
15043
15046
  }, [f("div", {
@@ -15052,10 +15055,10 @@ const kr = /* @__PURE__ */ ie({
15052
15055
  }, [f("span", null, [P])])]))])]);
15053
15056
  }
15054
15057
  if (C === "select") {
15055
- const L = u.value[_.id] ?? "", U = r.value[_.id] ?? {
15058
+ const L = u.value[_.id] ?? "", W = r.value[_.id] ?? {
15056
15059
  active: !1,
15057
15060
  text: ""
15058
- }, W = Array.isArray(_.options) ? _.options : [], B = L === $t || U.active;
15061
+ }, U = Array.isArray(_.options) ? _.options : [], B = L === $t || W.active;
15059
15062
  return f("div", {
15060
15063
  key: _.id
15061
15064
  }, [f("div", {
@@ -15064,7 +15067,7 @@ const kr = /* @__PURE__ */ ie({
15064
15067
  class: "f-hitl-opt-row"
15065
15068
  }, [f("div", {
15066
15069
  class: "f-hitl-opt-row__label"
15067
- }, [f("span", null, [U.text || "其他"])])]) : W.filter((P) => P.label === L).map((P) => f("div", {
15070
+ }, [f("span", null, [W.text || "其他"])])]) : U.filter((P) => P.label === L).map((P) => f("div", {
15068
15071
  class: "f-hitl-opt-row",
15069
15072
  key: P.label
15070
15073
  }, [f("div", {
@@ -15086,19 +15089,19 @@ const kr = /* @__PURE__ */ ie({
15086
15089
  }, [L === !0 ? "是" : "否"])])]);
15087
15090
  }
15088
15091
  if (C === "form") {
15089
- const L = u.value[_.id] ?? {}, U = _.fields ?? [];
15092
+ const L = u.value[_.id] ?? {}, W = _.fields ?? [];
15090
15093
  return f("div", {
15091
15094
  class: "f-hitl-field",
15092
15095
  key: _.id
15093
15096
  }, [f("div", {
15094
15097
  class: "f-hitl-form-group"
15095
- }, [U.map((W) => {
15096
- const B = L[W.name] ?? "";
15098
+ }, [W.map((U) => {
15099
+ const B = L[U.name] ?? "";
15097
15100
  let P;
15098
- return W.type === "number" ? P = I("number", B, {
15099
- min: W.min,
15100
- max: W.max
15101
- }) : W.type === "date" ? P = I("date", B) : P = I("text", B), T(W, P);
15101
+ return U.type === "number" ? P = I("number", B, {
15102
+ min: U.min,
15103
+ max: U.max
15104
+ }) : U.type === "date" ? P = I("date", B) : P = I("text", B), T(U, P);
15102
15105
  })])]);
15103
15106
  }
15104
15107
  if (C === "date") {
@@ -15199,7 +15202,7 @@ const kr = /* @__PURE__ */ ie({
15199
15202
  onClick: b
15200
15203
  }, [ce("提交")])])]);
15201
15204
  }
15202
- return () => t.value ? O() : V();
15205
+ return () => i.value ? O() : V();
15203
15206
  }
15204
15207
  });
15205
15208
  kr.install = (e) => {