@topvisor/ui 1.0.24 → 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.
@@ -21,8 +21,8 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
21
21
  }),
22
22
  emits: ["update:modelValue"],
23
23
  setup(t) {
24
- const o = t, n = D(t, "modelValue"), e = E(() => {
25
- if (o.showSelectAllItem)
24
+ const l = t, n = D(t, "modelValue"), e = E(() => {
25
+ if (l.showSelectAllItem)
26
26
  return {
27
27
  icon: "",
28
28
  title: R().Common.Select_all,
@@ -40,30 +40,30 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
40
40
  icon2: ""
41
41
  }, {
42
42
  default: _(() => {
43
- var l;
43
+ var o;
44
44
  return [
45
- G(M((l = i.items.find((d) => {
46
- var f;
47
- return d.value === ((f = n.value) == null ? void 0 : f[0]);
48
- })) == null ? void 0 : l.content), 1)
45
+ G(M((o = i.items.find((d) => {
46
+ var m;
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(Y, null, de(i.items, (l, d) => {
56
- var f;
55
+ (k(!0), B(Y, null, de(i.items, (o, d) => {
56
+ var m;
57
57
  return k(), b(ue, {
58
58
  class: X({
59
- "top-active": (f = n.value) == null ? void 0 : f.includes(l.value)
59
+ "top-active": (m = n.value) == null ? void 0 : m.includes(o.value)
60
60
  }),
61
- "data-top-icon": l.icon,
62
- title: l.title,
63
- onClick: () => n.value = [l.value]
61
+ "data-top-icon": o.icon,
62
+ title: o.title,
63
+ onClick: () => n.value = [o.value]
64
64
  }, {
65
65
  default: _(() => [
66
- he("span", Je, M(l.content), 1)
66
+ he("span", Je, M(o.content), 1)
67
67
  ]),
68
68
  _: 2
69
69
  }, 1032, ["class", "data-top-icon", "title", "onClick"]);
@@ -73,7 +73,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
73
73
  })) : (k(), b(Ne, {
74
74
  key: 1,
75
75
  modelValue: n.value,
76
- "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l),
76
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => n.value = o),
77
77
  items: i.items,
78
78
  isMultiple: !0,
79
79
  styling: "bar",
@@ -101,15 +101,15 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
101
101
  name: "--",
102
102
  regions: [ae],
103
103
  regionByIndex: /* @__PURE__ */ new Map([[p, ae]])
104
- }, oe = {
104
+ }, le = {
105
105
  key: p,
106
106
  name: "Autoselect",
107
107
  index: p
108
108
  }, ie = {
109
109
  key: p,
110
110
  name: "Autoselect",
111
- regions: [oe],
112
- regionByIndex: /* @__PURE__ */ new Map([[p, oe]])
111
+ regions: [le],
112
+ regionByIndex: /* @__PURE__ */ new Map([[p, le]])
113
113
  }, fe = {
114
114
  countryCode: "00",
115
115
  depth: 1,
@@ -118,66 +118,66 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
118
118
  index: te,
119
119
  lang: "ru",
120
120
  name: "Without region"
121
- }, We = () => (oe.name = R().Common.Autoselect, oe), Ye = () => (We(), ie.name = R().Common.Autoselect, console.log(ie), ie), He = () => (fe.name = R().Keywords.Without_region, fe), ke = (t = !1, o = !1, n = []) => {
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 = Qe(n) : e = Ce(n), o && e.set(p, Ye()), e.size || e.set(p, xe), e;
124
- }, Ce = (t, o = !0, n = [], 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 l = { ...a };
129
- l.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((d) => {
130
- if (o && !d.enabled) return;
131
- const f = { ...d };
132
- l.regionByIndex.set(f.index, f);
133
- }), !l.regionByIndex.size && !n.length && l.regionByIndex.set(ae.index, ae), typeof l.key == "number" && i.set(l.key, l);
128
+ const o = { ...a };
129
+ o.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((d) => {
130
+ if (l && !d.enabled) return;
131
+ const m = { ...d };
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
134
  }), n.forEach((a) => {
135
135
  if (i.has(a)) return;
136
- const l = {
136
+ const o = {
137
137
  key: a,
138
138
  name: Ge[a],
139
139
  regions: [],
140
140
  regionByIndex: /* @__PURE__ */ new Map()
141
141
  };
142
- i.set(l.key, l);
142
+ i.set(o.key, o);
143
143
  }), i;
144
144
  }, Qe = (t) => {
145
- const o = Ce(t, !1, [0, 1], !0);
146
- if (o.has(2)) {
147
- const n = o.get(2);
145
+ const l = Ce(t, !1, [0, 1], !0);
146
+ if (l.has(2)) {
147
+ const n = l.get(2);
148
148
  n && (n.regionByIndex = /* @__PURE__ */ new Map());
149
149
  }
150
- return o.forEach((n) => {
150
+ return l.forEach((n) => {
151
151
  if (!n.regionByIndex) return;
152
152
  const e = { ...He() };
153
153
  n.regionByIndex.set(e.index, e);
154
- }), o;
155
- }, Xe = (t, o, n = []) => {
154
+ }), l;
155
+ }, Xe = (t, l, n = []) => {
156
156
  const e = ke(t, !1, n);
157
157
  let i;
158
158
  return e.forEach((a) => {
159
- if (!(o.searcher_key !== void 0 && o.searcher_key != a.key) && a.regions && (a.regions.forEach((l) => {
160
- if (!i && !(o.key !== void 0 && o.key != l.key) && !(o.index !== void 0 && o.index != l.index) && !(!t && (o.lang !== void 0 && o.lang != l.lang || o.device !== void 0 && o.device != l.device)))
161
- return l.searcher_key = a.key, i = l, !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
- }, Ze = De(() => import("../.chunks/dialog_selectorRegions-eupaC53Q.es.js")), et = (t, o) => {
166
- const n = R(), e = F(o.value.keys().next().value ?? p), 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 (o.value.forEach((l) => {
168
+ if (l.value.forEach((o) => {
169
169
  let d = {
170
- value: l.key,
171
- title: l.name
170
+ value: o.key,
171
+ title: o.name
172
172
  };
173
- t.addSearcherIcon && (d.icon = Fe(l.key)), a.set(l.key, d);
173
+ t.addSearcherIcon && (d.icon = Fe(o.key)), a.set(o.key, d);
174
174
  }), t.addCompare && !a.has(p)) {
175
- const l = {
175
+ const o = {
176
176
  value: "",
177
177
  title: "--------------------",
178
178
  disabled: !0
179
179
  };
180
- a.set(l.value, l);
180
+ a.set(o.value, o);
181
181
  const d = {
182
182
  value: K,
183
183
  title: n.Common.Compare
@@ -190,45 +190,45 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
190
190
  searcherKey: e,
191
191
  optionBySearcherKey: i
192
192
  };
193
- }, tt = (t, o) => {
194
- var a, l, d;
193
+ }, tt = (t, l) => {
194
+ var a, o, d;
195
195
  const n = R(), e = F(p);
196
- t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === p && (t.forFrequency ? e.value = ((l = (a = o.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : l.key) ?? p : e.value = ((d = o.value) == null ? void 0 : d.regionByIndex.keys().next().value) ?? 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
198
  var h;
199
- const f = /* @__PURE__ */ new Map();
200
- return (h = o.value.regionByIndex) == null || h.forEach((S) => {
199
+ const m = /* @__PURE__ */ new Map();
200
+ return (h = l.value.regionByIndex) == null || h.forEach((S) => {
201
201
  let r = S.name;
202
202
  if (t.forFrequency) {
203
203
  const x = {
204
204
  value: S.key,
205
205
  title: r
206
206
  };
207
- f.has(S.key) || f.set(S.key, x);
207
+ m.has(S.key) || m.set(S.key, x);
208
208
  return;
209
209
  }
210
210
  S.device && (r += " (" + n.Common["Device_" + S.device] + ")");
211
- const g = qe(o.value.key || 0, S.lang ?? "");
211
+ const g = qe(l.value.key || 0, S.lang ?? "");
212
212
  g && (r += " / " + g);
213
213
  const u = {
214
214
  value: S.index,
215
215
  title: r,
216
216
  icon: S.device ? Pe(S.device) : void 0
217
217
  };
218
- f.set(S.index, u);
219
- }), f;
218
+ m.set(S.index, u);
219
+ }), m;
220
220
  });
221
- return w(i, (f, h) => {
221
+ return w(i, (m, h) => {
222
222
  var u;
223
- if (t.onlySearcher || e.value !== void 0 && f.get(e.value))
223
+ if (t.onlySearcher || e.value !== void 0 && m.get(e.value))
224
224
  return;
225
- let S = f.keys().next().value;
225
+ let S = m.keys().next().value;
226
226
  if (e.value === p || S === p) {
227
227
  e.value = S;
228
228
  return;
229
229
  }
230
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 f.entries()) {
231
+ for (const [x, T] of m.entries()) {
232
232
  const C = T.title;
233
233
  if (typeof C != "string" || typeof x == "string")
234
234
  break;
@@ -237,31 +237,31 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
237
237
  break;
238
238
  }
239
239
  const V = new RegExp(` \\((${n.Common.Device_1}|${n.Common.Device_2})\\)`);
240
- let m = r, s = 3;
241
- C.indexOf(m) === -1 && (m = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), s--), C.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), m = m.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), C.indexOf(m) !== -1 && (s <= g || (g = s, S = x));
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, S = x));
242
242
  }
243
243
  e.value = S;
244
244
  }), {
245
245
  regionIndex: e,
246
246
  optionByRegionIndex: i
247
247
  };
248
- }, at = (t, o, n) => {
248
+ }, at = (t, l, n) => {
249
249
  const e = F([]), i = () => {
250
- if (t.onlySearcher && o.value) {
251
- e.value = Array.from(o.value.keys());
250
+ if (t.onlySearcher && l.value) {
251
+ e.value = Array.from(l.value.keys());
252
252
  return;
253
253
  }
254
- let l = [];
254
+ let o = [];
255
255
  if (t.modelValue.length > 1)
256
- l = [...t.modelValue];
256
+ o = [...t.modelValue];
257
257
  else
258
258
  try {
259
- l = JSON.parse(
259
+ o = JSON.parse(
260
260
  localStorage.getItem("ui:project:regionSelector" + t.projectId + ":regionsIndexes")
261
261
  ) ?? [];
262
262
  } catch {
263
263
  }
264
- l.length && (l = l.filter((d) => n.value.has(d))), l.length || (l = Array.from(n.value)), e.value = [...l];
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
  };
@@ -270,29 +270,29 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
270
270
  }), t.addCompare && i(), {
271
271
  regionsIndexes: e
272
272
  };
273
- }, ot = (t) => {
274
- const o = E(() => ke(t.forFrequency, t.autoRegion, t.searchers)), n = E(() => o.value.get(i.searcherKey.value) || xe), 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
- return o.value.forEach((g) => {
276
+ return l.value.forEach((g) => {
277
277
  g.regionByIndex.forEach((u) => {
278
278
  u.index !== te && u.index !== p && r.add(u.index);
279
279
  });
280
280
  }), r;
281
- }), i = et(t, o), a = tt(t, n), l = at(t, o, e);
282
- w(o, () => {
281
+ }), i = et(t, l), a = tt(t, n), o = at(t, l, e);
282
+ w(l, () => {
283
283
  var g, u, x, T;
284
- if (t.onlySearcher ? l.regionsIndexes.value = Array.from(o.value.keys()) : l.regionsIndexes.value = l.regionsIndexes.value.filter((C) => e.value.has(C)), i.searcherKey.value === K) return;
285
- let r = o.value.keys().next().value;
286
- o.value.forEach((C) => {
287
- var V, m, s;
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
+ let r = l.value.keys().next().value;
286
+ l.value.forEach((C) => {
287
+ var V, f, s;
288
288
  if (t.onlySearcher && C.key === i.searcherKey.value) {
289
289
  r = i.searcherKey.value;
290
290
  return;
291
291
  }
292
292
  if (a.regionIndex.value && ((V = C.regionByIndex) != null && V.has(a.regionIndex.value)) && (r = C.key), !t.onlySearcher) {
293
293
  let c;
294
- r !== void 0 && (c = (m = o.value.get(r)) == null ? void 0 : m.regionByIndex);
295
- const v = (s = o.value.get(C.key)) == null ? void 0 : s.regionByIndex;
294
+ r !== void 0 && (c = (f = l.value.get(r)) == null ? void 0 : f.regionByIndex);
295
+ const v = (s = l.value.get(C.key)) == null ? void 0 : s.regionByIndex;
296
296
  c != null && c.has(p) && !(v != null && v.has(p)) && (r = C.key);
297
297
  }
298
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);
@@ -300,7 +300,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
300
300
  const d = () => {
301
301
  if (!(i.searcherKey.value === K || i.searcherKey.value === p))
302
302
  return i.searcherKey.value;
303
- }, f = () => {
303
+ }, m = () => {
304
304
  if (t.onlySearcher || a.regionIndex.value === p) return;
305
305
  let r = a.regionIndex.value;
306
306
  if (t.forFrequency) {
@@ -311,23 +311,23 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
311
311
  }, h = () => {
312
312
  const r = d();
313
313
  if (r !== void 0)
314
- return o.value.get(r);
314
+ return l.value.get(r);
315
315
  };
316
316
  return {
317
317
  selectSearcher: i,
318
318
  selectRegion: a,
319
- compare: l,
320
- searcherByKey: o,
319
+ compare: o,
320
+ searcherByKey: l,
321
321
  allRegionsIndexes: e,
322
322
  getSearcher: h,
323
323
  getRegion: () => {
324
324
  var g, u;
325
- const r = f();
325
+ const r = m();
326
326
  if (r !== void 0)
327
327
  return (u = (g = h()) == null ? void 0 : g.regionByIndex) == null ? void 0 : u.get(r);
328
328
  }
329
329
  };
330
- }, lt = /* @__PURE__ */ P({
330
+ }, ot = /* @__PURE__ */ P({
331
331
  __name: "selectorRegion",
332
332
  props: /* @__PURE__ */ N({
333
333
  projectId: {},
@@ -348,18 +348,18 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
348
348
  modelValueSingleModifiers: {}
349
349
  }),
350
350
  emits: ["update:modelValue", "update:modelValueSingle"],
351
- setup(t, { expose: o }) {
351
+ setup(t, { expose: l }) {
352
352
  const n = t, e = D(t, "modelValue"), i = D(t, "modelValueSingle"), {
353
353
  selectSearcher: a,
354
- selectRegion: l,
354
+ selectRegion: o,
355
355
  compare: d,
356
- searcherByKey: f,
356
+ searcherByKey: m,
357
357
  allRegionsIndexes: h,
358
358
  getSearcher: S,
359
359
  getRegion: r
360
- } = ot(n), g = () => {
360
+ } = lt(n), g = () => {
361
361
  const u = [];
362
- f.value.forEach((x) => {
362
+ m.value.forEach((x) => {
363
363
  x.enabled && x.regions.forEach((T) => {
364
364
  T.enabled && u.push(T);
365
365
  });
@@ -369,22 +369,22 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
369
369
  "@update:regionsIndexes": (x) => d.regionsIndexes.value = x
370
370
  });
371
371
  };
372
- return w([l.regionIndex, a.searcherKey, d.regionsIndexes], () => {
372
+ return w([o.regionIndex, a.searcherKey, d.regionsIndexes], () => {
373
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
- n.onlySearcher ? (e.value = [a.searcherKey.value], a.searcherKey.value === p && !n.autoRegion && (e.value = [])) : (e.value = [l.regionIndex.value], l.regionIndex.value === p && !n.autoRegion && (e.value = []));
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
379
  !n.onlySearcher && !h.value.size && (a.searcherKey.value = p);
380
380
  }), i.value && w(i, () => {
381
381
  i.value && (e.value = [i.value]);
382
382
  }, { immediate: !0 }), w(e, () => {
383
383
  var u, x, T, C, V;
384
384
  if (e.value[0] && (i.value = e.value[0]), n.onlySearcher) {
385
- if (!e.value.length || e.value.length === 1 && !f.value.has(e.value[0])) {
386
- let m = f.value.keys().next().value;
387
- m === p && !n.autoRegion && (m = void 0, i.value = p), m !== void 0 && (e.value = [m]);
385
+ if (!e.value.length || e.value.length === 1 && !m.value.has(e.value[0])) {
386
+ let f = m.value.keys().next().value;
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,24 +392,24 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
392
392
  return;
393
393
  }
394
394
  } else {
395
- let m = [...new Set(e.value)], s = (x = (u = f.value.values().next().value) == null ? void 0 : u.regionByIndex) == null ? void 0 : x.keys().next().value;
396
- if (n.forFrequency && (s = (V = (C = (T = f.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), !m.length)
397
- s !== void 0 && m.push(s);
398
- else if (m.length === 1) {
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
+ s !== void 0 && f.push(s);
398
+ else if (f.length === 1) {
399
399
  let c = h.value;
400
- n.forFrequency && (c = /* @__PURE__ */ new Set(), f.value.forEach((v) => {
400
+ n.forFrequency && (c = /* @__PURE__ */ new Set(), m.value.forEach((v) => {
401
401
  v.regionByIndex.forEach((I) => {
402
402
  I.index !== te && I.index !== p && c.add(I.key);
403
403
  });
404
- })), !c.has(m[0]) && m[0] !== p && (m = [], s !== void 0 && m.push(s));
404
+ })), c.has(f[0]) || (f = [], s !== void 0 && f.push(s));
405
405
  } else
406
- m = m.filter((c) => h.value.has(c)), !m.length && s !== void 0 && m.push(s);
407
- if (JSON.stringify(e.value) !== JSON.stringify(m)) {
408
- e.value = m;
406
+ f = f.filter((c) => h.value.has(c)), !f.length && s !== void 0 && f.push(s);
407
+ if (JSON.stringify(e.value) !== JSON.stringify(f)) {
408
+ e.value = f;
409
409
  return;
410
410
  }
411
411
  }
412
- if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : l.regionIndex.value)))
412
+ if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : o.regionIndex.value)))
413
413
  if (n.onlySearcher) {
414
414
  if (e.value.length === 1) {
415
415
  a.searcherKey.value = e.value[0];
@@ -417,22 +417,26 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
417
417
  }
418
418
  a.searcherKey.value = K;
419
419
  return;
420
- } else if (e.value.length === 1 && a.searcherKey.value !== K) {
421
- l.regionIndex.value = e.value[0];
422
- let m;
423
- for (const s of f.value.values()) {
424
- for (const c of s.regionByIndex.values())
425
- if ((n.forFrequency ? c.key : c.index) === l.regionIndex.value) {
426
- m = 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 (m !== void 0)
430
- break;
431
- }
432
- m !== void 0 && (a.searcherKey.value = m);
433
- } else
434
- a.searcherKey.value = K, d.regionsIndexes.value = [...e.value];
435
- }, { immediate: !0 }), o({
434
+ }
435
+ f !== void 0 && (a.searcherKey.value = f);
436
+ } else
437
+ a.searcherKey.value = K, d.regionsIndexes.value = [...e.value];
438
+ }
439
+ }, { immediate: !0 }), l({
436
440
  getSearcher: S,
437
441
  getRegion: r
438
442
  }), (u, x) => (k(), B("div", {
@@ -451,9 +455,9 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
451
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(l).optionByRegionIndex.value,
455
- modelValue: y(l).regionIndex.value,
456
- "onUpdate:modelValue": x[1] || (x[1] = (T) => y(l).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
@@ -522,9 +526,9 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
522
526
  name: "Turquoise",
523
527
  color_id: "10"
524
528
  }
525
- ], ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, le = (t, o) => {
529
+ ], ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, oe = (t, l) => {
526
530
  t = Q(t);
527
- const n = o.find((e) => e.id === t);
531
+ const n = l.find((e) => e.id === t);
528
532
  if (n)
529
533
  return n;
530
534
  }, rt = ["data-tag_id", "data-tag_color_id", "title"], ne = /* @__PURE__ */ P({
@@ -536,15 +540,15 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
536
540
  state: {}
537
541
  },
538
542
  setup(t) {
539
- return (o, n) => (k(), B("div", {
543
+ return (l, n) => (k(), B("div", {
540
544
  class: X({
541
545
  "top-tagSelector_tagIcon": !0,
542
- "top-tagSelector-active": !!o.state,
543
- "top-tagSelector-excluded": o.state === "excluded"
546
+ "top-tagSelector-active": !!l.state,
547
+ "top-tagSelector-excluded": l.state === "excluded"
544
548
  }),
545
- "data-tag_id": o.id,
546
- "data-tag_color_id": o.colorId,
547
- title: o.name
549
+ "data-tag_id": l.id,
550
+ "data-tag_color_id": l.colorId,
551
+ title: l.name
548
552
  }, null, 10, rt));
549
553
  }
550
554
  }), it = ["contenteditable", "onKeydown"], ye = /* @__PURE__ */ P({
@@ -564,11 +568,11 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
564
568
  nameModifiers: {}
565
569
  }),
566
570
  emits: /* @__PURE__ */ N(["update:name", "unselect", "exclude", "select"], ["update:name"]),
567
- setup(t, { emit: o }) {
568
- const n = t, e = o, i = D(t, "name"), a = F(null), l = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
571
+ setup(t, { emit: l }) {
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 = F(!1), f = async () => {
575
+ } : {}), d = F(!1), m = async () => {
572
576
  var g;
573
577
  d.value = !0, await Ve(), (g = a.value) == null || g.focus();
574
578
  }, h = () => {
@@ -606,7 +610,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
606
610
  ref: a,
607
611
  class: "top-tagSelector_tagListItemName",
608
612
  contenteditable: d.value ? "plaintext-only" : !1
609
- }, l.value, {
613
+ }, o.value, {
610
614
  onKeydown: [
611
615
  ce(J(h, ["stop"]), ["enter"]),
612
616
  ce(J(S, ["stop"]), ["esc"])
@@ -622,7 +626,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
622
626
  key: 0,
623
627
  "data-top-icon": "",
624
628
  class: "top-tagSelector_edit",
625
- onClick: f
629
+ onClick: m
626
630
  }))
627
631
  ], 64)) : q("", !0)
628
632
  ]),
@@ -649,52 +653,52 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
649
653
  }),
650
654
  emits: ["update:modelValue"],
651
655
  setup(t) {
652
- const o = t, n = D(t, "modelValue"), e = o.useTopButton ? H : "div", i = o.useTopButton ? "html" : "default", a = {
656
+ const l = t, n = D(t, "modelValue"), e = l.useTopButton ? H : "div", i = l.useTopButton ? "html" : "default", a = {
653
657
  model: n,
654
- mode: o.mode,
655
- targetId: o.targetId,
656
- filters: o.filters,
657
- payload: o.payload
658
+ mode: l.mode,
659
+ targetId: l.targetId,
660
+ filters: l.filters,
661
+ payload: l.payload
658
662
  };
659
- return (l, d) => {
660
- const f = Ee("top-data");
661
- return k(), b(Oe, { id: l.id }, {
663
+ return (o, d) => {
664
+ const m = Ee("top-data");
665
+ return k(), b(Oe, { id: o.id }, {
662
666
  default: _(() => [
663
667
  Ke((k(), b(Me(y(e)), Se({
664
668
  class: {
665
669
  "top-tagSelector": !0,
666
- "top-tagSelector-filter": o.mode === "filter",
667
- "top-tagSelector-setter_single": o.mode === "setter" && !l.filters,
668
- "top-tagSelector-setter_several": o.mode === "setter" && l.filters,
670
+ "top-tagSelector-filter": l.mode === "filter",
671
+ "top-tagSelector-setter_single": l.mode === "setter" && !o.filters,
672
+ "top-tagSelector-setter_several": l.mode === "setter" && o.filters,
669
673
  "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
670
674
  "top-tagSelector-toTwoLine": n.value.length > 5
671
675
  },
672
676
  color: "theme",
673
677
  styling: ""
674
- }, l.$attrs), {
678
+ }, o.$attrs), {
675
679
  [y(i)]: _(() => [
676
- !n.value.length && l.mode === "filter" ? (k(), b(ne, {
680
+ !n.value.length && o.mode === "filter" ? (k(), b(ne, {
677
681
  key: 0,
678
682
  id: "all",
679
683
  colorId: "",
680
- name: l.$i18n.Common.All_tags ?? "",
684
+ name: o.$i18n.Common.All_tags ?? "",
681
685
  state: ""
682
686
  }, null, 8, ["name"])) : q("", !0),
683
- l.mode === "setter" && l.filters ? (k(), B("div", st, [
684
- $e(l.$slots, "default")
687
+ o.mode === "setter" && o.filters ? (k(), B("div", st, [
688
+ $e(o.$slots, "default")
685
689
  ])) : (k(!0), B(Y, { key: 2 }, de(n.value, (h) => {
686
690
  var S, r;
687
691
  return k(), b(ne, {
688
692
  id: y(Q)(h),
689
- colorId: ((S = y(le)(h, l.tags)) == null ? void 0 : S.color_id) ?? "",
690
- name: ((r = y(le)(h, l.tags)) == null ? void 0 : r.name) ?? "",
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) ?? "",
691
695
  state: y(Q)(h) === h ? "selected" : "excluded"
692
696
  }, null, 8, ["id", "colorId", "name", "state"]);
693
697
  }), 256))
694
698
  ]),
695
699
  _: 2
696
700
  }, 1040, ["class"])), [
697
- [f, a, "topTagSelectorTarget"]
701
+ [m, a, "topTagSelectorTarget"]
698
702
  ])
699
703
  ]),
700
704
  _: 3
@@ -724,12 +728,12 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
724
728
  tagsModifiers: {}
725
729
  }),
726
730
  emits: /* @__PURE__ */ N(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
727
- setup(t, { emit: o }) {
728
- const n = R(), e = t, i = D(t, "modelValue"), a = D(t, "tags"), l = o, d = Re((s, c) => {
729
- l(s, c);
731
+ setup(t, { emit: l }) {
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 f = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
736
+ const m = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
733
737
  var v;
734
738
  const s = " " + ((v = n.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
735
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;
@@ -776,7 +780,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
776
780
  id: String(c),
777
781
  name: s,
778
782
  color_id: String((c - 1) % 10 + 1)
779
- }), l("tagsChanged", a.value);
783
+ }), o("tagsChanged", a.value);
780
784
  }, V = (s) => {
781
785
  var c;
782
786
  if (r.value = W(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
@@ -804,7 +808,7 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
804
808
  }), d("tagsChanged", a.value);
805
809
  }
806
810
  });
807
- }, m = (s) => {
811
+ }, f = (s) => {
808
812
  var c;
809
813
  (c = z.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
810
814
  };
@@ -813,16 +817,16 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
813
817
  class: "top-select_arrow",
814
818
  modelValue: i.value,
815
819
  "onUpdate:modelValue": c[0] || (c[0] = (v) => i.value = v),
816
- id: y(f),
820
+ id: y(m),
817
821
  tags: a.value,
818
822
  mode: "filter",
819
823
  useTopButton: ""
820
824
  }, null, 8, ["modelValue", "id", "tags"]),
821
825
  A(Ie, {
822
- id: y(f),
826
+ id: y(m),
823
827
  class: X(T.value),
824
828
  onOpen: c[4] || (c[4] = (v) => V(v)),
825
- onClose: c[5] || (c[5] = (v) => m(v)),
829
+ onClose: c[5] || (c[5] = (v) => f(v)),
826
830
  "transition-duration": 50
827
831
  }, Le({
828
832
  contentList: _(() => [
@@ -902,24 +906,24 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
902
906
  ]), 1032, ["id", "class"])
903
907
  ], 64));
904
908
  }
905
- }), St = (t, o) => E(() => ge(t).filter((i) => i.on >= 0 || i.id === o).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 === ge(o) ? "" : "",
912
+ icon: i.id === ge(l) ? "" : "",
909
913
  content: i.name
910
- }))), It = (t, o, n) => {
911
- o || (o = { id: t.id }), o.id = t.id;
912
- const e = Ue.genElPopupOpener("div", o);
914
+ }))), It = (t, l, n) => {
915
+ l || (l = { id: t.id }), l.id = t.id;
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 = F(t.modelValue), l = {
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
- W(e, "topTagSelectorTarget", l), delete e.dataset.topPopupDisabled, me(t.modelValue) || w(a, () => {
926
+ W(e, "topTagSelectorTarget", o), delete e.dataset.topPopupDisabled, me(t.modelValue) || w(a, () => {
923
927
  t.modelValue = a.value, ee(e, t, n);
924
928
  }), e.click();
925
929
  }, me(t.modelValue) ? w(t.modelValue, () => ee(e, t, n)) : W(e, "topTagSelectorRender", (i) => {
@@ -927,17 +931,17 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
927
931
  const a = W(e, "topTagSelectorTarget");
928
932
  a && (a.model.value = i), ee(e, t, n);
929
933
  }), ee(e, t, n), e;
930
- }, xt = (t, o) => {
934
+ }, xt = (t, l) => {
931
935
  var n;
932
- (n = W(t, "topTagSelectorRender")) == null || n(o);
933
- }, ee = (t, o, n) => {
936
+ (n = W(t, "topTagSelectorRender")) == null || n(l);
937
+ }, ee = (t, l, n) => {
934
938
  var i;
935
- const e = y(o.modelValue);
936
- if (t.classList.toggle("top-tagSelector-selectedOne", !e.length || e.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", e.length > 5), o.mode === "setter" && o.filters) {
939
+ const e = y(l.modelValue);
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
941
  t.innerHTML = `<div>${n}</div>`;
938
942
  return;
939
943
  }
940
- if (t.innerHTML = "", !e.length && o.mode === "filter") {
944
+ if (t.innerHTML = "", !e.length && l.mode === "filter") {
941
945
  const a = pe({
942
946
  id: "all",
943
947
  colorId: "",
@@ -947,19 +951,19 @@ const je = { class: "top-selectorCompetitors" }, Je = { class: "top-ellipsis1" }
947
951
  t.append(a);
948
952
  }
949
953
  e.forEach((a) => {
950
- var d, f;
951
- const l = pe({
954
+ var d, m;
955
+ const o = pe({
952
956
  id: Q(a),
953
- colorId: ((d = le(a, o.tags)) == null ? void 0 : d.color_id) ?? "",
954
- name: ((f = le(a, o.tags)) == null ? void 0 : f.name) ?? "",
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) ?? "",
955
959
  state: Q(a) === a ? "selected" : "excluded"
956
960
  });
957
- t.append(l);
961
+ t.append(o);
958
962
  });
959
963
  }, pe = (t) => {
960
- const o = document.createElement("div");
961
- return o.classList.add("top-tagSelector_tagIcon"), o.classList.toggle("top-tagSelector-active", !!t.state), o.classList.toggle("top-tagSelector-excluded", t.state === "excluded"), o.dataset.tag_id = t.id, o.dataset.tag_color_id = t.colorId, o.title = t.name, o;
962
- }, kt = ze, Ct = lt, Tt = dt, _t = Te, bt = ne;
964
+ const l = document.createElement("div");
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;
966
+ }, kt = ze, Ct = ot, Tt = dt, _t = Te, bt = ne;
963
967
  export {
964
968
  kt as TopSelectorCompetitors,
965
969
  Ct as TopSelectorRegion,