x-essential-lib 0.9.0 → 0.9.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.
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -2,5 +2,6 @@ interface Props {
2
2
  open?: boolean;
3
3
  zIndex?: number;
4
4
  }
5
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
6
7
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -5,9 +5,10 @@ interface Props {
5
5
  text: string;
6
6
  timeout?: number;
7
7
  }
8
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
9
  timeout: (...args: any[]) => void;
10
10
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
11
11
  onTimeout?: ((...args: any[]) => any) | undefined;
12
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
13
14
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
2
3
  export default _default;
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.id="x-essential-lib",d.appendChild(document.createTextNode('.fade-leave-active[data-v-83c3cd1d]{transition:opacity .5s ease}.fade-leave-to[data-v-83c3cd1d]{opacity:0}.x-cont[data-v-83c3cd1d]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-83c3cd1d]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-83c3cd1d]{transform-origin:20px 20px;animation:lds-spinner-83c3cd1d 1.2s linear infinite}.lds-spinner div[data-v-83c3cd1d]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-83c3cd1d]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-83c3cd1d]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-83c3cd1d]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-83c3cd1d]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-83c3cd1d]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-83c3cd1d]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-83c3cd1d]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-83c3cd1d]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-83c3cd1d]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-83c3cd1d]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-83c3cd1d{0%{opacity:1}to{opacity:0}}.x-item[data-v-f1f60167]{width:600px}@media (max-width: 600px){.x-item[data-v-f1f60167]{width:calc(100vw - 16px)}}.x-cont[data-v-b482df18]{position:fixed;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(d)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { computed as C, provide as U, inject as $, ref as p, watchEffect as le, onMounted as N, onBeforeUnmount as K, onBeforeMount as xe, defineComponent as I, watch as F, resolveComponent as v, createBlock as L, openBlock as q, withKeys as z, unref as E, withModifiers as A, isRef as W, withCtx as g, createVNode as b, createTextVNode as B, toDisplayString as S, Transition as ke, createElementBlock as P, createCommentVNode as ee, normalizeStyle as ue, createElementVNode as k, Fragment as De, renderList as Ve, useTemplateRef as ce } from "vue";
2
+ import { computed as C, provide as U, inject as $, ref as p, watchEffect as le, onMounted as N, onBeforeUnmount as K, onBeforeMount as we, defineComponent as I, watch as F, resolveComponent as v, createBlock as L, openBlock as q, withKeys as z, unref as E, withModifiers as A, isRef as W, withCtx as g, createVNode as b, createTextVNode as B, toDisplayString as S, Transition as ke, createElementBlock as P, createCommentVNode as ee, normalizeStyle as ue, createElementVNode as k, Fragment as De, renderList as Ve, useTemplateRef as ce } from "vue";
3
3
  import { useI18n as G } from "vue-i18n";
4
4
  import { useTheme as se, useDisplay as Ce } from "vuetify";
5
5
  import { useRouter as pe, useRoute as qe } from "vue-router";
6
6
  import je from "axios";
7
- import { a as T, m as Re, u as Se } from "./vendor.ohp5twbt.js";
7
+ import { a as T, m as Re, u as Se } from "./vendor.lvdyytxg.js";
8
8
  function Oe() {
9
- const e = se(), t = C(() => e.global.current.value.colors.primary), a = C(() => e.global.current.value.colors.secondary), o = C(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = C(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = C(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), c = C(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = C(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
9
+ const e = se(), t = C(() => e.global.current.value.colors.primary), a = C(() => e.global.current.value.colors.secondary), o = C(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = C(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = C(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), s = C(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = C(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
10
10
  return {
11
11
  primaryColor: t,
12
12
  secondaryColor: a,
13
13
  backgroundColor0: o,
14
14
  backgroundColor1: l,
15
15
  backgroundColor2: r,
16
- highlightColor: c,
16
+ highlightColor: s,
17
17
  borderColor: n
18
18
  };
19
19
  }
@@ -304,10 +304,10 @@ function H(e) {
304
304
  const o = e.split("/").filter((l) => l.trim() !== "");
305
305
  return Je.forEach((l) => {
306
306
  const r = l.path.split("/").filter((n) => n.trim() !== "");
307
- let c = 0;
307
+ let s = 0;
308
308
  for (let n = 0; n < o.length && !(n >= r.length || o[n] !== r[n]); n++)
309
- c++;
310
- c > 0 && c > a && (t = l, a = c);
309
+ s++;
310
+ s > 0 && s > a && (t = l, a = s);
311
311
  }), t;
312
312
  }
313
313
  const Z = p("");
@@ -320,8 +320,8 @@ function O(e, t, a) {
320
320
  }
321
321
  if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !l)
322
322
  return;
323
- const r = o.app === l.app, c = o.path === l.path, n = o.level >= l.level;
324
- r ? c ? Z.value = "" : Z.value = n ? "inner-left" : "inner-right" : (Z.value = "", Ie(o.app, n));
323
+ const r = o.app === l.app, s = o.path === l.path, n = o.level >= l.level;
324
+ r ? s ? Z.value = "" : Z.value = n ? "inner-left" : "inner-right" : (Z.value = "", Ie(o.app, n));
325
325
  }
326
326
  function Qe() {
327
327
  return !!T.get("accessToken");
@@ -330,12 +330,12 @@ function Ye() {
330
330
  return !!T.get("activeOrg");
331
331
  }
332
332
  function Ut(e, t, a, o) {
333
- const l = Qe(), r = Ye(), c = H(e.path);
334
- if (!c) {
333
+ const l = Qe(), r = Ye(), s = H(e.path);
334
+ if (!s) {
335
335
  console.assert(!1), a();
336
336
  return;
337
337
  }
338
- if (c.requiredState === "auth")
338
+ if (s.requiredState === "auth")
339
339
  if (l)
340
340
  if (r) {
341
341
  const n = "/main";
@@ -346,7 +346,7 @@ function Ut(e, t, a, o) {
346
346
  const n = "/passport/login";
347
347
  O(n, t.path, o), a({ path: n });
348
348
  }
349
- else if (c.requiredState === "org")
349
+ else if (s.requiredState === "org")
350
350
  if (l)
351
351
  if (r)
352
352
  O(e.path, t.path, o), a();
@@ -394,21 +394,21 @@ function Kt(e) {
394
394
  e.value = [];
395
395
  }
396
396
  function Nt(e, t, a, o, l, r) {
397
- const c = qe(), n = pe(), _ = Se(), s = p(!1);
397
+ const s = qe(), n = pe(), _ = Se(), c = p(!1);
398
398
  le(() => {
399
399
  let f = !1;
400
- typeof e.value == "boolean" ? f = e.value : f = _.value, s.value = f;
401
- }), Ke(s), Ne(t), We(a), ze(o), He(l), Fe(r);
402
- const h = se();
400
+ typeof e.value == "boolean" ? f = e.value : f = _.value, c.value = f;
401
+ }), Ke(c), Ne(t), We(a), ze(o), He(l), Fe(r);
402
+ const x = se();
403
403
  le(() => {
404
- h.change(s.value ? "dark" : "light");
404
+ x.change(c.value ? "dark" : "light");
405
405
  });
406
406
  const D = () => {
407
407
  if (!Ze(r)) {
408
408
  me(r, "waitDlg") || tt(r);
409
409
  return;
410
410
  }
411
- const f = H(c.path);
411
+ const f = H(s.path);
412
412
  if (!f) {
413
413
  console.assert(!1);
414
414
  return;
@@ -424,17 +424,17 @@ function Nt(e, t, a, o, l, r) {
424
424
  D();
425
425
  return;
426
426
  }
427
- }, w = () => {
427
+ }, h = () => {
428
428
  D();
429
429
  };
430
430
  N(() => {
431
- window.addEventListener("keydown", y), u.on("backbutton", w);
431
+ window.addEventListener("keydown", y), u.on("backbutton", h);
432
432
  }), K(() => {
433
- window.removeEventListener("keydown", y), u.off("backbutton", w);
433
+ window.removeEventListener("keydown", y), u.off("backbutton", h);
434
434
  });
435
435
  const i = (f) => {
436
436
  e.value = f;
437
- }, x = (f) => {
437
+ }, w = (f) => {
438
438
  t.value = f;
439
439
  }, d = (f) => {
440
440
  const m = f;
@@ -442,10 +442,10 @@ function Nt(e, t, a, o, l, r) {
442
442
  }, j = (f) => {
443
443
  l.value = f;
444
444
  };
445
- xe(() => {
446
- u.on("updateDark", i), u.on("updateLocale", x), u.on("updatePermission", d), u.on("updateLastAppPath", j), u.emit("syncGlobalState");
445
+ we(() => {
446
+ u.on("updateDark", i), u.on("updateLocale", w), u.on("updatePermission", d), u.on("updateLastAppPath", j), u.emit("syncGlobalState");
447
447
  }), K(() => {
448
- u.off("updateDark", i), u.off("updateLocale", x), u.off("updatePermission", d), u.off("updateLastAppPath", j);
448
+ u.off("updateDark", i), u.off("updateLocale", w), u.off("updatePermission", d), u.off("updateLastAppPath", j);
449
449
  });
450
450
  }
451
451
  function Wt() {
@@ -488,18 +488,18 @@ function J(e, t) {
488
488
  const at = /* @__PURE__ */ I({
489
489
  __name: "index",
490
490
  setup(e) {
491
- const { t } = G(), a = p(""), o = p(""), l = p(""), r = p(""), c = p(""), n = p("");
492
- let _ = 0, s = !1;
493
- const h = (w) => {
494
- const i = w;
495
- a.value = i.title, o.value = i.text, l.value = i.cancel?.color ?? "primary", r.value = i.cancel?.text ?? t("dlg.common.cancel"), c.value = i.confirm?.color ?? "primary", n.value = i.confirm?.text ?? t("dlg.common.confirm"), _ = i.seq, s = !1, D.value = !0;
496
- }, { open: D } = J("confirmDlg", h), y = () => {
497
- D.value = !1, s || (u.emit("confirmDlgResult" + _, !0), s = !0);
491
+ const { t } = G(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(""), n = p("");
492
+ let _ = 0, c = !1;
493
+ const x = (h) => {
494
+ const i = h;
495
+ a.value = i.title, o.value = i.text, l.value = i.cancel?.color ?? "primary", r.value = i.cancel?.text ?? t("dlg.common.cancel"), s.value = i.confirm?.color ?? "primary", n.value = i.confirm?.text ?? t("dlg.common.confirm"), _ = i.seq, c = !1, D.value = !0;
496
+ }, { open: D } = J("confirmDlg", x), y = () => {
497
+ D.value = !1, c || (u.emit("confirmDlgResult" + _, !0), c = !0);
498
498
  };
499
- return F(D, (w) => {
500
- !w && !s && (u.emit("confirmDlgResult" + _, !1), s = !0);
501
- }), (w, i) => {
502
- const x = v("v-card-text"), d = v("v-btn"), j = v("v-card-actions"), f = v("v-card"), m = v("v-dialog");
499
+ return F(D, (h) => {
500
+ !h && !c && (u.emit("confirmDlgResult" + _, !1), c = !0);
501
+ }), (h, i) => {
502
+ const w = v("v-card-text"), d = v("v-btn"), j = v("v-card-actions"), f = v("v-card"), m = v("v-dialog");
503
503
  return q(), L(m, {
504
504
  modelValue: E(D),
505
505
  "onUpdate:modelValue": i[1] || (i[1] = (V) => W(D) ? D.value = V : null),
@@ -514,7 +514,7 @@ const at = /* @__PURE__ */ I({
514
514
  default: g(() => [
515
515
  b(f, { title: a.value }, {
516
516
  default: g(() => [
517
- b(x, null, {
517
+ b(w, null, {
518
518
  default: g(() => [
519
519
  B(S(o.value), 1)
520
520
  ]),
@@ -533,7 +533,7 @@ const at = /* @__PURE__ */ I({
533
533
  _: 1
534
534
  }, 8, ["color"]),
535
535
  b(d, {
536
- color: c.value,
536
+ color: s.value,
537
537
  variant: "text",
538
538
  onClick: y
539
539
  }, {
@@ -567,7 +567,7 @@ const at = /* @__PURE__ */ I({
567
567
  let o = 0;
568
568
  return (l, r) => (q(), L(ke, { name: "fade" }, {
569
569
  default: g(() => [
570
- l.open ? (q(), P("div", {
570
+ e.open ? (q(), P("div", {
571
571
  key: W(o) ? ++o.value : ++o,
572
572
  class: "x-cont",
573
573
  style: ue(a.value)
@@ -627,13 +627,13 @@ const at = /* @__PURE__ */ I({
627
627
  setTimeout(() => {
628
628
  r("timeout", e.id);
629
629
  }, e.timeout);
630
- }), F(l, (c) => {
631
- c || r("timeout", e.id);
632
- }), (c, n) => {
633
- const _ = v("v-icon"), s = v("v-sheet");
634
- return q(), L(s, {
630
+ }), F(l, (s) => {
631
+ s || r("timeout", e.id);
632
+ }), (s, n) => {
633
+ const _ = v("v-icon"), c = v("v-sheet");
634
+ return q(), L(c, {
635
635
  class: "x-item d-flex align-center py-2 mb-2",
636
- color: c.type,
636
+ color: e.type,
637
637
  elevation: 1
638
638
  }, {
639
639
  default: g(() => [
@@ -644,11 +644,11 @@ const at = /* @__PURE__ */ I({
644
644
  }, null, 8, ["icon"])) : ee("", !0),
645
645
  k("div", {
646
646
  style: ue(a.value)
647
- }, S(c.text), 5),
647
+ }, S(e.text), 5),
648
648
  b(_, {
649
649
  class: "mx-1",
650
650
  icon: "mdi-close",
651
- onClick: n[0] || (n[0] = (h) => r("timeout", c.id))
651
+ onClick: n[0] || (n[0] = (x) => r("timeout", e.id))
652
652
  })
653
653
  ]),
654
654
  _: 1
@@ -665,17 +665,17 @@ const at = /* @__PURE__ */ I({
665
665
  u.off("message", a);
666
666
  });
667
667
  const a = (n) => {
668
- const { type: _, text: s, timeout: h } = n;
669
- r(_, s, h);
668
+ const { type: _, text: c, timeout: x } = n;
669
+ r(_, c, x);
670
670
  }, o = (n) => {
671
- c(n);
671
+ s(n);
672
672
  };
673
673
  let l = 0;
674
- const r = (n, _, s) => {
675
- const h = l++;
676
- t.value.push({ id: h, type: n, text: _, timeout: s });
677
- }, c = (n) => {
678
- const _ = t.value.findIndex((s) => s.id === n);
674
+ const r = (n, _, c) => {
675
+ const x = l++;
676
+ t.value.push({ id: x, type: n, text: _, timeout: c });
677
+ }, s = (n) => {
678
+ const _ = t.value.findIndex((c) => c.id === n);
679
679
  _ >= 0 && t.value.splice(_, 1);
680
680
  };
681
681
  return (n, _) => (q(), P("div", {
@@ -683,12 +683,12 @@ const at = /* @__PURE__ */ I({
683
683
  onClick: _[0] || (_[0] = A(() => {
684
684
  }, ["stop"]))
685
685
  }, [
686
- (q(!0), P(De, null, Ve(t.value, (s) => (q(), L(rt, {
687
- id: s.id,
688
- key: s.id,
689
- text: s.text,
690
- timeout: s.timeout,
691
- type: s.type,
686
+ (q(!0), P(De, null, Ve(t.value, (c) => (q(), L(rt, {
687
+ id: c.id,
688
+ key: c.id,
689
+ text: c.text,
690
+ timeout: c.timeout,
691
+ type: c.type,
692
692
  onTimeout: o
693
693
  }, null, 8, ["id", "text", "timeout", "type"]))), 128))
694
694
  ]));
@@ -696,16 +696,16 @@ const at = /* @__PURE__ */ I({
696
696
  }), ct = /* @__PURE__ */ oe(ut, [["__scopeId", "data-v-b482df18"]]), st = /* @__PURE__ */ I({
697
697
  __name: "index",
698
698
  setup(e) {
699
- const { t } = G(), a = p(""), o = p(0), l = p(), r = p(-1 / 0), c = p(1 / 0), n = p(1);
700
- let _ = 0, s = !1;
701
- const h = ce("target"), D = async (x) => {
702
- a.value = x.title, o.value = x.value, l.value = x.precision, r.value = x.min, c.value = x.max, n.value = x.step, _ = x.seq, s = !1, y.value = !0, await X(() => !!h.value), h.value.focus();
703
- }, { open: y } = J("numberDlg", D), w = p(!1), i = () => {
704
- y.value = !1, s || (u.emit(`numberDlgResult${_}`, o.value), s = !0);
699
+ const { t } = G(), a = p(""), o = p(0), l = p(), r = p(-1 / 0), s = p(1 / 0), n = p(1);
700
+ let _ = 0, c = !1;
701
+ const x = ce("target"), D = async (w) => {
702
+ a.value = w.title, o.value = w.value, l.value = w.precision, r.value = w.min, s.value = w.max, n.value = w.step, _ = w.seq, c = !1, y.value = !0, await X(() => !!x.value), x.value.focus();
703
+ }, { open: y } = J("numberDlg", D), h = p(!1), i = () => {
704
+ y.value = !1, c || (u.emit(`numberDlgResult${_}`, o.value), c = !0);
705
705
  };
706
- return F(y, (x) => {
707
- !x && !s && (u.emit(`numberDlgResult${_}`, void 0), s = !0);
708
- }), (x, d) => {
706
+ return F(y, (w) => {
707
+ !w && !c && (u.emit(`numberDlgResult${_}`, void 0), c = !0);
708
+ }), (w, d) => {
709
709
  const j = v("v-number-input"), f = v("v-btn"), m = v("v-card-actions"), V = v("v-form"), Q = v("v-card"), Y = v("v-dialog");
710
710
  return q(), L(Y, {
711
711
  modelValue: E(y),
@@ -719,19 +719,19 @@ const at = /* @__PURE__ */ I({
719
719
  b(Q, { title: a.value }, {
720
720
  default: g(() => [
721
721
  b(V, {
722
- modelValue: w.value,
723
- "onUpdate:modelValue": d[2] || (d[2] = (R) => w.value = R),
722
+ modelValue: h.value,
723
+ "onUpdate:modelValue": d[2] || (d[2] = (R) => h.value = R),
724
724
  class: "mx-3",
725
725
  onSubmit: A(i, ["prevent"])
726
726
  }, {
727
727
  default: g(() => [
728
728
  b(j, {
729
729
  ref_key: "target",
730
- ref: h,
730
+ ref: x,
731
731
  modelValue: o.value,
732
732
  "onUpdate:modelValue": d[0] || (d[0] = (R) => o.value = R),
733
733
  "control-variant": "stacked",
734
- max: c.value,
734
+ max: s.value,
735
735
  min: r.value,
736
736
  precision: l.value,
737
737
  step: n.value
@@ -750,7 +750,7 @@ const at = /* @__PURE__ */ I({
750
750
  }),
751
751
  b(f, {
752
752
  color: "primary",
753
- disabled: !w.value,
753
+ disabled: !h.value,
754
754
  type: "submit",
755
755
  variant: "text"
756
756
  }, {
@@ -776,18 +776,18 @@ const at = /* @__PURE__ */ I({
776
776
  }), pt = /* @__PURE__ */ I({
777
777
  __name: "index",
778
778
  setup(e) {
779
- const { t } = G(), a = p(""), o = p(""), l = p(""), r = p(""), c = p(), n = p(""), _ = p(""), s = p(""), h = p(""), D = p("");
780
- let y = 0, w = !1;
781
- const i = ce("target"), x = async (m) => {
782
- a.value = m.title, o.value = m.text, l.value = m.label, r.value = m.placeholder, c.value = m.rules, n.value = m.value, _.value = m.cancel?.color ?? "primary", s.value = m.cancel?.text ?? t("dlg.common.cancel"), h.value = m.confirm?.color ?? "primary", D.value = m.confirm?.text ?? t("dlg.common.confirm"), y = m.seq, w = !1, d.value = !0, await X(() => !!i.value), i.value.focus();
783
- }, { open: d } = J("promptDlg", x), j = p(!1), f = () => {
784
- d.value = !1, w || (u.emit("promptDlgResult" + y, n.value ?? ""), w = !0);
779
+ const { t } = G(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(), n = p(""), _ = p(""), c = p(""), x = p(""), D = p("");
780
+ let y = 0, h = !1;
781
+ const i = ce("target"), w = async (m) => {
782
+ a.value = m.title, o.value = m.text, l.value = m.label, r.value = m.placeholder, s.value = m.rules, n.value = m.value, _.value = m.cancel?.color ?? "primary", c.value = m.cancel?.text ?? t("dlg.common.cancel"), x.value = m.confirm?.color ?? "primary", D.value = m.confirm?.text ?? t("dlg.common.confirm"), y = m.seq, h = !1, d.value = !0, await X(() => !!i.value), i.value.focus();
783
+ }, { open: d } = J("promptDlg", w), j = p(!1), f = () => {
784
+ d.value = !1, h || (u.emit("promptDlgResult" + y, n.value ?? ""), h = !0);
785
785
  };
786
786
  return F(d, (m) => {
787
- !m && !w && (u.emit("promptDlgResult" + y, void 0), w = !0);
787
+ !m && !h && (u.emit("promptDlgResult" + y, void 0), h = !0);
788
788
  }), (m, V) => {
789
- const Q = v("v-card-text"), Y = v("v-text-field"), R = v("v-btn"), be = v("v-card-actions"), ye = v("v-form"), he = v("v-card"), we = v("v-dialog");
790
- return q(), L(we, {
789
+ const Q = v("v-card-text"), Y = v("v-text-field"), R = v("v-btn"), be = v("v-card-actions"), ye = v("v-form"), xe = v("v-card"), he = v("v-dialog");
790
+ return q(), L(he, {
791
791
  modelValue: E(d),
792
792
  "onUpdate:modelValue": V[3] || (V[3] = (M) => W(d) ? d.value = M : null),
793
793
  attach: "",
@@ -796,7 +796,7 @@ const at = /* @__PURE__ */ I({
796
796
  onKeydown: V[4] || (V[4] = z(A((M) => d.value = !1, ["stop", "prevent"]), ["esc"]))
797
797
  }, {
798
798
  default: g(() => [
799
- b(he, { title: a.value }, {
799
+ b(xe, { title: a.value }, {
800
800
  default: g(() => [
801
801
  o.value ? (q(), L(Q, { key: 0 }, {
802
802
  default: g(() => [
@@ -818,7 +818,7 @@ const at = /* @__PURE__ */ I({
818
818
  "onUpdate:modelValue": V[0] || (V[0] = (M) => n.value = M),
819
819
  label: l.value,
820
820
  placeholder: r.value,
821
- rules: c.value
821
+ rules: s.value
822
822
  }, null, 8, ["modelValue", "label", "placeholder", "rules"]),
823
823
  b(be, { class: "d-flex justify-end" }, {
824
824
  default: g(() => [
@@ -828,12 +828,12 @@ const at = /* @__PURE__ */ I({
828
828
  onClick: V[1] || (V[1] = (M) => d.value = !1)
829
829
  }, {
830
830
  default: g(() => [
831
- B(S(s.value), 1)
831
+ B(S(c.value), 1)
832
832
  ]),
833
833
  _: 1
834
834
  }, 8, ["color"]),
835
835
  b(R, {
836
- color: h.value,
836
+ color: x.value,
837
837
  disabled: !j.value,
838
838
  type: "submit",
839
839
  variant: "text"
@@ -860,8 +860,8 @@ const at = /* @__PURE__ */ I({
860
860
  }), _t = { class: "ma-auto" }, dt = { class: "w-100 h-100 d-flex align-center justify-center" }, it = { class: "text-body-1" }, ft = /* @__PURE__ */ I({
861
861
  __name: "index",
862
862
  setup(e) {
863
- const { t } = G(), a = p(""), o = (c) => {
864
- const n = c;
863
+ const { t } = G(), a = p(""), o = (s) => {
864
+ const n = s;
865
865
  a.value = n.text ?? t("dlg.common.responding"), r.value = !0;
866
866
  }, l = () => {
867
867
  r.value = !1;
@@ -870,11 +870,11 @@ const at = /* @__PURE__ */ I({
870
870
  u.on("closeWaitDlg", l);
871
871
  }), K(() => {
872
872
  u.off("closeWaitDlg", l);
873
- }), (c, n) => {
874
- const _ = v("v-card"), s = v("v-dialog");
875
- return q(), L(s, {
873
+ }), (s, n) => {
874
+ const _ = v("v-card"), c = v("v-dialog");
875
+ return q(), L(c, {
876
876
  modelValue: E(r),
877
- "onUpdate:modelValue": n[0] || (n[0] = (h) => W(r) ? r.value = h : null),
877
+ "onUpdate:modelValue": n[0] || (n[0] = (x) => W(r) ? r.value = x : null),
878
878
  attach: "",
879
879
  fullscreen: "",
880
880
  "no-click-animation": "",
@@ -0,0 +1,183 @@
1
+ import { getCurrentInstance as j, getCurrentScope as M, hasInjectionContext as x, inject as I, watch as b, onScopeDispose as E, shallowRef as h, watchEffect as O, toValue as p, computed as w, onMounted as R, unref as D } from "vue";
2
+ function U(e, n) {
3
+ return M() ? (E(e, n), !0) : !1;
4
+ }
5
+ const g = /* @__PURE__ */ new WeakMap(), A = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
6
+ var n;
7
+ const t = e[0], i = (n = j()) === null || n === void 0 ? void 0 : n.proxy, o = i ?? M();
8
+ if (o == null && !x()) throw new Error("injectLocal must be called in setup");
9
+ return o && g.has(o) && t in g.get(o) ? g.get(o)[t] : I(...e);
10
+ }, B = typeof window < "u" && typeof document < "u";
11
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
12
+ const F = Object.prototype.toString, L = (e) => F.call(e) === "[object Object]";
13
+ function S(e) {
14
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
15
+ }
16
+ function y(e) {
17
+ return Array.isArray(e) ? e : [e];
18
+ }
19
+ function P(e, n, t) {
20
+ return b(e, n, {
21
+ ...t,
22
+ immediate: !0
23
+ });
24
+ }
25
+ const W = B ? window : void 0;
26
+ function T(e) {
27
+ var n;
28
+ const t = p(e);
29
+ return (n = t?.$el) !== null && n !== void 0 ? n : t;
30
+ }
31
+ function $(...e) {
32
+ const n = [], t = () => {
33
+ n.forEach((r) => r()), n.length = 0;
34
+ }, i = (r, c, s, l) => (r.addEventListener(c, s, l), () => r.removeEventListener(c, s, l)), o = w(() => {
35
+ const r = y(p(e[0])).filter((c) => c != null);
36
+ return r.every((c) => typeof c != "string") ? r : void 0;
37
+ }), a = P(() => {
38
+ var r, c;
39
+ return [
40
+ (r = (c = o.value) === null || c === void 0 ? void 0 : c.map((s) => T(s))) !== null && r !== void 0 ? r : [W].filter((s) => s != null),
41
+ y(p(o.value ? e[1] : e[0])),
42
+ y(D(o.value ? e[2] : e[1])),
43
+ p(o.value ? e[3] : e[2])
44
+ ];
45
+ }, ([r, c, s, l]) => {
46
+ if (t(), !r?.length || !c?.length || !s?.length) return;
47
+ const f = L(l) ? { ...l } : l;
48
+ n.push(...r.flatMap((v) => c.flatMap((d) => s.map((k) => i(v, d, k, f)))));
49
+ }, { flush: "post" }), u = () => {
50
+ a(), t();
51
+ };
52
+ return U(t), u;
53
+ }
54
+ // @__NO_SIDE_EFFECTS__
55
+ function z() {
56
+ const e = h(!1), n = j();
57
+ return n && R(() => {
58
+ e.value = !0;
59
+ }, n), e;
60
+ }
61
+ // @__NO_SIDE_EFFECTS__
62
+ function G(e) {
63
+ const n = /* @__PURE__ */ z();
64
+ return w(() => (n.value, !!e()));
65
+ }
66
+ const Q = Symbol("vueuse-ssr-width");
67
+ // @__NO_SIDE_EFFECTS__
68
+ function V() {
69
+ const e = x() ? /* @__PURE__ */ A(Q, null) : null;
70
+ return typeof e == "number" ? e : void 0;
71
+ }
72
+ function H(e, n = {}) {
73
+ const { window: t = W, ssrWidth: i = /* @__PURE__ */ V() } = n, o = /* @__PURE__ */ G(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), a = h(typeof i == "number"), u = h(), r = h(!1), c = (s) => {
74
+ r.value = s.matches;
75
+ };
76
+ return O(() => {
77
+ if (a.value) {
78
+ a.value = !o.value, r.value = p(e).split(",").some((s) => {
79
+ const l = s.includes("not all"), f = s.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), v = s.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
80
+ let d = !!(f || v);
81
+ return f && d && (d = i >= S(f[1])), v && d && (d = i <= S(v[1])), l ? !d : d;
82
+ });
83
+ return;
84
+ }
85
+ o.value && (u.value = t.matchMedia(p(e)), r.value = u.value.matches);
86
+ }), $(u, "change", c, { passive: !0 }), w(() => r.value);
87
+ }
88
+ // @__NO_SIDE_EFFECTS__
89
+ function X(e) {
90
+ return H("(prefers-color-scheme: dark)", e);
91
+ }
92
+ /*! js-cookie v3.0.5 | MIT */
93
+ function m(e) {
94
+ for (var n = 1; n < arguments.length; n++) {
95
+ var t = arguments[n];
96
+ for (var i in t)
97
+ e[i] = t[i];
98
+ }
99
+ return e;
100
+ }
101
+ var J = {
102
+ read: function(e) {
103
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
104
+ },
105
+ write: function(e) {
106
+ return encodeURIComponent(e).replace(
107
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
108
+ decodeURIComponent
109
+ );
110
+ }
111
+ };
112
+ function C(e, n) {
113
+ function t(o, a, u) {
114
+ if (!(typeof document > "u")) {
115
+ u = m({}, n, u), typeof u.expires == "number" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
116
+ var r = "";
117
+ for (var c in u)
118
+ u[c] && (r += "; " + c, u[c] !== !0 && (r += "=" + u[c].split(";")[0]));
119
+ return document.cookie = o + "=" + e.write(a, o) + r;
120
+ }
121
+ }
122
+ function i(o) {
123
+ if (!(typeof document > "u" || arguments.length && !o)) {
124
+ for (var a = document.cookie ? document.cookie.split("; ") : [], u = {}, r = 0; r < a.length; r++) {
125
+ var c = a[r].split("="), s = c.slice(1).join("=");
126
+ try {
127
+ var l = decodeURIComponent(c[0]);
128
+ if (u[l] = e.read(s, l), o === l)
129
+ break;
130
+ } catch {
131
+ }
132
+ }
133
+ return o ? u[o] : u;
134
+ }
135
+ }
136
+ return Object.create(
137
+ {
138
+ set: t,
139
+ get: i,
140
+ remove: function(o, a) {
141
+ t(
142
+ o,
143
+ "",
144
+ m({}, a, {
145
+ expires: -1
146
+ })
147
+ );
148
+ },
149
+ withAttributes: function(o) {
150
+ return C(this.converter, m({}, this.attributes, o));
151
+ },
152
+ withConverter: function(o) {
153
+ return C(m({}, this.converter, o), this.attributes);
154
+ }
155
+ },
156
+ {
157
+ attributes: { value: Object.freeze(n) },
158
+ converter: { value: Object.freeze(e) }
159
+ }
160
+ );
161
+ }
162
+ var Y = C(J, { path: "/" });
163
+ function Z(e) {
164
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
165
+ var i = e.get(n);
166
+ i ? i.push(t) : e.set(n, [t]);
167
+ }, off: function(n, t) {
168
+ var i = e.get(n);
169
+ i && (t ? i.splice(i.indexOf(t) >>> 0, 1) : e.set(n, []));
170
+ }, emit: function(n, t) {
171
+ var i = e.get(n);
172
+ i && i.slice().map(function(o) {
173
+ o(t);
174
+ }), (i = e.get("*")) && i.slice().map(function(o) {
175
+ o(n, t);
176
+ });
177
+ } };
178
+ }
179
+ export {
180
+ Y as a,
181
+ Z as m,
182
+ X as u
183
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -22,35 +22,35 @@
22
22
  "*": "prettier --write ."
23
23
  },
24
24
  "dependencies": {
25
- "@vueuse/core": "^13.9.0",
26
- "axios": "^1.12.1",
25
+ "@vueuse/core": "^14.0.0",
26
+ "axios": "^1.12.2",
27
27
  "js-cookie": "^3.0.5",
28
28
  "mitt": "^3.0.1",
29
- "vue": "^3.5.21",
29
+ "vue": "^3.5.22",
30
30
  "vue-i18n": "^11.1.12",
31
- "vue-router": "^4.5.1",
32
- "vuetify": "^3.10.0"
31
+ "vue-router": "^4.6.3",
32
+ "vuetify": "^3.10.7"
33
33
  },
34
34
  "devDependencies": {
35
- "@eslint/js": "^9.35.0",
35
+ "@eslint/js": "^9.38.0",
36
36
  "@types/js-cookie": "^3.0.6",
37
- "@types/node": "^24.3.3",
37
+ "@types/node": "^24.9.1",
38
38
  "@vitejs/plugin-vue": "^6.0.1",
39
- "eslint": "^9.35.0",
39
+ "eslint": "^9.38.0",
40
40
  "eslint-config-prettier": "^10.1.8",
41
41
  "eslint-plugin-prettier": "^5.5.4",
42
- "eslint-plugin-vue": "^10.4.0",
42
+ "eslint-plugin-vue": "^10.5.1",
43
43
  "globals": "^16.4.0",
44
44
  "husky": "^9.1.7",
45
- "lint-staged": "^16.1.6",
45
+ "lint-staged": "^16.2.6",
46
46
  "prettier": "3.6.2",
47
- "sass": "^1.92.1",
48
- "typescript": "^5.9.2",
49
- "typescript-eslint": "^8.43.0",
50
- "vite": "^7.1.5",
47
+ "sass": "^1.93.2",
48
+ "typescript": "^5.9.3",
49
+ "typescript-eslint": "^8.46.2",
50
+ "vite": "^7.1.11",
51
51
  "vite-plugin-css-injected-by-js": "^3.5.2",
52
52
  "vite-plugin-vuetify": "^2.1.2",
53
53
  "vue-eslint-parser": "^10.2.0",
54
- "vue-tsc": "^3.0.7"
54
+ "vue-tsc": "^3.1.1"
55
55
  }
56
56
  }
@@ -1,202 +0,0 @@
1
- import { getCurrentInstance as M, hasInjectionContext as x, inject as b, watch as k, getCurrentScope as E, onScopeDispose as I, shallowRef as g, watchEffect as O, toValue as d, computed as S, onMounted as R, unref as D } from "vue";
2
- function U(e) {
3
- return E() ? (I(e), !0) : !1;
4
- }
5
- const y = /* @__PURE__ */ new WeakMap(), A = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
6
- var n;
7
- const t = e[0], o = (n = M()) == null ? void 0 : n.proxy;
8
- if (o == null && !x())
9
- throw new Error("injectLocal must be called in setup");
10
- return o && y.has(o) && t in y.get(o) ? y.get(o)[t] : b(...e);
11
- }, B = typeof window < "u" && typeof document < "u";
12
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
- const F = Object.prototype.toString, L = (e) => F.call(e) === "[object Object]";
14
- function j(e) {
15
- return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
16
- }
17
- function w(e) {
18
- return Array.isArray(e) ? e : [e];
19
- }
20
- function z(e, n, t) {
21
- return k(
22
- e,
23
- n,
24
- {
25
- ...t,
26
- immediate: !0
27
- }
28
- );
29
- }
30
- const W = B ? window : void 0;
31
- function P(e) {
32
- var n;
33
- const t = d(e);
34
- return (n = t?.$el) != null ? n : t;
35
- }
36
- function T(...e) {
37
- const n = [], t = () => {
38
- n.forEach((i) => i()), n.length = 0;
39
- }, o = (i, c, s, l) => (i.addEventListener(c, s, l), () => i.removeEventListener(c, s, l)), r = S(() => {
40
- const i = w(d(e[0])).filter((c) => c != null);
41
- return i.every((c) => typeof c != "string") ? i : void 0;
42
- }), a = z(
43
- () => {
44
- var i, c;
45
- return [
46
- (c = (i = r.value) == null ? void 0 : i.map((s) => P(s))) != null ? c : [W].filter((s) => s != null),
47
- w(d(r.value ? e[1] : e[0])),
48
- w(D(r.value ? e[2] : e[1])),
49
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
50
- d(r.value ? e[3] : e[2])
51
- ];
52
- },
53
- ([i, c, s, l]) => {
54
- if (t(), !i?.length || !c?.length || !s?.length)
55
- return;
56
- const h = L(l) ? { ...l } : l;
57
- n.push(
58
- ...i.flatMap(
59
- (p) => c.flatMap(
60
- (v) => s.map((f) => o(p, v, f, h))
61
- )
62
- )
63
- );
64
- },
65
- { flush: "post" }
66
- ), u = () => {
67
- a(), t();
68
- };
69
- return U(t), u;
70
- }
71
- // @__NO_SIDE_EFFECTS__
72
- function G() {
73
- const e = g(!1), n = M();
74
- return n && R(() => {
75
- e.value = !0;
76
- }, n), e;
77
- }
78
- // @__NO_SIDE_EFFECTS__
79
- function Q(e) {
80
- const n = /* @__PURE__ */ G();
81
- return S(() => (n.value, !!e()));
82
- }
83
- const V = Symbol("vueuse-ssr-width");
84
- // @__NO_SIDE_EFFECTS__
85
- function $() {
86
- const e = x() ? /* @__PURE__ */ A(V, null) : null;
87
- return typeof e == "number" ? e : void 0;
88
- }
89
- function H(e, n = {}) {
90
- const { window: t = W, ssrWidth: o = /* @__PURE__ */ $() } = n, r = /* @__PURE__ */ Q(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), a = g(typeof o == "number"), u = g(), i = g(!1), c = (s) => {
91
- i.value = s.matches;
92
- };
93
- return O(() => {
94
- if (a.value) {
95
- a.value = !r.value;
96
- const s = d(e).split(",");
97
- i.value = s.some((l) => {
98
- const h = l.includes("not all"), p = l.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), v = l.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
99
- let f = !!(p || v);
100
- return p && f && (f = o >= j(p[1])), v && f && (f = o <= j(v[1])), h ? !f : f;
101
- });
102
- return;
103
- }
104
- r.value && (u.value = t.matchMedia(d(e)), i.value = u.value.matches);
105
- }), T(u, "change", c, { passive: !0 }), S(() => i.value);
106
- }
107
- // @__NO_SIDE_EFFECTS__
108
- function X(e) {
109
- return H("(prefers-color-scheme: dark)", e);
110
- }
111
- /*! js-cookie v3.0.5 | MIT */
112
- function m(e) {
113
- for (var n = 1; n < arguments.length; n++) {
114
- var t = arguments[n];
115
- for (var o in t)
116
- e[o] = t[o];
117
- }
118
- return e;
119
- }
120
- var J = {
121
- read: function(e) {
122
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
123
- },
124
- write: function(e) {
125
- return encodeURIComponent(e).replace(
126
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
127
- decodeURIComponent
128
- );
129
- }
130
- };
131
- function C(e, n) {
132
- function t(r, a, u) {
133
- if (!(typeof document > "u")) {
134
- u = m({}, n, u), typeof u.expires == "number" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
135
- var i = "";
136
- for (var c in u)
137
- u[c] && (i += "; " + c, u[c] !== !0 && (i += "=" + u[c].split(";")[0]));
138
- return document.cookie = r + "=" + e.write(a, r) + i;
139
- }
140
- }
141
- function o(r) {
142
- if (!(typeof document > "u" || arguments.length && !r)) {
143
- for (var a = document.cookie ? document.cookie.split("; ") : [], u = {}, i = 0; i < a.length; i++) {
144
- var c = a[i].split("="), s = c.slice(1).join("=");
145
- try {
146
- var l = decodeURIComponent(c[0]);
147
- if (u[l] = e.read(s, l), r === l)
148
- break;
149
- } catch {
150
- }
151
- }
152
- return r ? u[r] : u;
153
- }
154
- }
155
- return Object.create(
156
- {
157
- set: t,
158
- get: o,
159
- remove: function(r, a) {
160
- t(
161
- r,
162
- "",
163
- m({}, a, {
164
- expires: -1
165
- })
166
- );
167
- },
168
- withAttributes: function(r) {
169
- return C(this.converter, m({}, this.attributes, r));
170
- },
171
- withConverter: function(r) {
172
- return C(m({}, this.converter, r), this.attributes);
173
- }
174
- },
175
- {
176
- attributes: { value: Object.freeze(n) },
177
- converter: { value: Object.freeze(e) }
178
- }
179
- );
180
- }
181
- var Y = C(J, { path: "/" });
182
- function Z(e) {
183
- return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
184
- var o = e.get(n);
185
- o ? o.push(t) : e.set(n, [t]);
186
- }, off: function(n, t) {
187
- var o = e.get(n);
188
- o && (t ? o.splice(o.indexOf(t) >>> 0, 1) : e.set(n, []));
189
- }, emit: function(n, t) {
190
- var o = e.get(n);
191
- o && o.slice().map(function(r) {
192
- r(t);
193
- }), (o = e.get("*")) && o.slice().map(function(r) {
194
- r(n, t);
195
- });
196
- } };
197
- }
198
- export {
199
- Y as a,
200
- Z as m,
201
- X as u
202
- };