@topvisor/ui 1.4.0-TopGroupSelector.9 → 1.4.0

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.
@@ -3,20 +3,20 @@
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 R, mergeModels as M, useModel as T, computed as E, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as me, normalizeClass as X, createElementVNode as oe, toDisplayString as b, createVNode as N, createTextVNode as z, toValue as ye, ref as G, watch as V, createCommentVNode as L, reactive as be, isRef as he, withModifiers as U, mergeProps as Ve, withKeys as Ie, nextTick as Ne, resolveDirective as Pe, withDirectives as De, resolveDynamicComponent as Fe, renderSlot as qe, shallowRef as Ue, createSlots as _e } from "vue";
7
- import { u as w, C as _, e as Q, p as se, d as ze } from "../.chunks/forms-BseC3Ftz.es.js";
8
- import { _ as Me, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js";
9
- import { a as We, _ as we, b as Ee, c as $e, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js";
10
- import { u as Ye } from "../.chunks/utils-YrUExsH7.es.js";
11
- import { getSearcherGIcon as Qe, getLangLabel as He, getDeviceGIcon as Xe } from "../utils/searchers.js";
6
+ import { defineComponent as R, mergeModels as V, useModel as T, computed as M, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as me, normalizeClass as X, createElementVNode as oe, toDisplayString as b, createVNode as P, createTextVNode as J, toValue as ye, ref as K, watch as E, createCommentVNode as O, reactive as be, isRef as he, withModifiers as U, mergeProps as Ve, withKeys as Ie, nextTick as Re, resolveDirective as Pe, withDirectives as Ne, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Fe, createSlots as Ue } from "vue";
7
+ import { u as w, C as z, e as Q, p as ce, d as ze } from "../.chunks/forms-BseC3Ftz.es.js";
8
+ import { _ as we, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js";
9
+ import { a as We, _ as Me, b as Ee, c as $e, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js";
10
+ import { u as _e } from "../.chunks/utils-YrUExsH7.es.js";
11
+ import { getSearcherGIcon as Ye, getLangLabel as Qe, getDeviceGIcon as He } from "../utils/searchers.js";
12
12
  import "../.chunks/core-BL-38XF7.es.js";
13
13
  import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js";
14
14
  import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
15
- import { storage as J } from "../utils/dom.js";
16
- import { TopPopupWorker as Ze } from "../popup/worker.js";
17
- const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" }, Nt = /* @__PURE__ */ R({
15
+ import { storage as W } from "../utils/dom.js";
16
+ import { TopPopupWorker as Xe } from "../popup/worker.js";
17
+ const Ze = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
18
18
  __name: "competitorSelector",
19
- props: /* @__PURE__ */ M({
19
+ props: /* @__PURE__ */ V({
20
20
  modelValue: {},
21
21
  items: {},
22
22
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -26,7 +26,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
26
26
  }),
27
27
  emits: ["update:modelValue"],
28
28
  setup(e) {
29
- const a = e, o = T(e, "modelValue"), t = E(() => {
29
+ const a = e, o = T(e, "modelValue"), t = M(() => {
30
30
  if (a.showSelectAllItem)
31
31
  return {
32
32
  icon: "",
@@ -35,17 +35,17 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
35
35
  content: ""
36
36
  };
37
37
  });
38
- return (r, l) => (h(), A("div", et, [
39
- v(_).state.isMobile ? (h(), C(Me, { key: 0 }, {
38
+ return (r, l) => (h(), A("div", Ze, [
39
+ v(z).state.isMobile ? (h(), C(we, { key: 0 }, {
40
40
  opener: B(() => [
41
- N(Q, {
41
+ P(Q, {
42
42
  class: "top-competitorSelector_opener",
43
43
  color: "theme",
44
44
  icon: "",
45
45
  icon2: ""
46
46
  }, {
47
47
  default: B(() => [
48
- z(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
48
+ J(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
49
49
  ]),
50
50
  _: 1
51
51
  })
@@ -60,7 +60,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
60
60
  onClick: () => o.value = [n.value]
61
61
  }, {
62
62
  default: B(() => [
63
- oe("span", tt, b(n.content), 1)
63
+ oe("span", et, b(n.content), 1)
64
64
  ]),
65
65
  _: 2
66
66
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
@@ -78,12 +78,12 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
78
78
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
79
79
  ]));
80
80
  }
81
- }), Pt = (e, a) => E(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
81
+ }), Pt = (e, a) => M(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
82
82
  value: r.id,
83
83
  title: r.url + ` [${r.id}]`,
84
84
  icon: r.id === ye(a) ? "" : "",
85
85
  content: r.name
86
- }))), j = -1, y = -2, le = -1, ot = {
86
+ }))), L = -1, y = -2, le = -1, tt = {
87
87
  0: "Yandex",
88
88
  1: "Google",
89
89
  4: "YouTube",
@@ -106,7 +106,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
106
106
  key: y,
107
107
  name: "Autoselect",
108
108
  index: y
109
- }, ue = {
109
+ }, se = {
110
110
  key: y,
111
111
  name: "Autoselect",
112
112
  regions: [ae],
@@ -119,9 +119,9 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
119
119
  index: le,
120
120
  lang: "ru",
121
121
  name: "Without region"
122
- }, lt = () => (ae.name = w().Common.Autoselect, ae), at = () => (lt(), ue.name = w().Common.Autoselect, console.log(ue), ue), nt = () => (ke.name = w().Keywords.Without_region, ke), Ke = (e = !1, a = !1, o = []) => {
122
+ }, ot = () => (ae.name = w().Common.Autoselect, ae), lt = () => (ot(), se.name = w().Common.Autoselect, console.log(se), se), at = () => (ke.name = w().Keywords.Without_region, ke), Ke = (e = !1, a = !1, o = []) => {
123
123
  let t;
124
- return e ? t = rt(o) : t = Oe(o), a && t.set(y, at()), t.size || t.set(y, Ge), t;
124
+ return e ? t = nt(o) : t = Oe(o), a && t.set(y, lt()), t.size || t.set(y, Ge), t;
125
125
  }, Oe = (e, a = !0, o = [], t = !1) => {
126
126
  const r = /* @__PURE__ */ new Map();
127
127
  return e.forEach((l) => {
@@ -139,13 +139,13 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
139
139
  if (r.has(l)) return;
140
140
  const n = {
141
141
  key: l,
142
- name: ot[l],
142
+ name: tt[l],
143
143
  regions: [],
144
144
  regionByIndex: /* @__PURE__ */ new Map()
145
145
  };
146
146
  r.set(n.key, n);
147
147
  }), r;
148
- }, rt = (e) => {
148
+ }, nt = (e) => {
149
149
  const a = Oe(e, !1, [0, 1], !0);
150
150
  if (a.has(2)) {
151
151
  const o = a.get(2);
@@ -153,10 +153,10 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
153
153
  }
154
154
  return a.forEach((o) => {
155
155
  if (!o.regionByIndex) return;
156
- const t = { ...nt() };
156
+ const t = { ...at() };
157
157
  o.regionByIndex.set(t.index, t);
158
158
  }), a;
159
- }, it = (e, a, o = []) => {
159
+ }, rt = (e, a, o = []) => {
160
160
  const t = Ke(e, !1, o);
161
161
  let r;
162
162
  return t.forEach((l) => {
@@ -166,15 +166,15 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
166
166
  }), r))
167
167
  return !1;
168
168
  }), r;
169
- }, dt = Ye(() => import("../.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js")), ut = (e, a) => {
170
- const o = w(), t = G(a.value.keys().next().value ?? y), r = E(() => {
169
+ }, it = _e(() => import("../.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js")), dt = (e, a) => {
170
+ const o = w(), t = K(a.value.keys().next().value ?? y), r = M(() => {
171
171
  const l = /* @__PURE__ */ new Map();
172
172
  if (a.value.forEach((n) => {
173
173
  let u = {
174
174
  value: n.key,
175
175
  title: n.name
176
176
  };
177
- e.addSearcherIcon && (u.icon = Qe(n.key)), l.set(n.key, u);
177
+ e.addSearcherIcon && (u.icon = Ye(n.key)), l.set(n.key, u);
178
178
  }), e.addCompare && !l.has(y)) {
179
179
  const n = {
180
180
  value: "",
@@ -183,7 +183,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
183
183
  };
184
184
  l.set(n.value, n);
185
185
  const u = {
186
- value: j,
186
+ value: L,
187
187
  title: o.Common.Compare
188
188
  };
189
189
  l.set(u.value, u);
@@ -194,10 +194,10 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
194
194
  searcherKey: t,
195
195
  optionBySearcherKey: r
196
196
  };
197
- }, st = (e, a) => {
198
- const o = w(), t = G(y);
197
+ }, ut = (e, a) => {
198
+ const o = w(), t = K(y);
199
199
  e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === y && (e.forFrequency ? t.value = a.value?.regionByIndex.values().next().value?.key ?? y : t.value = a.value?.regionByIndex.keys().next().value ?? y);
200
- const r = E(() => {
200
+ const r = M(() => {
201
201
  const l = /* @__PURE__ */ new Map();
202
202
  return a.value.regionByIndex?.forEach((n) => {
203
203
  let u = n.name;
@@ -210,17 +210,17 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
210
210
  return;
211
211
  }
212
212
  n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
213
- const f = He(a.value.key || 0, n.lang ?? "");
213
+ const f = Qe(a.value.key || 0, n.lang ?? "");
214
214
  f && (u += " / " + f);
215
215
  const c = {
216
216
  value: n.index,
217
217
  title: u,
218
- icon: n.device ? Xe(n.device) : void 0
218
+ icon: n.device ? He(n.device) : void 0
219
219
  };
220
220
  l.set(n.index, c);
221
221
  }), l;
222
222
  });
223
- return V(r, (l, n) => {
223
+ return E(r, (l, n) => {
224
224
  if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
225
225
  return;
226
226
  let u = l.keys().next().value;
@@ -246,8 +246,8 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
246
246
  regionIndex: t,
247
247
  optionByRegionIndex: r
248
248
  };
249
- }, ct = (e, a, o) => {
250
- const t = G([]), r = () => {
249
+ }, st = (e, a, o) => {
250
+ const t = K([]), r = () => {
251
251
  if (e.onlySearcher && a.value) {
252
252
  t.value = Array.from(a.value.keys());
253
253
  return;
@@ -266,22 +266,22 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
266
266
  }, l = () => {
267
267
  t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
268
268
  };
269
- return V(t, () => {
269
+ return E(t, () => {
270
270
  l();
271
271
  }), e.addCompare && r(), {
272
272
  regionsIndexes: t
273
273
  };
274
- }, gt = (e) => {
275
- const a = E(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => a.value.get(r.searcherKey.value) || Ge), t = E(() => {
274
+ }, ct = (e) => {
275
+ const a = M(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = M(() => a.value.get(r.searcherKey.value) || Ge), t = M(() => {
276
276
  const i = /* @__PURE__ */ new Set();
277
277
  return a.value.forEach((m) => {
278
278
  m.regionByIndex.forEach((d) => {
279
279
  d.index !== le && d.index !== y && i.add(d.index);
280
280
  });
281
281
  }), i;
282
- }), r = ut(e, a), l = st(e, o), n = ct(e, a, t);
283
- V(a, () => {
284
- if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === j) return;
282
+ }), r = dt(e, a), l = ut(e, o), n = st(e, a, t);
283
+ E(a, () => {
284
+ if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === L) return;
285
285
  let i = a.value.keys().next().value;
286
286
  a.value.forEach((m) => {
287
287
  if (e.onlySearcher && m.key === r.searcherKey.value) {
@@ -297,14 +297,14 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
297
297
  }), i !== void 0 && (r.searcherKey.value = i), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
298
298
  }, { immediate: !0 });
299
299
  const u = () => {
300
- if (!(r.searcherKey.value === j || r.searcherKey.value === y))
300
+ if (!(r.searcherKey.value === L || r.searcherKey.value === y))
301
301
  return r.searcherKey.value;
302
302
  }, f = () => {
303
303
  if (e.onlySearcher || l.regionIndex.value === y) return;
304
304
  let i = l.regionIndex.value;
305
305
  if (e.forFrequency) {
306
306
  const m = l.regionIndex.value;
307
- i = it(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
307
+ i = rt(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
308
308
  }
309
309
  return i;
310
310
  }, c = () => {
@@ -325,9 +325,9 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
325
325
  return c()?.regionByIndex?.get(i);
326
326
  }
327
327
  };
328
- }, Dt = /* @__PURE__ */ R({
328
+ }, Nt = /* @__PURE__ */ R({
329
329
  __name: "regionSelector",
330
- props: /* @__PURE__ */ M({
330
+ props: /* @__PURE__ */ V({
331
331
  projectId: {},
332
332
  searchers: { default: () => [] },
333
333
  modelValue: {},
@@ -355,29 +355,29 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
355
355
  allRegionsIndexes: c,
356
356
  getSearcher: x,
357
357
  getRegion: i
358
- } = gt(o), m = () => {
358
+ } = ct(o), m = () => {
359
359
  const d = [];
360
360
  f.value.forEach((s) => {
361
361
  s.enabled && s.regions.forEach((g) => {
362
362
  g.enabled && d.push(g);
363
363
  });
364
- }), dt.open("regions", {
364
+ }), it.open("regions", {
365
365
  regions: d,
366
366
  regionsIndexes: u.regionsIndexes.value,
367
367
  "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
368
368
  });
369
369
  };
370
- return V([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
371
- if (l.searcherKey.value === j && u.regionsIndexes.value.length) {
370
+ return E([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
371
+ if (l.searcherKey.value === L && u.regionsIndexes.value.length) {
372
372
  if (JSON.stringify(t.value) === JSON.stringify(u.regionsIndexes.value))
373
373
  return;
374
374
  t.value = [...u.regionsIndexes.value];
375
375
  } else
376
376
  o.onlySearcher ? (t.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (t.value.length = 0)) : (t.value = [n.regionIndex.value], n.regionIndex.value === y && !o.autoRegion && (t.value.length = 0));
377
377
  !o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
378
- }), r.value && V(r, () => {
378
+ }), r.value && E(r, () => {
379
379
  r.value && (t.value = [r.value]);
380
- }, { immediate: !0 }), V(t, () => {
380
+ }, { immediate: !0 }), E(t, () => {
381
381
  if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
382
382
  if (!t.value.length || t.value.length === 1 && !f.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
383
383
  let d = f.value.keys().next().value;
@@ -395,8 +395,8 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
395
395
  else if (d.length === 1) {
396
396
  let g = c.value;
397
397
  o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
398
- Z.regionByIndex.forEach((P) => {
399
- P.index !== le && P.index !== y && g.add(P.key);
398
+ Z.regionByIndex.forEach((N) => {
399
+ N.index !== le && N.index !== y && g.add(N.key);
400
400
  });
401
401
  })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
402
402
  } else
@@ -412,12 +412,12 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
412
412
  l.searcherKey.value = t.value[0];
413
413
  return;
414
414
  }
415
- l.searcherKey.value = j;
415
+ l.searcherKey.value = L;
416
416
  return;
417
417
  } else {
418
418
  if (!t.value.length)
419
419
  return;
420
- if (t.value.length === 1 && l.searcherKey.value !== j) {
420
+ if (t.value.length === 1 && l.searcherKey.value !== L) {
421
421
  n.regionIndex.value = t.value[0];
422
422
  let d;
423
423
  for (const s of f.value.values()) {
@@ -431,7 +431,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
431
431
  }
432
432
  d !== void 0 && (l.searcherKey.value = d);
433
433
  } else
434
- l.searcherKey.value = j, u.regionsIndexes.value = [...t.value];
434
+ l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
435
435
  }
436
436
  }, { immediate: !0 }), a({
437
437
  getSearcher: x,
@@ -442,14 +442,14 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
442
442
  "top-selectorRegion-onlySearcher": e.onlySearcher
443
443
  })
444
444
  }, [
445
- N(se, {
445
+ P(ce, {
446
446
  options: v(l).optionBySearcherKey.value,
447
447
  modelValue: v(l).searcherKey.value,
448
448
  "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
449
449
  name: "searcher_key",
450
450
  addChanger: e.addChanger
451
451
  }, null, 8, ["options", "modelValue", "addChanger"]),
452
- !e.onlySearcher && v(l).searcherKey.value !== v(j) ? (h(), C(se, {
452
+ !e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
453
453
  key: 0,
454
454
  class: "top-select-region",
455
455
  options: v(n).optionByRegionIndex.value,
@@ -458,39 +458,36 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
458
458
  name: e.forFrequency ? "region_key" : "region_index",
459
459
  addChanger: e.addChanger,
460
460
  "data-top-icon": e.addRegionIcon ? "" : void 0
461
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : L("", !0),
462
- e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(j) ? (h(), C(Q, {
461
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
462
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(L) ? (h(), C(Q, {
463
463
  key: 1,
464
464
  name: "compare",
465
465
  onClick: m,
466
466
  "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
467
467
  }, {
468
468
  default: B(() => [
469
- z(b(d.$i18n.Common.Selected_regions), 1)
469
+ J(b(d.$i18n.Common.Selected_regions), 1)
470
470
  ]),
471
471
  _: 1
472
- }, 8, ["data-count-compare-regions-indexes"])) : L("", !0)
472
+ }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
473
473
  ], 2));
474
474
  }
475
- }), O = {
475
+ }), j = {
476
476
  id: 0,
477
477
  name: "/",
478
478
  path: "/"
479
- }, ft = (e, a) => {
480
- let o = e?.root[0] ?? O;
481
- return o = { ...o }, o.name = Le(a), o;
482
479
  };
483
- function Le(e) {
480
+ function gt(e) {
484
481
  return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
485
482
  }
486
483
  const pe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (t.childsIds = [], t.id && (t.countAllGroupsActive = t.count_groups_active), e[t.id] && e[t.id].forEach((l) => {
487
- l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = Le(a));
484
+ l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = gt(a));
488
485
  const n = r > 1 ? "-".repeat(r - 1) + " " : "";
489
486
  n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), pe(e, a, o, l, r + 1), t.childsIds = t.childsIds.concat(l.childsIds), t.id && l.count_groups_active && (t.countAllGroupsActive += l.count_groups_active);
490
- }), o), mt = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
491
- function ce(e, a, o) {
487
+ }), o), ft = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
488
+ function ge(e, a, o) {
492
489
  const t = Object.keys(e), r = t.map((l) => e[l]);
493
- return V(r, (l, n, u) => {
490
+ return E(r, (l, n, u) => {
494
491
  const f = {};
495
492
  l.forEach((c, x) => {
496
493
  if (!Object.is(c, n[x])) {
@@ -503,9 +500,9 @@ function ce(e, a, o) {
503
500
  }), Object.keys(f).length && a(f, u);
504
501
  }, o);
505
502
  }
506
- const vt = /* @__PURE__ */ R({
503
+ const mt = /* @__PURE__ */ R({
507
504
  __name: "folders",
508
- props: /* @__PURE__ */ M({
505
+ props: /* @__PURE__ */ V({
509
506
  folderId: {},
510
507
  folder: {},
511
508
  folders: {},
@@ -517,21 +514,21 @@ const vt = /* @__PURE__ */ R({
517
514
  }, {
518
515
  folderId: { required: !0 },
519
516
  folderIdModifiers: {},
520
- folder: { default: O },
517
+ folder: { default: j },
521
518
  folderModifiers: {}
522
519
  }),
523
520
  emits: ["update:folderId", "update:folder"],
524
521
  setup(e) {
525
- const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? mt(a.client) : void 0, l = G(null);
526
- V(() => a.projectId, () => {
522
+ const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client) : void 0, l = K(null);
523
+ E(() => a.projectId, () => {
527
524
  r?.changeParams({
528
525
  project_id: a.projectId
529
526
  }), r?.setOptions({
530
527
  checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
531
528
  }), l.value?.resetCache();
532
529
  }, { immediate: !0 });
533
- const n = E(() => pe(a.folders ?? { root: [O] }, a.canSelectAll));
534
- return ce({
530
+ const n = M(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
531
+ return ge({
535
532
  modelFolder: t,
536
533
  modelFolderId: o
537
534
  }, async (u) => {
@@ -541,15 +538,9 @@ const vt = /* @__PURE__ */ R({
541
538
  o.value = t.value.id;
542
539
  return;
543
540
  }
544
- if (u.modelFolderId) {
545
- const c = n.value.get(a.folderId);
546
- c && (t.value = c, t.value = c);
547
- }
548
541
  let f = n.value.get(a.folderId);
549
- f || (f = O), t.value = f, o.value = f.id;
550
- }, { immediate: !0 }), V(t, () => {
551
- o.value = t.value.id;
552
- }), (u, f) => (h(), C(we, {
542
+ f || (f = j), t.value = f, o.value = f.id;
543
+ }, { immediate: !0 }), (u, f) => (h(), C(Me, {
553
544
  class: "top-groupSelector_folder",
554
545
  modelValue: t.value,
555
546
  "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
@@ -562,25 +553,25 @@ const vt = /* @__PURE__ */ R({
562
553
  useCache: ""
563
554
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
564
555
  }
565
- }), ge = {
556
+ }), ne = {
566
557
  id: -1,
567
558
  name: "--",
568
- folder_id: O.id,
569
- folder_path: O.path
570
- }, ne = {
559
+ folder_id: j.id,
560
+ folder_path: j.path
561
+ }, re = {
571
562
  id: $e,
572
563
  name: "All groups",
573
- folder_id: O.id,
574
- folder_path: O.path
575
- }, W = () => (ne.name = w()?.Common.All_groups, ne), je = () => (ne.name = w()?.Keywords.Choose_group, ne), pt = (e, a, o) => (e = [...e], a !== void 0 && (e = e.filter((t) => t.on == Number(a))), o && o.id && o.childsIds && (e = e.filter((t) => t.folder_id === o.id || o.childsIds.includes(t.folder_id))), e), Ce = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), yt = (e) => e.gen("/add/keywords_2/groups/"), ht = { class: "top-groupSelector_groupItem" }, It = {
564
+ folder_id: j.id,
565
+ folder_path: j.path
566
+ }, _ = () => (re.name = w()?.Common.All_groups, re), Le = () => (re.name = w()?.Keywords.Choose_group, re), vt = (e, a, o) => (e = [...e], a !== void 0 && (e = e.filter((t) => t.on == Number(a))), o && o.id && o.childsIds && (e = e.filter((t) => t.folder_id === o.id || o.childsIds.includes(t.folder_id))), e), Ce = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), pt = (e) => e.gen("/add/keywords_2/groups/"), yt = { class: "top-groupSelector_groupItem" }, ht = {
576
567
  key: 0,
577
568
  class: "top-comment"
578
- }, St = {
569
+ }, It = {
579
570
  key: 1,
580
571
  class: "top-groupSelector_groupItemFolderPath"
581
- }, xt = /* @__PURE__ */ R({
572
+ }, St = /* @__PURE__ */ R({
582
573
  __name: "groups",
583
- props: /* @__PURE__ */ M({
574
+ props: /* @__PURE__ */ V({
584
575
  groupId: {},
585
576
  group: {},
586
577
  projectId: {},
@@ -591,6 +582,7 @@ const vt = /* @__PURE__ */ R({
591
582
  canSelectAll: { type: [Boolean, String] },
592
583
  autoselect: { default: "first" },
593
584
  addChanger: { type: Boolean, default: !0 },
585
+ showPath: { type: Boolean },
594
586
  addIcon: { type: Boolean, default: !0 },
595
587
  client: {}
596
588
  }, {
@@ -599,19 +591,20 @@ const vt = /* @__PURE__ */ R({
599
591
  group: { required: !0 },
600
592
  groupModifiers: {}
601
593
  }),
602
- emits: /* @__PURE__ */ M(["addGroup"], ["update:groupId", "update:group"]),
594
+ emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
603
595
  setup(e, { emit: a }) {
604
- const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? yt(o.client) : void 0, f = G(null), c = G(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
596
+ const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? pt(o.client) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
605
597
  n?.changeParams({
606
598
  project_id: o.projectId,
599
+ folder_id_depth: !0,
607
600
  filters: [
608
601
  x
609
602
  ]
610
- }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [o.on]));
603
+ }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [Number(o.on)]));
611
604
  const i = (d) => {
612
605
  l.value = d, r.value = d.id;
613
606
  };
614
- ce({
607
+ ge({
615
608
  projectId: () => o.projectId,
616
609
  folderId: () => o.folder?.id,
617
610
  canSelectAll: () => o.canSelectAll
@@ -622,11 +615,11 @@ const vt = /* @__PURE__ */ R({
622
615
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
623
616
  })), d.folderId && (x.values = [
624
617
  o.folder?.id ?? 0
625
- ], o.groups && (c.value = pt(o.groups, o.on, o.folder))), f.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && r.value !== de) {
618
+ ], o.groups && (c.value = vt(o.groups, o.on, o.folder))), f.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && r.value !== ue) {
626
619
  let s;
627
- o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(W()))), (o.autoselect === "placeholder" || !s) && (s = je()), i(s);
620
+ o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(_()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
628
621
  }
629
- }, { immediate: !0 }), ce({
622
+ }, { immediate: !0 }), ge({
630
623
  modelGroup: l,
631
624
  modelGroupId: r
632
625
  }, async (d) => {
@@ -635,14 +628,14 @@ const vt = /* @__PURE__ */ R({
635
628
  r.value = l.value.id;
636
629
  return;
637
630
  }
638
- if (!(o.canAdd && r.value === de)) {
631
+ if (!(o.canAdd && r.value === ue)) {
639
632
  if (o.groups) {
640
633
  let s = c.value?.find((g) => g.id === r.value);
641
- if (!s && o.canSelectAll && (s = W()), s)
634
+ if (!s && o.canSelectAll && (s = _()), s)
642
635
  i(s);
643
636
  else {
644
637
  const g = c.value?.[0];
645
- g && !r.value ? i(g) : i(ge);
638
+ g && !r.value ? i(g) : i(ne);
646
639
  }
647
640
  }
648
641
  if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
@@ -658,7 +651,7 @@ const vt = /* @__PURE__ */ R({
658
651
  });
659
652
  const g = await s.call();
660
653
  if (!g.errors?.length && !g.result) return;
661
- !g.errors && g.result[0] ? i(g.result[0]) : i(ge);
654
+ !g.errors && g.result[0] ? i(g.result[0]) : i(ne);
662
655
  }
663
656
  }
664
657
  }
@@ -668,12 +661,12 @@ const vt = /* @__PURE__ */ R({
668
661
  const s = l.value, g = await u.changeParams({
669
662
  project_id: o.projectId,
670
663
  names: [d.name],
671
- to_id: o.folder?.id ?? O.id,
664
+ to_id: o.folder?.id ?? j.id,
672
665
  to_type: "in_folder_last"
673
666
  }).call();
674
667
  g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
675
668
  };
676
- return (d, s) => (h(), C(we, {
669
+ return (d, s) => (h(), C(Me, {
677
670
  ref_key: "refSelector",
678
671
  ref: f,
679
672
  class: "top-groupSelector_group",
@@ -685,31 +678,32 @@ const vt = /* @__PURE__ */ R({
685
678
  api: e.groups ? void 0 : v(n),
686
679
  apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
687
680
  appendSearchToResult: !!e.canAdd,
688
- useAllItem: e.canSelectAll ? v(W)().name : !1,
681
+ useAllItem: e.canSelectAll ? v(_)().name : !1,
689
682
  addChanger: e.addChanger,
690
683
  useCache: "",
691
684
  onAppendItem: m
692
685
  }, {
693
686
  item: B(({ item: g }) => [
694
- oe("div", ht, [
695
- g.id === v(de) ? (h(), A("div", It, b(d.$i18n.Common.Add) + ": ", 1)) : L("", !0),
687
+ oe("div", yt, [
688
+ g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
696
689
  oe("span", null, b(g.name), 1),
697
- g.folder_path ? (h(), A("span", St, b(g.folder_path), 1)) : L("", !0)
690
+ g.folder_path && e.showPath ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
698
691
  ])
699
692
  ]),
700
693
  _: 1
701
694
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
702
695
  }
703
- }), kt = { class: "top-groupSelector" }, Ft = /* @__PURE__ */ R({
696
+ }), xt = { class: "top-groupSelector" }, Dt = /* @__PURE__ */ R({
704
697
  __name: "groupSelector",
705
- props: /* @__PURE__ */ M({
698
+ props: /* @__PURE__ */ V({
706
699
  folderId: {},
700
+ folder: {},
707
701
  groupId: {},
708
702
  group: {},
709
703
  projectId: {},
710
704
  folders: {},
711
705
  groups: {},
712
- on: { type: Boolean },
706
+ on: { type: Boolean, default: void 0 },
713
707
  canSelectAllGroups: { type: Boolean },
714
708
  canAddGroup: {},
715
709
  autoselect: { default: "first" },
@@ -721,82 +715,85 @@ const vt = /* @__PURE__ */ R({
721
715
  }, {
722
716
  folderId: { required: !0 },
723
717
  folderIdModifiers: {},
718
+ folder: {},
719
+ folderModifiers: {},
724
720
  groupId: { required: !0 },
725
721
  groupIdModifiers: {},
726
- group: {},
722
+ group: { default: ne },
727
723
  groupModifiers: {}
728
724
  }),
729
- emits: /* @__PURE__ */ M(["update:groups"], ["update:folderId", "update:groupId", "update:group"]),
725
+ emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
730
726
  setup(e, { emit: a }) {
731
- const o = e, t = T(e, "folderId"), r = T(e, "groupId"), l = T(e, "group"), n = a, u = G(ft(o.folders, o.canSelectAllGroups)), f = pe(o.folders ?? { root: [O] }, o.canSelectAllGroups);
732
- u.value = f.get(t.value);
733
- let c = o.groups?.find((i) => i.id === r.value);
734
- r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = je()), c ??= ge, l.value ??= c;
727
+ const o = e, t = T(e, "folderId"), r = T(e, "folder"), l = T(e, "groupId"), n = T(e, "group"), u = a, f = pe(o.folders ?? { root: [j] }, o.canSelectAllGroups);
728
+ r.value = f.get(t.value);
729
+ let c = o.groups?.find((i) => i.id === l.value);
730
+ l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = _()), o.canSelectAllGroups && !c && (c = _()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
735
731
  const x = (i) => {
736
732
  let m;
737
- o.groups && i && (m = [...o.groups, i]), n("update:groups", m);
733
+ o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
738
734
  };
739
- return (i, m) => (h(), A("div", kt, [
740
- e.showFolders ? (h(), C(vt, {
735
+ return (i, m) => (h(), A("div", xt, [
736
+ e.showFolders ? (h(), C(mt, {
741
737
  key: 0,
742
738
  folderId: t.value,
743
739
  "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
744
- folder: u.value,
745
- "onUpdate:folder": m[1] || (m[1] = (d) => u.value = d),
740
+ folder: r.value,
741
+ "onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
746
742
  projectId: e.projectId,
747
743
  folders: e.folders,
748
744
  canSelectAll: e.canSelectAllGroups,
749
745
  addChanger: e.addChanger,
750
746
  addIcon: e.addIcon,
751
747
  client: e.client
752
- }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : L("", !0),
753
- e.showGroups ? (h(), C(xt, {
748
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
749
+ e.showGroups ? (h(), C(St, {
754
750
  key: 1,
755
- groupId: r.value,
756
- "onUpdate:groupId": m[2] || (m[2] = (d) => r.value = d),
757
- group: l.value,
758
- "onUpdate:group": m[3] || (m[3] = (d) => l.value = d),
751
+ groupId: l.value,
752
+ "onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
753
+ group: n.value,
754
+ "onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
759
755
  projectId: e.projectId,
760
- folder: u.value,
756
+ folder: r.value,
761
757
  groups: e.groups,
762
758
  on: e.on,
763
759
  canAdd: e.canAddGroup,
764
760
  canSelectAll: e.canSelectAllGroups,
765
761
  autoselect: e.autoselect,
766
762
  addChanger: e.addChanger,
763
+ showPath: e.showFolders && !!e.folders?.[0],
767
764
  addIcon: e.addIcon,
768
765
  client: e.client,
769
766
  onAddGroup: x
770
- }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : L("", !0)
767
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : O("", !0)
771
768
  ]));
772
769
  }
773
- }), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, re = (e, a) => {
770
+ }), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
774
771
  e = H(e);
775
772
  const o = a.find((t) => t.id === e);
776
773
  if (o)
777
774
  return o;
778
775
  }, qt = (e, a, o) => {
779
776
  a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
780
- const t = Ze.genElPopupOpener("div", a);
777
+ const t = Xe.genElPopupOpener("div", a);
781
778
  return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || t.classList.add("top-tagSelector-custom"), e.mode === "filter" && t.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && t.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && t.classList.add("top-tagSelector-setter_several"), t.onclick = (r) => {
782
779
  r.preventDefault(), r.stopPropagation(), t.onclick = null;
783
- const l = G(e.modelValue), n = {
780
+ const l = K(e.modelValue), n = {
784
781
  model: l,
785
782
  mode: e.mode,
786
783
  targetId: e.targetId,
787
784
  filters: e.filters,
788
785
  payload: e.payload
789
786
  };
790
- J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || V(l, () => {
787
+ W(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
791
788
  e.modelValue = l.value, te(t, e, o);
792
789
  }), t.click();
793
- }, he(e.modelValue) ? V(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
790
+ }, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : W(t, "topTagSelectorRender", (r) => {
794
791
  e.modelValue = r;
795
- const l = J(t, "topTagSelectorTarget");
792
+ const l = W(t, "topTagSelectorTarget");
796
793
  l && (l.model.value = r), te(t, e, o);
797
794
  }), te(t, e, o), t;
798
- }, Ut = (e, a) => {
799
- J(e, "topTagSelectorRender")?.(a);
795
+ }, Ft = (e, a) => {
796
+ W(e, "topTagSelectorRender")?.(a);
800
797
  }, te = (e, a, o) => {
801
798
  const t = v(a.modelValue);
802
799
  if (e.classList.toggle("top-tagSelector-selectedOne", !t.length || t.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", t.length > 5), a.mode === "setter" && a.filters) {
@@ -815,8 +812,8 @@ const vt = /* @__PURE__ */ R({
815
812
  t.forEach((r) => {
816
813
  const l = Te({
817
814
  id: H(r),
818
- colorId: re(r, a.tags)?.color_id ?? "",
819
- name: re(r, a.tags)?.name ?? "",
815
+ colorId: ie(r, a.tags)?.color_id ?? "",
816
+ name: ie(r, a.tags)?.name ?? "",
820
817
  state: H(r) === r ? "selected" : "excluded"
821
818
  });
822
819
  e.append(l);
@@ -824,7 +821,7 @@ const vt = /* @__PURE__ */ R({
824
821
  }, Te = (e) => {
825
822
  const a = document.createElement("div");
826
823
  return a.classList.add("top-tagSelector_tagIcon"), a.classList.toggle("top-tagSelector-active", !!e.state), a.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), a.dataset.tag_id = e.id, a.dataset.tag_color_id = e.colorId, a.title = e.name, a;
827
- }, Ct = [
824
+ }, kt = [
828
825
  {
829
826
  id: "1",
830
827
  name: "Without Tag",
@@ -875,7 +872,7 @@ const vt = /* @__PURE__ */ R({
875
872
  name: "Turquoise",
876
873
  color_id: "10"
877
874
  }
878
- ], Bt = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
875
+ ], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
879
876
  __name: "tagIcon",
880
877
  props: {
881
878
  id: {},
@@ -893,11 +890,11 @@ const vt = /* @__PURE__ */ R({
893
890
  "data-tag_id": e.id,
894
891
  "data-tag_color_id": e.colorId,
895
892
  title: e.name
896
- }, null, 10, Bt));
893
+ }, null, 10, Ct));
897
894
  }
898
- }), Tt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
895
+ }), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
899
896
  __name: "tagPopupListItem",
900
- props: /* @__PURE__ */ M({
897
+ props: /* @__PURE__ */ V({
901
898
  editable: { type: Boolean },
902
899
  disabled: { type: Boolean },
903
900
  canExclude: { type: Boolean },
@@ -911,13 +908,13 @@ const vt = /* @__PURE__ */ R({
911
908
  },
912
909
  nameModifiers: {}
913
910
  }),
914
- emits: /* @__PURE__ */ M(["update:name", "unselect", "exclude", "select"], ["update:name"]),
911
+ emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
915
912
  setup(e, { emit: a }) {
916
- const o = e, t = a, r = T(e, "name"), l = G(null), n = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
913
+ const o = e, t = a, r = T(e, "name"), l = K(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
917
914
  contenteditable: u.value,
918
915
  onpaste: (m) => m.preventDefault()
919
- } : {}), u = G(!1), f = async () => {
920
- u.value = !0, await Ne(), l.value?.focus();
916
+ } : {}), u = K(!1), f = async () => {
917
+ u.value = !0, await Re(), l.value?.focus();
921
918
  }, c = () => {
922
919
  const m = l.value?.innerText;
923
920
  if (!m) return x();
@@ -941,7 +938,7 @@ const vt = /* @__PURE__ */ R({
941
938
  onClick: U(i, ["stop"])
942
939
  }, {
943
940
  default: B(() => [
944
- N(fe, {
941
+ P(fe, {
945
942
  id: e.id,
946
943
  name: r.value,
947
944
  colorId: e.colorId,
@@ -957,7 +954,7 @@ const vt = /* @__PURE__ */ R({
957
954
  Ie(U(c, ["stop"]), ["enter"]),
958
955
  Ie(U(x, ["stop"]), ["esc"])
959
956
  ]
960
- }), b(r.value), 17, Tt),
957
+ }), b(r.value), 17, Bt),
961
958
  e.editable ? (h(), A(Y, { key: 0 }, [
962
959
  u.value ? (h(), A("span", {
963
960
  key: 1,
@@ -970,15 +967,15 @@ const vt = /* @__PURE__ */ R({
970
967
  class: "top-tagSelector_edit",
971
968
  onClick: f
972
969
  }))
973
- ], 64)) : L("", !0)
970
+ ], 64)) : O("", !0)
974
971
  ]),
975
972
  _: 1
976
973
  }, 8, ["class"]));
977
974
  }
978
- }), At = { key: 1 }, bt = /* @__PURE__ */ R({
975
+ }), Tt = { key: 1 }, At = /* @__PURE__ */ R({
979
976
  inheritAttrs: !1,
980
977
  __name: "popupOpener",
981
- props: /* @__PURE__ */ M({
978
+ props: /* @__PURE__ */ V({
982
979
  modelValue: {},
983
980
  id: {},
984
981
  tags: {},
@@ -1007,7 +1004,7 @@ const vt = /* @__PURE__ */ R({
1007
1004
  const f = Pe("top-data");
1008
1005
  return h(), C(Je, { id: e.id }, {
1009
1006
  default: B(() => [
1010
- De((h(), C(Fe(v(t)), Ve({
1007
+ Ne((h(), C(De(v(t)), Ve({
1011
1008
  class: {
1012
1009
  "top-tagSelector": !0,
1013
1010
  "top-tagSelector-useTopButton": a.useTopButton,
@@ -1029,13 +1026,13 @@ const vt = /* @__PURE__ */ R({
1029
1026
  colorId: "",
1030
1027
  name: n.$i18n.Common.All_tags ?? "",
1031
1028
  state: ""
1032
- }, null, 8, ["name"])) : L("", !0),
1033
- e.mode === "setter" && e.filters ? (h(), A("div", At, [
1029
+ }, null, 8, ["name"])) : O("", !0),
1030
+ e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
1034
1031
  qe(n.$slots, "default")
1035
1032
  ])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
1036
1033
  id: v(H)(c),
1037
- colorId: v(re)(c, e.tags)?.color_id ?? "",
1038
- name: v(re)(c, e.tags)?.name ?? "",
1034
+ colorId: v(ie)(c, e.tags)?.color_id ?? "",
1035
+ name: v(ie)(c, e.tags)?.name ?? "",
1039
1036
  state: v(H)(c) === c ? "selected" : "excluded"
1040
1037
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1041
1038
  ]),
@@ -1048,9 +1045,9 @@ const vt = /* @__PURE__ */ R({
1048
1045
  }, 8, ["id"]);
1049
1046
  };
1050
1047
  }
1051
- }), _t = /* @__PURE__ */ R({
1048
+ }), Ut = /* @__PURE__ */ R({
1052
1049
  __name: "tagSelector",
1053
- props: /* @__PURE__ */ M({
1050
+ props: /* @__PURE__ */ V({
1054
1051
  modelValue: {},
1055
1052
  tags: {},
1056
1053
  tagsEditable: { type: Boolean },
@@ -1068,31 +1065,31 @@ const vt = /* @__PURE__ */ R({
1068
1065
  },
1069
1066
  modelModifiers: {},
1070
1067
  tags: {
1071
- default: be(Ct)
1068
+ default: be(kt)
1072
1069
  },
1073
1070
  tagsModifiers: {}
1074
1071
  }),
1075
- emits: /* @__PURE__ */ M(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1072
+ emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1076
1073
  setup(e, { emit: a }) {
1077
1074
  const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
1078
1075
  n(p, I);
1079
1076
  }, t.emitDelay);
1080
1077
  t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1081
- const f = t.id ?? "top-popup-id-" + Math.random(), c = G("add"), x = () => {
1078
+ const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
1082
1079
  const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1083
1080
  return I.set("add", { value: "add", title: o.Common.Add + p }), I.set("replace", { value: "replace", title: o.Common.Replace + p }), I.set("delete", { value: "delete", title: o.Common.Delete + p }), I;
1084
1081
  };
1085
- let i = Ue({
1082
+ let i = Fe({
1086
1083
  model: r,
1087
1084
  mode: "filter",
1088
1085
  targetId: void 0,
1089
1086
  filters: void 0,
1090
1087
  payload: void 0
1091
1088
  });
1092
- V(r, () => {
1089
+ E(r, () => {
1093
1090
  u("selector", r.value);
1094
1091
  });
1095
- const m = E(() => {
1092
+ const m = M(() => {
1096
1093
  if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1097
1094
  return i.value.model.value.length >= t.maxTagsForSetter;
1098
1095
  }), d = (p) => {
@@ -1103,17 +1100,17 @@ const vt = /* @__PURE__ */ R({
1103
1100
  return p === "all" && !i.value.model.value.length ? "selected" : "";
1104
1101
  }, s = (p, I) => {
1105
1102
  const S = Be(p);
1106
- let k = i.value.model.value.filter((K) => K !== p && K !== S);
1107
- I === "select" && k.push(p), I === "exclude" && k.push(S), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, ee) => {
1103
+ let k = i.value.model.value.filter((G) => G !== p && G !== S);
1104
+ I === "select" && k.push(p), I === "exclude" && k.push(S), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((G) => G !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((G, ee) => {
1108
1105
  if (!t.tags) return 0;
1109
- const D = t.tags.findIndex((q) => q.id === K), F = t.tags.findIndex((q) => q.id === ee);
1110
- return D - F;
1106
+ const D = t.tags.findIndex((F) => F.id === G), q = t.tags.findIndex((F) => F.id === ee);
1107
+ return D - q;
1111
1108
  }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1112
1109
  tagsIds: k,
1113
1110
  targetId: i.value.targetId,
1114
1111
  payload: i.value.payload
1115
1112
  });
1116
- }, g = E(() => {
1113
+ }, g = M(() => {
1117
1114
  let p = "top-tagSelector_popup";
1118
1115
  return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
1119
1116
  }), Z = () => {
@@ -1125,13 +1122,13 @@ const vt = /* @__PURE__ */ R({
1125
1122
  name: p,
1126
1123
  color_id: String((I - 1) % 10 + 1)
1127
1124
  }), n("tagsChanged", l.value);
1128
- }, P = (p) => {
1129
- if (i.value = J(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1130
- if (i.value.filters && (c.value = "add", i.value.model.value = []), !_.$?.ui.sortable) {
1125
+ }, N = (p) => {
1126
+ if (i.value = W(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1127
+ if (i.value.filters && (c.value = "add", i.value.model.value = []), !z.$?.ui.sortable) {
1131
1128
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1132
1129
  return;
1133
1130
  }
1134
- !_.state.isMobile && !_.state.isMobileUA && l.value && $(p.elPopup).sortable({
1131
+ !z.state.isMobile && !z.state.isMobileUA && l.value && $(p.elPopup).sortable({
1135
1132
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
1136
1133
  /**
1137
1134
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
@@ -1140,22 +1137,22 @@ const vt = /* @__PURE__ */ R({
1140
1137
  distance: 10,
1141
1138
  stop: function(I, S) {
1142
1139
  if (!l.value) return;
1143
- const k = $(S.item).parent().find("[data-tag_id]"), K = [];
1140
+ const k = $(S.item).parent().find("[data-tag_id]"), G = [];
1144
1141
  k.each((ee, D) => {
1145
1142
  if (!l.value) return;
1146
- const F = $(D).attr("data-tag_id");
1147
- K.push(F);
1143
+ const q = $(D).attr("data-tag_id");
1144
+ G.push(q);
1148
1145
  }), l.value.sort((ee, D) => {
1149
- const F = K.findIndex((ie) => ie === ee.id), q = K.findIndex((ie) => ie === D.id);
1150
- return F - q;
1146
+ const q = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === D.id);
1147
+ return q - F;
1151
1148
  }), u("tagsChanged", l.value);
1152
1149
  }
1153
1150
  });
1154
- }, Re = (p) => {
1155
- _.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
1151
+ }, je = (p) => {
1152
+ z.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
1156
1153
  };
1157
1154
  return (p, I) => (h(), A(Y, null, [
1158
- N(bt, {
1155
+ P(At, {
1159
1156
  modelValue: r.value,
1160
1157
  "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
1161
1158
  id: v(f),
@@ -1164,13 +1161,13 @@ const vt = /* @__PURE__ */ R({
1164
1161
  mode: "filter",
1165
1162
  useTopButton: e.useTopButton
1166
1163
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1167
- N(Me, {
1164
+ P(we, {
1168
1165
  id: v(f),
1169
1166
  class: X(g.value),
1170
- onOpen: I[4] || (I[4] = (S) => P(S)),
1171
- onClose: I[5] || (I[5] = (S) => Re(S)),
1167
+ onOpen: I[4] || (I[4] = (S) => N(S)),
1168
+ onClose: I[5] || (I[5] = (S) => je(S)),
1172
1169
  "transition-duration": 50
1173
- }, _e({
1170
+ }, Ue({
1174
1171
  contentList: B(() => [
1175
1172
  v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
1176
1173
  key: 0,
@@ -1179,7 +1176,7 @@ const vt = /* @__PURE__ */ R({
1179
1176
  name: p.$i18n.Common.All_tags ?? "",
1180
1177
  state: v(i).model.value.length ? "" : "selected",
1181
1178
  onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
1182
- }, null, 8, ["name", "state"])) : L("", !0),
1179
+ }, null, 8, ["name", "state"])) : O("", !0),
1183
1180
  (h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
1184
1181
  key: S.id,
1185
1182
  id: S.id,
@@ -1202,17 +1199,17 @@ const vt = /* @__PURE__ */ R({
1202
1199
  onClick: U(Z, ["stop"])
1203
1200
  }, {
1204
1201
  default: B(() => [
1205
- z(b(p.$i18n.Common.Add), 1)
1202
+ J(b(p.$i18n.Common.Add), 1)
1206
1203
  ]),
1207
1204
  _: 1
1208
- })) : L("", !0)
1205
+ })) : O("", !0)
1209
1206
  ]),
1210
1207
  _: 2
1211
1208
  }, [
1212
1209
  v(i).mode === "setter" && v(i).filters ? {
1213
1210
  name: "header",
1214
1211
  fn: B(() => [
1215
- N(se, {
1212
+ P(ce, {
1216
1213
  modelValue: c.value,
1217
1214
  "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
1218
1215
  options: x()
@@ -1223,13 +1220,13 @@ const vt = /* @__PURE__ */ R({
1223
1220
  v(i).mode === "setter" && v(i).filters ? {
1224
1221
  name: "footer",
1225
1222
  fn: B(() => [
1226
- N(Q, { color: "theme" }, {
1223
+ P(Q, { color: "theme" }, {
1227
1224
  default: B(() => [
1228
- z(b(p.$i18n.Common.Cancel), 1)
1225
+ J(b(p.$i18n.Common.Cancel), 1)
1229
1226
  ]),
1230
1227
  _: 1
1231
1228
  }),
1232
- N(Q, {
1229
+ P(Q, {
1233
1230
  onClick: I[2] || (I[2] = (S) => v(u)("setter", {
1234
1231
  tagsIds: v(i).model.value,
1235
1232
  filters: v(i).filters,
@@ -1238,7 +1235,7 @@ const vt = /* @__PURE__ */ R({
1238
1235
  }))
1239
1236
  }, {
1240
1237
  default: B(() => [
1241
- z(b(c.value === "add" ? p.$i18n.Common.Add : "") + " " + b(c.value === "replace" ? p.$i18n.Common.Replace : "") + " " + b(c.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
1238
+ J(b(c.value === "add" ? p.$i18n.Common.Add : "") + " " + b(c.value === "replace" ? p.$i18n.Common.Replace : "") + " " + b(c.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
1242
1239
  ]),
1243
1240
  _: 1
1244
1241
  })
@@ -1250,17 +1247,17 @@ const vt = /* @__PURE__ */ R({
1250
1247
  }
1251
1248
  });
1252
1249
  export {
1253
- Nt as TopCompetitorSelector,
1254
- Ft as TopGroupSelector,
1255
- Dt as TopRegionSelector,
1256
- _t as TopTagSelector,
1257
- bt as TopTagSelectorPopupOpener,
1250
+ Rt as TopCompetitorSelector,
1251
+ Dt as TopGroupSelector,
1252
+ Nt as TopRegionSelector,
1253
+ Ut as TopTagSelector,
1254
+ At as TopTagSelectorPopupOpener,
1258
1255
  fe as TopTagSelectorTagIcon,
1259
- dt as dialogRegionSelector,
1260
- it as findRegion,
1256
+ it as dialogRegionSelector,
1257
+ rt as findRegion,
1261
1258
  qt as genElTopTagSelectorPopupOpener,
1262
1259
  Ke as genSearcherByKey,
1263
- Ut as renderElTopTagSelectorPopupOpener,
1260
+ Ft as renderElTopTagSelectorPopupOpener,
1264
1261
  Pt as useItemsFromCompetitors
1265
1262
  };
1266
1263
  //# sourceMappingURL=project.js.map