@topvisor/ui 1.4.3-fixGroupSelector.0 → 1.4.3-fixGroupSelector.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/.chunks/policy.vue_vue_type_style_index_0_lang-BFldQm5e.es.js +519 -0
  2. package/.chunks/policy.vue_vue_type_style_index_0_lang-BFldQm5e.es.js.map +1 -0
  3. package/.chunks/policy.vue_vue_type_style_index_0_lang-CR-aHxza.amd.js +2 -0
  4. package/.chunks/policy.vue_vue_type_style_index_0_lang-CR-aHxza.amd.js.map +1 -0
  5. package/formsExt/formsExt.amd.js +1 -1
  6. package/formsExt/formsExt.js +1 -1
  7. package/icomoon/Topvisor icons.json +285 -229
  8. package/icomoon/demo.html +29 -1
  9. package/icomoon/fonts/Topvisor-2.eot +0 -0
  10. package/icomoon/fonts/Topvisor-2.svg +2 -0
  11. package/icomoon/fonts/Topvisor-2.ttf +0 -0
  12. package/icomoon/fonts/Topvisor-2.woff +0 -0
  13. package/icomoon/selection.json +1 -1
  14. package/icomoon/style.css +11 -5
  15. package/package.json +1 -1
  16. package/project/project.amd.js +1 -1
  17. package/project/project.amd.js.map +1 -1
  18. package/project/project.js +192 -177
  19. package/project/project.js.map +1 -1
  20. package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -1
  21. package/src/components/formsExt/selector2/types.d.ts +6 -0
  22. package/src/components/project/groupSelector/groups/groups.vue.d.ts +1 -0
  23. package/src/components/project/groupSelector/groups/utils.d.ts +6 -2
  24. package/src/components/project/groupSelector/utils.d.ts +10 -4
  25. package/src/components/project/project.d.ts +1 -0
  26. package/src/components/project/projectSelector/projectSelector.vue.d.ts +1 -0
  27. package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js +0 -517
  28. package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js.map +0 -1
  29. package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js +0 -2
  30. package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js.map +0 -1
@@ -3,10 +3,10 @@
3
3
  const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
4
4
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
5
5
 
6
- import { defineComponent as K, mergeModels as G, useModel as P, computed as E, createElementBlock as j, openBlock as h, createBlock as A, unref as m, withCtx as B, Fragment as F, renderList as ve, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as W, toValue as we, ref as _, watch as L, createCommentVNode as M, reactive as Ue, resolveComponent as Ne, shallowRef as De, onMounted as et, withModifiers as H, isRef as $e, mergeProps as Fe, withKeys as be, nextTick as tt, resolveDirective as ot, withDirectives as at, resolveDynamicComponent as lt, renderSlot as nt, createSlots as rt } from "vue";
7
- import { u as w, C as X, e as ee, q as Ie, d as it } from "../.chunks/forms-BpbQYyEQ.es.js";
8
- import { _ as Te, b as je, a as dt } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
9
- import { a as st, _ as Ae, b as qe, c as We, I as he } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js";
6
+ import { defineComponent as K, mergeModels as G, useModel as P, computed as E, createElementBlock as j, openBlock as h, createBlock as A, unref as v, withCtx as B, Fragment as F, renderList as pe, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as W, toValue as be, ref as _, watch as L, createCommentVNode as M, reactive as De, resolveComponent as Fe, shallowRef as qe, onMounted as et, withModifiers as H, isRef as Pe, mergeProps as We, withKeys as Ee, nextTick as tt, resolveDirective as ot, withDirectives as at, resolveDynamicComponent as lt, renderSlot as nt, createSlots as rt } from "vue";
7
+ import { u as w, C as X, e as ee, q as xe, d as it } from "../.chunks/forms-BpbQYyEQ.es.js";
8
+ import { _ as je, b as Ae, a as dt } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
9
+ import { a as st, _ as Be, b as He, c as Je, I as ye } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BFldQm5e.es.js";
10
10
  import { u as ut } from "../.chunks/utils-MzIaxkRQ.es.js";
11
11
  import { getSearcherGIcon as ct, getLangLabel as ft, getDeviceGIcon as gt } from "../utils/searchers.js";
12
12
  import "../.chunks/core-DoIr-EAf.es.js";
@@ -39,7 +39,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
39
39
  };
40
40
  });
41
41
  return (n, l) => (h(), j("div", yt, [
42
- m(X).state.isMobile ? (h(), A(Te, { key: 0 }, {
42
+ v(X).state.isMobile ? (h(), A(je, { key: 0 }, {
43
43
  opener: B(() => [
44
44
  U(ee, {
45
45
  class: "top-competitorSelector_opener",
@@ -54,7 +54,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
54
54
  })
55
55
  ]),
56
56
  contentList: B(() => [
57
- (h(!0), j(F, null, ve(e.items, (r) => (h(), A(je, {
57
+ (h(!0), j(F, null, pe(e.items, (r) => (h(), A(Ae, {
58
58
  class: oe({
59
59
  "top-active": o.value?.includes(r.value)
60
60
  }),
@@ -81,10 +81,10 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
81
81
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
82
82
  ]));
83
83
  }
84
- }), wo = (e, t) => E(() => we(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
84
+ }), wo = (e, t) => E(() => be(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
85
85
  value: n.id,
86
86
  title: n.url + ` [${n.id}]`,
87
- icon: n.id === we(t) ? "" : "",
87
+ icon: n.id === be(t) ? "" : "",
88
88
  content: n.name
89
89
  }))), D = -1, S = -2, de = -1, It = {
90
90
  0: "Yandex",
@@ -96,25 +96,25 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
96
96
  9: "GoogleStore",
97
97
  20: "Yandex.com",
98
98
  21: "Yandex.com.tr"
99
- }, Pe = {
99
+ }, Me = {
100
100
  key: S,
101
101
  name: "--",
102
102
  index: S
103
- }, He = {
103
+ }, ze = {
104
104
  key: S,
105
105
  name: "--",
106
- regions: [Pe],
107
- regionByIndex: /* @__PURE__ */ new Map([[S, Pe]])
106
+ regions: [Me],
107
+ regionByIndex: /* @__PURE__ */ new Map([[S, Me]])
108
108
  }, se = {
109
109
  key: S,
110
110
  name: "Autoselect",
111
111
  index: S
112
- }, ye = {
112
+ }, Se = {
113
113
  key: S,
114
114
  name: "Autoselect",
115
115
  regions: [se],
116
116
  regionByIndex: /* @__PURE__ */ new Map([[S, se]])
117
- }, Ee = {
117
+ }, _e = {
118
118
  countryCode: "00",
119
119
  depth: 1,
120
120
  device: 0,
@@ -122,10 +122,10 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
122
122
  index: de,
123
123
  lang: "ru",
124
124
  name: "Without region"
125
- }, xt = () => (se.name = w().Common.Autoselect, se), Ct = () => (xt(), ye.name = w().Common.Autoselect, console.log(ye), ye), kt = () => (Ee.name = w().Keywords.Without_region, Ee), Je = (e = !1, t = !1, o = []) => {
125
+ }, xt = () => (se.name = w().Common.Autoselect, se), Ct = () => (xt(), Se.name = w().Common.Autoselect, console.log(Se), Se), kt = () => (_e.name = w().Keywords.Without_region, _e), Ye = (e = !1, t = !1, o = []) => {
126
126
  let a;
127
- return e ? a = Tt(o) : a = ze(o), t && a.set(S, Ct()), a.size || a.set(S, He), a;
128
- }, ze = (e, t = !0, o = [], a = !1) => {
127
+ return e ? a = Tt(o) : a = Qe(o), t && a.set(S, Ct()), a.size || a.set(S, ze), a;
128
+ }, Qe = (e, t = !0, o = [], a = !1) => {
129
129
  const n = /* @__PURE__ */ new Map();
130
130
  return e.forEach((l) => {
131
131
  if (!l.enabled || a && typeof l.key == "number" && l.key > 1) return;
@@ -149,7 +149,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
149
149
  n.set(r.key, r);
150
150
  }), n;
151
151
  }, Tt = (e) => {
152
- const t = ze(e, !1, [0, 1], !0);
152
+ const t = Qe(e, !1, [0, 1], !0);
153
153
  if (t.has(2)) {
154
154
  const o = t.get(2);
155
155
  o && (o.regionByIndex = /* @__PURE__ */ new Map());
@@ -160,7 +160,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
160
160
  o.regionByIndex.set(a.index, a);
161
161
  }), t;
162
162
  }, jt = (e, t, o = []) => {
163
- const a = Je(e, !1, o);
163
+ const a = Ye(e, !1, o);
164
164
  let n;
165
165
  return a.forEach((l) => {
166
166
  if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
@@ -241,8 +241,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
241
241
  break;
242
242
  }
243
243
  const s = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
244
- let c = u, v = 3;
245
- f.indexOf(c) === -1 && (c = u.replace(/^[^a-zа-я]/i, "").replace(s, ""), v--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), v--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(s, ""), v--), f.indexOf(c) !== -1 && (v <= g || (g = v, i = x));
244
+ let c = u, m = 3;
245
+ f.indexOf(c) === -1 && (c = u.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), m--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), f.indexOf(c) !== -1 && (m <= g || (g = m, i = x));
246
246
  }
247
247
  a.value = i;
248
248
  }), {
@@ -275,7 +275,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
275
275
  regionsIndexes: a
276
276
  };
277
277
  }, bt = (e) => {
278
- const t = E(() => Je(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => t.value.get(n.searcherKey.value) || He), a = E(() => {
278
+ const t = E(() => Ye(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => t.value.get(n.searcherKey.value) || ze), a = E(() => {
279
279
  const d = /* @__PURE__ */ new Set();
280
280
  return t.value.forEach((f) => {
281
281
  f.regionByIndex.forEach((s) => {
@@ -361,8 +361,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
361
361
  } = bt(o), f = () => {
362
362
  const s = [];
363
363
  u.value.forEach((c) => {
364
- c.enabled && c.regions.forEach((v) => {
365
- v.enabled && s.push(v);
364
+ c.enabled && c.regions.forEach((m) => {
365
+ m.enabled && s.push(m);
366
366
  });
367
367
  }), At.open("regions", {
368
368
  regions: s,
@@ -396,14 +396,14 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
396
396
  if (o.forFrequency && (c = u.value.values().next().value?.regionByIndex?.values().next().value?.key), c === S && !o.autoRegion && (c = void 0, n.value = S), !s.length)
397
397
  c !== void 0 && s.push(c);
398
398
  else if (s.length === 1) {
399
- let v = g.value;
400
- o.forFrequency && (v = /* @__PURE__ */ new Set(), u.value.forEach((I) => {
399
+ let m = g.value;
400
+ o.forFrequency && (m = /* @__PURE__ */ new Set(), u.value.forEach((I) => {
401
401
  I.regionByIndex.forEach((C) => {
402
- C.index !== de && C.index !== S && v.add(C.key);
402
+ C.index !== de && C.index !== S && m.add(C.key);
403
403
  });
404
- })), v.has(s[0]) || (s = [], c !== void 0 && s.push(c));
404
+ })), m.has(s[0]) || (s = [], c !== void 0 && s.push(c));
405
405
  } else
406
- s = s.filter((v) => g.value.has(v)), !s.length && c !== void 0 && s.push(c);
406
+ s = s.filter((m) => g.value.has(m)), !s.length && c !== void 0 && s.push(c);
407
407
  if (JSON.stringify(a.value) !== JSON.stringify(s)) {
408
408
  a.value = s;
409
409
  return;
@@ -424,8 +424,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
424
424
  r.regionIndex.value = a.value[0];
425
425
  let s;
426
426
  for (const c of u.value.values()) {
427
- for (const v of c.regionByIndex.values())
428
- if ((o.forFrequency ? v.key : v.index) === r.regionIndex.value) {
427
+ for (const m of c.regionByIndex.values())
428
+ if ((o.forFrequency ? m.key : m.index) === r.regionIndex.value) {
429
429
  s = c.key;
430
430
  break;
431
431
  }
@@ -445,28 +445,28 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
445
445
  "top-selectorRegion-onlySearcher": e.onlySearcher
446
446
  })
447
447
  }, [
448
- U(Ie, {
449
- options: m(l).optionBySearcherKey.value,
450
- modelValue: m(l).searcherKey.value,
451
- "onUpdate:modelValue": c[0] || (c[0] = (v) => m(l).searcherKey.value = v),
448
+ U(xe, {
449
+ options: v(l).optionBySearcherKey.value,
450
+ modelValue: v(l).searcherKey.value,
451
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => v(l).searcherKey.value = m),
452
452
  name: "searcher_key",
453
453
  addChanger: e.addChanger
454
454
  }, null, 8, ["options", "modelValue", "addChanger"]),
455
- !e.onlySearcher && m(l).searcherKey.value !== m(D) ? (h(), A(Ie, {
455
+ !e.onlySearcher && v(l).searcherKey.value !== v(D) ? (h(), A(xe, {
456
456
  key: 0,
457
457
  class: "top-select-region",
458
- options: m(r).optionByRegionIndex.value,
459
- modelValue: m(r).regionIndex.value,
460
- "onUpdate:modelValue": c[1] || (c[1] = (v) => m(r).regionIndex.value = v),
458
+ options: v(r).optionByRegionIndex.value,
459
+ modelValue: v(r).regionIndex.value,
460
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => v(r).regionIndex.value = m),
461
461
  name: e.forFrequency ? "region_key" : "region_index",
462
462
  addChanger: e.addChanger,
463
463
  "data-top-icon": e.addRegionIcon ? "" : void 0
464
464
  }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : M("", !0),
465
- e.addCompare && !e.onlySearcher && m(l).searcherKey.value === m(D) ? (h(), A(ee, {
465
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(D) ? (h(), A(ee, {
466
466
  key: 1,
467
467
  name: "compare",
468
468
  onClick: f,
469
- "data-count-compare-regions-indexes": m(i).regionsIndexes.value.length
469
+ "data-count-compare-regions-indexes": v(i).regionsIndexes.value.length
470
470
  }, {
471
471
  default: B(() => [
472
472
  W(b(s.$i18n.Common.Selected_regions), 1)
@@ -475,15 +475,17 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
475
475
  }, 8, ["data-count-compare-regions-indexes"])) : M("", !0)
476
476
  ], 2));
477
477
  }
478
- }), ue = (e) => (e = e.replace(/&quot;/g, '"'), e.replace(/&apos;/g, "'")), Ye = (e) => ({
478
+ }), ue = (e) => (e = e.replace(/&quot;/g, '"'), e.replace(/&apos;/g, "'")), we = (e) => ({
479
479
  ...e,
480
480
  name: ue(e.name),
481
481
  path: ue(e.path)
482
- }), Qe = (e) => ({
483
- ...e,
484
- name: ue(e.name),
485
- folder_path: ue(e.folder_path)
486
- }), q = {
482
+ }), ce = (e) => {
483
+ const t = {
484
+ ...e,
485
+ name: ue(e.name)
486
+ };
487
+ return "folder_path" in t && typeof t.folder_path == "string" && (t.folder_path = ue(t.folder_path)), t;
488
+ }, q = {
487
489
  id: 0,
488
490
  name: "/",
489
491
  path: "/"
@@ -491,12 +493,17 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
491
493
  function Pt(e) {
492
494
  return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
493
495
  }
494
- const Be = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
496
+ const $e = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
495
497
  l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name = Pt(t));
496
498
  const r = n > 1 ? "-".repeat(n - 1) + " " : "";
497
- r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), Be(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
498
- }), o), Et = (e, t) => e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
499
- function xe(e, t, o) {
499
+ r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), $e(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
500
+ }), o), Et = (e, t) => {
501
+ const o = e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
502
+ return o.options.onApiLoaded = (a, n, l) => {
503
+ a.result && (a.result = a.result.map((r) => we(r))), l?.(a, n);
504
+ }, o;
505
+ };
506
+ function Ce(e, t, o) {
500
507
  const a = Object.keys(e), n = a.map((l) => e[l]);
501
508
  return L(n, (l, r, i) => {
502
509
  const u = {};
@@ -531,10 +538,10 @@ const Mt = /* @__PURE__ */ K({
531
538
  }),
532
539
  emits: ["update:folderId", "update:folder"],
533
540
  setup(e) {
534
- const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders ? Et(t.client, t.service) : void 0, l = _(null), r = E(() => {
535
- const i = Be(t.folders ?? { root: [q] }, t.canSelectAll), u = /* @__PURE__ */ new Map();
541
+ const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders && t.service ? Et(t.client, t.service) : void 0, l = _(null), r = E(() => {
542
+ const i = $e(t.folders ?? { root: [q] }, t.canSelectAll), u = /* @__PURE__ */ new Map();
536
543
  return i.forEach((g, x) => {
537
- u.set(x, Ye(g));
544
+ u.set(x, we(g));
538
545
  }), u;
539
546
  });
540
547
  return L(() => t.projectId, () => {
@@ -543,7 +550,7 @@ const Mt = /* @__PURE__ */ K({
543
550
  }), n?.setOptions({
544
551
  checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
545
552
  }), l.value?.resetCache();
546
- }, { immediate: !0 }), xe({
553
+ }, { immediate: !0 }), Ce({
547
554
  modelFolder: a,
548
555
  modelFolderId: o
549
556
  }, async (i) => {
@@ -555,30 +562,35 @@ const Mt = /* @__PURE__ */ K({
555
562
  }
556
563
  let u = r.value.get(t.folderId);
557
564
  u || (u = q), a.value = u, o.value = u.id;
558
- }, { immediate: !0 }), (i, u) => (h(), A(Ae, {
565
+ }, { immediate: !0 }), (i, u) => (h(), A(Be, {
559
566
  class: "top-groupSelector_folder",
560
567
  modelValue: a.value,
561
568
  "onUpdate:modelValue": u[0] || (u[0] = (g) => a.value = g),
562
569
  items: e.folders ? [...r.value.values()] : void 0,
563
570
  "search-type": "inline",
564
571
  icon: e.addIcon ? "" : void 0,
565
- api: e.folders ? void 0 : m(n),
566
- apiSetSearchParams: (...g) => m(qe)(...g, "name"),
572
+ api: e.folders ? void 0 : v(n),
573
+ apiSetSearchParams: (...g) => v(He)(...g, "name"),
567
574
  addChanger: e.addChanger,
568
575
  useCache: ""
569
576
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
570
577
  }
571
- }), ce = {
578
+ }), fe = {
572
579
  id: -1,
573
580
  name: "--",
574
581
  folder_id: q.id,
575
582
  folder_path: q.path
576
- }, fe = {
577
- id: We,
583
+ }, ge = {
584
+ id: Je,
578
585
  name: "All groups",
579
586
  folder_id: q.id,
580
587
  folder_path: q.path
581
- }, re = () => (fe.name = w()?.Common.All_groups, fe), Xe = () => (fe.name = w()?.Keywords.Choose_group, fe), _t = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Me = (e, t) => e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Vt = (e, t) => e.gen(`/add/${t}/groups/`), Gt = { class: "top-groupSelector_groupItem" }, Lt = {
588
+ }, re = () => (ge.name = w()?.Common.All_groups, ge), Xe = () => (ge.name = w()?.Keywords.Choose_group, ge), _t = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Ve = (e, t) => {
589
+ const o = e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 });
590
+ return o.options.onApiLoaded = (a, n, l) => {
591
+ a.result && (a.result = a.result.map((r) => ce(r))), l?.(a, n);
592
+ }, o;
593
+ }, Vt = (e, t) => e.gen(`/add/${t}/groups/`), Gt = { class: "top-groupSelector_groupItem" }, Lt = {
582
594
  key: 0,
583
595
  class: "top-comment"
584
596
  }, Rt = {
@@ -609,7 +621,7 @@ const Mt = /* @__PURE__ */ K({
609
621
  }),
610
622
  emits: /* @__PURE__ */ G(["addGroup"], ["update:groupId", "update:group"]),
611
623
  setup(e, { emit: t }) {
612
- const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups ? Me(o.client, o.service) : void 0, i = o.client ? Vt(o.client, o.service) : void 0, u = _(null), g = _(void 0), x = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
624
+ const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups && o.service ? Ve(o.client, o.service) : void 0, i = o.client && o.service ? Vt(o.client, o.service) : void 0, u = _(null), g = _(void 0), x = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
613
625
  r?.changeParams({
614
626
  project_id: o.projectId,
615
627
  folder_id_depth: !0,
@@ -620,11 +632,12 @@ const Mt = /* @__PURE__ */ K({
620
632
  const d = E(() => {
621
633
  const c = g.value ?? o.groups;
622
634
  if (c)
623
- return c.map((v) => Qe(v));
635
+ return c.map((m) => ce(m));
624
636
  }), f = (c) => {
625
- l.value = c, n.value = c.id;
637
+ const m = ce(c);
638
+ l.value = m, n.value = m.id;
626
639
  };
627
- xe({
640
+ Ce({
628
641
  projectId: () => o.projectId,
629
642
  folderId: () => o.folder?.id,
630
643
  canSelectAll: () => o.canSelectAll
@@ -635,11 +648,11 @@ const Mt = /* @__PURE__ */ K({
635
648
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
636
649
  })), c.folderId && (x.values = [
637
650
  o.folder?.id ?? 0
638
- ], o.groups && (g.value = _t(o.groups, o.on, o.folder))), u.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== he) {
639
- let v;
640
- o.autoselect === "first" && (v = g.value?.[0], o.canSelectAll && (v = Ue(re()))), (o.autoselect === "placeholder" || !v) && (v = Xe()), f(v);
651
+ ], o.groups && (g.value = _t(o.groups, o.on, o.folder))), u.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== ye) {
652
+ let m;
653
+ o.autoselect === "first" && (m = g.value?.[0], o.canSelectAll && (m = De(re()))), (o.autoselect === "placeholder" || !m) && (m = Xe()), f(m);
641
654
  }
642
- }, { immediate: !0 }), xe({
655
+ }, { immediate: !0 }), Ce({
643
656
  modelGroup: l,
644
657
  modelGroupId: n
645
658
  }, async (c) => {
@@ -648,64 +661,64 @@ const Mt = /* @__PURE__ */ K({
648
661
  n.value = l.value.id;
649
662
  return;
650
663
  }
651
- if (!(o.canAdd && n.value === he)) {
664
+ if (!(o.canAdd && n.value === ye)) {
652
665
  if (o.groups) {
653
- let v = g.value?.find((I) => I.id === n.value);
654
- if (!v && o.canSelectAll && (v = re()), v)
655
- f(v);
666
+ let m = g.value?.find((I) => I.id === n.value);
667
+ if (!m && o.canSelectAll && (m = re()), m)
668
+ f(m);
656
669
  else {
657
670
  const I = g.value?.[0];
658
- I && !n.value ? f(I) : f(ce);
671
+ I && !n.value ? f(I) : f(fe);
659
672
  }
660
673
  }
661
- if (o.client && !o.groups && (n.value || n.value === We && !o.canSelectAll)) {
662
- const v = Me(o.client, o.service).changeParams({
674
+ if (o.client && !o.groups && o.service && (n.value || n.value === Je && !o.canSelectAll)) {
675
+ const m = Ve(o.client, o.service).changeParams({
663
676
  project_id: o.projectId,
664
677
  id: n.value,
665
678
  filters: [
666
679
  x
667
680
  ]
668
681
  });
669
- v?.setOptions({
682
+ m?.setOptions({
670
683
  checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
671
684
  });
672
- const I = await v.call();
685
+ const I = await m.call();
673
686
  if (!I.errors?.length && !I.result) return;
674
- !I.errors && I.result[0] ? f(I.result[0]) : f(ce);
687
+ !I.errors && I.result[0] ? f(I.result[0]) : f(fe);
675
688
  }
676
689
  }
677
690
  }
678
691
  }, { immediate: !0 });
679
692
  const s = async (c) => {
680
693
  if (o.canAdd !== "api" || !i) return;
681
- const v = l.value, I = await i.changeParams({
694
+ const m = l.value, I = await i.changeParams({
682
695
  project_id: o.projectId,
683
696
  names: [c.name],
684
697
  to_id: o.folder?.id ?? q.id,
685
698
  to_type: "in_folder_last"
686
699
  }).call();
687
- I.result ? (f(I.result), a("addGroup", I.result)) : f(v), u.value?.resetCache(!0);
700
+ I.result ? (f(I.result), a("addGroup", I.result)) : f(m), u.value?.resetCache(!0);
688
701
  };
689
- return (c, v) => (h(), A(Ae, {
702
+ return (c, m) => (h(), A(Be, {
690
703
  ref_key: "refSelector",
691
704
  ref: u,
692
705
  class: "top-groupSelector_group",
693
706
  modelValue: l.value,
694
- "onUpdate:modelValue": v[0] || (v[0] = (I) => l.value = I),
707
+ "onUpdate:modelValue": m[0] || (m[0] = (I) => l.value = I),
695
708
  items: d.value,
696
709
  searchType: "inline",
697
710
  icon: e.addIcon ? "" : void 0,
698
- api: e.groups ? void 0 : m(r),
699
- apiSetSearchParams: (...I) => m(qe)(...I, "name"),
711
+ api: e.groups ? void 0 : v(r),
712
+ apiSetSearchParams: (...I) => v(He)(...I, "name"),
700
713
  appendSearchToResult: !!e.canAdd,
701
- useAllItem: e.canSelectAll ? m(re)().name : !1,
714
+ useAllItem: e.canSelectAll ? v(re)().name : !1,
702
715
  addChanger: e.addChanger,
703
716
  useCache: "",
704
717
  onAppendItem: s
705
718
  }, {
706
719
  item: B(({ item: I }) => [
707
720
  N("div", Gt, [
708
- I.id === m(he) ? (h(), j("div", Lt, b(c.$i18n.Common.Add) + ": ", 1)) : M("", !0),
721
+ I.id === v(ye) ? (h(), j("div", Lt, b(c.$i18n.Common.Add) + ": ", 1)) : M("", !0),
709
722
  N("span", null, b(I.name), 1),
710
723
  I.folder_path && e.showPath ? (h(), j("span", Rt, b(I.folder_path), 1)) : M("", !0)
711
724
  ])
@@ -740,15 +753,15 @@ const Mt = /* @__PURE__ */ K({
740
753
  folderModifiers: {},
741
754
  groupId: { required: !0 },
742
755
  groupIdModifiers: {},
743
- group: { default: ce },
756
+ group: { default: fe },
744
757
  groupModifiers: {}
745
758
  }),
746
759
  emits: /* @__PURE__ */ G(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
747
760
  setup(e, { emit: t }) {
748
- const o = e, a = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, u = Be(o.folders ?? { root: [q] }, o.canSelectAllGroups);
749
- n.value = u.get(a.value), n.value && Ye(n.value);
761
+ const o = e, a = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, u = $e(o.folders ?? { root: [q] }, o.canSelectAllGroups);
762
+ n.value = u.get(a.value), n.value && (n.value = we(n.value));
750
763
  let g = o.groups?.find((d) => d.id === l.value);
751
- l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = re()), (o.autoselect === "placeholder" || !g) && (g = Xe()), g ??= ce, r.value = g, r.value = Qe(r.value);
764
+ l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = re()), (o.autoselect === "placeholder" || !g) && (g = Xe()), g ??= fe, r.value = g, r.value = ce(r.value);
752
765
  const x = (d) => {
753
766
  let f;
754
767
  o.groups && d && (f = [...o.groups, d]), i("update:groups", f);
@@ -867,8 +880,8 @@ const Mt = /* @__PURE__ */ K({
867
880
  }
868
881
  ], n = E(() => t.right.includes("0") ? a.filter((l) => t.right[l.right] === "1") : a);
869
882
  return (l, r) => {
870
- const i = Ne("TopButton");
871
- return h(), A(m(Te), {
883
+ const i = Fe("TopButton");
884
+ return h(), A(v(je), {
872
885
  class: "top-projectSelectorSubmenu",
873
886
  notch: !1,
874
887
  pos: "2"
@@ -881,7 +894,7 @@ const Mt = /* @__PURE__ */ K({
881
894
  })
882
895
  ]),
883
896
  contentList: B(() => [
884
- (h(!0), j(F, null, ve(n.value, (u) => (h(), j("li", Ut, [
897
+ (h(!0), j(F, null, pe(n.value, (u) => (h(), j("li", Ut, [
885
898
  N("a", {
886
899
  href: u.href,
887
900
  title: u.title,
@@ -901,26 +914,26 @@ const Mt = /* @__PURE__ */ K({
901
914
  });
902
915
  };
903
916
  }
904
- }), Se = (e) => ({
917
+ }), Ie = (e) => ({
905
918
  id: null,
906
919
  name: e,
907
920
  listItemProps: {
908
921
  type: "title"
909
922
  }
910
- }), Ce = {
923
+ }), ke = {
911
924
  scheduledUpdate: !1,
912
925
  manualUpdate: !1,
913
926
  guestProjects: !1
914
927
  }, Wt = (e, t) => {
915
928
  const o = [], a = {
916
- scheduledUpdate: Se(w().Projects.Scheduled_update),
917
- manualUpdate: Se(w().Projects.Manual_update),
918
- guestProjects: Se(w().Projects.Guest_projects)
929
+ scheduledUpdate: Ie(w().Projects.Scheduled_update),
930
+ manualUpdate: Ie(w().Projects.Manual_update),
931
+ guestProjects: Ie(w().Projects.Guest_projects)
919
932
  }, n = t ? {
920
933
  scheduledUpdate: !1,
921
934
  manualUpdate: !1,
922
935
  guestProjects: !1
923
- } : Ce;
936
+ } : ke;
924
937
  for (const l of e)
925
938
  !n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (o.push(a.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (o.push(a.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (o.push(a.guestProjects), n.guestProjects = !0), o.push(l);
926
939
  return o;
@@ -931,7 +944,7 @@ const Mt = /* @__PURE__ */ K({
931
944
  }
932
945
  })), Jt = (e, t, o) => {
933
946
  if (!e || e.length === 0) return [];
934
- t && Object.keys(Ce).forEach((n) => Ce[n] = !1);
947
+ t && Object.keys(ke).forEach((n) => ke[n] = !1);
935
948
  const a = Ht(e);
936
949
  return Wt(a, o);
937
950
  }, zt = (e) => {
@@ -945,7 +958,7 @@ const Mt = /* @__PURE__ */ K({
945
958
  let n = "/" + o + e + "/" + a;
946
959
  const l = zt(location.hash);
947
960
  return n += l, n;
948
- }, _e = (e) => {
961
+ }, Ge = (e) => {
949
962
  let t = e.startsWith("http") ? e : "http://" + e;
950
963
  return t = t.replace(/"/g, "%22"), t;
951
964
  }, Qt = (e, t) => {
@@ -953,7 +966,7 @@ const Mt = /* @__PURE__ */ K({
953
966
  o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
954
967
  const a = pt(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
955
968
  t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
956
- }, Ve = (e, t, o) => {
969
+ }, Le = (e, t, o) => {
957
970
  const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
958
971
  return a.params = {
959
972
  ...o,
@@ -970,26 +983,26 @@ const Mt = /* @__PURE__ */ K({
970
983
  const i = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, u = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
971
984
  n.result = Jt(n.result, i, u), r?.(n, l);
972
985
  }, a;
973
- }, Xt = (e) => e.gen("/add/projects_2/projects/"), ge = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V = De(), Ze = _(0), Q = _(null), Ge = (e, t) => {
986
+ }, Xt = (e) => e.gen("/add/projects_2/projects/"), me = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V = qe(), Ze = _(0), Q = _(null), Re = (e, t) => {
974
987
  localStorage.setItem(
975
- ge + e,
988
+ me + e,
976
989
  JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + Zt })
977
990
  );
978
991
  }, eo = (e) => {
979
- const t = localStorage.getItem(ge + e);
992
+ const t = localStorage.getItem(me + e);
980
993
  if (!t) return;
981
994
  const { projectsTotal: o, expiresAt: a } = JSON.parse(t);
982
995
  if (Date.now() > a) {
983
- localStorage.removeItem(ge + e);
996
+ localStorage.removeItem(me + e);
984
997
  return;
985
998
  }
986
999
  return o;
987
1000
  }, to = (e, t = !0) => {
988
- V.value = void 0, localStorage.removeItem(ge + e), t && Ze.value++;
1001
+ V.value = void 0, localStorage.removeItem(me + e), t && Ze.value++;
989
1002
  }, oo = { class: "top-projectSelector_item" }, ao = { class: "top-projectSelector_itemText" }, lo = { class: "top-comment" }, no = {
990
1003
  key: 0,
991
1004
  class: "top-comment"
992
- }, ro = ["href"], Le = 1e3, Po = /* @__PURE__ */ K({
1005
+ }, ro = ["href"], Ke = 1e3, Po = /* @__PURE__ */ K({
993
1006
  __name: "projectSelector",
994
1007
  props: /* @__PURE__ */ G({
995
1008
  client: {},
@@ -1009,22 +1022,22 @@ const Mt = /* @__PURE__ */ K({
1009
1022
  const t = w();
1010
1023
  if (!window.mo?.user?.id)
1011
1024
  throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
1012
- const o = window.mo.user.id, a = e, n = P(e, "project"), l = Ve(
1025
+ const o = window.mo.user.id, a = e, n = P(e, "project"), l = Le(
1013
1026
  a.client,
1014
1027
  o
1015
1028
  ), r = Xt(a.client), i = _(eo(o)), u = _(null), g = E(() => a.placeholder ?? t.Projects.Select_project), x = E(() => !V.value || !a.excludeProjectId ? V.value : V.value.filter((C) => C.id !== a.excludeProjectId)), d = E(() => {
1016
1029
  if (!(!i.value && i.value !== 0))
1017
- return i.value < Le ? "static" : "api";
1030
+ return i.value < Ke ? "static" : "api";
1018
1031
  });
1019
1032
  L(Ze, () => {
1020
- v();
1033
+ m();
1021
1034
  });
1022
1035
  const f = async () => {
1023
1036
  if (!Q.value) {
1024
- const R = Ve(
1037
+ const R = Le(
1025
1038
  a.client,
1026
1039
  o,
1027
- { limit: Le }
1040
+ { limit: Ke }
1028
1041
  );
1029
1042
  Q.value = R.call();
1030
1043
  }
@@ -1037,7 +1050,7 @@ const Mt = /* @__PURE__ */ K({
1037
1050
  }, s = async () => {
1038
1051
  if (i.value) return;
1039
1052
  const C = await f();
1040
- C && (i.value = C.total, d.value === "static" && !V.value && (V.value = C.result), i.value && Ge(o, i.value));
1053
+ C && (i.value = C.total, d.value === "static" && !V.value && (V.value = C.result), i.value && Re(o, i.value));
1041
1054
  }, c = async (C) => {
1042
1055
  const R = await r.changeParams({
1043
1056
  url: C.name,
@@ -1060,11 +1073,11 @@ const Mt = /* @__PURE__ */ K({
1060
1073
  ...V.value.slice(0, p),
1061
1074
  y,
1062
1075
  ...V.value.slice(p)
1063
- ], i.value && (i.value += 1, Ge(o, i.value));
1076
+ ], i.value && (i.value += 1, Re(o, i.value));
1064
1077
  }
1065
1078
  d.value === "api" && to(o);
1066
1079
  }
1067
- }, v = () => {
1080
+ }, m = () => {
1068
1081
  d.value === "api" && u.value?.resetCache(!0);
1069
1082
  }, I = async () => {
1070
1083
  if (V.value || d.value !== "static") return;
@@ -1074,8 +1087,8 @@ const Mt = /* @__PURE__ */ K({
1074
1087
  return et(async () => {
1075
1088
  await s();
1076
1089
  }), (C, R) => {
1077
- const y = Ne("TopButton");
1078
- return h(), A(Ae, {
1090
+ const y = Fe("TopButton");
1091
+ return h(), A(Be, {
1079
1092
  ref_key: "refSelector",
1080
1093
  ref: u,
1081
1094
  class: "top-projectSelector",
@@ -1087,11 +1100,12 @@ const Mt = /* @__PURE__ */ K({
1087
1100
  searchFields: ["id", "name", "url"],
1088
1101
  placeholder: g.value,
1089
1102
  hasCloserBtn: "",
1090
- api: d.value === "api" ? m(l) : void 0,
1091
- apiSetSearchParams: d.value === "api" ? (...p) => m(Qt)(...p) : void 0,
1103
+ api: d.value === "api" ? v(l) : void 0,
1104
+ apiSetSearchParams: d.value === "api" ? (...p) => v(Qt)(...p) : void 0,
1092
1105
  useCache: "",
1093
1106
  appendSearchToResult: "",
1094
- appendSearchToResultCond: m(mt),
1107
+ appendSearchAllowDuplicate: "",
1108
+ appendSearchToResultCond: v(mt),
1095
1109
  appendWithoutSelect: "",
1096
1110
  buttonProps: e.buttonProps,
1097
1111
  openerShortcut: e.openerShortcut,
@@ -1102,7 +1116,7 @@ const Mt = /* @__PURE__ */ K({
1102
1116
  N("div", oo, [
1103
1117
  N("div", ao, [
1104
1118
  p.id ? (h(), j(F, { key: 0 }, [
1105
- W(b(m(vt)(p.name, 20)) + " ", 1),
1119
+ W(b(v(vt)(p.name, 20)) + " ", 1),
1106
1120
  N("span", lo, " id " + b(p.id), 1)
1107
1121
  ], 64)) : (h(), j(F, { key: 1 }, [
1108
1122
  p.listItemProps?.type ? M("", !0) : (h(), j("div", no, b(C.$i18n.Projects.Add_project) + ": ", 1)),
@@ -1113,12 +1127,12 @@ const Mt = /* @__PURE__ */ K({
1113
1127
  e.addLinksToProjects ? (h(), j("a", {
1114
1128
  key: 0,
1115
1129
  class: "top-projectSelector_itemLink",
1116
- href: m(Yt)(p.id)
1130
+ href: v(Yt)(p.id)
1117
1131
  }, null, 8, ro)) : M("", !0),
1118
1132
  C.$core.state.isMobile ? M("", !0) : (h(), A(y, {
1119
1133
  key: 1,
1120
1134
  class: "top-projectSelector_itemExtLink",
1121
- href: m(_e)(p.url),
1135
+ href: v(Ge)(p.url),
1122
1136
  "data-top-icon": "",
1123
1137
  color: "theme",
1124
1138
  target: "_blank",
@@ -1128,7 +1142,7 @@ const Mt = /* @__PURE__ */ K({
1128
1142
  U(qt, {
1129
1143
  id: p.id,
1130
1144
  right: p.right ?? void 0,
1131
- url: m(_e)(p.url)
1145
+ url: v(Ge)(p.url)
1132
1146
  }, null, 8, ["id", "right", "url"])
1133
1147
  ], 64)) : M("", !0)
1134
1148
  ])
@@ -1137,7 +1151,7 @@ const Mt = /* @__PURE__ */ K({
1137
1151
  }, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
1138
1152
  };
1139
1153
  }
1140
- }), Re = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, me = (e, t) => {
1154
+ }), Oe = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, ve = (e, t) => {
1141
1155
  e = te(e);
1142
1156
  const o = t.find((a) => a.id === e);
1143
1157
  if (o)
@@ -1154,10 +1168,10 @@ const Mt = /* @__PURE__ */ K({
1154
1168
  filters: e.filters,
1155
1169
  payload: e.payload
1156
1170
  };
1157
- Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, $e(e.modelValue) || L(l, () => {
1171
+ Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, Pe(e.modelValue) || L(l, () => {
1158
1172
  e.modelValue = l.value, ne(a, e, o);
1159
1173
  }), a.click();
1160
- }, $e(e.modelValue) ? L(e.modelValue, () => ne(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
1174
+ }, Pe(e.modelValue) ? L(e.modelValue, () => ne(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
1161
1175
  e.modelValue = n;
1162
1176
  const l = Z(a, "topTagSelectorTarget");
1163
1177
  l && (l.model.value = n), ne(a, e, o);
@@ -1165,13 +1179,13 @@ const Mt = /* @__PURE__ */ K({
1165
1179
  }, Mo = (e, t) => {
1166
1180
  Z(e, "topTagSelectorRender")?.(t);
1167
1181
  }, ne = (e, t, o) => {
1168
- const a = m(t.modelValue);
1182
+ const a = v(t.modelValue);
1169
1183
  if (e.classList.toggle("top-tagSelector-selectedOne", !a.length || a.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", a.length > 5), t.mode === "setter" && t.filters) {
1170
1184
  e.innerHTML = `<div>${o}</div>`;
1171
1185
  return;
1172
1186
  }
1173
1187
  if (e.innerHTML = "", !a.length && t.mode === "filter") {
1174
- const n = Ke({
1188
+ const n = Ue({
1175
1189
  id: "all",
1176
1190
  colorId: "",
1177
1191
  name: w().Common?.All_tags ?? "",
@@ -1180,15 +1194,15 @@ const Mt = /* @__PURE__ */ K({
1180
1194
  e.append(n);
1181
1195
  }
1182
1196
  a.forEach((n) => {
1183
- const l = Ke({
1197
+ const l = Ue({
1184
1198
  id: te(n),
1185
- colorId: me(n, t.tags)?.color_id ?? "",
1186
- name: me(n, t.tags)?.name ?? "",
1199
+ colorId: ve(n, t.tags)?.color_id ?? "",
1200
+ name: ve(n, t.tags)?.name ?? "",
1187
1201
  state: te(n) === n ? "selected" : "excluded"
1188
1202
  });
1189
1203
  e.append(l);
1190
1204
  });
1191
- }, Ke = (e) => {
1205
+ }, Ue = (e) => {
1192
1206
  const t = document.createElement("div");
1193
1207
  return t.classList.add("top-tagSelector_tagIcon"), t.classList.toggle("top-tagSelector-active", !!e.state), t.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), t.dataset.tag_id = e.id, t.dataset.tag_color_id = e.colorId, t.title = e.name, t;
1194
1208
  }, io = [
@@ -1242,7 +1256,7 @@ const Mt = /* @__PURE__ */ K({
1242
1256
  name: "Turquoise",
1243
1257
  color_id: "10"
1244
1258
  }
1245
- ], so = ["data-tag_id", "data-tag_color_id", "title"], ke = /* @__PURE__ */ K({
1259
+ ], so = ["data-tag_id", "data-tag_color_id", "title"], Te = /* @__PURE__ */ K({
1246
1260
  __name: "tagIcon",
1247
1261
  props: {
1248
1262
  id: {},
@@ -1262,7 +1276,7 @@ const Mt = /* @__PURE__ */ K({
1262
1276
  title: e.name
1263
1277
  }, null, 10, so));
1264
1278
  }
1265
- }), uo = ["contenteditable", "onKeydown"], Oe = /* @__PURE__ */ K({
1279
+ }), uo = ["contenteditable", "onKeydown"], Ne = /* @__PURE__ */ K({
1266
1280
  __name: "tagPopupListItem",
1267
1281
  props: /* @__PURE__ */ G({
1268
1282
  editable: { type: Boolean },
@@ -1296,7 +1310,7 @@ const Mt = /* @__PURE__ */ K({
1296
1310
  let s = "selected";
1297
1311
  o.canExclude && (f.ctrlKey || f.metaKey) && (s = "excluded"), o.state == s && (s = ""), s === "" && a("unselect"), s === "selected" && a("select"), s === "excluded" && a("exclude");
1298
1312
  };
1299
- return (f, s) => (h(), A(je, {
1313
+ return (f, s) => (h(), A(Ae, {
1300
1314
  class: oe({
1301
1315
  "top-tagSelector_tagListItem": !0,
1302
1316
  "top-tagSelector_tagListItem-inEdit": i.value,
@@ -1308,21 +1322,21 @@ const Mt = /* @__PURE__ */ K({
1308
1322
  onClick: H(d, ["stop"])
1309
1323
  }, {
1310
1324
  default: B(() => [
1311
- U(ke, {
1325
+ U(Te, {
1312
1326
  id: e.id,
1313
1327
  name: n.value,
1314
1328
  colorId: e.colorId,
1315
1329
  state: e.state
1316
1330
  }, null, 8, ["id", "name", "colorId", "state"]),
1317
- N("span", Fe({
1331
+ N("span", We({
1318
1332
  ref_key: "elName",
1319
1333
  ref: l,
1320
1334
  class: "top-tagSelector_tagListItemName",
1321
1335
  contenteditable: i.value ? "plaintext-only" : !1
1322
1336
  }, r.value, {
1323
1337
  onKeydown: [
1324
- be(H(g, ["stop"]), ["enter"]),
1325
- be(H(x, ["stop"]), ["esc"])
1338
+ Ee(H(g, ["stop"]), ["enter"]),
1339
+ Ee(H(x, ["stop"]), ["esc"])
1326
1340
  ]
1327
1341
  }), b(n.value), 17, uo),
1328
1342
  e.editable ? (h(), j(F, { key: 0 }, [
@@ -1374,7 +1388,7 @@ const Mt = /* @__PURE__ */ K({
1374
1388
  const u = ot("top-data");
1375
1389
  return h(), A(dt, { id: e.id }, {
1376
1390
  default: B(() => [
1377
- at((h(), A(lt(m(a)), Fe({
1391
+ at((h(), A(lt(v(a)), We({
1378
1392
  class: {
1379
1393
  "top-tagSelector": !0,
1380
1394
  "top-tagSelector-useTopButton": t.useTopButton,
@@ -1389,8 +1403,8 @@ const Mt = /* @__PURE__ */ K({
1389
1403
  color: "theme",
1390
1404
  styling: e.styling
1391
1405
  }, r.$attrs), {
1392
- [m(n)]: B(() => [
1393
- !o.value.length && e.mode === "filter" ? (h(), A(ke, {
1406
+ [v(n)]: B(() => [
1407
+ !o.value.length && e.mode === "filter" ? (h(), A(Te, {
1394
1408
  key: 0,
1395
1409
  id: "all",
1396
1410
  colorId: "",
@@ -1399,11 +1413,11 @@ const Mt = /* @__PURE__ */ K({
1399
1413
  }, null, 8, ["name"])) : M("", !0),
1400
1414
  e.mode === "setter" && e.filters ? (h(), j("div", co, [
1401
1415
  nt(r.$slots, "default")
1402
- ])) : (h(!0), j(F, { key: 2 }, ve(o.value, (g) => (h(), A(ke, {
1403
- id: m(te)(g),
1404
- colorId: m(me)(g, e.tags)?.color_id ?? "",
1405
- name: m(me)(g, e.tags)?.name ?? "",
1406
- state: m(te)(g) === g ? "selected" : "excluded"
1416
+ ])) : (h(!0), j(F, { key: 2 }, pe(o.value, (g) => (h(), A(Te, {
1417
+ id: v(te)(g),
1418
+ colorId: v(ve)(g, e.tags)?.color_id ?? "",
1419
+ name: v(ve)(g, e.tags)?.name ?? "",
1420
+ state: v(te)(g) === g ? "selected" : "excluded"
1407
1421
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1408
1422
  ]),
1409
1423
  _: 2
@@ -1435,7 +1449,7 @@ const Mt = /* @__PURE__ */ K({
1435
1449
  },
1436
1450
  modelModifiers: {},
1437
1451
  tags: {
1438
- default: Ue(io)
1452
+ default: De(io)
1439
1453
  },
1440
1454
  tagsModifiers: {}
1441
1455
  }),
@@ -1449,7 +1463,7 @@ const Mt = /* @__PURE__ */ K({
1449
1463
  const y = " " + o.Common.Tags?.toLowerCase(), p = /* @__PURE__ */ new Map();
1450
1464
  return p.set("add", { value: "add", title: o.Common.Add + y }), p.set("replace", { value: "replace", title: o.Common.Replace + y }), p.set("delete", { value: "delete", title: o.Common.Delete + y }), p;
1451
1465
  };
1452
- let d = De({
1466
+ let d = qe({
1453
1467
  model: n,
1454
1468
  mode: "filter",
1455
1469
  targetId: void 0,
@@ -1465,11 +1479,11 @@ const Mt = /* @__PURE__ */ K({
1465
1479
  }), s = (y) => {
1466
1480
  if (y !== "all") {
1467
1481
  if (d.value.model.value.includes(y)) return "selected";
1468
- if (d.value.model.value.includes(Re(y))) return "excluded";
1482
+ if (d.value.model.value.includes(Oe(y))) return "excluded";
1469
1483
  }
1470
1484
  return y === "all" && !d.value.model.value.length ? "selected" : "";
1471
1485
  }, c = (y, p) => {
1472
- const k = Re(y);
1486
+ const k = Oe(y);
1473
1487
  let T = d.value.model.value.filter((O) => O !== y && O !== k);
1474
1488
  p === "select" && T.push(y), p === "exclude" && T.push(k), d.value.mode === "setter" && d.value.targetId !== void 0 && a.requiredForSetter && (T.length || T.push("1"), T.length === 2 && d.value.model.value.length === 1 && d.value.model.value[0] === "1" && (T = T.filter((O) => O !== "1"))), a.singleMode && !d.value.filters && (T.length || (T = d.value.model.value), T.length > 1 && (T = [T[T.length - 1]])), T.sort((O, ae) => {
1475
1489
  if (!a.tags) return 0;
@@ -1480,7 +1494,7 @@ const Mt = /* @__PURE__ */ K({
1480
1494
  targetId: d.value.targetId,
1481
1495
  payload: d.value.payload
1482
1496
  });
1483
- }, v = E(() => {
1497
+ }, m = E(() => {
1484
1498
  let y = "top-tagSelector_popup";
1485
1499
  return d.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), d.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
1486
1500
  }), I = () => {
@@ -1513,7 +1527,7 @@ const Mt = /* @__PURE__ */ K({
1513
1527
  const z = $(J).attr("data-tag_id");
1514
1528
  O.push(z);
1515
1529
  }), l.value.sort((ae, J) => {
1516
- const z = O.findIndex((pe) => pe === ae.id), Y = O.findIndex((pe) => pe === J.id);
1530
+ const z = O.findIndex((he) => he === ae.id), Y = O.findIndex((he) => he === J.id);
1517
1531
  return z - Y;
1518
1532
  }), i("tagsChanged", l.value);
1519
1533
  }
@@ -1525,45 +1539,45 @@ const Mt = /* @__PURE__ */ K({
1525
1539
  U(fo, {
1526
1540
  modelValue: n.value,
1527
1541
  "onUpdate:modelValue": p[0] || (p[0] = (k) => n.value = k),
1528
- id: m(u),
1542
+ id: v(u),
1529
1543
  tags: l.value,
1530
1544
  styling: e.styling,
1531
1545
  mode: "filter",
1532
1546
  useTopButton: e.useTopButton
1533
1547
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1534
- U(Te, {
1535
- id: m(u),
1536
- class: oe(v.value),
1548
+ U(je, {
1549
+ id: v(u),
1550
+ class: oe(m.value),
1537
1551
  onOpen: p[4] || (p[4] = (k) => C(k)),
1538
1552
  onClose: p[5] || (p[5] = (k) => R(k)),
1539
1553
  "transition-duration": 50
1540
1554
  }, rt({
1541
1555
  contentList: B(() => [
1542
- m(d).mode === "filter" && !e.singleMode ? (h(), A(Oe, {
1556
+ v(d).mode === "filter" && !e.singleMode ? (h(), A(Ne, {
1543
1557
  key: 0,
1544
1558
  id: "all",
1545
1559
  colorId: "",
1546
1560
  name: y.$i18n.Common.All_tags ?? "",
1547
- state: m(d).model.value.length ? "" : "selected",
1548
- onSelect: p[3] || (p[3] = (k) => m(d).model.value = [])
1561
+ state: v(d).model.value.length ? "" : "selected",
1562
+ onSelect: p[3] || (p[3] = (k) => v(d).model.value = [])
1549
1563
  }, null, 8, ["name", "state"])) : M("", !0),
1550
- (h(!0), j(F, null, ve(l.value, (k) => (h(), A(Oe, {
1564
+ (h(!0), j(F, null, pe(l.value, (k) => (h(), A(Ne, {
1551
1565
  key: k.id,
1552
1566
  id: k.id,
1553
1567
  colorId: k.color_id,
1554
1568
  name: k.name,
1555
1569
  state: s(k.id),
1556
- canExclude: m(d).mode === "filter" && !e.singleMode,
1570
+ canExclude: v(d).mode === "filter" && !e.singleMode,
1557
1571
  editable: e.tagsEditable,
1558
1572
  disabled: f.value && s(k.id) === "",
1559
1573
  onUnselect: (T) => c(k.id, "unselect"),
1560
1574
  onSelect: (T) => c(k.id, "select"),
1561
1575
  onExclude: (T) => c(k.id, "exclude"),
1562
1576
  "onUpdate:name": (T) => {
1563
- k.name = T, m(i)("tagsChanged", l.value);
1577
+ k.name = T, v(i)("tagsChanged", l.value);
1564
1578
  }
1565
1579
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1566
- e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), A(je, {
1580
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), A(Ae, {
1567
1581
  key: 1,
1568
1582
  "data-top-icon": "",
1569
1583
  onClick: H(I, ["stop"])
@@ -1576,10 +1590,10 @@ const Mt = /* @__PURE__ */ K({
1576
1590
  ]),
1577
1591
  _: 2
1578
1592
  }, [
1579
- m(d).mode === "setter" && m(d).filters ? {
1593
+ v(d).mode === "setter" && v(d).filters ? {
1580
1594
  name: "header",
1581
1595
  fn: B(() => [
1582
- U(Ie, {
1596
+ U(xe, {
1583
1597
  modelValue: g.value,
1584
1598
  "onUpdate:modelValue": p[1] || (p[1] = (k) => g.value = k),
1585
1599
  options: x()
@@ -1587,7 +1601,7 @@ const Mt = /* @__PURE__ */ K({
1587
1601
  ]),
1588
1602
  key: "0"
1589
1603
  } : void 0,
1590
- m(d).mode === "setter" && m(d).filters ? {
1604
+ v(d).mode === "setter" && v(d).filters ? {
1591
1605
  name: "footer",
1592
1606
  fn: B(() => [
1593
1607
  U(ee, { color: "theme" }, {
@@ -1597,11 +1611,11 @@ const Mt = /* @__PURE__ */ K({
1597
1611
  _: 1
1598
1612
  }),
1599
1613
  U(ee, {
1600
- onClick: p[2] || (p[2] = (k) => m(i)("setter", {
1601
- tagsIds: m(d).model.value,
1602
- filters: m(d).filters,
1614
+ onClick: p[2] || (p[2] = (k) => v(i)("setter", {
1615
+ tagsIds: v(d).model.value,
1616
+ filters: v(d).filters,
1603
1617
  filtersAction: g.value,
1604
- payload: m(d).payload
1618
+ payload: v(d).payload
1605
1619
  }))
1606
1620
  }, {
1607
1621
  default: B(() => [
@@ -1623,11 +1637,12 @@ export {
1623
1637
  $o as TopRegionSelector,
1624
1638
  _o as TopTagSelector,
1625
1639
  fo as TopTagSelectorPopupOpener,
1626
- ke as TopTagSelectorTagIcon,
1640
+ Te as TopTagSelectorTagIcon,
1641
+ to as clearCache,
1627
1642
  At as dialogRegionSelector,
1628
1643
  jt as findRegion,
1629
1644
  Eo as genElTopTagSelectorPopupOpener,
1630
- Je as genSearcherByKey,
1645
+ Ye as genSearcherByKey,
1631
1646
  Mo as renderElTopTagSelectorPopupOpener,
1632
1647
  wo as useItemsFromCompetitors
1633
1648
  };