@topvisor/ui 1.0.23-dev.6 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
- import { Core as Te } from "../core/app.js";
2
- import { defineComponent as q, mergeModels as R, useModel as N, computed as E, createElementBlock as B, openBlock as k, createBlock as b, unref as y, withCtx as _, Fragment as W, renderList as ie, normalizeClass as Q, createElementVNode as ye, toDisplayString as M, createVNode as L, createTextVNode as z, ref as D, watch as K, createCommentVNode as F, withModifiers as j, mergeProps as pe, withKeys as de, nextTick as be, resolveDirective as Be, withDirectives as Ve, resolveDynamicComponent as Ee, renderSlot as Me, shallowRef as $e, createSlots as Ke, reactive as we, toValue as ue, isRef as ce } from "vue";
3
- import { u as A, C as J, _ as Y, x as re, d as Le } from "../.chunks/forms-BEOYaG5x.es.js";
4
- import { _ as he, a as se, b as Ae } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-BzHSHzgd.es.js";
5
- import { _ as Oe } from "../.chunks/menu.vue_vue_type_style_index_0_lang-D38vuK6Z.es.js";
6
- import { u as Re } from "../.chunks/utils-Lh80NiyA.es.js";
7
- import { getSearcherGIcon as Ne, getLangLabel as De, getDeviceGIcon as Fe } from "../utils/searchers.js";
8
- import { storage as G } from "../utils/dom.js";
9
- import { TopPopupWorker as qe } from "../popup/worker.js";
10
- const _e = ["../assets/project.css"].map((t) => import.meta.resolve(t));
11
- Te.insertCSSLinkToPage(_e, !0);
12
- const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }, je = /* @__PURE__ */ q({
1
+ import { Core as be } from "../core/app.js";
2
+ import { defineComponent as P, mergeModels as N, useModel as D, computed as E, createElementBlock as B, openBlock as k, createBlock as b, unref as y, withCtx as _, Fragment as Y, renderList as de, normalizeClass as X, createElementVNode as he, toDisplayString as M, createVNode as A, createTextVNode as G, ref as F, watch as w, createCommentVNode as q, withModifiers as J, mergeProps as Se, withKeys as ce, nextTick as Ve, resolveDirective as Ee, withDirectives as Ke, resolveDynamicComponent as Me, renderSlot as $e, shallowRef as we, createSlots as Le, reactive as Ae, toValue as ge, isRef as me } from "vue";
3
+ import { u as R, C as z, _ as H, x as se, d as Re } from "../.chunks/forms-BEOYaG5x.es.js";
4
+ import { _ as Ie, a as ue, b as Oe } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-BzHSHzgd.es.js";
5
+ import { _ as Ne } from "../.chunks/menu.vue_vue_type_style_index_0_lang-D38vuK6Z.es.js";
6
+ import { u as De } from "../.chunks/utils-Lh80NiyA.es.js";
7
+ import { getSearcherGIcon as Fe, getLangLabel as qe, getDeviceGIcon as Pe } from "../utils/searchers.js";
8
+ import { storage as W } from "../utils/dom.js";
9
+ import { TopPopupWorker as Ue } from "../popup/worker.js";
10
+ const Be = ["../assets/project.css"].map((t) => import.meta.resolve(t));
11
+ be.insertCSSLinkToPage(Be, !0);
12
+ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }, ze = /* @__PURE__ */ P({
13
13
  __name: "selectorCompetitors",
14
- props: /* @__PURE__ */ R({
14
+ props: /* @__PURE__ */ N({
15
15
  modelValue: {},
16
16
  items: {},
17
17
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -21,59 +21,59 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
21
21
  }),
22
22
  emits: ["update:modelValue"],
23
23
  setup(t) {
24
- const l = t, o = N(t, "modelValue"), e = E(() => {
24
+ const l = t, n = D(t, "modelValue"), e = E(() => {
25
25
  if (l.showSelectAllItem)
26
26
  return {
27
27
  icon: "",
28
- title: A().Common.Select_all,
28
+ title: R().Common.Select_all,
29
29
  value: "all",
30
30
  content: ""
31
31
  };
32
32
  });
33
- return (i, a) => (k(), B("div", Pe, [
34
- y(J).state.isMobile ? (k(), b(he, { key: 0 }, {
33
+ return (i, a) => (k(), B("div", je, [
34
+ y(z).state.isMobile ? (k(), b(Ie, { key: 0 }, {
35
35
  opener: _(() => [
36
- L(Y, {
36
+ A(H, {
37
37
  class: "top-selectorCompetitors_opener",
38
38
  color: "theme",
39
39
  icon: "",
40
40
  icon2: ""
41
41
  }, {
42
42
  default: _(() => {
43
- var n;
43
+ var o;
44
44
  return [
45
- z(M((n = i.items.find((d) => {
45
+ G(M((o = i.items.find((d) => {
46
46
  var m;
47
- return d.value === ((m = o.value) == null ? void 0 : m[0]);
48
- })) == null ? void 0 : n.content), 1)
47
+ return d.value === ((m = n.value) == null ? void 0 : m[0]);
48
+ })) == null ? void 0 : o.content), 1)
49
49
  ];
50
50
  }),
51
51
  _: 1
52
52
  })
53
53
  ]),
54
54
  contentList: _(() => [
55
- (k(!0), B(W, null, ie(i.items, (n, d) => {
55
+ (k(!0), B(Y, null, de(i.items, (o, d) => {
56
56
  var m;
57
- return k(), b(se, {
58
- class: Q({
59
- "top-active": (m = o.value) == null ? void 0 : m.includes(n.value)
57
+ return k(), b(ue, {
58
+ class: X({
59
+ "top-active": (m = n.value) == null ? void 0 : m.includes(o.value)
60
60
  }),
61
- "data-top-icon": n.icon,
62
- title: n.title,
63
- onClick: () => o.value = [n.value]
61
+ "data-top-icon": o.icon,
62
+ title: o.title,
63
+ onClick: () => n.value = [o.value]
64
64
  }, {
65
65
  default: _(() => [
66
- ye("span", Ue, M(n.content), 1)
66
+ he("span", Je, M(o.content), 1)
67
67
  ]),
68
68
  _: 2
69
69
  }, 1032, ["class", "data-top-icon", "title", "onClick"]);
70
70
  }), 256))
71
71
  ]),
72
72
  _: 1
73
- })) : (k(), b(Oe, {
73
+ })) : (k(), b(Ne, {
74
74
  key: 1,
75
- modelValue: o.value,
76
- "onUpdate:modelValue": a[0] || (a[0] = (n) => o.value = n),
75
+ modelValue: n.value,
76
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.value = o),
77
77
  items: i.items,
78
78
  isMultiple: !0,
79
79
  styling: "bar",
@@ -82,7 +82,7 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
82
82
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
83
83
  ]));
84
84
  }
85
- }), x = -2, Je = {
85
+ }), K = -1, p = -2, te = -1, Ge = {
86
86
  0: "Yandex",
87
87
  1: "Google",
88
88
  4: "YouTube",
@@ -92,95 +92,95 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
92
92
  9: "GoogleStore",
93
93
  20: "Yandex.com",
94
94
  21: "Yandex.com.tr"
95
- }, ee = {
96
- key: x,
95
+ }, ae = {
96
+ key: p,
97
97
  name: "--",
98
- index: x
99
- }, Se = {
100
- key: x,
98
+ index: p
99
+ }, xe = {
100
+ key: p,
101
101
  name: "--",
102
- regions: [ee],
103
- regionByIndex: /* @__PURE__ */ new Map([[x, ee]])
104
- }, te = {
105
- key: x,
102
+ regions: [ae],
103
+ regionByIndex: /* @__PURE__ */ new Map([[p, ae]])
104
+ }, le = {
105
+ key: p,
106
106
  name: "Autoselect",
107
- index: x
108
- }, oe = {
109
- key: x,
107
+ index: p
108
+ }, ie = {
109
+ key: p,
110
110
  name: "Autoselect",
111
- regions: [te],
112
- regionByIndex: /* @__PURE__ */ new Map([[x, te]])
113
- }, ge = {
111
+ regions: [le],
112
+ regionByIndex: /* @__PURE__ */ new Map([[p, le]])
113
+ }, fe = {
114
114
  countryCode: "00",
115
115
  depth: 1,
116
116
  device: 0,
117
- key: -1,
118
- index: -1,
117
+ key: te,
118
+ index: te,
119
119
  lang: "ru",
120
120
  name: "Without region"
121
- }, ze = () => (te.name = A().Common.Autoselect, te), Ge = () => (ze(), oe.name = A().Common.Autoselect, console.log(oe), oe), We = () => (ge.name = A().Keywords.Without_region, ge), Ie = (t = !1, l = !1, o = []) => {
121
+ }, We = () => (le.name = R().Common.Autoselect, le), Ye = () => (We(), ie.name = R().Common.Autoselect, console.log(ie), ie), He = () => (fe.name = R().Keywords.Without_region, fe), ke = (t = !1, l = !1, n = []) => {
122
122
  let e;
123
- return t ? e = Ye(o) : e = xe(o), l && e.set(x, Ge()), e.size || e.set(x, Se), e;
124
- }, xe = (t, l = !0, o = [], e = !1) => {
123
+ return t ? e = Qe(n) : e = Ce(n), l && e.set(p, Ye()), e.size || e.set(p, xe), e;
124
+ }, Ce = (t, l = !0, n = [], e = !1) => {
125
125
  const i = /* @__PURE__ */ new Map();
126
126
  return t.forEach((a) => {
127
127
  if (!a.enabled || e && typeof a.key == "number" && a.key > 1) return;
128
- const n = { ...a };
129
- n.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((d) => {
128
+ const o = { ...a };
129
+ o.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((d) => {
130
130
  if (l && !d.enabled) return;
131
131
  const m = { ...d };
132
- n.regionByIndex.set(m.index, m);
133
- }), !n.regionByIndex.size && !o.length && n.regionByIndex.set(ee.index, ee), typeof n.key == "number" && i.set(n.key, n);
134
- }), o.forEach((a) => {
132
+ o.regionByIndex.set(m.index, m);
133
+ }), !o.regionByIndex.size && !n.length && o.regionByIndex.set(ae.index, ae), typeof o.key == "number" && i.set(o.key, o);
134
+ }), n.forEach((a) => {
135
135
  if (i.has(a)) return;
136
- const n = {
136
+ const o = {
137
137
  key: a,
138
- name: Je[a],
138
+ name: Ge[a],
139
139
  regions: [],
140
140
  regionByIndex: /* @__PURE__ */ new Map()
141
141
  };
142
- i.set(n.key, n);
142
+ i.set(o.key, o);
143
143
  }), i;
144
- }, Ye = (t) => {
145
- const l = xe(t, !1, [0, 1], !0);
144
+ }, Qe = (t) => {
145
+ const l = Ce(t, !1, [0, 1], !0);
146
146
  if (l.has(2)) {
147
- const o = l.get(2);
148
- o && (o.regionByIndex = /* @__PURE__ */ new Map());
147
+ const n = l.get(2);
148
+ n && (n.regionByIndex = /* @__PURE__ */ new Map());
149
149
  }
150
- return l.forEach((o) => {
151
- if (!o.regionByIndex) return;
152
- const e = { ...We() };
153
- o.regionByIndex.set(e.index, e);
150
+ return l.forEach((n) => {
151
+ if (!n.regionByIndex) return;
152
+ const e = { ...He() };
153
+ n.regionByIndex.set(e.index, e);
154
154
  }), l;
155
- }, He = (t, l, o = []) => {
156
- const e = Ie(t, !1, o);
155
+ }, Xe = (t, l, n = []) => {
156
+ const e = ke(t, !1, n);
157
157
  let i;
158
158
  return e.forEach((a) => {
159
- if (!(l.searcher_key !== void 0 && l.searcher_key != a.key) && a.regions && (a.regions.forEach((n) => {
160
- if (!i && !(l.key !== void 0 && l.key != n.key) && !(l.index !== void 0 && l.index != n.index) && !(!t && (l.lang !== void 0 && l.lang != n.lang || l.device !== void 0 && l.device != n.device)))
161
- return n.searcher_key = a.key, i = n, !1;
159
+ if (!(l.searcher_key !== void 0 && l.searcher_key != a.key) && a.regions && (a.regions.forEach((o) => {
160
+ if (!i && !(l.key !== void 0 && l.key != o.key) && !(l.index !== void 0 && l.index != o.index) && !(!t && (l.lang !== void 0 && l.lang != o.lang || l.device !== void 0 && l.device != o.device)))
161
+ return o.searcher_key = a.key, i = o, !1;
162
162
  }), i))
163
163
  return !1;
164
164
  }), i;
165
- }, Qe = Re(() => import("../.chunks/dialog_selectorRegions-eupaC53Q.es.js")), Xe = (t, l) => {
166
- const o = A(), e = D(l.value.keys().next().value ?? x), i = E(() => {
165
+ }, Ze = De(() => import("../.chunks/dialog_selectorRegions-eupaC53Q.es.js")), et = (t, l) => {
166
+ const n = R(), e = F(l.value.keys().next().value ?? p), i = E(() => {
167
167
  const a = /* @__PURE__ */ new Map();
168
- if (l.value.forEach((n) => {
168
+ if (l.value.forEach((o) => {
169
169
  let d = {
170
- value: n.key,
171
- title: n.name
170
+ value: o.key,
171
+ title: o.name
172
172
  };
173
- t.addSearcherIcon && (d.icon = Ne(n.key)), a.set(n.key, d);
174
- }), t.addCompare && !a.has(x)) {
175
- const n = {
173
+ t.addSearcherIcon && (d.icon = Fe(o.key)), a.set(o.key, d);
174
+ }), t.addCompare && !a.has(p)) {
175
+ const o = {
176
176
  value: "",
177
177
  title: "--------------------",
178
178
  disabled: !0
179
179
  };
180
- a.set(n.value, n);
180
+ a.set(o.value, o);
181
181
  const d = {
182
- value: -1,
183
- title: o.Common.Compare
182
+ value: K,
183
+ title: n.Common.Compare
184
184
  };
185
185
  a.set(d.value, d);
186
186
  }
@@ -190,98 +190,98 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
190
190
  searcherKey: e,
191
191
  optionBySearcherKey: i
192
192
  };
193
- }, Ze = (t, l) => {
194
- var a, n, d;
195
- const o = A(), e = D(x);
196
- t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === x && (t.forFrequency ? e.value = ((n = (a = l.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : n.key) ?? x : e.value = ((d = l.value) == null ? void 0 : d.regionByIndex.keys().next().value) ?? x);
193
+ }, tt = (t, l) => {
194
+ var a, o, d;
195
+ const n = R(), e = F(p);
196
+ t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === p && (t.forFrequency ? e.value = ((o = (a = l.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : o.key) ?? p : e.value = ((d = l.value) == null ? void 0 : d.regionByIndex.keys().next().value) ?? p);
197
197
  const i = E(() => {
198
- var p;
198
+ var h;
199
199
  const m = /* @__PURE__ */ new Map();
200
- return (p = l.value.regionByIndex) == null || p.forEach((h) => {
201
- let r = h.name;
200
+ return (h = l.value.regionByIndex) == null || h.forEach((S) => {
201
+ let r = S.name;
202
202
  if (t.forFrequency) {
203
- const I = {
204
- value: h.key,
203
+ const x = {
204
+ value: S.key,
205
205
  title: r
206
206
  };
207
- m.has(h.key) || m.set(h.key, I);
207
+ m.has(S.key) || m.set(S.key, x);
208
208
  return;
209
209
  }
210
- h.device && (r += " (" + o.Common["Device_" + h.device] + ")");
211
- const g = De(l.value.key || 0, h.lang ?? "");
210
+ S.device && (r += " (" + n.Common["Device_" + S.device] + ")");
211
+ const g = qe(l.value.key || 0, S.lang ?? "");
212
212
  g && (r += " / " + g);
213
213
  const u = {
214
- value: h.index,
214
+ value: S.index,
215
215
  title: r,
216
- icon: h.device ? Fe(h.device) : void 0
216
+ icon: S.device ? Pe(S.device) : void 0
217
217
  };
218
- m.set(h.index, u);
218
+ m.set(S.index, u);
219
219
  }), m;
220
220
  });
221
- return K(i, (m, p) => {
221
+ return w(i, (m, h) => {
222
222
  var u;
223
223
  if (t.onlySearcher || e.value !== void 0 && m.get(e.value))
224
224
  return;
225
- let h = m.keys().next().value;
226
- if (e.value === x || h === x) {
227
- e.value = h;
225
+ let S = m.keys().next().value;
226
+ if (e.value === p || S === p) {
227
+ e.value = S;
228
228
  return;
229
229
  }
230
- let r = ((u = p == null ? void 0 : p.get(e.value)) == null ? void 0 : u.title) || "", g = -1;
231
- for (const [I, T] of m.entries()) {
230
+ let r = ((u = h == null ? void 0 : h.get(e.value)) == null ? void 0 : u.title) || "", g = -1;
231
+ for (const [x, T] of m.entries()) {
232
232
  const C = T.title;
233
- if (typeof C != "string" || typeof I == "string")
233
+ if (typeof C != "string" || typeof x == "string")
234
234
  break;
235
235
  if (C === r) {
236
- h = I;
236
+ S = x;
237
237
  break;
238
238
  }
239
- const V = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
239
+ const V = new RegExp(` \\((${n.Common.Device_1}|${n.Common.Device_2})\\)`);
240
240
  let f = r, s = 3;
241
- C.indexOf(f) === -1 && (f = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(f) === -1 && (f = r.replace(/ \/.*/, ""), s--), C.indexOf(f) === -1 && (f = r.replace(/ \/.*/, ""), f = f.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(f) !== -1 && (s <= g || (g = s, h = I));
241
+ C.indexOf(f) === -1 && (f = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(f) === -1 && (f = r.replace(/ \/.*/, ""), s--), C.indexOf(f) === -1 && (f = r.replace(/ \/.*/, ""), f = f.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(f) !== -1 && (s <= g || (g = s, S = x));
242
242
  }
243
- e.value = h;
243
+ e.value = S;
244
244
  }), {
245
245
  regionIndex: e,
246
246
  optionByRegionIndex: i
247
247
  };
248
- }, et = (t, l, o) => {
249
- const e = D([]), i = () => {
248
+ }, at = (t, l, n) => {
249
+ const e = F([]), i = () => {
250
250
  if (t.onlySearcher && l.value) {
251
251
  e.value = Array.from(l.value.keys());
252
252
  return;
253
253
  }
254
- let n = [];
254
+ let o = [];
255
255
  if (t.modelValue.length > 1)
256
- n = [...t.modelValue];
256
+ o = [...t.modelValue];
257
257
  else
258
258
  try {
259
- n = JSON.parse(
259
+ o = JSON.parse(
260
260
  localStorage.getItem("ui:project:regionSelector" + t.projectId + ":regionsIndexes")
261
261
  ) ?? [];
262
262
  } catch {
263
263
  }
264
- n.length && (n = n.filter((d) => o.value.has(d))), n.length || (n = Array.from(o.value)), e.value = [...n];
264
+ o.length && (o = o.filter((d) => n.value.has(d))), o.length || (o = Array.from(n.value)), e.value = [...o];
265
265
  }, a = () => {
266
266
  e.value.length ? localStorage.setItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes", JSON.stringify(e.value)) : localStorage.removeItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes");
267
267
  };
268
- return K(e, () => {
268
+ return w(e, () => {
269
269
  a();
270
270
  }), t.addCompare && i(), {
271
271
  regionsIndexes: e
272
272
  };
273
- }, tt = (t) => {
274
- const l = E(() => Ie(t.forFrequency, t.autoRegion, t.searchers)), o = E(() => l.value.get(i.searcherKey.value) || Se), e = E(() => {
273
+ }, lt = (t) => {
274
+ const l = E(() => ke(t.forFrequency, t.autoRegion, t.searchers)), n = E(() => l.value.get(i.searcherKey.value) || xe), e = E(() => {
275
275
  const r = /* @__PURE__ */ new Set();
276
276
  return l.value.forEach((g) => {
277
277
  g.regionByIndex.forEach((u) => {
278
- u.index !== -1 && u.index !== x && r.add(u.index);
278
+ u.index !== te && u.index !== p && r.add(u.index);
279
279
  });
280
280
  }), r;
281
- }), i = Xe(t, l), a = Ze(t, o), n = et(t, l, e);
282
- K(l, () => {
283
- var g, u, I, T;
284
- if (t.onlySearcher ? n.regionsIndexes.value = Array.from(l.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((C) => e.value.has(C)), i.searcherKey.value === -1) return;
281
+ }), i = et(t, l), a = tt(t, n), o = at(t, l, e);
282
+ w(l, () => {
283
+ var g, u, x, T;
284
+ if (t.onlySearcher ? o.regionsIndexes.value = Array.from(l.value.keys()) : o.regionsIndexes.value = o.regionsIndexes.value.filter((C) => e.value.has(C)), i.searcherKey.value === K) return;
285
285
  let r = l.value.keys().next().value;
286
286
  l.value.forEach((C) => {
287
287
  var V, f, s;
@@ -293,22 +293,22 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
293
293
  let c;
294
294
  r !== void 0 && (c = (f = l.value.get(r)) == null ? void 0 : f.regionByIndex);
295
295
  const v = (s = l.value.get(C.key)) == null ? void 0 : s.regionByIndex;
296
- c != null && c.has(x) && !(v != null && v.has(x)) && (r = C.key);
296
+ c != null && c.has(p) && !(v != null && v.has(p)) && (r = C.key);
297
297
  }
298
- }), r !== void 0 && (i.searcherKey.value = r), a.regionIndex.value !== void 0 && !((u = (g = o.value) == null ? void 0 : g.regionByIndex) != null && u.has(a.regionIndex.value)) && (a.regionIndex.value = (T = (I = o.value) == null ? void 0 : I.regions) == null ? void 0 : T.keys().next().value);
298
+ }), r !== void 0 && (i.searcherKey.value = r), a.regionIndex.value !== void 0 && !((u = (g = n.value) == null ? void 0 : g.regionByIndex) != null && u.has(a.regionIndex.value)) && (a.regionIndex.value = (T = (x = n.value) == null ? void 0 : x.regions) == null ? void 0 : T.keys().next().value);
299
299
  }, { immediate: !0 });
300
300
  const d = () => {
301
- if (!(i.searcherKey.value === -1 || i.searcherKey.value === x))
301
+ if (!(i.searcherKey.value === K || i.searcherKey.value === p))
302
302
  return i.searcherKey.value;
303
303
  }, m = () => {
304
- if (t.onlySearcher || a.regionIndex.value === x) return;
304
+ if (t.onlySearcher || a.regionIndex.value === p) return;
305
305
  let r = a.regionIndex.value;
306
306
  if (t.forFrequency) {
307
- const g = a.regionIndex.value, u = He(t.forFrequency, { searcher_key: d(), key: g }, t.searchers);
307
+ const g = a.regionIndex.value, u = Xe(t.forFrequency, { searcher_key: d(), key: g }, t.searchers);
308
308
  r = u == null ? void 0 : u.index;
309
309
  }
310
310
  return r;
311
- }, p = () => {
311
+ }, h = () => {
312
312
  const r = d();
313
313
  if (r !== void 0)
314
314
  return l.value.get(r);
@@ -316,20 +316,20 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
316
316
  return {
317
317
  selectSearcher: i,
318
318
  selectRegion: a,
319
- compare: n,
319
+ compare: o,
320
320
  searcherByKey: l,
321
321
  allRegionsIndexes: e,
322
- getSearcher: p,
322
+ getSearcher: h,
323
323
  getRegion: () => {
324
324
  var g, u;
325
325
  const r = m();
326
326
  if (r !== void 0)
327
- return (u = (g = p()) == null ? void 0 : g.regionByIndex) == null ? void 0 : u.get(r);
327
+ return (u = (g = h()) == null ? void 0 : g.regionByIndex) == null ? void 0 : u.get(r);
328
328
  }
329
329
  };
330
- }, at = /* @__PURE__ */ q({
330
+ }, ot = /* @__PURE__ */ P({
331
331
  __name: "selectorRegion",
332
- props: /* @__PURE__ */ R({
332
+ props: /* @__PURE__ */ N({
333
333
  projectId: {},
334
334
  searchers: { default: () => [] },
335
335
  modelValue: {},
@@ -349,42 +349,42 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
349
349
  }),
350
350
  emits: ["update:modelValue", "update:modelValueSingle"],
351
351
  setup(t, { expose: l }) {
352
- const o = t, e = N(t, "modelValue"), i = N(t, "modelValueSingle"), {
352
+ const n = t, e = D(t, "modelValue"), i = D(t, "modelValueSingle"), {
353
353
  selectSearcher: a,
354
- selectRegion: n,
354
+ selectRegion: o,
355
355
  compare: d,
356
356
  searcherByKey: m,
357
- allRegionsIndexes: p,
358
- getSearcher: h,
357
+ allRegionsIndexes: h,
358
+ getSearcher: S,
359
359
  getRegion: r
360
- } = tt(o), g = () => {
360
+ } = lt(n), g = () => {
361
361
  const u = [];
362
- m.value.forEach((I) => {
363
- I.enabled && I.regions.forEach((T) => {
362
+ m.value.forEach((x) => {
363
+ x.enabled && x.regions.forEach((T) => {
364
364
  T.enabled && u.push(T);
365
365
  });
366
- }), Qe.open("selectorRegions", {
366
+ }), Ze.open("selectorRegions", {
367
367
  regions: u,
368
368
  regionsIndexes: d.regionsIndexes.value,
369
- "@update:regionsIndexes": (I) => d.regionsIndexes.value = I
369
+ "@update:regionsIndexes": (x) => d.regionsIndexes.value = x
370
370
  });
371
371
  };
372
- return K([n.regionIndex, a.searcherKey, d.regionsIndexes], () => {
373
- if (a.searcherKey.value === -1 && d.regionsIndexes.value.length) {
372
+ return w([o.regionIndex, a.searcherKey, d.regionsIndexes], () => {
373
+ if (a.searcherKey.value === K && d.regionsIndexes.value.length) {
374
374
  if (JSON.stringify(e.value) === JSON.stringify(d.regionsIndexes.value))
375
375
  return;
376
376
  e.value = [...d.regionsIndexes.value];
377
377
  } else
378
- e.value = [o.onlySearcher ? a.searcherKey.value : n.regionIndex.value];
379
- !o.onlySearcher && !p.value.size && (a.searcherKey.value = x);
380
- }), i.value && K(i, () => {
381
- e.value = [i.value];
382
- }, { immediate: !0 }), K(e, () => {
383
- var u, I, T, C, V;
384
- if (e.value[0] && (i.value = e.value[0]), o.onlySearcher) {
378
+ n.onlySearcher ? (e.value = [a.searcherKey.value], a.searcherKey.value === p && !n.autoRegion && (e.value.length = 0)) : (e.value = [o.regionIndex.value], o.regionIndex.value === p && !n.autoRegion && (e.value.length = 0));
379
+ !n.onlySearcher && !h.value.size && (a.searcherKey.value = p);
380
+ }), i.value && w(i, () => {
381
+ i.value && (e.value = [i.value]);
382
+ }, { immediate: !0 }), w(e, () => {
383
+ var u, x, T, C, V;
384
+ if (e.value[0] && (i.value = e.value[0]), n.onlySearcher) {
385
385
  if (!e.value.length || e.value.length === 1 && !m.value.has(e.value[0])) {
386
386
  let f = m.value.keys().next().value;
387
- f !== void 0 && (e.value = [f]);
387
+ f === p && !n.autoRegion && (f = void 0, i.value = p), f !== void 0 && (e.value = [f]);
388
388
  return;
389
389
  }
390
390
  if (e.value.length > 1 && JSON.stringify(e.value) !== JSON.stringify(d.regionsIndexes.value)) {
@@ -392,86 +392,90 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
392
392
  return;
393
393
  }
394
394
  } else {
395
- let f = [...new Set(e.value)], s = (I = (u = m.value.values().next().value) == null ? void 0 : u.regionByIndex) == null ? void 0 : I.keys().next().value;
396
- if (o.forFrequency && (s = (V = (C = (T = m.value.values().next().value) == null ? void 0 : T.regionByIndex) == null ? void 0 : C.values().next().value) == null ? void 0 : V.key), !f.length)
395
+ let f = [...new Set(e.value)], s = (x = (u = m.value.values().next().value) == null ? void 0 : u.regionByIndex) == null ? void 0 : x.keys().next().value;
396
+ if (n.forFrequency && (s = (V = (C = (T = m.value.values().next().value) == null ? void 0 : T.regionByIndex) == null ? void 0 : C.values().next().value) == null ? void 0 : V.key), s === p && !n.autoRegion && (s = void 0, i.value = p), !f.length)
397
397
  s !== void 0 && f.push(s);
398
398
  else if (f.length === 1) {
399
- let c = p.value;
400
- o.forFrequency && (c = /* @__PURE__ */ new Set(), m.value.forEach((v) => {
401
- v.regionByIndex.forEach((S) => {
402
- S.index !== -1 && S.index !== x && c.add(S.key);
399
+ let c = h.value;
400
+ n.forFrequency && (c = /* @__PURE__ */ new Set(), m.value.forEach((v) => {
401
+ v.regionByIndex.forEach((I) => {
402
+ I.index !== te && I.index !== p && c.add(I.key);
403
403
  });
404
- })), !c.has(f[0]) && f[0] !== -2 && (f = [], s !== void 0 && f.push(s));
404
+ })), c.has(f[0]) || (f = [], s !== void 0 && f.push(s));
405
405
  } else
406
- f = f.filter((c) => p.value.has(c)), !f.length && s !== void 0 && f.push(s);
406
+ f = f.filter((c) => h.value.has(c)), !f.length && s !== void 0 && f.push(s);
407
407
  if (JSON.stringify(e.value) !== JSON.stringify(f)) {
408
408
  e.value = f;
409
409
  return;
410
410
  }
411
411
  }
412
- if (!(e.value.length === 1 && e.value[0] === (o.onlySearcher ? a.searcherKey.value : n.regionIndex.value)))
413
- if (o.onlySearcher) {
412
+ if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : o.regionIndex.value)))
413
+ if (n.onlySearcher) {
414
414
  if (e.value.length === 1) {
415
415
  a.searcherKey.value = e.value[0];
416
416
  return;
417
417
  }
418
- a.searcherKey.value = -1;
418
+ a.searcherKey.value = K;
419
419
  return;
420
- } else if (e.value.length === 1 && a.searcherKey.value !== -1) {
421
- n.regionIndex.value = e.value[0];
422
- let f;
423
- for (const s of m.value.values()) {
424
- for (const c of s.regionByIndex.values())
425
- if ((o.forFrequency ? c.key : c.index) === n.regionIndex.value) {
426
- f = s.key;
420
+ } else {
421
+ if (!e.value.length)
422
+ return;
423
+ if (e.value.length === 1 && a.searcherKey.value !== K) {
424
+ o.regionIndex.value = e.value[0];
425
+ let f;
426
+ for (const s of m.value.values()) {
427
+ for (const c of s.regionByIndex.values())
428
+ if ((n.forFrequency ? c.key : c.index) === o.regionIndex.value) {
429
+ f = s.key;
430
+ break;
431
+ }
432
+ if (f !== void 0)
427
433
  break;
428
- }
429
- if (f !== void 0)
430
- break;
431
- }
432
- f !== void 0 && (a.searcherKey.value = f);
433
- } else
434
- a.searcherKey.value = -1, d.regionsIndexes.value = [...e.value];
434
+ }
435
+ f !== void 0 && (a.searcherKey.value = f);
436
+ } else
437
+ a.searcherKey.value = K, d.regionsIndexes.value = [...e.value];
438
+ }
435
439
  }, { immediate: !0 }), l({
436
- getSearcher: h,
440
+ getSearcher: S,
437
441
  getRegion: r
438
- }), (u, I) => (k(), B("div", {
439
- class: Q({
442
+ }), (u, x) => (k(), B("div", {
443
+ class: X({
440
444
  "top-selectorRegion": !0,
441
445
  "top-selectorRegion-onlySearcher": u.onlySearcher
442
446
  })
443
447
  }, [
444
- L(re, {
448
+ A(se, {
445
449
  options: y(a).optionBySearcherKey.value,
446
450
  modelValue: y(a).searcherKey.value,
447
- "onUpdate:modelValue": I[0] || (I[0] = (T) => y(a).searcherKey.value = T),
451
+ "onUpdate:modelValue": x[0] || (x[0] = (T) => y(a).searcherKey.value = T),
448
452
  name: "searcher_key",
449
453
  addChanger: u.addChanger
450
454
  }, null, 8, ["options", "modelValue", "addChanger"]),
451
- !u.onlySearcher && y(a).searcherKey.value !== -1 ? (k(), b(re, {
455
+ !u.onlySearcher && y(a).searcherKey.value !== y(K) ? (k(), b(se, {
452
456
  key: 0,
453
457
  class: "top-select-region",
454
- options: y(n).optionByRegionIndex.value,
455
- modelValue: y(n).regionIndex.value,
456
- "onUpdate:modelValue": I[1] || (I[1] = (T) => y(n).regionIndex.value = T),
458
+ options: y(o).optionByRegionIndex.value,
459
+ modelValue: y(o).regionIndex.value,
460
+ "onUpdate:modelValue": x[1] || (x[1] = (T) => y(o).regionIndex.value = T),
457
461
  name: u.forFrequency ? "region_key" : "region_index",
458
462
  addChanger: u.addChanger,
459
463
  "data-top-icon": u.addRegionIcon ? "" : void 0
460
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : F("", !0),
461
- u.addCompare && !u.onlySearcher && y(a).searcherKey.value === -1 ? (k(), b(Y, {
464
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : q("", !0),
465
+ u.addCompare && !u.onlySearcher && y(a).searcherKey.value === y(K) ? (k(), b(H, {
462
466
  key: 1,
463
467
  name: "compare",
464
468
  onClick: g,
465
469
  "data-count-compare-regions-indexes": y(d).regionsIndexes.value.length
466
470
  }, {
467
471
  default: _(() => [
468
- z(M(u.$i18n.Common.Selected_regions), 1)
472
+ G(M(u.$i18n.Common.Selected_regions), 1)
469
473
  ]),
470
474
  _: 1
471
- }, 8, ["data-count-compare-regions-indexes"])) : F("", !0)
475
+ }, 8, ["data-count-compare-regions-indexes"])) : q("", !0)
472
476
  ], 2));
473
477
  }
474
- }), lt = [
478
+ }), nt = [
475
479
  {
476
480
  id: "1",
477
481
  name: "Without Tag",
@@ -522,12 +526,12 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
522
526
  name: "Turquoise",
523
527
  color_id: "10"
524
528
  }
525
- ], me = (t) => "-" + t, H = (t) => t[0] === "-" ? t.substring(1) : t, ae = (t, l) => {
526
- t = H(t);
527
- const o = l.find((e) => e.id === t);
528
- if (o)
529
- return o;
530
- }, nt = ["data-tag_id", "data-tag_color_id", "title"], le = /* @__PURE__ */ q({
529
+ ], ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, oe = (t, l) => {
530
+ t = Q(t);
531
+ const n = l.find((e) => e.id === t);
532
+ if (n)
533
+ return n;
534
+ }, rt = ["data-tag_id", "data-tag_color_id", "title"], ne = /* @__PURE__ */ P({
531
535
  __name: "tagIcon",
532
536
  props: {
533
537
  id: {},
@@ -536,8 +540,8 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
536
540
  state: {}
537
541
  },
538
542
  setup(t) {
539
- return (l, o) => (k(), B("div", {
540
- class: Q({
543
+ return (l, n) => (k(), B("div", {
544
+ class: X({
541
545
  "top-tagSelector_tagIcon": !0,
542
546
  "top-tagSelector-active": !!l.state,
543
547
  "top-tagSelector-excluded": l.state === "excluded"
@@ -545,11 +549,11 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
545
549
  "data-tag_id": l.id,
546
550
  "data-tag_color_id": l.colorId,
547
551
  title: l.name
548
- }, null, 10, nt));
552
+ }, null, 10, rt));
549
553
  }
550
- }), ot = ["contenteditable", "onKeydown"], fe = /* @__PURE__ */ q({
554
+ }), it = ["contenteditable", "onKeydown"], ye = /* @__PURE__ */ P({
551
555
  __name: "tagPopupListItem",
552
- props: /* @__PURE__ */ R({
556
+ props: /* @__PURE__ */ N({
553
557
  editable: { type: Boolean },
554
558
  disabled: { type: Boolean },
555
559
  canExclude: { type: Boolean },
@@ -563,28 +567,28 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
563
567
  },
564
568
  nameModifiers: {}
565
569
  }),
566
- emits: /* @__PURE__ */ R(["update:name", "unselect", "exclude", "select"], ["update:name"]),
570
+ emits: /* @__PURE__ */ N(["update:name", "unselect", "exclude", "select"], ["update:name"]),
567
571
  setup(t, { emit: l }) {
568
- const o = t, e = l, i = N(t, "name"), a = D(null), n = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
572
+ const n = t, e = l, i = D(t, "name"), a = F(null), o = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
569
573
  contenteditable: d.value,
570
574
  onpaste: (g) => g.preventDefault()
571
- } : {}), d = D(!1), m = async () => {
575
+ } : {}), d = F(!1), m = async () => {
572
576
  var g;
573
- d.value = !0, await be(), (g = a.value) == null || g.focus();
574
- }, p = () => {
577
+ d.value = !0, await Ve(), (g = a.value) == null || g.focus();
578
+ }, h = () => {
575
579
  var u;
576
580
  const g = (u = a.value) == null ? void 0 : u.innerText;
577
- if (!g) return h();
581
+ if (!g) return S();
578
582
  a.value && (a.value.innerText = g), d.value = !1, e("update:name", g);
579
- }, h = async () => {
580
- a.value && (a.value.innerText = o.name), d.value = !1;
583
+ }, S = async () => {
584
+ a.value && (a.value.innerText = n.name), d.value = !1;
581
585
  }, r = (g) => {
582
- if (d.value || o.disabled) return;
586
+ if (d.value || n.disabled) return;
583
587
  let u = "selected";
584
- o.canExclude && (g.ctrlKey || g.metaKey) && (u = "excluded"), o.state == u && (u = ""), u === "" && e("unselect"), u === "selected" && e("select"), u === "excluded" && e("exclude");
588
+ n.canExclude && (g.ctrlKey || g.metaKey) && (u = "excluded"), n.state == u && (u = ""), u === "" && e("unselect"), u === "selected" && e("select"), u === "excluded" && e("exclude");
585
589
  };
586
- return (g, u) => (k(), b(se, {
587
- class: Q({
590
+ return (g, u) => (k(), b(ue, {
591
+ class: X({
588
592
  "top-tagSelector_tagListItem": !0,
589
593
  "top-tagSelector_tagListItem-inEdit": d.value,
590
594
  "top-tagSelector_tagListItem-disabled": g.disabled,
@@ -592,47 +596,47 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
592
596
  "top-tagSelector-active": !!g.state,
593
597
  "top-tagSelector-excluded": g.state === "excluded"
594
598
  }),
595
- onClick: j(r, ["stop"])
599
+ onClick: J(r, ["stop"])
596
600
  }, {
597
601
  default: _(() => [
598
- L(le, {
602
+ A(ne, {
599
603
  id: g.id,
600
604
  name: i.value,
601
605
  colorId: g.colorId,
602
606
  state: g.state
603
607
  }, null, 8, ["id", "name", "colorId", "state"]),
604
- ye("span", pe({
608
+ he("span", Se({
605
609
  ref_key: "elName",
606
610
  ref: a,
607
611
  class: "top-tagSelector_tagListItemName",
608
612
  contenteditable: d.value ? "plaintext-only" : !1
609
- }, n.value, {
613
+ }, o.value, {
610
614
  onKeydown: [
611
- de(j(p, ["stop"]), ["enter"]),
612
- de(j(h, ["stop"]), ["esc"])
615
+ ce(J(h, ["stop"]), ["enter"]),
616
+ ce(J(S, ["stop"]), ["esc"])
613
617
  ]
614
- }), M(i.value), 17, ot),
615
- g.editable ? (k(), B(W, { key: 0 }, [
618
+ }), M(i.value), 17, it),
619
+ g.editable ? (k(), B(Y, { key: 0 }, [
616
620
  d.value ? (k(), B("span", {
617
621
  key: 1,
618
622
  "data-top-icon": "",
619
623
  class: "top-tagSelector_edit",
620
- onClick: j(p, ["stop"])
624
+ onClick: J(h, ["stop"])
621
625
  })) : (k(), B("span", {
622
626
  key: 0,
623
627
  "data-top-icon": "",
624
628
  class: "top-tagSelector_edit",
625
629
  onClick: m
626
630
  }))
627
- ], 64)) : F("", !0)
631
+ ], 64)) : q("", !0)
628
632
  ]),
629
633
  _: 1
630
634
  }, 8, ["class"]));
631
635
  }
632
- }), rt = { key: 1 }, ke = /* @__PURE__ */ q({
636
+ }), st = { key: 1 }, Te = /* @__PURE__ */ P({
633
637
  inheritAttrs: !1,
634
638
  __name: "popupOpener",
635
- props: /* @__PURE__ */ R({
639
+ props: /* @__PURE__ */ N({
636
640
  modelValue: {},
637
641
  id: {},
638
642
  tags: {},
@@ -649,46 +653,46 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
649
653
  }),
650
654
  emits: ["update:modelValue"],
651
655
  setup(t) {
652
- const l = t, o = N(t, "modelValue"), e = l.useTopButton ? Y : "div", i = l.useTopButton ? "html" : "default", a = {
653
- model: o,
656
+ const l = t, n = D(t, "modelValue"), e = l.useTopButton ? H : "div", i = l.useTopButton ? "html" : "default", a = {
657
+ model: n,
654
658
  mode: l.mode,
655
659
  targetId: l.targetId,
656
660
  filters: l.filters,
657
661
  payload: l.payload
658
662
  };
659
- return (n, d) => {
660
- const m = Be("top-data");
661
- return k(), b(Ae, { id: n.id }, {
663
+ return (o, d) => {
664
+ const m = Ee("top-data");
665
+ return k(), b(Oe, { id: o.id }, {
662
666
  default: _(() => [
663
- Ve((k(), b(Ee(y(e)), pe({
667
+ Ke((k(), b(Me(y(e)), Se({
664
668
  class: {
665
669
  "top-tagSelector": !0,
666
670
  "top-tagSelector-filter": l.mode === "filter",
667
- "top-tagSelector-setter_single": l.mode === "setter" && !n.filters,
668
- "top-tagSelector-setter_several": l.mode === "setter" && n.filters,
669
- "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
670
- "top-tagSelector-toTwoLine": o.value.length > 5
671
+ "top-tagSelector-setter_single": l.mode === "setter" && !o.filters,
672
+ "top-tagSelector-setter_several": l.mode === "setter" && o.filters,
673
+ "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
674
+ "top-tagSelector-toTwoLine": n.value.length > 5
671
675
  },
672
676
  color: "theme",
673
677
  styling: ""
674
- }, n.$attrs), {
678
+ }, o.$attrs), {
675
679
  [y(i)]: _(() => [
676
- !o.value.length && n.mode === "filter" ? (k(), b(le, {
680
+ !n.value.length && o.mode === "filter" ? (k(), b(ne, {
677
681
  key: 0,
678
682
  id: "all",
679
683
  colorId: "",
680
- name: n.$i18n.Common.All_tags ?? "",
684
+ name: o.$i18n.Common.All_tags ?? "",
681
685
  state: ""
682
- }, null, 8, ["name"])) : F("", !0),
683
- n.mode === "setter" && n.filters ? (k(), B("div", rt, [
684
- Me(n.$slots, "default")
685
- ])) : (k(!0), B(W, { key: 2 }, ie(o.value, (p) => {
686
- var h, r;
687
- return k(), b(le, {
688
- id: y(H)(p),
689
- colorId: ((h = y(ae)(p, n.tags)) == null ? void 0 : h.color_id) ?? "",
690
- name: ((r = y(ae)(p, n.tags)) == null ? void 0 : r.name) ?? "",
691
- state: y(H)(p) === p ? "selected" : "excluded"
686
+ }, null, 8, ["name"])) : q("", !0),
687
+ o.mode === "setter" && o.filters ? (k(), B("div", st, [
688
+ $e(o.$slots, "default")
689
+ ])) : (k(!0), B(Y, { key: 2 }, de(n.value, (h) => {
690
+ var S, r;
691
+ return k(), b(ne, {
692
+ id: y(Q)(h),
693
+ colorId: ((S = y(oe)(h, o.tags)) == null ? void 0 : S.color_id) ?? "",
694
+ name: ((r = y(oe)(h, o.tags)) == null ? void 0 : r.name) ?? "",
695
+ state: y(Q)(h) === h ? "selected" : "excluded"
692
696
  }, null, 8, ["id", "colorId", "name", "state"]);
693
697
  }), 256))
694
698
  ]),
@@ -701,9 +705,9 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
701
705
  }, 8, ["id"]);
702
706
  };
703
707
  }
704
- }), it = /* @__PURE__ */ q({
708
+ }), dt = /* @__PURE__ */ P({
705
709
  __name: "tagSelector",
706
- props: /* @__PURE__ */ R({
710
+ props: /* @__PURE__ */ N({
707
711
  modelValue: {},
708
712
  tags: {},
709
713
  tagsEditable: { type: Boolean },
@@ -719,29 +723,29 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
719
723
  },
720
724
  modelModifiers: {},
721
725
  tags: {
722
- default: we(lt)
726
+ default: Ae(nt)
723
727
  },
724
728
  tagsModifiers: {}
725
729
  }),
726
- emits: /* @__PURE__ */ R(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
730
+ emits: /* @__PURE__ */ N(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
727
731
  setup(t, { emit: l }) {
728
- const o = A(), e = t, i = N(t, "modelValue"), a = N(t, "tags"), n = l, d = Le((s, c) => {
729
- n(s, c);
732
+ const n = R(), e = t, i = D(t, "modelValue"), a = D(t, "tags"), o = l, d = Re((s, c) => {
733
+ o(s, c);
730
734
  }, e.emitDelay);
731
735
  e.singleMode && !i.value.length && (i.value = [a.value[0].id]);
732
- const m = e.id ?? "top-popup-id-" + Math.random(), p = D("add"), h = () => {
736
+ const m = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
733
737
  var v;
734
- const s = " " + ((v = o.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
735
- return c.set("add", { value: "add", title: o.Common.Add + s }), c.set("replace", { value: "replace", title: o.Common.Replace + s }), c.set("delete", { value: "delete", title: o.Common.Delete + s }), c;
738
+ const s = " " + ((v = n.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
739
+ return c.set("add", { value: "add", title: n.Common.Add + s }), c.set("replace", { value: "replace", title: n.Common.Replace + s }), c.set("delete", { value: "delete", title: n.Common.Delete + s }), c;
736
740
  };
737
- let r = $e({
741
+ let r = we({
738
742
  model: i,
739
743
  mode: "filter",
740
744
  targetId: void 0,
741
745
  filters: void 0,
742
746
  payload: void 0
743
747
  });
744
- K(i, () => {
748
+ w(i, () => {
745
749
  d("selector", i.value);
746
750
  });
747
751
  const g = E(() => {
@@ -750,18 +754,18 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
750
754
  }), u = (s) => {
751
755
  if (s !== "all") {
752
756
  if (r.value.model.value.includes(s)) return "selected";
753
- if (r.value.model.value.includes(me(s))) return "excluded";
757
+ if (r.value.model.value.includes(ve(s))) return "excluded";
754
758
  }
755
759
  return s === "all" && !r.value.model.value.length ? "selected" : "";
756
- }, I = (s, c) => {
757
- const v = me(s);
758
- let S = r.value.model.value.filter((w) => w !== s && w !== v);
759
- c === "select" && S.push(s), c === "exclude" && S.push(v), r.value.mode === "setter" && r.value.targetId !== void 0 && e.requiredForSetter && (S.length || S.push("1"), S.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (S = S.filter((w) => w !== "1"))), e.singleMode && !r.value.filters && (S.length || (S = r.value.model.value), S.length > 1 && (S = [S[S.length - 1]])), S.sort((w, P) => {
760
+ }, x = (s, c) => {
761
+ const v = ve(s);
762
+ let I = r.value.model.value.filter((L) => L !== s && L !== v);
763
+ c === "select" && I.push(s), c === "exclude" && I.push(v), r.value.mode === "setter" && r.value.targetId !== void 0 && e.requiredForSetter && (I.length || I.push("1"), I.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (I = I.filter((L) => L !== "1"))), e.singleMode && !r.value.filters && (I.length || (I = r.value.model.value), I.length > 1 && (I = [I[I.length - 1]])), I.sort((L, U) => {
760
764
  if (!e.tags) return 0;
761
- const X = e.tags.findIndex((O) => O.id === w), U = e.tags.findIndex((O) => O.id === P);
762
- return X - U;
763
- }), r.value.model.value = S, r.value.mode === "setter" && r.value.targetId !== void 0 && d("setter", {
764
- tagsIds: S,
765
+ const Z = e.tags.findIndex((O) => O.id === L), j = e.tags.findIndex((O) => O.id === U);
766
+ return Z - j;
767
+ }), r.value.model.value = I, r.value.mode === "setter" && r.value.targetId !== void 0 && d("setter", {
768
+ tagsIds: I,
765
769
  targetId: r.value.targetId,
766
770
  payload: r.value.payload
767
771
  });
@@ -776,40 +780,40 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
776
780
  id: String(c),
777
781
  name: s,
778
782
  color_id: String((c - 1) % 10 + 1)
779
- }), n("tagsChanged", a.value);
783
+ }), o("tagsChanged", a.value);
780
784
  }, V = (s) => {
781
785
  var c;
782
- if (r.value = G(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
783
- if (r.value.filters && (p.value = "add", r.value.model.value = []), !((c = J.$) != null && c.ui.sortable)) {
786
+ if (r.value = W(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
787
+ if (r.value.filters && (h.value = "add", r.value.model.value = []), !((c = z.$) != null && c.ui.sortable)) {
784
788
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
785
789
  return;
786
790
  }
787
- !J.state.isMobile && !J.state.isMobileUA && a.value && $(s.elPopup).sortable({
791
+ !z.state.isMobile && !z.state.isMobileUA && a.value && $(s.elPopup).sortable({
788
792
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
789
793
  /**
790
794
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
791
795
  */
792
796
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
793
797
  distance: 10,
794
- stop: function(v, S) {
798
+ stop: function(v, I) {
795
799
  if (!a.value) return;
796
- const w = $(S.item).parent().find("[data-tag_id]"), P = [];
797
- w.each((X, U) => {
800
+ const L = $(I.item).parent().find("[data-tag_id]"), U = [];
801
+ L.each((Z, j) => {
798
802
  if (!a.value) return;
799
- const O = $(U).attr("data-tag_id");
800
- P.push(O);
801
- }), a.value.sort((X, U) => {
802
- const O = P.findIndex((ne) => ne === X.id), Ce = P.findIndex((ne) => ne === U.id);
803
- return O - Ce;
803
+ const O = $(j).attr("data-tag_id");
804
+ U.push(O);
805
+ }), a.value.sort((Z, j) => {
806
+ const O = U.findIndex((re) => re === Z.id), _e = U.findIndex((re) => re === j.id);
807
+ return O - _e;
804
808
  }), d("tagsChanged", a.value);
805
809
  }
806
810
  });
807
811
  }, f = (s) => {
808
812
  var c;
809
- (c = J.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
813
+ (c = z.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
810
814
  };
811
- return (s, c) => (k(), B(W, null, [
812
- L(ke, {
815
+ return (s, c) => (k(), B(Y, null, [
816
+ A(Te, {
813
817
  class: "top-select_arrow",
814
818
  modelValue: i.value,
815
819
  "onUpdate:modelValue": c[0] || (c[0] = (v) => i.value = v),
@@ -818,23 +822,23 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
818
822
  mode: "filter",
819
823
  useTopButton: ""
820
824
  }, null, 8, ["modelValue", "id", "tags"]),
821
- L(he, {
825
+ A(Ie, {
822
826
  id: y(m),
823
- class: Q(T.value),
827
+ class: X(T.value),
824
828
  onOpen: c[4] || (c[4] = (v) => V(v)),
825
829
  onClose: c[5] || (c[5] = (v) => f(v)),
826
830
  "transition-duration": 50
827
- }, Ke({
831
+ }, Le({
828
832
  contentList: _(() => [
829
- y(r).mode === "filter" && !s.singleMode ? (k(), b(fe, {
833
+ y(r).mode === "filter" && !s.singleMode ? (k(), b(ye, {
830
834
  key: 0,
831
835
  id: "all",
832
836
  colorId: "",
833
837
  name: s.$i18n.Common.All_tags ?? "",
834
838
  state: y(r).model.value.length ? "" : "selected",
835
839
  onSelect: c[3] || (c[3] = (v) => y(r).model.value = [])
836
- }, null, 8, ["name", "state"])) : F("", !0),
837
- (k(!0), B(W, null, ie(a.value, (v) => (k(), b(fe, {
840
+ }, null, 8, ["name", "state"])) : q("", !0),
841
+ (k(!0), B(Y, null, de(a.value, (v) => (k(), b(ye, {
838
842
  key: v.id,
839
843
  id: v.id,
840
844
  colorId: v.color_id,
@@ -843,33 +847,33 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
843
847
  canExclude: y(r).mode === "filter" && !s.singleMode,
844
848
  editable: s.tagsEditable,
845
849
  disabled: g.value && u(v.id) === "",
846
- onUnselect: (S) => I(v.id, "unselect"),
847
- onSelect: (S) => I(v.id, "select"),
848
- onExclude: (S) => I(v.id, "exclude"),
849
- "onUpdate:name": (S) => {
850
- v.name = S, y(d)("tagsChanged", a.value);
850
+ onUnselect: (I) => x(v.id, "unselect"),
851
+ onSelect: (I) => x(v.id, "select"),
852
+ onExclude: (I) => x(v.id, "exclude"),
853
+ "onUpdate:name": (I) => {
854
+ v.name = I, y(d)("tagsChanged", a.value);
851
855
  }
852
856
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
853
- s.tagsEditable && a.value.length < s.tagsMax && a.value.length < 20 ? (k(), b(se, {
857
+ s.tagsEditable && a.value.length < s.tagsMax && a.value.length < 20 ? (k(), b(ue, {
854
858
  key: 1,
855
859
  "data-top-icon": "",
856
- onClick: j(C, ["stop"])
860
+ onClick: J(C, ["stop"])
857
861
  }, {
858
862
  default: _(() => [
859
- z(M(s.$i18n.Common.Add), 1)
863
+ G(M(s.$i18n.Common.Add), 1)
860
864
  ]),
861
865
  _: 1
862
- })) : F("", !0)
866
+ })) : q("", !0)
863
867
  ]),
864
868
  _: 2
865
869
  }, [
866
870
  y(r).mode === "setter" && y(r).filters ? {
867
871
  name: "header",
868
872
  fn: _(() => [
869
- L(re, {
870
- modelValue: p.value,
871
- "onUpdate:modelValue": c[1] || (c[1] = (v) => p.value = v),
872
- options: h()
873
+ A(se, {
874
+ modelValue: h.value,
875
+ "onUpdate:modelValue": c[1] || (c[1] = (v) => h.value = v),
876
+ options: S()
873
877
  }, null, 8, ["modelValue", "options"])
874
878
  ]),
875
879
  key: "0"
@@ -877,22 +881,22 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
877
881
  y(r).mode === "setter" && y(r).filters ? {
878
882
  name: "footer",
879
883
  fn: _(() => [
880
- L(Y, { color: "theme" }, {
884
+ A(H, { color: "theme" }, {
881
885
  default: _(() => [
882
- z(M(s.$i18n.Common.Cancel), 1)
886
+ G(M(s.$i18n.Common.Cancel), 1)
883
887
  ]),
884
888
  _: 1
885
889
  }),
886
- L(Y, {
890
+ A(H, {
887
891
  onClick: c[2] || (c[2] = (v) => y(d)("setter", {
888
892
  tagsIds: y(r).model.value,
889
893
  filters: y(r).filters,
890
- filtersAction: p.value,
894
+ filtersAction: h.value,
891
895
  payload: y(r).payload
892
896
  }))
893
897
  }, {
894
898
  default: _(() => [
895
- z(M(p.value === "add" ? s.$i18n.Common.Add : "") + " " + M(p.value === "replace" ? s.$i18n.Common.Replace : "") + " " + M(p.value === "delete" ? s.$i18n.Common.Remove : ""), 1)
899
+ G(M(h.value === "add" ? s.$i18n.Common.Add : "") + " " + M(h.value === "replace" ? s.$i18n.Common.Replace : "") + " " + M(h.value === "delete" ? s.$i18n.Common.Remove : ""), 1)
896
900
  ]),
897
901
  _: 1
898
902
  })
@@ -902,75 +906,75 @@ const Pe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
902
906
  ]), 1032, ["id", "class"])
903
907
  ], 64));
904
908
  }
905
- }), pt = (t, l) => E(() => ue(t).filter((i) => i.on >= 0 || i.id === l).map((i) => ({
909
+ }), St = (t, l) => E(() => ge(t).filter((i) => i.on >= 0 || i.id === l).map((i) => ({
906
910
  value: i.id,
907
911
  title: i.url + ` [${i.id}]`,
908
- icon: i.id === ue(l) ? "" : "",
912
+ icon: i.id === ge(l) ? "" : "",
909
913
  content: i.name
910
- }))), ht = (t, l, o) => {
914
+ }))), It = (t, l, n) => {
911
915
  l || (l = { id: t.id }), l.id = t.id;
912
- const e = qe.genElPopupOpener("div", l);
916
+ const e = Ue.genElPopupOpener("div", l);
913
917
  return e.classList.add("top-tagSelector"), t.useTopButton && e.classList.add("top-button", "top-color_theme"), t.mode === "filter" && e.classList.add("top-tagSelector-filter"), t.mode === "setter" && !t.filters && e.classList.add("top-tagSelector-setter_single"), t.mode === "setter" && t.filters && e.classList.add("top-tagSelector-setter_several"), e.onclick = (i) => {
914
918
  i.preventDefault(), i.stopPropagation(), e.onclick = null;
915
- const a = D(t.modelValue), n = {
919
+ const a = F(t.modelValue), o = {
916
920
  model: a,
917
921
  mode: t.mode,
918
922
  targetId: t.targetId,
919
923
  filters: t.filters,
920
924
  payload: t.payload
921
925
  };
922
- G(e, "topTagSelectorTarget", n), delete e.dataset.topPopupDisabled, ce(t.modelValue) || K(a, () => {
923
- t.modelValue = a.value, Z(e, t, o);
926
+ W(e, "topTagSelectorTarget", o), delete e.dataset.topPopupDisabled, me(t.modelValue) || w(a, () => {
927
+ t.modelValue = a.value, ee(e, t, n);
924
928
  }), e.click();
925
- }, ce(t.modelValue) ? K(t.modelValue, () => Z(e, t, o)) : G(e, "topTagSelectorRender", (i) => {
929
+ }, me(t.modelValue) ? w(t.modelValue, () => ee(e, t, n)) : W(e, "topTagSelectorRender", (i) => {
926
930
  t.modelValue = i;
927
- const a = G(e, "topTagSelectorTarget");
928
- a && (a.model.value = i), Z(e, t, o);
929
- }), Z(e, t, o), e;
930
- }, St = (t, l) => {
931
- var o;
932
- (o = G(t, "topTagSelectorRender")) == null || o(l);
933
- }, Z = (t, l, o) => {
931
+ const a = W(e, "topTagSelectorTarget");
932
+ a && (a.model.value = i), ee(e, t, n);
933
+ }), ee(e, t, n), e;
934
+ }, xt = (t, l) => {
935
+ var n;
936
+ (n = W(t, "topTagSelectorRender")) == null || n(l);
937
+ }, ee = (t, l, n) => {
934
938
  var i;
935
939
  const e = y(l.modelValue);
936
940
  if (t.classList.toggle("top-tagSelector-selectedOne", !e.length || e.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", e.length > 5), l.mode === "setter" && l.filters) {
937
- t.innerHTML = `<div>${o}</div>`;
941
+ t.innerHTML = `<div>${n}</div>`;
938
942
  return;
939
943
  }
940
944
  if (t.innerHTML = "", !e.length && l.mode === "filter") {
941
- const a = ve({
945
+ const a = pe({
942
946
  id: "all",
943
947
  colorId: "",
944
- name: ((i = A().Common) == null ? void 0 : i.All_tags) ?? "",
948
+ name: ((i = R().Common) == null ? void 0 : i.All_tags) ?? "",
945
949
  state: ""
946
950
  });
947
951
  t.append(a);
948
952
  }
949
953
  e.forEach((a) => {
950
954
  var d, m;
951
- const n = ve({
952
- id: H(a),
953
- colorId: ((d = ae(a, l.tags)) == null ? void 0 : d.color_id) ?? "",
954
- name: ((m = ae(a, l.tags)) == null ? void 0 : m.name) ?? "",
955
- state: H(a) === a ? "selected" : "excluded"
955
+ const o = pe({
956
+ id: Q(a),
957
+ colorId: ((d = oe(a, l.tags)) == null ? void 0 : d.color_id) ?? "",
958
+ name: ((m = oe(a, l.tags)) == null ? void 0 : m.name) ?? "",
959
+ state: Q(a) === a ? "selected" : "excluded"
956
960
  });
957
- t.append(n);
961
+ t.append(o);
958
962
  });
959
- }, ve = (t) => {
963
+ }, pe = (t) => {
960
964
  const l = document.createElement("div");
961
965
  return l.classList.add("top-tagSelector_tagIcon"), l.classList.toggle("top-tagSelector-active", !!t.state), l.classList.toggle("top-tagSelector-excluded", t.state === "excluded"), l.dataset.tag_id = t.id, l.dataset.tag_color_id = t.colorId, l.title = t.name, l;
962
- }, It = je, xt = at, kt = it, Ct = ke, Tt = le;
966
+ }, kt = ze, Ct = ot, Tt = dt, _t = Te, bt = ne;
963
967
  export {
964
- It as TopSelectorCompetitors,
965
- xt as TopSelectorRegion,
966
- kt as TopTagSelector,
967
- Ct as TopTagSelectorPopupOpener,
968
- Tt as TopTagSelectorTagIcon,
969
- Qe as dialogSelectorRegions,
970
- He as findRegion,
971
- ht as genElTopTagSelectorPopupOpener,
972
- Ie as genSearcherByKey,
973
- St as renderElTopTagSelectorPopupOpener,
974
- pt as useItemsFromCompetitors
968
+ kt as TopSelectorCompetitors,
969
+ Ct as TopSelectorRegion,
970
+ Tt as TopTagSelector,
971
+ _t as TopTagSelectorPopupOpener,
972
+ bt as TopTagSelectorTagIcon,
973
+ Ze as dialogSelectorRegions,
974
+ Xe as findRegion,
975
+ It as genElTopTagSelectorPopupOpener,
976
+ ke as genSearcherByKey,
977
+ xt as renderElTopTagSelectorPopupOpener,
978
+ St as useItemsFromCompetitors
975
979
  };
976
980
  //# sourceMappingURL=project.js.map