@topvisor/ui 1.4.3-fixVTopTooltip.1 → 1.4.3-fixVTopTooltip.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js +517 -0
  2. package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js.map +1 -0
  3. package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js +2 -0
  4. package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js.map +1 -0
  5. package/assets/policy.css +1 -1
  6. package/assets/project.css +1 -1
  7. package/formsExt/formsExt.amd.js +1 -1
  8. package/formsExt/formsExt.js +1 -1
  9. package/icomoon/Topvisor icons.json +285 -229
  10. package/icomoon/demo.html +29 -1
  11. package/icomoon/fonts/Topvisor-2.eot +0 -0
  12. package/icomoon/fonts/Topvisor-2.svg +2 -0
  13. package/icomoon/fonts/Topvisor-2.ttf +0 -0
  14. package/icomoon/fonts/Topvisor-2.woff +0 -0
  15. package/icomoon/selection.json +1 -1
  16. package/icomoon/style.css +11 -5
  17. package/package.json +1 -1
  18. package/project/project.amd.js +1 -1
  19. package/project/project.amd.js.map +1 -1
  20. package/project/project.js +977 -625
  21. package/project/project.js.map +1 -1
  22. package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -1
  23. package/src/components/formsExt/selector2/selector2.vue.d.ts +2 -0
  24. package/src/components/formsExt/selector2/types.d.ts +29 -1
  25. package/src/components/formsExt/selector2/utils.d.ts +2 -0
  26. package/src/components/project/groupSelector/groups/groups.vue.d.ts +10 -2
  27. package/src/components/project/groupSelector/groups/utils.d.ts +1 -1
  28. package/src/components/project/project.d.ts +2 -0
  29. package/src/components/project/projectSelector/cache.d.ts +29 -0
  30. package/src/components/project/projectSelector/projectSelector.vue.d.ts +129 -0
  31. package/src/components/project/projectSelector/submenu/submenu.vue.d.ts +4 -0
  32. package/src/components/project/projectSelector/submenu/types.d.ts +17 -0
  33. package/src/components/project/projectSelector/types.d.ts +48 -0
  34. package/src/components/project/projectSelector/utils.d.ts +230 -0
  35. package/.chunks/policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js +0 -2
  36. package/.chunks/policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js.map +0 -1
  37. package/.chunks/policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js +0 -498
  38. package/.chunks/policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js.map +0 -1
@@ -3,20 +3,23 @@
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 V, useModel as T, computed as M, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Q, renderList as me, normalizeClass as Z, 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 qe, renderSlot as De, shallowRef as Fe, createSlots as Ue } from "vue";
7
- import { u as w, C as z, e as H, q as ce, d as ze } from "../.chunks/forms-BpbQYyEQ.es.js";
8
- import { _ as we, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
9
- import { a as We, _ as Me, b as $e, c as Ee, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js";
10
- import { u as Ye } from "../.chunks/utils-MzIaxkRQ.es.js";
11
- import { getSearcherGIcon as Qe, getLangLabel as He, getDeviceGIcon as Xe } from "../utils/searchers.js";
6
+ import { defineComponent as R, mergeModels as _, useModel as w, computed as P, createElementBlock as T, openBlock as h, createBlock as j, unref as v, withCtx as A, Fragment as D, renderList as me, normalizeClass as ae, createElementVNode as U, toDisplayString as b, createVNode as O, createTextVNode as q, toValue as Be, ref as M, watch as G, createCommentVNode as E, reactive as Oe, resolveComponent as Ue, shallowRef as Ne, onMounted as Qe, withModifiers as H, isRef as $e, mergeProps as De, withKeys as be, nextTick as Xe, resolveDirective as Ze, withDirectives as et, resolveDynamicComponent as tt, renderSlot as ot, createSlots as at } from "vue";
7
+ import { u as B, C as X, e as te, q as Se, d as lt } from "../.chunks/forms-BpbQYyEQ.es.js";
8
+ import { _ as ke, b as Te, a as nt } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
9
+ import { a as rt, _ as je, b as Fe, c as qe, I as pe } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js";
10
+ import { u as it } from "../.chunks/utils-MzIaxkRQ.es.js";
11
+ import { getSearcherGIcon as dt, getLangLabel as st, getDeviceGIcon as ut } from "../utils/searchers.js";
12
12
  import "../.chunks/core-DoIr-EAf.es.js";
13
13
  import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-D8WYUfXI.es.js";
14
- import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
15
- import { storage as W } from "../utils/dom.js";
16
- import { TopPopupWorker as Ze } from "../popup/worker.js";
17
- const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
14
+ import { g as ie, a as ne } from "../.chunks/field-CyyFzM-Y.es.js";
15
+ import { validUrl as ct } from "../utils/check.js";
16
+ import { ellipsis as ft } from "../utils/string.js";
17
+ import { invertKeyboardLayout as gt } from "../utils/keyboard.js";
18
+ import { storage as Z } from "../utils/dom.js";
19
+ import { TopPopupWorker as mt } from "../popup/worker.js";
20
+ const vt = { class: "top-competitorSelector" }, pt = { class: "top-ellipsis1" }, To = /* @__PURE__ */ R({
18
21
  __name: "competitorSelector",
19
- props: /* @__PURE__ */ V({
22
+ props: /* @__PURE__ */ _({
20
23
  modelValue: {},
21
24
  items: {},
22
25
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -26,64 +29,64 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
26
29
  }),
27
30
  emits: ["update:modelValue"],
28
31
  setup(e) {
29
- const a = e, o = T(e, "modelValue"), t = M(() => {
30
- if (a.showSelectAllItem)
32
+ const t = e, o = w(e, "modelValue"), a = P(() => {
33
+ if (t.showSelectAllItem)
31
34
  return {
32
35
  icon: "",
33
- title: w().Common.Select_all,
36
+ title: B().Common.Select_all,
34
37
  value: "all",
35
38
  content: ""
36
39
  };
37
40
  });
38
- return (r, l) => (h(), A("div", _e, [
39
- v(z).state.isMobile ? (h(), C(we, { key: 0 }, {
40
- opener: B(() => [
41
- P(H, {
41
+ return (n, l) => (h(), T("div", vt, [
42
+ v(X).state.isMobile ? (h(), j(ke, { key: 0 }, {
43
+ opener: A(() => [
44
+ O(te, {
42
45
  class: "top-competitorSelector_opener",
43
46
  color: "theme",
44
47
  icon: "",
45
48
  icon2: ""
46
49
  }, {
47
- default: B(() => [
48
- J(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
50
+ default: A(() => [
51
+ q(b(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
49
52
  ]),
50
53
  _: 1
51
54
  })
52
55
  ]),
53
- contentList: B(() => [
54
- (h(!0), A(Q, null, me(e.items, (n) => (h(), C(ve, {
55
- class: Z({
56
- "top-active": o.value?.includes(n.value)
56
+ contentList: A(() => [
57
+ (h(!0), T(D, null, me(e.items, (r) => (h(), j(Te, {
58
+ class: ae({
59
+ "top-active": o.value?.includes(r.value)
57
60
  }),
58
- "data-top-icon": n.icon,
59
- title: n.title,
60
- onClick: () => o.value = [n.value]
61
+ "data-top-icon": r.icon,
62
+ title: r.title,
63
+ onClick: () => o.value = [r.value]
61
64
  }, {
62
- default: B(() => [
63
- oe("span", et, b(n.content), 1)
65
+ default: A(() => [
66
+ U("span", pt, b(r.content), 1)
64
67
  ]),
65
68
  _: 2
66
69
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
67
70
  ]),
68
71
  _: 1
69
- })) : (h(), C(We, {
72
+ })) : (h(), j(rt, {
70
73
  key: 1,
71
74
  modelValue: o.value,
72
- "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
75
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r),
73
76
  items: e.items,
74
77
  isMultiple: !0,
75
78
  styling: "bar",
76
79
  canBeEmptyMultiple: !1,
77
- selectAllItem: t.value
80
+ selectAllItem: a.value
78
81
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
79
82
  ]));
80
83
  }
81
- }), Pt = (e, a) => M(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
82
- value: r.id,
83
- title: r.url + ` [${r.id}]`,
84
- icon: r.id === ye(a) ? "" : "",
85
- content: r.name
86
- }))), L = -1, y = -2, le = -1, tt = {
84
+ }), jo = (e, t) => P(() => Be(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
85
+ value: n.id,
86
+ title: n.url + ` [${n.id}]`,
87
+ icon: n.id === Be(t) ? "" : "",
88
+ content: n.name
89
+ }))), N = -1, S = -2, de = -1, ht = {
87
90
  0: "Yandex",
88
91
  1: "Google",
89
92
  4: "YouTube",
@@ -93,241 +96,241 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
93
96
  9: "GoogleStore",
94
97
  20: "Yandex.com",
95
98
  21: "Yandex.com.tr"
96
- }, xe = {
97
- key: y,
99
+ }, we = {
100
+ key: S,
98
101
  name: "--",
99
- index: y
100
- }, Ge = {
101
- key: y,
102
+ index: S
103
+ }, We = {
104
+ key: S,
102
105
  name: "--",
103
- regions: [xe],
104
- regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
105
- }, ae = {
106
- key: y,
107
- name: "Autoselect",
108
- index: y
106
+ regions: [we],
107
+ regionByIndex: /* @__PURE__ */ new Map([[S, we]])
109
108
  }, se = {
110
- key: y,
109
+ key: S,
110
+ name: "Autoselect",
111
+ index: S
112
+ }, he = {
113
+ key: S,
111
114
  name: "Autoselect",
112
- regions: [ae],
113
- regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
114
- }, ke = {
115
+ regions: [se],
116
+ regionByIndex: /* @__PURE__ */ new Map([[S, se]])
117
+ }, Pe = {
115
118
  countryCode: "00",
116
119
  depth: 1,
117
120
  device: 0,
118
- key: le,
119
- index: le,
121
+ key: de,
122
+ index: de,
120
123
  lang: "ru",
121
124
  name: "Without region"
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
- let t;
124
- return e ? t = nt(o) : t = Oe(o), a && t.set(y, lt()), t.size || t.set(y, Ge), t;
125
- }, Oe = (e, a = !0, o = [], t = !1) => {
126
- const r = /* @__PURE__ */ new Map();
125
+ }, yt = () => (se.name = B().Common.Autoselect, se), St = () => (yt(), he.name = B().Common.Autoselect, console.log(he), he), It = () => (Pe.name = B().Keywords.Without_region, Pe), He = (e = !1, t = !1, o = []) => {
126
+ let a;
127
+ return e ? a = xt(o) : a = Je(o), t && a.set(S, St()), a.size || a.set(S, We), a;
128
+ }, Je = (e, t = !0, o = [], a = !1) => {
129
+ const n = /* @__PURE__ */ new Map();
127
130
  return e.forEach((l) => {
128
- if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
129
- const n = { ...l };
130
- n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((u) => {
131
- if (a && !u.enabled) return;
132
- const f = { ...u };
133
- n.regionByIndex.set(f.index, f);
134
- }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
131
+ if (!l.enabled || a && typeof l.key == "number" && l.key > 1) return;
132
+ const r = { ...l };
133
+ r.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((d) => {
134
+ if (t && !d.enabled) return;
135
+ const c = { ...d };
136
+ r.regionByIndex.set(c.index, c);
137
+ }), !r.regionByIndex.size && o.length, // режим вывода ПС без регионов
135
138
  (!l.regions || // есть включенные регионы
136
- n.regionByIndex.size || // запрошен вывод конкретных ПС
137
- o.length) && r.set(n.key, n);
139
+ r.regionByIndex.size || // запрошен вывод конкретных ПС
140
+ o.length) && n.set(r.key, r);
138
141
  }), o.forEach((l) => {
139
- if (r.has(l)) return;
140
- const n = {
142
+ if (n.has(l)) return;
143
+ const r = {
141
144
  key: l,
142
- name: tt[l],
145
+ name: ht[l],
143
146
  regions: [],
144
147
  regionByIndex: /* @__PURE__ */ new Map()
145
148
  };
146
- r.set(n.key, n);
147
- }), r;
148
- }, nt = (e) => {
149
- const a = Oe(e, !1, [0, 1], !0);
150
- if (a.has(2)) {
151
- const o = a.get(2);
149
+ n.set(r.key, r);
150
+ }), n;
151
+ }, xt = (e) => {
152
+ const t = Je(e, !1, [0, 1], !0);
153
+ if (t.has(2)) {
154
+ const o = t.get(2);
152
155
  o && (o.regionByIndex = /* @__PURE__ */ new Map());
153
156
  }
154
- return a.forEach((o) => {
157
+ return t.forEach((o) => {
155
158
  if (!o.regionByIndex) return;
156
- const t = { ...at() };
157
- o.regionByIndex.set(t.index, t);
158
- }), a;
159
- }, rt = (e, a, o = []) => {
160
- const t = Ke(e, !1, o);
161
- let r;
162
- return t.forEach((l) => {
163
- if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
164
- if (!r && !(a.key !== void 0 && a.key != n.key) && !(a.index !== void 0 && a.index != n.index) && !(!e && (a.lang !== void 0 && a.lang != n.lang || a.device !== void 0 && a.device != n.device)))
165
- return n.searcher_key = l.key, r = n, !1;
166
- }), r))
159
+ const a = { ...It() };
160
+ o.regionByIndex.set(a.index, a);
161
+ }), t;
162
+ }, Ct = (e, t, o = []) => {
163
+ const a = He(e, !1, o);
164
+ let n;
165
+ return a.forEach((l) => {
166
+ if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
167
+ if (!n && !(t.key !== void 0 && t.key != r.key) && !(t.index !== void 0 && t.index != r.index) && !(!e && (t.lang !== void 0 && t.lang != r.lang || t.device !== void 0 && t.device != r.device)))
168
+ return r.searcher_key = l.key, n = r, !1;
169
+ }), n))
167
170
  return !1;
168
- }), r;
169
- }, it = Ye(() => import("../.chunks/dialog_regionSelectorRegions-D7x41iZu.es.js")), dt = (e, a) => {
170
- const o = w(), t = K(a.value.keys().next().value ?? y), r = M(() => {
171
+ }), n;
172
+ }, kt = it(() => import("../.chunks/dialog_regionSelectorRegions-D7x41iZu.es.js")), Tt = (e, t) => {
173
+ const o = B(), a = M(t.value.keys().next().value ?? S), n = P(() => {
171
174
  const l = /* @__PURE__ */ new Map();
172
- if (a.value.forEach((n) => {
173
- let u = {
174
- value: n.key,
175
- title: n.name
175
+ if (t.value.forEach((r) => {
176
+ let d = {
177
+ value: r.key,
178
+ title: r.name
176
179
  };
177
- e.addSearcherIcon && (u.icon = Qe(n.key)), l.set(n.key, u);
178
- }), e.addCompare && !l.has(y)) {
179
- const n = {
180
+ e.addSearcherIcon && (d.icon = dt(r.key)), l.set(r.key, d);
181
+ }), e.addCompare && !l.has(S)) {
182
+ const r = {
180
183
  value: "",
181
184
  title: "--------------------",
182
185
  disabled: !0
183
186
  };
184
- l.set(n.value, n);
185
- const u = {
186
- value: L,
187
+ l.set(r.value, r);
188
+ const d = {
189
+ value: N,
187
190
  title: o.Common.Compare
188
191
  };
189
- l.set(u.value, u);
192
+ l.set(d.value, d);
190
193
  }
191
194
  return l;
192
195
  });
193
196
  return {
194
- searcherKey: t,
195
- optionBySearcherKey: r
197
+ searcherKey: a,
198
+ optionBySearcherKey: n
196
199
  };
197
- }, ut = (e, a) => {
198
- const o = w(), t = K(y);
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 = M(() => {
200
+ }, jt = (e, t) => {
201
+ const o = B(), a = M(S);
202
+ e.modelValue.length === 1 && (a.value = e.modelValue[0]), a.value === S && (e.forFrequency ? a.value = t.value?.regionByIndex.values().next().value?.key ?? S : a.value = t.value?.regionByIndex.keys().next().value ?? S);
203
+ const n = P(() => {
201
204
  const l = /* @__PURE__ */ new Map();
202
- return a.value.regionByIndex?.forEach((n) => {
203
- let u = n.name;
205
+ return t.value.regionByIndex?.forEach((r) => {
206
+ let d = r.name;
204
207
  if (e.forFrequency) {
205
- const x = {
206
- value: n.key,
207
- title: u
208
+ const C = {
209
+ value: r.key,
210
+ title: d
208
211
  };
209
- l.has(n.key) || l.set(n.key, x);
212
+ l.has(r.key) || l.set(r.key, C);
210
213
  return;
211
214
  }
212
- n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
213
- const f = He(a.value.key || 0, n.lang ?? "");
214
- f && (u += " / " + f);
215
- const c = {
216
- value: n.index,
217
- title: u,
218
- icon: n.device ? Xe(n.device) : void 0
215
+ r.device && (d += " (" + o.Common["Device_" + r.device] + ")");
216
+ const c = st(t.value.key || 0, r.lang ?? "");
217
+ c && (d += " / " + c);
218
+ const f = {
219
+ value: r.index,
220
+ title: d,
221
+ icon: r.device ? ut(r.device) : void 0
219
222
  };
220
- l.set(n.index, c);
223
+ l.set(r.index, f);
221
224
  }), l;
222
225
  });
223
- return E(r, (l, n) => {
224
- if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
226
+ return G(n, (l, r) => {
227
+ if (e.onlySearcher || a.value !== void 0 && l.get(a.value))
225
228
  return;
226
- let u = l.keys().next().value;
227
- if (t.value === y || u === y) {
228
- t.value = u;
229
+ let d = l.keys().next().value;
230
+ if (a.value === S || d === S) {
231
+ a.value = d;
229
232
  return;
230
233
  }
231
- let f = n?.get(t.value)?.title || "", c = -1;
232
- for (const [x, i] of l.entries()) {
233
- const m = i.title;
234
- if (typeof m != "string" || typeof x == "string")
234
+ let c = r?.get(a.value)?.title || "", f = -1;
235
+ for (const [C, i] of l.entries()) {
236
+ const g = i.title;
237
+ if (typeof g != "string" || typeof C == "string")
235
238
  break;
236
- if (m === f) {
237
- u = x;
239
+ if (g === c) {
240
+ d = C;
238
241
  break;
239
242
  }
240
- const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
241
- let s = f, g = 3;
242
- m.indexOf(s) === -1 && (s = f.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) !== -1 && (g <= c || (c = g, u = x));
243
+ const s = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
244
+ let u = c, m = 3;
245
+ g.indexOf(u) === -1 && (u = c.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), g.indexOf(u) === -1 && (u = c.replace(/ \/.*/, ""), m--), g.indexOf(u) === -1 && (u = c.replace(/ \/.*/, ""), u = u.replace(/^[^a-zа-я]/i, "").replace(s, ""), m--), g.indexOf(u) !== -1 && (m <= f || (f = m, d = C));
243
246
  }
244
- t.value = u;
247
+ a.value = d;
245
248
  }), {
246
- regionIndex: t,
247
- optionByRegionIndex: r
249
+ regionIndex: a,
250
+ optionByRegionIndex: n
248
251
  };
249
- }, st = (e, a, o) => {
250
- const t = K([]), r = () => {
251
- if (e.onlySearcher && a.value) {
252
- t.value = Array.from(a.value.keys());
252
+ }, At = (e, t, o) => {
253
+ const a = M([]), n = () => {
254
+ if (e.onlySearcher && t.value) {
255
+ a.value = Array.from(t.value.keys());
253
256
  return;
254
257
  }
255
- let n = [];
258
+ let r = [];
256
259
  if (e.modelValue.length > 1)
257
- n = [...e.modelValue];
260
+ r = [...e.modelValue];
258
261
  else
259
262
  try {
260
- n = JSON.parse(
263
+ r = JSON.parse(
261
264
  localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
262
265
  ) ?? [];
263
266
  } catch {
264
267
  }
265
- n.length && (n = n.filter((u) => o.value.has(u))), n.length || (n = Array.from(o.value)), t.value = [...n];
268
+ r.length && (r = r.filter((d) => o.value.has(d))), r.length || (r = Array.from(o.value)), a.value = [...r];
266
269
  }, l = () => {
267
- t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
270
+ a.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(a.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
268
271
  };
269
- return E(t, () => {
272
+ return G(a, () => {
270
273
  l();
271
- }), e.addCompare && r(), {
272
- regionsIndexes: t
274
+ }), e.addCompare && n(), {
275
+ regionsIndexes: a
273
276
  };
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(() => {
277
+ }, Bt = (e) => {
278
+ const t = P(() => He(e.forFrequency, e.autoRegion, e.searchers)), o = P(() => t.value.get(n.searcherKey.value) || We), a = P(() => {
276
279
  const i = /* @__PURE__ */ new Set();
277
- return a.value.forEach((m) => {
278
- m.regionByIndex.forEach((d) => {
279
- d.index !== le && d.index !== y && i.add(d.index);
280
+ return t.value.forEach((g) => {
281
+ g.regionByIndex.forEach((s) => {
282
+ s.index !== de && s.index !== S && i.add(s.index);
280
283
  });
281
284
  }), i;
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
- let i = a.value.keys().next().value;
286
- a.value.forEach((m) => {
287
- if (e.onlySearcher && m.key === r.searcherKey.value) {
288
- i = r.searcherKey.value;
285
+ }), n = Tt(e, t), l = jt(e, o), r = At(e, t, a);
286
+ G(t, () => {
287
+ if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((g) => a.value.has(g)), n.searcherKey.value === N) return;
288
+ let i = t.value.keys().next().value;
289
+ t.value.forEach((g) => {
290
+ if (e.onlySearcher && g.key === n.searcherKey.value) {
291
+ i = n.searcherKey.value;
289
292
  return;
290
293
  }
291
- if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
292
- let d;
293
- i !== void 0 && (d = a.value.get(i)?.regionByIndex);
294
- const s = a.value.get(m.key)?.regionByIndex;
295
- d?.has(y) && !s?.has(y) && (i = m.key);
294
+ if (l.regionIndex.value && g.regionByIndex?.has(l.regionIndex.value) && (i = g.key), !e.onlySearcher) {
295
+ let s;
296
+ i !== void 0 && (s = t.value.get(i)?.regionByIndex);
297
+ const u = t.value.get(g.key)?.regionByIndex;
298
+ s?.has(S) && !u?.has(S) && (i = g.key);
296
299
  }
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);
300
+ }), i !== void 0 && (n.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
301
  }, { immediate: !0 });
299
- const u = () => {
300
- if (!(r.searcherKey.value === L || r.searcherKey.value === y))
301
- return r.searcherKey.value;
302
- }, f = () => {
303
- if (e.onlySearcher || l.regionIndex.value === y) return;
302
+ const d = () => {
303
+ if (!(n.searcherKey.value === N || n.searcherKey.value === S))
304
+ return n.searcherKey.value;
305
+ }, c = () => {
306
+ if (e.onlySearcher || l.regionIndex.value === S) return;
304
307
  let i = l.regionIndex.value;
305
308
  if (e.forFrequency) {
306
- const m = l.regionIndex.value;
307
- i = rt(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
309
+ const g = l.regionIndex.value;
310
+ i = Ct(e.forFrequency, { searcher_key: d(), key: g }, e.searchers)?.index;
308
311
  }
309
312
  return i;
310
- }, c = () => {
311
- const i = u();
313
+ }, f = () => {
314
+ const i = d();
312
315
  if (i !== void 0)
313
- return a.value.get(i);
316
+ return t.value.get(i);
314
317
  };
315
318
  return {
316
- selectSearcher: r,
319
+ selectSearcher: n,
317
320
  selectRegion: l,
318
- compare: n,
319
- searcherByKey: a,
320
- allRegionsIndexes: t,
321
- getSearcher: c,
321
+ compare: r,
322
+ searcherByKey: t,
323
+ allRegionsIndexes: a,
324
+ getSearcher: f,
322
325
  getRegion: () => {
323
- const i = f();
326
+ const i = c();
324
327
  if (i !== void 0)
325
- return c()?.regionByIndex?.get(i);
328
+ return f()?.regionByIndex?.get(i);
326
329
  }
327
330
  };
328
- }, Nt = /* @__PURE__ */ R({
331
+ }, Ao = /* @__PURE__ */ R({
329
332
  __name: "regionSelector",
330
- props: /* @__PURE__ */ V({
333
+ props: /* @__PURE__ */ _({
331
334
  projectId: {},
332
335
  searchers: { default: () => [] },
333
336
  modelValue: {},
@@ -346,163 +349,163 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
346
349
  modelValueSingleModifiers: {}
347
350
  }),
348
351
  emits: ["update:modelValue", "update:modelValueSingle"],
349
- setup(e, { expose: a }) {
350
- const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
352
+ setup(e, { expose: t }) {
353
+ const o = e, a = w(e, "modelValue"), n = w(e, "modelValueSingle"), {
351
354
  selectSearcher: l,
352
- selectRegion: n,
353
- compare: u,
354
- searcherByKey: f,
355
- allRegionsIndexes: c,
356
- getSearcher: x,
355
+ selectRegion: r,
356
+ compare: d,
357
+ searcherByKey: c,
358
+ allRegionsIndexes: f,
359
+ getSearcher: C,
357
360
  getRegion: i
358
- } = ct(o), m = () => {
359
- const d = [];
360
- f.value.forEach((s) => {
361
- s.enabled && s.regions.forEach((g) => {
362
- g.enabled && d.push(g);
361
+ } = Bt(o), g = () => {
362
+ const s = [];
363
+ c.value.forEach((u) => {
364
+ u.enabled && u.regions.forEach((m) => {
365
+ m.enabled && s.push(m);
363
366
  });
364
- }), it.open("regions", {
365
- regions: d,
366
- regionsIndexes: u.regionsIndexes.value,
367
- "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
367
+ }), kt.open("regions", {
368
+ regions: s,
369
+ regionsIndexes: d.regionsIndexes.value,
370
+ "@update:regionsIndexes": (u) => d.regionsIndexes.value = u
368
371
  });
369
372
  };
370
- return E([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
371
- if (l.searcherKey.value === L && u.regionsIndexes.value.length) {
372
- if (JSON.stringify(t.value) === JSON.stringify(u.regionsIndexes.value))
373
+ return G([r.regionIndex, l.searcherKey, d.regionsIndexes], () => {
374
+ if (l.searcherKey.value === N && d.regionsIndexes.value.length) {
375
+ if (JSON.stringify(a.value) === JSON.stringify(d.regionsIndexes.value))
373
376
  return;
374
- t.value = [...u.regionsIndexes.value];
377
+ a.value = [...d.regionsIndexes.value];
375
378
  } else
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
- !o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
378
- }), r.value && E(r, () => {
379
- r.value && (t.value = [r.value]);
380
- }, { immediate: !0 }), E(t, () => {
381
- if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
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
- let d = f.value.keys().next().value;
384
- d === y && !o.autoRegion && (d = void 0, r.value = y), d !== void 0 ? t.value = [d] : t.value.length = 0;
379
+ o.onlySearcher ? (a.value = [l.searcherKey.value], l.searcherKey.value === S && !o.autoRegion && (a.value.length = 0)) : (a.value = [r.regionIndex.value], r.regionIndex.value === S && !o.autoRegion && (a.value.length = 0));
380
+ !o.onlySearcher && !f.value.size && (l.searcherKey.value = S);
381
+ }), n.value && G(n, () => {
382
+ n.value && (a.value = [n.value]);
383
+ }, { immediate: !0 }), G(a, () => {
384
+ if (a.value[0] && (n.value = a.value[0]), o.onlySearcher) {
385
+ if (!a.value.length || a.value.length === 1 && !c.value.has(a.value[0]) || a.value.length === 1 && a.value[0] === S && !o.autoRegion) {
386
+ let s = c.value.keys().next().value;
387
+ s === S && !o.autoRegion && (s = void 0, n.value = S), s !== void 0 ? a.value = [s] : a.value.length = 0;
385
388
  return;
386
389
  }
387
- if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
388
- t.value = [...u.regionsIndexes.value];
390
+ if (a.value.length > 1 && JSON.stringify(a.value) !== JSON.stringify(d.regionsIndexes.value)) {
391
+ a.value = [...d.regionsIndexes.value];
389
392
  return;
390
393
  }
391
394
  } else {
392
- let d = [...new Set(t.value)], s = f.value.values().next().value?.regionByIndex?.keys().next().value;
393
- if (o.forFrequency && (s = f.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !d.length)
394
- s !== void 0 && d.push(s);
395
- else if (d.length === 1) {
396
- let g = c.value;
397
- o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((_) => {
398
- _.regionByIndex.forEach((N) => {
399
- N.index !== le && N.index !== y && g.add(N.key);
395
+ let s = [...new Set(a.value)], u = c.value.values().next().value?.regionByIndex?.keys().next().value;
396
+ if (o.forFrequency && (u = c.value.values().next().value?.regionByIndex?.values().next().value?.key), u === S && !o.autoRegion && (u = void 0, n.value = S), !s.length)
397
+ u !== void 0 && s.push(u);
398
+ else if (s.length === 1) {
399
+ let m = f.value;
400
+ o.forFrequency && (m = /* @__PURE__ */ new Set(), c.value.forEach((W) => {
401
+ W.regionByIndex.forEach((I) => {
402
+ I.index !== de && I.index !== S && m.add(I.key);
400
403
  });
401
- })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
404
+ })), m.has(s[0]) || (s = [], u !== void 0 && s.push(u));
402
405
  } else
403
- d = d.filter((g) => c.value.has(g)), !d.length && s !== void 0 && d.push(s);
404
- if (JSON.stringify(t.value) !== JSON.stringify(d)) {
405
- t.value = d;
406
+ s = s.filter((m) => f.value.has(m)), !s.length && u !== void 0 && s.push(u);
407
+ if (JSON.stringify(a.value) !== JSON.stringify(s)) {
408
+ a.value = s;
406
409
  return;
407
410
  }
408
411
  }
409
- if (!(t.value.length === 1 && t.value[0] === (o.onlySearcher ? l.searcherKey.value : n.regionIndex.value)))
412
+ if (!(a.value.length === 1 && a.value[0] === (o.onlySearcher ? l.searcherKey.value : r.regionIndex.value)))
410
413
  if (o.onlySearcher) {
411
- if (t.value.length === 1) {
412
- l.searcherKey.value = t.value[0];
414
+ if (a.value.length === 1) {
415
+ l.searcherKey.value = a.value[0];
413
416
  return;
414
417
  }
415
- l.searcherKey.value = L;
418
+ l.searcherKey.value = N;
416
419
  return;
417
420
  } else {
418
- if (!t.value.length)
421
+ if (!a.value.length)
419
422
  return;
420
- if (t.value.length === 1 && l.searcherKey.value !== L) {
421
- n.regionIndex.value = t.value[0];
422
- let d;
423
- for (const s of f.value.values()) {
424
- for (const g of s.regionByIndex.values())
425
- if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
426
- d = s.key;
423
+ if (a.value.length === 1 && l.searcherKey.value !== N) {
424
+ r.regionIndex.value = a.value[0];
425
+ let s;
426
+ for (const u of c.value.values()) {
427
+ for (const m of u.regionByIndex.values())
428
+ if ((o.forFrequency ? m.key : m.index) === r.regionIndex.value) {
429
+ s = u.key;
427
430
  break;
428
431
  }
429
- if (d !== void 0)
432
+ if (s !== void 0)
430
433
  break;
431
434
  }
432
- d !== void 0 && (l.searcherKey.value = d);
435
+ s !== void 0 && (l.searcherKey.value = s);
433
436
  } else
434
- l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
437
+ l.searcherKey.value = N, d.regionsIndexes.value = [...a.value];
435
438
  }
436
- }, { immediate: !0 }), a({
437
- getSearcher: x,
439
+ }, { immediate: !0 }), t({
440
+ getSearcher: C,
438
441
  getRegion: i
439
- }), (d, s) => (h(), A("div", {
440
- class: Z({
442
+ }), (s, u) => (h(), T("div", {
443
+ class: ae({
441
444
  "top-selectorRegion": !0,
442
445
  "top-selectorRegion-onlySearcher": e.onlySearcher
443
446
  })
444
447
  }, [
445
- P(ce, {
448
+ O(Se, {
446
449
  options: v(l).optionBySearcherKey.value,
447
450
  modelValue: v(l).searcherKey.value,
448
- "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
451
+ "onUpdate:modelValue": u[0] || (u[0] = (m) => v(l).searcherKey.value = m),
449
452
  name: "searcher_key",
450
453
  addChanger: e.addChanger
451
454
  }, null, 8, ["options", "modelValue", "addChanger"]),
452
- !e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
455
+ !e.onlySearcher && v(l).searcherKey.value !== v(N) ? (h(), j(Se, {
453
456
  key: 0,
454
457
  class: "top-select-region",
455
- options: v(n).optionByRegionIndex.value,
456
- modelValue: v(n).regionIndex.value,
457
- "onUpdate:modelValue": s[1] || (s[1] = (g) => v(n).regionIndex.value = g),
458
+ options: v(r).optionByRegionIndex.value,
459
+ modelValue: v(r).regionIndex.value,
460
+ "onUpdate:modelValue": u[1] || (u[1] = (m) => v(r).regionIndex.value = m),
458
461
  name: e.forFrequency ? "region_key" : "region_index",
459
462
  addChanger: e.addChanger,
460
463
  "data-top-icon": e.addRegionIcon ? "" : void 0
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(H, {
464
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : E("", !0),
465
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(N) ? (h(), j(te, {
463
466
  key: 1,
464
467
  name: "compare",
465
- onClick: m,
466
- "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
468
+ onClick: g,
469
+ "data-count-compare-regions-indexes": v(d).regionsIndexes.value.length
467
470
  }, {
468
- default: B(() => [
469
- J(b(d.$i18n.Common.Selected_regions), 1)
471
+ default: A(() => [
472
+ q(b(s.$i18n.Common.Selected_regions), 1)
470
473
  ]),
471
474
  _: 1
472
- }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
475
+ }, 8, ["data-count-compare-regions-indexes"])) : E("", !0)
473
476
  ], 2));
474
477
  }
475
- }), j = {
478
+ }), F = {
476
479
  id: 0,
477
480
  name: "/",
478
481
  path: "/"
479
482
  };
480
- function gt(e) {
481
- return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
483
+ function $t(e) {
484
+ return e ? B()?.Common.All_folders : "/ (" + B()?.Keywords.Root_folder + ")";
482
485
  }
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) => {
484
- l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = gt(a));
485
- const n = r > 1 ? "-".repeat(r - 1) + " " : "";
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);
487
- }), o), ft = (e, a) => e.gen(`/get/${a}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
488
- function ge(e, a, o) {
489
- const t = Object.keys(e), r = t.map((l) => e[l]);
490
- return E(r, (l, n, u) => {
491
- const f = {};
492
- l.forEach((c, x) => {
493
- if (!Object.is(c, n[x])) {
494
- const i = t[x];
495
- f[i] = {
496
- old: n[x],
497
- new: c
486
+ const Ae = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
487
+ l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name = $t(t));
488
+ const r = n > 1 ? "-".repeat(n - 1) + " " : "";
489
+ r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), Ae(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
490
+ }), o), bt = (e, t) => e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
491
+ function Ie(e, t, o) {
492
+ const a = Object.keys(e), n = a.map((l) => e[l]);
493
+ return G(n, (l, r, d) => {
494
+ const c = {};
495
+ l.forEach((f, C) => {
496
+ if (!Object.is(f, r[C])) {
497
+ const i = a[C];
498
+ c[i] = {
499
+ old: r[C],
500
+ new: f
498
501
  };
499
502
  }
500
- }), Object.keys(f).length && a(f, u);
503
+ }), Object.keys(c).length && t(c, d);
501
504
  }, o);
502
505
  }
503
- const mt = /* @__PURE__ */ R({
506
+ const wt = /* @__PURE__ */ R({
504
507
  __name: "folders",
505
- props: /* @__PURE__ */ V({
508
+ props: /* @__PURE__ */ _({
506
509
  folderId: {},
507
510
  folder: {},
508
511
  folders: {},
@@ -515,64 +518,64 @@ const mt = /* @__PURE__ */ R({
515
518
  }, {
516
519
  folderId: { required: !0 },
517
520
  folderIdModifiers: {},
518
- folder: { default: j },
521
+ folder: { default: F },
519
522
  folderModifiers: {}
520
523
  }),
521
524
  emits: ["update:folderId", "update:folder"],
522
525
  setup(e) {
523
- const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client, a.service) : void 0, l = K(null);
524
- E(() => a.projectId, () => {
525
- r?.changeParams({
526
- project_id: a.projectId
527
- }), r?.setOptions({
528
- checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
526
+ const t = e, o = w(e, "folderId"), a = w(e, "folder"), n = t.client && !t.folders ? bt(t.client, t.service) : void 0, l = M(null);
527
+ G(() => t.projectId, () => {
528
+ n?.changeParams({
529
+ project_id: t.projectId
530
+ }), n?.setOptions({
531
+ checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
529
532
  }), l.value?.resetCache();
530
533
  }, { immediate: !0 });
531
- const n = M(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
532
- return ge({
533
- modelFolder: t,
534
+ const r = P(() => Ae(t.folders ?? { root: [F] }, t.canSelectAll));
535
+ return Ie({
536
+ modelFolder: a,
534
537
  modelFolderId: o
535
- }, async (u) => {
536
- if (o.value === t.value.id)
538
+ }, async (d) => {
539
+ if (o.value === a.value.id)
537
540
  return;
538
- if (u.modelFolder && !u.modelFolderId) {
539
- o.value = t.value.id;
541
+ if (d.modelFolder && !d.modelFolderId) {
542
+ o.value = a.value.id;
540
543
  return;
541
544
  }
542
- let f = n.value.get(a.folderId);
543
- f || (f = j), t.value = f, o.value = f.id;
544
- }, { immediate: !0 }), (u, f) => (h(), C(Me, {
545
+ let c = r.value.get(t.folderId);
546
+ c || (c = F), a.value = c, o.value = c.id;
547
+ }, { immediate: !0 }), (d, c) => (h(), j(je, {
545
548
  class: "top-groupSelector_folder",
546
- modelValue: t.value,
547
- "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
548
- items: e.folders ? [...n.value.values()] : void 0,
549
+ modelValue: a.value,
550
+ "onUpdate:modelValue": c[0] || (c[0] = (f) => a.value = f),
551
+ items: e.folders ? [...r.value.values()] : void 0,
549
552
  "search-type": "inline",
550
553
  icon: e.addIcon ? "" : void 0,
551
- api: e.folders ? void 0 : v(r),
552
- apiSetSearchParams: (...c) => v($e)(...c, "name"),
554
+ api: e.folders ? void 0 : v(n),
555
+ apiSetSearchParams: (...f) => v(Fe)(...f, "name"),
553
556
  addChanger: e.addChanger,
554
557
  useCache: ""
555
558
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
556
559
  }
557
- }), ne = {
560
+ }), ue = {
558
561
  id: -1,
559
562
  name: "--",
560
- folder_id: j.id,
561
- folder_path: j.path
562
- }, re = {
563
- id: Ee,
563
+ folder_id: F.id,
564
+ folder_path: F.path
565
+ }, ce = {
566
+ id: qe,
564
567
  name: "All groups",
565
- folder_id: j.id,
566
- folder_path: j.path
567
- }, Y = () => (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, a) => e.gen(`/get/${a}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), pt = (e, a) => e.gen(`/add/${a}/groups/`), yt = { class: "top-groupSelector_groupItem" }, ht = {
568
+ folder_id: F.id,
569
+ folder_path: F.path
570
+ }, ee = () => (ce.name = B()?.Common.All_groups, ce), ze = () => (ce.name = B()?.Keywords.Choose_group, ce), Pt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Ee = (e, t) => e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Et = (e, t) => e.gen(`/add/${t}/groups/`), Mt = { class: "top-groupSelector_groupItem" }, Vt = {
568
571
  key: 0,
569
572
  class: "top-comment"
570
- }, It = {
573
+ }, _t = {
571
574
  key: 1,
572
575
  class: "top-groupSelector_groupItemFolderPath"
573
- }, St = /* @__PURE__ */ R({
576
+ }, Gt = /* @__PURE__ */ R({
574
577
  __name: "groups",
575
- props: /* @__PURE__ */ V({
578
+ props: /* @__PURE__ */ _({
576
579
  groupId: {},
577
580
  group: {},
578
581
  projectId: {},
@@ -593,111 +596,111 @@ const mt = /* @__PURE__ */ R({
593
596
  group: { required: !0 },
594
597
  groupModifiers: {}
595
598
  }),
596
- emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
597
- setup(e, { emit: a }) {
598
- const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client, o.service) : void 0, u = o.client ? pt(o.client, o.service) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
599
- n?.changeParams({
599
+ emits: /* @__PURE__ */ _(["addGroup"], ["update:groupId", "update:group"]),
600
+ setup(e, { emit: t }) {
601
+ const o = e, a = t, n = w(e, "groupId"), l = w(e, "group"), r = o.client && !o.groups ? Ee(o.client, o.service) : void 0, d = o.client ? Et(o.client, o.service) : void 0, c = M(null), f = M(void 0), C = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
602
+ r?.changeParams({
600
603
  project_id: o.projectId,
601
604
  folder_id_depth: !0,
602
605
  filters: [
603
- x
606
+ C
604
607
  ]
605
- }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [Number(o.on)]));
606
- const i = (d) => {
607
- l.value = d, r.value = d.id;
608
+ }), o.on !== void 0 && r?.params.filters?.push(ie("on", "EQUALS", [Number(o.on)]));
609
+ const i = (s) => {
610
+ l.value = s, n.value = s.id;
608
611
  };
609
- ge({
612
+ Ie({
610
613
  projectId: () => o.projectId,
611
614
  folderId: () => o.folder?.id,
612
615
  canSelectAll: () => o.canSelectAll
613
- }, (d) => {
614
- if (d.projectId && (n?.changeParams({
616
+ }, (s) => {
617
+ if (s.projectId && (r?.changeParams({
615
618
  project_id: o.projectId
616
- }), n?.setOptions({
619
+ }), r?.setOptions({
617
620
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
618
- })), d.folderId && (x.values = [
621
+ })), s.folderId && (C.values = [
619
622
  o.folder?.id ?? 0
620
- ], 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) {
621
- let s;
622
- o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(Y()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
623
+ ], o.groups && (f.value = Pt(o.groups, o.on, o.folder))), c.value?.resetCache(), (s.folderId?.old !== void 0 || s.canSelectAll?.old !== void 0) && n.value !== pe) {
624
+ let u;
625
+ o.autoselect === "first" && (u = f.value?.[0], o.canSelectAll && (u = Oe(ee()))), (o.autoselect === "placeholder" || !u) && (u = ze()), i(u);
623
626
  }
624
- }, { immediate: !0 }), ge({
627
+ }, { immediate: !0 }), Ie({
625
628
  modelGroup: l,
626
- modelGroupId: r
627
- }, async (d) => {
628
- if (r.value !== l.value.id) {
629
- if (d.modelGroup && !d.modelGroupId) {
630
- r.value = l.value.id;
629
+ modelGroupId: n
630
+ }, async (s) => {
631
+ if (n.value !== l.value.id) {
632
+ if (s.modelGroup && !s.modelGroupId) {
633
+ n.value = l.value.id;
631
634
  return;
632
635
  }
633
- if (!(o.canAdd && r.value === ue)) {
636
+ if (!(o.canAdd && n.value === pe)) {
634
637
  if (o.groups) {
635
- let s = c.value?.find((g) => g.id === r.value);
636
- if (!s && o.canSelectAll && (s = Y()), s)
637
- i(s);
638
+ let u = f.value?.find((m) => m.id === n.value);
639
+ if (!u && o.canSelectAll && (u = ee()), u)
640
+ i(u);
638
641
  else {
639
- const g = c.value?.[0];
640
- g && !r.value ? i(g) : i(ne);
642
+ const m = f.value?.[0];
643
+ m && !n.value ? i(m) : i(ue);
641
644
  }
642
645
  }
643
- if (o.client && !o.groups && (r.value || r.value === Ee && !o.canSelectAll)) {
644
- const s = Ce(o.client, o.service).changeParams({
646
+ if (o.client && !o.groups && (n.value || n.value === qe && !o.canSelectAll)) {
647
+ const u = Ee(o.client, o.service).changeParams({
645
648
  project_id: o.projectId,
646
- id: r.value,
649
+ id: n.value,
647
650
  filters: [
648
- x
651
+ C
649
652
  ]
650
653
  });
651
- s?.setOptions({
654
+ u?.setOptions({
652
655
  checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
653
656
  });
654
- const g = await s.call();
655
- if (!g.errors?.length && !g.result) return;
656
- !g.errors && g.result[0] ? i(g.result[0]) : i(ne);
657
+ const m = await u.call();
658
+ if (!m.errors?.length && !m.result) return;
659
+ !m.errors && m.result[0] ? i(m.result[0]) : i(ue);
657
660
  }
658
661
  }
659
662
  }
660
663
  }, { immediate: !0 });
661
- const m = async (d) => {
662
- if (o.canAdd !== "api" || !u) return;
663
- const s = l.value, g = await u.changeParams({
664
+ const g = async (s) => {
665
+ if (o.canAdd !== "api" || !d) return;
666
+ const u = l.value, m = await d.changeParams({
664
667
  project_id: o.projectId,
665
- names: [d.name],
666
- to_id: o.folder?.id ?? j.id,
668
+ names: [s.name],
669
+ to_id: o.folder?.id ?? F.id,
667
670
  to_type: "in_folder_last"
668
671
  }).call();
669
- g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
672
+ m.result ? (i(m.result), a("addGroup", m.result)) : i(u), c.value?.resetCache(!0);
670
673
  };
671
- return (d, s) => (h(), C(Me, {
674
+ return (s, u) => (h(), j(je, {
672
675
  ref_key: "refSelector",
673
- ref: f,
676
+ ref: c,
674
677
  class: "top-groupSelector_group",
675
678
  modelValue: l.value,
676
- "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
677
- items: c.value ?? e.groups,
679
+ "onUpdate:modelValue": u[0] || (u[0] = (m) => l.value = m),
680
+ items: f.value ?? e.groups,
678
681
  searchType: "inline",
679
682
  icon: e.addIcon ? "" : void 0,
680
- api: e.groups ? void 0 : v(n),
681
- apiSetSearchParams: (...g) => v($e)(...g, "name"),
683
+ api: e.groups ? void 0 : v(r),
684
+ apiSetSearchParams: (...m) => v(Fe)(...m, "name"),
682
685
  appendSearchToResult: !!e.canAdd,
683
- useAllItem: e.canSelectAll ? v(Y)().name : !1,
686
+ useAllItem: e.canSelectAll ? v(ee)().name : !1,
684
687
  addChanger: e.addChanger,
685
688
  useCache: "",
686
- onAppendItem: m
689
+ onAppendItem: g
687
690
  }, {
688
- item: B(({ item: g }) => [
689
- oe("div", yt, [
690
- g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
691
- oe("span", null, b(g.name), 1),
692
- g.folder_path && e.showPath ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
691
+ item: A(({ item: m }) => [
692
+ U("div", Mt, [
693
+ m.id === v(pe) ? (h(), T("div", Vt, b(s.$i18n.Common.Add) + ": ", 1)) : E("", !0),
694
+ U("span", null, b(m.name), 1),
695
+ m.folder_path && e.showPath ? (h(), T("span", _t, b(m.folder_path), 1)) : E("", !0)
693
696
  ])
694
697
  ]),
695
698
  _: 1
696
699
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
697
700
  }
698
- }), xt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ R({
701
+ }), Lt = { class: "top-groupSelector" }, Bo = /* @__PURE__ */ R({
699
702
  __name: "groupSelector",
700
- props: /* @__PURE__ */ V({
703
+ props: /* @__PURE__ */ _({
701
704
  folderId: {},
702
705
  folder: {},
703
706
  groupId: {},
@@ -722,26 +725,26 @@ const mt = /* @__PURE__ */ R({
722
725
  folderModifiers: {},
723
726
  groupId: { required: !0 },
724
727
  groupIdModifiers: {},
725
- group: { default: ne },
728
+ group: { default: ue },
726
729
  groupModifiers: {}
727
730
  }),
728
- emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
729
- setup(e, { emit: a }) {
730
- 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);
731
- r.value = f.get(t.value);
732
- let c = o.groups?.find((i) => i.id === l.value);
733
- l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = Y()), o.canSelectAllGroups && !c && (c = Y()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
734
- const x = (i) => {
735
- let m;
736
- o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
731
+ emits: /* @__PURE__ */ _(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
732
+ setup(e, { emit: t }) {
733
+ const o = e, a = w(e, "folderId"), n = w(e, "folder"), l = w(e, "groupId"), r = w(e, "group"), d = t, c = Ae(o.folders ?? { root: [F] }, o.canSelectAllGroups);
734
+ n.value = c.get(a.value);
735
+ let f = o.groups?.find((i) => i.id === l.value);
736
+ l.value || (f = o.groups?.[0]), o.canSelectAllGroups && !f && (f = ee()), o.canSelectAllGroups && !f && (f = ee()), (o.autoselect === "placeholder" || !f) && (f = ze()), f ??= ue, r.value = f;
737
+ const C = (i) => {
738
+ let g;
739
+ o.groups && i && (g = [...o.groups, i]), d("update:groups", g);
737
740
  };
738
- return (i, m) => (h(), A("div", xt, [
739
- e.showFolders ? (h(), C(mt, {
741
+ return (i, g) => (h(), T("div", Lt, [
742
+ e.showFolders ? (h(), j(wt, {
740
743
  key: 0,
741
- folderId: t.value,
742
- "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
743
- folder: r.value,
744
- "onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
744
+ folderId: a.value,
745
+ "onUpdate:folderId": g[0] || (g[0] = (s) => a.value = s),
746
+ folder: n.value,
747
+ "onUpdate:folder": g[1] || (g[1] = (s) => n.value = s),
745
748
  projectId: e.projectId,
746
749
  folders: e.folders,
747
750
  canSelectAll: e.canSelectAllGroups,
@@ -749,15 +752,15 @@ const mt = /* @__PURE__ */ R({
749
752
  addIcon: e.addIcon,
750
753
  client: e.client,
751
754
  service: e.service
752
- }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) : O("", !0),
753
- e.showGroups ? (h(), C(St, {
755
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) : E("", !0),
756
+ e.showGroups ? (h(), j(Gt, {
754
757
  key: 1,
755
758
  groupId: l.value,
756
- "onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
757
- group: n.value,
758
- "onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
759
+ "onUpdate:groupId": g[2] || (g[2] = (s) => l.value = s),
760
+ group: r.value,
761
+ "onUpdate:group": g[3] || (g[3] = (s) => r.value = s),
759
762
  projectId: e.projectId,
760
- folder: r.value,
763
+ folder: n.value,
761
764
  groups: e.groups,
762
765
  on: e.on,
763
766
  canAdd: e.canAddGroup,
@@ -768,65 +771,412 @@ const mt = /* @__PURE__ */ R({
768
771
  addIcon: e.addIcon,
769
772
  client: e.client,
770
773
  service: e.service,
771
- onAddGroup: x
772
- }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) : O("", !0)
774
+ onAddGroup: C
775
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) : E("", !0)
773
776
  ]));
774
777
  }
775
- }), Be = (e) => "-" + e, X = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
776
- e = X(e);
777
- const o = a.find((t) => t.id === e);
778
+ }), Rt = { class: "top-projectSelectorSubmenu_item" }, Kt = ["href", "title", "data-top-icon", "data-right"], Ot = { class: "top-projectSelectorSubmenu_item" }, Ut = ["href"], Nt = /* @__PURE__ */ R({
779
+ __name: "submenu",
780
+ props: {
781
+ id: {},
782
+ right: {},
783
+ url: {}
784
+ },
785
+ setup(e) {
786
+ const t = e, o = B(), a = [
787
+ {
788
+ href: `/project/keywords/${t.id}/`,
789
+ title: o.Common.Menu_phrases,
790
+ icon: "",
791
+ right: "2"
792
+ },
793
+ {
794
+ href: `/project/dynamics/${t.id}/`,
795
+ title: o.Common.Menu_dynamics,
796
+ icon: "",
797
+ right: "1"
798
+ },
799
+ {
800
+ href: `/project/snapshots/${t.id}/`,
801
+ title: o.Common.Menu_snapshots,
802
+ icon: "",
803
+ right: "1"
804
+ },
805
+ {
806
+ href: `/project/competitors/${t.id}/`,
807
+ title: o.Common.Menu_competitors,
808
+ icon: "",
809
+ right: "1"
810
+ },
811
+ {
812
+ href: `/project/analytics/${t.id}/`,
813
+ title: o.Common.Menu_analytics,
814
+ icon: "",
815
+ right: "5"
816
+ },
817
+ {
818
+ href: `/project/broker/${t.id}/`,
819
+ title: o.Common.Menu_broker,
820
+ icon: "",
821
+ right: "6"
822
+ },
823
+ {
824
+ href: `/project/audit/${t.id}/sitemap/`,
825
+ title: o.Audit.Sitemap_gen,
826
+ icon: "",
827
+ right: "8"
828
+ },
829
+ {
830
+ href: `/project/audit/${t.id}/audit/`,
831
+ title: o.Common.Menu_audit,
832
+ icon: "",
833
+ right: "8"
834
+ },
835
+ {
836
+ href: `/project/audit/${t.id}/indexing/`,
837
+ title: o.Audit.Indexing,
838
+ icon: "",
839
+ right: "8"
840
+ },
841
+ {
842
+ href: `/project/audit/${t.id}/watcher/`,
843
+ title: o.Audit.Watcher,
844
+ icon: "",
845
+ right: "9"
846
+ },
847
+ {
848
+ href: `/project/settings/${t.id}/`,
849
+ title: o.Common.Menu_settings,
850
+ icon: "",
851
+ right: "2"
852
+ }
853
+ ], n = P(() => t.right.includes("0") ? a.filter((l) => t.right[l.right] === "1") : a);
854
+ return (l, r) => {
855
+ const d = Ue("TopButton");
856
+ return h(), j(v(ke), {
857
+ class: "top-projectSelectorSubmenu",
858
+ notch: !1,
859
+ pos: "2"
860
+ }, {
861
+ opener: A(() => [
862
+ O(d, {
863
+ class: "top-projectSelectorSubmenu_opener",
864
+ "data-top-icon": "",
865
+ color: "theme"
866
+ })
867
+ ]),
868
+ contentList: A(() => [
869
+ (h(!0), T(D, null, me(n.value, (c) => (h(), T("li", Rt, [
870
+ U("a", {
871
+ href: c.href,
872
+ title: c.title,
873
+ "data-top-icon": c.icon,
874
+ "data-right": c.right
875
+ }, null, 8, Kt)
876
+ ]))), 256)),
877
+ U("li", Ot, [
878
+ U("a", {
879
+ href: e.url,
880
+ "data-top-icon": "",
881
+ target: "_blank"
882
+ }, null, 8, Ut)
883
+ ])
884
+ ]),
885
+ _: 1
886
+ });
887
+ };
888
+ }
889
+ }), ye = (e) => ({
890
+ id: null,
891
+ name: e,
892
+ listItemProps: {
893
+ type: "title"
894
+ }
895
+ }), xe = {
896
+ scheduledUpdate: !1,
897
+ manualUpdate: !1,
898
+ guestProjects: !1
899
+ }, Dt = (e, t) => {
900
+ const o = [], a = {
901
+ scheduledUpdate: ye(B().Projects.Scheduled_update),
902
+ manualUpdate: ye(B().Projects.Manual_update),
903
+ guestProjects: ye(B().Projects.Guest_projects)
904
+ }, n = t ? {
905
+ scheduledUpdate: !1,
906
+ manualUpdate: !1,
907
+ guestProjects: !1
908
+ } : xe;
909
+ for (const l of e)
910
+ !n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (o.push(a.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (o.push(a.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (o.push(a.guestProjects), n.guestProjects = !0), o.push(l);
911
+ return o;
912
+ }, Ft = (e) => e.map((t) => ({
913
+ ...t,
914
+ listItemProps: {
915
+ attrs: { title: t.name }
916
+ }
917
+ })), qt = (e, t, o) => {
918
+ if (!e || e.length === 0) return [];
919
+ t && Object.keys(xe).forEach((n) => xe[n] = !1);
920
+ const a = Ft(e);
921
+ return Dt(a, o);
922
+ }, Wt = (e) => {
923
+ if (!e) return "";
924
+ let t = e;
925
+ return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*],/, ""), /%22dataSort%22:\{[^}]*0000-00-00[^}]*}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^}]*},/, "")), t;
926
+ }, Ht = (e) => {
927
+ const t = location.pathname.split("/");
928
+ let o = "project/dynamics/", a = "";
929
+ t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (a = t[4] + "/");
930
+ let n = "/" + o + e + "/" + a;
931
+ const l = Wt(location.hash);
932
+ return n += l, n;
933
+ }, Me = (e) => {
934
+ let t = e.startsWith("http") ? e : "http://" + e;
935
+ return t = t.replace(/"/g, "%22"), t;
936
+ }, Jt = (e, t) => {
937
+ let o = e.params.filters ?? [];
938
+ o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
939
+ const a = gt(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
940
+ t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
941
+ }, Ve = (e, t, o) => {
942
+ const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
943
+ return a.params = {
944
+ ...o,
945
+ filters: [
946
+ ie("on", "GREATER_THAN_EQUALS", [0])
947
+ ],
948
+ orders: [
949
+ ne("user_id", "DESC", [t]),
950
+ ne("on", "DESC"),
951
+ ne("favorite", "DESC"),
952
+ ne("id", "DESC")
953
+ ]
954
+ }, a.options.onApiLoaded = (n, l, r) => {
955
+ const d = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, c = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
956
+ n.result = qt(n.result, d, c), r?.(n, l);
957
+ }, a;
958
+ }, zt = (e) => e.gen("/add/projects_2/projects/"), fe = "ui_project_selector_total:", Yt = 1440 * 60 * 1e3, V = Ne(), Ye = M(0), Q = M(null), _e = (e, t) => {
959
+ localStorage.setItem(
960
+ fe + e,
961
+ JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + Yt })
962
+ );
963
+ }, Qt = (e) => {
964
+ const t = localStorage.getItem(fe + e);
965
+ if (!t) return;
966
+ const { projectsTotal: o, expiresAt: a } = JSON.parse(t);
967
+ if (Date.now() > a) {
968
+ localStorage.removeItem(fe + e);
969
+ return;
970
+ }
971
+ return o;
972
+ }, Xt = (e, t = !0) => {
973
+ V.value = void 0, localStorage.removeItem(fe + e), t && Ye.value++;
974
+ }, Zt = { class: "top-projectSelector_item" }, eo = { class: "top-projectSelector_itemText" }, to = { class: "top-comment" }, oo = {
975
+ key: 0,
976
+ class: "top-comment"
977
+ }, ao = ["href"], Ge = 1e3, $o = /* @__PURE__ */ R({
978
+ __name: "projectSelector",
979
+ props: /* @__PURE__ */ _({
980
+ client: {},
981
+ project: {},
982
+ addLinksToProjects: { type: Boolean, default: !0 },
983
+ excludeProjectId: {},
984
+ modificator: {},
985
+ placeholder: {},
986
+ buttonProps: {},
987
+ openerShortcut: {}
988
+ }, {
989
+ project: { default: { id: null, name: "" } },
990
+ projectModifiers: {}
991
+ }),
992
+ emits: ["update:project"],
993
+ setup(e) {
994
+ const t = B();
995
+ if (!window.mo?.user?.id)
996
+ throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
997
+ const o = window.mo.user.id, a = e, n = w(e, "project"), l = Ve(
998
+ a.client,
999
+ o
1000
+ ), r = zt(a.client), d = M(Qt(o)), c = M(null), f = P(() => a.placeholder ?? t.Projects.Select_project), C = P(() => !V.value || !a.excludeProjectId ? V.value : V.value.filter((I) => I.id !== a.excludeProjectId)), i = P(() => {
1001
+ if (!(!d.value && d.value !== 0))
1002
+ return d.value < Ge ? "static" : "api";
1003
+ });
1004
+ G(Ye, () => {
1005
+ m();
1006
+ });
1007
+ const g = async () => {
1008
+ if (!Q.value) {
1009
+ const L = Ve(
1010
+ a.client,
1011
+ o,
1012
+ { limit: Ge }
1013
+ );
1014
+ Q.value = L.call();
1015
+ }
1016
+ const I = await Q.value;
1017
+ if (I.errors) {
1018
+ Q.value = null;
1019
+ return;
1020
+ }
1021
+ return Q.value = null, I;
1022
+ }, s = async () => {
1023
+ if (d.value) return;
1024
+ const I = await g();
1025
+ I && (d.value = I.total, i.value === "static" && !V.value && (V.value = I.result), d.value && _e(o, d.value));
1026
+ }, u = async (I) => {
1027
+ const L = await r.changeParams({
1028
+ url: I.name,
1029
+ name: I.name
1030
+ }).call();
1031
+ if (!L.errors) {
1032
+ if (V.value && i.value === "static") {
1033
+ const y = {
1034
+ id: Number(L.result),
1035
+ user_id: o,
1036
+ name: I.name,
1037
+ url: I.name,
1038
+ on: 0,
1039
+ right: "11111111111111111111",
1040
+ listItemProps: {
1041
+ attrs: { title: I.name }
1042
+ }
1043
+ }, p = V.value.findIndex((x) => x.on === 0);
1044
+ V.value = [
1045
+ ...V.value.slice(0, p),
1046
+ y,
1047
+ ...V.value.slice(p)
1048
+ ], d.value && (d.value += 1, _e(o, d.value));
1049
+ }
1050
+ i.value === "api" && Xt(o);
1051
+ }
1052
+ }, m = () => {
1053
+ i.value === "api" && c.value?.resetCache(!0);
1054
+ }, W = async () => {
1055
+ if (V.value || i.value !== "static") return;
1056
+ const I = await g();
1057
+ I && (V.value = I.result);
1058
+ };
1059
+ return Qe(async () => {
1060
+ await s();
1061
+ }), (I, L) => {
1062
+ const y = Ue("TopButton");
1063
+ return h(), j(je, {
1064
+ ref_key: "refSelector",
1065
+ ref: c,
1066
+ class: "top-projectSelector",
1067
+ modelValue: n.value,
1068
+ "onUpdate:modelValue": L[1] || (L[1] = (p) => n.value = p),
1069
+ items: C.value,
1070
+ title: I.$i18n.Projects.Search_projects,
1071
+ modificator: e.modificator,
1072
+ searchFields: ["id", "name", "url"],
1073
+ placeholder: f.value,
1074
+ hasCloserBtn: "",
1075
+ api: i.value === "api" ? v(l) : void 0,
1076
+ apiSetSearchParams: i.value === "api" ? (...p) => v(Jt)(...p) : void 0,
1077
+ useCache: "",
1078
+ appendSearchToResult: "",
1079
+ appendSearchToResultCond: v(ct),
1080
+ appendWithoutSelect: "",
1081
+ buttonProps: e.buttonProps,
1082
+ openerShortcut: e.openerShortcut,
1083
+ onAppendItem: u,
1084
+ onOpen: W
1085
+ }, {
1086
+ item: A(({ item: p }) => [
1087
+ U("div", Zt, [
1088
+ U("div", eo, [
1089
+ p.id ? (h(), T(D, { key: 0 }, [
1090
+ q(b(v(ft)(p.name, 20)) + " ", 1),
1091
+ U("span", to, " id " + b(p.id), 1)
1092
+ ], 64)) : (h(), T(D, { key: 1 }, [
1093
+ p.listItemProps?.type ? E("", !0) : (h(), T("div", oo, b(I.$i18n.Projects.Add_project) + ": ", 1)),
1094
+ q(" " + b(p.name), 1)
1095
+ ], 64))
1096
+ ]),
1097
+ p.id ? (h(), T(D, { key: 0 }, [
1098
+ e.addLinksToProjects ? (h(), T("a", {
1099
+ key: 0,
1100
+ class: "top-projectSelector_itemLink",
1101
+ href: v(Ht)(p.id)
1102
+ }, null, 8, ao)) : E("", !0),
1103
+ I.$core.state.isMobile ? E("", !0) : (h(), j(y, {
1104
+ key: 1,
1105
+ class: "top-projectSelector_itemExtLink",
1106
+ href: v(Me)(p.url),
1107
+ "data-top-icon": "",
1108
+ color: "theme",
1109
+ target: "_blank",
1110
+ onClick: L[0] || (L[0] = H(() => {
1111
+ }, ["stop"]))
1112
+ }, null, 8, ["href"])),
1113
+ O(Nt, {
1114
+ id: p.id,
1115
+ right: p.right ?? void 0,
1116
+ url: v(Me)(p.url)
1117
+ }, null, 8, ["id", "right", "url"])
1118
+ ], 64)) : E("", !0)
1119
+ ])
1120
+ ]),
1121
+ _: 1
1122
+ }, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
1123
+ };
1124
+ }
1125
+ }), Le = (e) => "-" + e, oe = (e) => e[0] === "-" ? e.substring(1) : e, ge = (e, t) => {
1126
+ e = oe(e);
1127
+ const o = t.find((a) => a.id === e);
778
1128
  if (o)
779
1129
  return o;
780
- }, Dt = (e, a, o) => {
781
- a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
782
- const t = Ze.genElPopupOpener("div", a);
783
- 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) => {
784
- r.preventDefault(), r.stopPropagation(), t.onclick = null;
785
- const l = K(e.modelValue), n = {
1130
+ }, bo = (e, t, o) => {
1131
+ t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
1132
+ const a = mt.genElPopupOpener("div", t);
1133
+ return a.classList.add("top-tagSelector"), e.useTopButton && a.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || a.classList.add("top-tagSelector-custom"), e.mode === "filter" && a.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && a.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && a.classList.add("top-tagSelector-setter_several"), a.onclick = (n) => {
1134
+ n.preventDefault(), n.stopPropagation(), a.onclick = null;
1135
+ const l = M(e.modelValue), r = {
786
1136
  model: l,
787
1137
  mode: e.mode,
788
1138
  targetId: e.targetId,
789
1139
  filters: e.filters,
790
1140
  payload: e.payload
791
1141
  };
792
- W(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
793
- e.modelValue = l.value, te(t, e, o);
794
- }), t.click();
795
- }, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : W(t, "topTagSelectorRender", (r) => {
796
- e.modelValue = r;
797
- const l = W(t, "topTagSelectorTarget");
798
- l && (l.model.value = r), te(t, e, o);
799
- }), te(t, e, o), t;
800
- }, Ft = (e, a) => {
801
- W(e, "topTagSelectorRender")?.(a);
802
- }, te = (e, a, o) => {
803
- const t = v(a.modelValue);
804
- 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) {
1142
+ Z(a, "topTagSelectorTarget", r), delete a.dataset.topPopupDisabled, $e(e.modelValue) || G(l, () => {
1143
+ e.modelValue = l.value, re(a, e, o);
1144
+ }), a.click();
1145
+ }, $e(e.modelValue) ? G(e.modelValue, () => re(a, e, o)) : Z(a, "topTagSelectorRender", (n) => {
1146
+ e.modelValue = n;
1147
+ const l = Z(a, "topTagSelectorTarget");
1148
+ l && (l.model.value = n), re(a, e, o);
1149
+ }), re(a, e, o), a;
1150
+ }, wo = (e, t) => {
1151
+ Z(e, "topTagSelectorRender")?.(t);
1152
+ }, re = (e, t, o) => {
1153
+ const a = v(t.modelValue);
1154
+ if (e.classList.toggle("top-tagSelector-selectedOne", !a.length || a.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", a.length > 5), t.mode === "setter" && t.filters) {
805
1155
  e.innerHTML = `<div>${o}</div>`;
806
1156
  return;
807
1157
  }
808
- if (e.innerHTML = "", !t.length && a.mode === "filter") {
809
- const r = Te({
1158
+ if (e.innerHTML = "", !a.length && t.mode === "filter") {
1159
+ const n = Re({
810
1160
  id: "all",
811
1161
  colorId: "",
812
- name: w().Common?.All_tags ?? "",
1162
+ name: B().Common?.All_tags ?? "",
813
1163
  state: ""
814
1164
  });
815
- e.append(r);
1165
+ e.append(n);
816
1166
  }
817
- t.forEach((r) => {
818
- const l = Te({
819
- id: X(r),
820
- colorId: ie(r, a.tags)?.color_id ?? "",
821
- name: ie(r, a.tags)?.name ?? "",
822
- state: X(r) === r ? "selected" : "excluded"
1167
+ a.forEach((n) => {
1168
+ const l = Re({
1169
+ id: oe(n),
1170
+ colorId: ge(n, t.tags)?.color_id ?? "",
1171
+ name: ge(n, t.tags)?.name ?? "",
1172
+ state: oe(n) === n ? "selected" : "excluded"
823
1173
  });
824
1174
  e.append(l);
825
1175
  });
826
- }, Te = (e) => {
827
- const a = document.createElement("div");
828
- 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;
829
- }, kt = [
1176
+ }, Re = (e) => {
1177
+ const t = document.createElement("div");
1178
+ return t.classList.add("top-tagSelector_tagIcon"), t.classList.toggle("top-tagSelector-active", !!e.state), t.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), t.dataset.tag_id = e.id, t.dataset.tag_color_id = e.colorId, t.title = e.name, t;
1179
+ }, lo = [
830
1180
  {
831
1181
  id: "1",
832
1182
  name: "Without Tag",
@@ -877,7 +1227,7 @@ const mt = /* @__PURE__ */ R({
877
1227
  name: "Turquoise",
878
1228
  color_id: "10"
879
1229
  }
880
- ], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
1230
+ ], no = ["data-tag_id", "data-tag_color_id", "title"], Ce = /* @__PURE__ */ R({
881
1231
  __name: "tagIcon",
882
1232
  props: {
883
1233
  id: {},
@@ -886,8 +1236,8 @@ const mt = /* @__PURE__ */ R({
886
1236
  state: {}
887
1237
  },
888
1238
  setup(e) {
889
- return (a, o) => (h(), A("div", {
890
- class: Z({
1239
+ return (t, o) => (h(), T("div", {
1240
+ class: ae({
891
1241
  "top-tagSelector_tagIcon": !0,
892
1242
  "top-tagSelector-active": !!e.state,
893
1243
  "top-tagSelector-excluded": e.state === "excluded"
@@ -895,11 +1245,11 @@ const mt = /* @__PURE__ */ R({
895
1245
  "data-tag_id": e.id,
896
1246
  "data-tag_color_id": e.colorId,
897
1247
  title: e.name
898
- }, null, 10, Ct));
1248
+ }, null, 10, no));
899
1249
  }
900
- }), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
1250
+ }), ro = ["contenteditable", "onKeydown"], Ke = /* @__PURE__ */ R({
901
1251
  __name: "tagPopupListItem",
902
- props: /* @__PURE__ */ V({
1252
+ props: /* @__PURE__ */ _({
903
1253
  editable: { type: Boolean },
904
1254
  disabled: { type: Boolean },
905
1255
  canExclude: { type: Boolean },
@@ -913,74 +1263,74 @@ const mt = /* @__PURE__ */ R({
913
1263
  },
914
1264
  nameModifiers: {}
915
1265
  }),
916
- emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
917
- setup(e, { emit: a }) {
918
- const o = e, t = a, r = T(e, "name"), l = K(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
919
- contenteditable: u.value,
920
- onpaste: (m) => m.preventDefault()
921
- } : {}), u = K(!1), f = async () => {
922
- u.value = !0, await Re(), l.value?.focus();
923
- }, c = () => {
924
- const m = l.value?.innerText;
925
- if (!m) return x();
926
- l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
927
- }, x = async () => {
928
- l.value && (l.value.innerText = o.name), u.value = !1;
929
- }, i = (m) => {
930
- if (u.value || o.disabled) return;
931
- let d = "selected";
932
- o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
1266
+ emits: /* @__PURE__ */ _(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1267
+ setup(e, { emit: t }) {
1268
+ const o = e, a = t, n = w(e, "name"), l = M(null), r = P(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
1269
+ contenteditable: d.value,
1270
+ onpaste: (g) => g.preventDefault()
1271
+ } : {}), d = M(!1), c = async () => {
1272
+ d.value = !0, await Xe(), l.value?.focus();
1273
+ }, f = () => {
1274
+ const g = l.value?.innerText;
1275
+ if (!g) return C();
1276
+ l.value && (l.value.innerText = g), d.value = !1, a("update:name", g);
1277
+ }, C = async () => {
1278
+ l.value && (l.value.innerText = o.name), d.value = !1;
1279
+ }, i = (g) => {
1280
+ if (d.value || o.disabled) return;
1281
+ let s = "selected";
1282
+ o.canExclude && (g.ctrlKey || g.metaKey) && (s = "excluded"), o.state == s && (s = ""), s === "" && a("unselect"), s === "selected" && a("select"), s === "excluded" && a("exclude");
933
1283
  };
934
- return (m, d) => (h(), C(ve, {
935
- class: Z({
1284
+ return (g, s) => (h(), j(Te, {
1285
+ class: ae({
936
1286
  "top-tagSelector_tagListItem": !0,
937
- "top-tagSelector_tagListItem-inEdit": u.value,
1287
+ "top-tagSelector_tagListItem-inEdit": d.value,
938
1288
  "top-tagSelector_tagListItem-disabled": e.disabled,
939
1289
  "top-tagSelector_tagListItem-canExclude": e.canExclude,
940
1290
  "top-tagSelector-active": !!e.state,
941
1291
  "top-tagSelector-excluded": e.state === "excluded"
942
1292
  }),
943
- onClick: U(i, ["stop"])
1293
+ onClick: H(i, ["stop"])
944
1294
  }, {
945
- default: B(() => [
946
- P(fe, {
1295
+ default: A(() => [
1296
+ O(Ce, {
947
1297
  id: e.id,
948
- name: r.value,
1298
+ name: n.value,
949
1299
  colorId: e.colorId,
950
1300
  state: e.state
951
1301
  }, null, 8, ["id", "name", "colorId", "state"]),
952
- oe("span", Ve({
1302
+ U("span", De({
953
1303
  ref_key: "elName",
954
1304
  ref: l,
955
1305
  class: "top-tagSelector_tagListItemName",
956
- contenteditable: u.value ? "plaintext-only" : !1
957
- }, n.value, {
1306
+ contenteditable: d.value ? "plaintext-only" : !1
1307
+ }, r.value, {
958
1308
  onKeydown: [
959
- Ie(U(c, ["stop"]), ["enter"]),
960
- Ie(U(x, ["stop"]), ["esc"])
1309
+ be(H(f, ["stop"]), ["enter"]),
1310
+ be(H(C, ["stop"]), ["esc"])
961
1311
  ]
962
- }), b(r.value), 17, Bt),
963
- e.editable ? (h(), A(Q, { key: 0 }, [
964
- u.value ? (h(), A("span", {
1312
+ }), b(n.value), 17, ro),
1313
+ e.editable ? (h(), T(D, { key: 0 }, [
1314
+ d.value ? (h(), T("span", {
965
1315
  key: 1,
966
1316
  "data-top-icon": "",
967
1317
  class: "top-tagSelector_edit",
968
- onClick: U(c, ["stop"])
969
- })) : (h(), A("span", {
1318
+ onClick: H(f, ["stop"])
1319
+ })) : (h(), T("span", {
970
1320
  key: 0,
971
1321
  "data-top-icon": "",
972
1322
  class: "top-tagSelector_edit",
973
- onClick: f
1323
+ onClick: c
974
1324
  }))
975
- ], 64)) : O("", !0)
1325
+ ], 64)) : E("", !0)
976
1326
  ]),
977
1327
  _: 1
978
1328
  }, 8, ["class"]));
979
1329
  }
980
- }), Tt = { key: 1 }, At = /* @__PURE__ */ R({
1330
+ }), io = { key: 1 }, so = /* @__PURE__ */ R({
981
1331
  inheritAttrs: !1,
982
1332
  __name: "popupOpener",
983
- props: /* @__PURE__ */ V({
1333
+ props: /* @__PURE__ */ _({
984
1334
  modelValue: {},
985
1335
  id: {},
986
1336
  tags: {},
@@ -998,61 +1348,61 @@ const mt = /* @__PURE__ */ R({
998
1348
  }),
999
1349
  emits: ["update:modelValue"],
1000
1350
  setup(e) {
1001
- const a = e, o = T(e, "modelValue"), t = a.useTopButton ? H : "div", r = a.useTopButton ? "html" : "default", l = {
1351
+ const t = e, o = w(e, "modelValue"), a = t.useTopButton ? te : "div", n = t.useTopButton ? "html" : "default", l = {
1002
1352
  model: o,
1003
- mode: a.mode,
1004
- targetId: a.targetId,
1005
- filters: a.filters,
1006
- payload: a.payload
1353
+ mode: t.mode,
1354
+ targetId: t.targetId,
1355
+ filters: t.filters,
1356
+ payload: t.payload
1007
1357
  };
1008
- return (n, u) => {
1009
- const f = Pe("top-data");
1010
- return h(), C(Je, { id: e.id }, {
1011
- default: B(() => [
1012
- Ne((h(), C(qe(v(t)), Ve({
1358
+ return (r, d) => {
1359
+ const c = Ze("top-data");
1360
+ return h(), j(nt, { id: e.id }, {
1361
+ default: A(() => [
1362
+ et((h(), j(tt(v(a)), De({
1013
1363
  class: {
1014
1364
  "top-tagSelector": !0,
1015
- "top-tagSelector-useTopButton": a.useTopButton,
1016
- "top-tagSelector-custom": !a.useTopButton,
1017
- "top-as-selector": a.useTopButton,
1018
- "top-tagSelector-filter": a.mode === "filter",
1019
- "top-tagSelector-setter_single": a.mode === "setter" && !e.filters,
1020
- "top-tagSelector-setter_several": a.mode === "setter" && e.filters,
1365
+ "top-tagSelector-useTopButton": t.useTopButton,
1366
+ "top-tagSelector-custom": !t.useTopButton,
1367
+ "top-as-selector": t.useTopButton,
1368
+ "top-tagSelector-filter": t.mode === "filter",
1369
+ "top-tagSelector-setter_single": t.mode === "setter" && !e.filters,
1370
+ "top-tagSelector-setter_several": t.mode === "setter" && e.filters,
1021
1371
  "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
1022
1372
  "top-tagSelector-toTwoLine": o.value.length > 5
1023
1373
  },
1024
1374
  color: "theme",
1025
1375
  styling: e.styling
1026
- }, n.$attrs), {
1027
- [v(r)]: B(() => [
1028
- !o.value.length && e.mode === "filter" ? (h(), C(fe, {
1376
+ }, r.$attrs), {
1377
+ [v(n)]: A(() => [
1378
+ !o.value.length && e.mode === "filter" ? (h(), j(Ce, {
1029
1379
  key: 0,
1030
1380
  id: "all",
1031
1381
  colorId: "",
1032
- name: n.$i18n.Common.All_tags ?? "",
1382
+ name: r.$i18n.Common.All_tags ?? "",
1033
1383
  state: ""
1034
- }, null, 8, ["name"])) : O("", !0),
1035
- e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
1036
- De(n.$slots, "default")
1037
- ])) : (h(!0), A(Q, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
1038
- id: v(X)(c),
1039
- colorId: v(ie)(c, e.tags)?.color_id ?? "",
1040
- name: v(ie)(c, e.tags)?.name ?? "",
1041
- state: v(X)(c) === c ? "selected" : "excluded"
1384
+ }, null, 8, ["name"])) : E("", !0),
1385
+ e.mode === "setter" && e.filters ? (h(), T("div", io, [
1386
+ ot(r.$slots, "default")
1387
+ ])) : (h(!0), T(D, { key: 2 }, me(o.value, (f) => (h(), j(Ce, {
1388
+ id: v(oe)(f),
1389
+ colorId: v(ge)(f, e.tags)?.color_id ?? "",
1390
+ name: v(ge)(f, e.tags)?.name ?? "",
1391
+ state: v(oe)(f) === f ? "selected" : "excluded"
1042
1392
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1043
1393
  ]),
1044
1394
  _: 2
1045
1395
  }, 1040, ["class", "styling"])), [
1046
- [f, l, "topTagSelectorTarget"]
1396
+ [c, l, "topTagSelectorTarget"]
1047
1397
  ])
1048
1398
  ]),
1049
1399
  _: 3
1050
1400
  }, 8, ["id"]);
1051
1401
  };
1052
1402
  }
1053
- }), Ut = /* @__PURE__ */ R({
1403
+ }), Po = /* @__PURE__ */ R({
1054
1404
  __name: "tagSelector",
1055
- props: /* @__PURE__ */ V({
1405
+ props: /* @__PURE__ */ _({
1056
1406
  modelValue: {},
1057
1407
  tags: {},
1058
1408
  tagsEditable: { type: Boolean },
@@ -1070,177 +1420,177 @@ const mt = /* @__PURE__ */ R({
1070
1420
  },
1071
1421
  modelModifiers: {},
1072
1422
  tags: {
1073
- default: be(kt)
1423
+ default: Oe(lo)
1074
1424
  },
1075
1425
  tagsModifiers: {}
1076
1426
  }),
1077
- emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1078
- setup(e, { emit: a }) {
1079
- const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
1080
- n(p, I);
1081
- }, t.emitDelay);
1082
- t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1083
- const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
1084
- const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1085
- 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;
1427
+ emits: /* @__PURE__ */ _(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1428
+ setup(e, { emit: t }) {
1429
+ const o = B(), a = e, n = w(e, "modelValue"), l = w(e, "tags"), r = t, d = lt((y, p) => {
1430
+ r(y, p);
1431
+ }, a.emitDelay);
1432
+ a.singleMode && !n.value.length && (n.value = [l.value[0].id]);
1433
+ const c = a.id ?? "top-popup-id-" + Math.random(), f = M("add"), C = () => {
1434
+ const y = " " + o.Common.Tags?.toLowerCase(), p = /* @__PURE__ */ new Map();
1435
+ return p.set("add", { value: "add", title: o.Common.Add + y }), p.set("replace", { value: "replace", title: o.Common.Replace + y }), p.set("delete", { value: "delete", title: o.Common.Delete + y }), p;
1086
1436
  };
1087
- let i = Fe({
1088
- model: r,
1437
+ let i = Ne({
1438
+ model: n,
1089
1439
  mode: "filter",
1090
1440
  targetId: void 0,
1091
1441
  filters: void 0,
1092
1442
  payload: void 0
1093
1443
  });
1094
- E(r, () => {
1095
- u("selector", r.value);
1444
+ G(n, () => {
1445
+ d("selector", n.value);
1096
1446
  });
1097
- const m = M(() => {
1098
- if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1099
- return i.value.model.value.length >= t.maxTagsForSetter;
1100
- }), d = (p) => {
1101
- if (p !== "all") {
1102
- if (i.value.model.value.includes(p)) return "selected";
1103
- if (i.value.model.value.includes(Be(p))) return "excluded";
1447
+ const g = P(() => {
1448
+ if (i.value.mode === "setter" && a.maxTagsForSetter && !i.value.filters)
1449
+ return i.value.model.value.length >= a.maxTagsForSetter;
1450
+ }), s = (y) => {
1451
+ if (y !== "all") {
1452
+ if (i.value.model.value.includes(y)) return "selected";
1453
+ if (i.value.model.value.includes(Le(y))) return "excluded";
1104
1454
  }
1105
- return p === "all" && !i.value.model.value.length ? "selected" : "";
1106
- }, s = (p, I) => {
1107
- const S = Be(p);
1108
- let k = i.value.model.value.filter((G) => G !== p && G !== S);
1109
- 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) => {
1110
- if (!t.tags) return 0;
1111
- const q = t.tags.findIndex((F) => F.id === G), D = t.tags.findIndex((F) => F.id === ee);
1112
- return q - D;
1113
- }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1455
+ return y === "all" && !i.value.model.value.length ? "selected" : "";
1456
+ }, u = (y, p) => {
1457
+ const x = Le(y);
1458
+ let k = i.value.model.value.filter((K) => K !== y && K !== x);
1459
+ p === "select" && k.push(y), p === "exclude" && k.push(x), i.value.mode === "setter" && i.value.targetId !== void 0 && a.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"))), a.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, le) => {
1460
+ if (!a.tags) return 0;
1461
+ const J = a.tags.findIndex((Y) => Y.id === K), z = a.tags.findIndex((Y) => Y.id === le);
1462
+ return J - z;
1463
+ }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && d("setter", {
1114
1464
  tagsIds: k,
1115
1465
  targetId: i.value.targetId,
1116
1466
  payload: i.value.payload
1117
1467
  });
1118
- }, g = M(() => {
1119
- let p = "top-tagSelector_popup";
1120
- return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
1121
- }), _ = () => {
1122
- const p = prompt("", "New tag");
1123
- if (!p || p === "New tag") return;
1124
- const I = l.value.length + 1;
1468
+ }, m = P(() => {
1469
+ let y = "top-tagSelector_popup";
1470
+ return i.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
1471
+ }), W = () => {
1472
+ const y = prompt("", "New tag");
1473
+ if (!y || y === "New tag") return;
1474
+ const p = l.value.length + 1;
1125
1475
  l.value.push({
1126
- id: String(I),
1127
- name: p,
1128
- color_id: String((I - 1) % 10 + 1)
1129
- }), n("tagsChanged", l.value);
1130
- }, N = (p) => {
1131
- if (i.value = W(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1132
- if (i.value.filters && (c.value = "add", i.value.model.value = []), !z.$?.ui.sortable) {
1476
+ id: String(p),
1477
+ name: y,
1478
+ color_id: String((p - 1) % 10 + 1)
1479
+ }), r("tagsChanged", l.value);
1480
+ }, I = (y) => {
1481
+ if (i.value = Z(y.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1482
+ if (i.value.filters && (f.value = "add", i.value.model.value = []), !X.$?.ui.sortable) {
1133
1483
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1134
1484
  return;
1135
1485
  }
1136
- !z.state.isMobile && !z.state.isMobileUA && l.value && $(p.elPopup).sortable({
1486
+ !X.state.isMobile && !X.state.isMobileUA && l.value && $(y.elPopup).sortable({
1137
1487
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
1138
1488
  /**
1139
1489
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
1140
1490
  */
1141
1491
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
1142
1492
  distance: 10,
1143
- stop: function(I, S) {
1493
+ stop: function(p, x) {
1144
1494
  if (!l.value) return;
1145
- const k = $(S.item).parent().find("[data-tag_id]"), G = [];
1146
- k.each((ee, q) => {
1495
+ const k = $(x.item).parent().find("[data-tag_id]"), K = [];
1496
+ k.each((le, J) => {
1147
1497
  if (!l.value) return;
1148
- const D = $(q).attr("data-tag_id");
1149
- G.push(D);
1150
- }), l.value.sort((ee, q) => {
1151
- const D = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === q.id);
1152
- return D - F;
1153
- }), u("tagsChanged", l.value);
1498
+ const z = $(J).attr("data-tag_id");
1499
+ K.push(z);
1500
+ }), l.value.sort((le, J) => {
1501
+ const z = K.findIndex((ve) => ve === le.id), Y = K.findIndex((ve) => ve === J.id);
1502
+ return z - Y;
1503
+ }), d("tagsChanged", l.value);
1154
1504
  }
1155
1505
  });
1156
- }, je = (p) => {
1157
- z.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
1506
+ }, L = (y) => {
1507
+ X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
1158
1508
  };
1159
- return (p, I) => (h(), A(Q, null, [
1160
- P(At, {
1161
- modelValue: r.value,
1162
- "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
1163
- id: v(f),
1509
+ return (y, p) => (h(), T(D, null, [
1510
+ O(so, {
1511
+ modelValue: n.value,
1512
+ "onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
1513
+ id: v(c),
1164
1514
  tags: l.value,
1165
1515
  styling: e.styling,
1166
1516
  mode: "filter",
1167
1517
  useTopButton: e.useTopButton
1168
1518
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1169
- P(we, {
1170
- id: v(f),
1171
- class: Z(g.value),
1172
- onOpen: I[4] || (I[4] = (S) => N(S)),
1173
- onClose: I[5] || (I[5] = (S) => je(S)),
1519
+ O(ke, {
1520
+ id: v(c),
1521
+ class: ae(m.value),
1522
+ onOpen: p[4] || (p[4] = (x) => I(x)),
1523
+ onClose: p[5] || (p[5] = (x) => L(x)),
1174
1524
  "transition-duration": 50
1175
- }, Ue({
1176
- contentList: B(() => [
1177
- v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
1525
+ }, at({
1526
+ contentList: A(() => [
1527
+ v(i).mode === "filter" && !e.singleMode ? (h(), j(Ke, {
1178
1528
  key: 0,
1179
1529
  id: "all",
1180
1530
  colorId: "",
1181
- name: p.$i18n.Common.All_tags ?? "",
1531
+ name: y.$i18n.Common.All_tags ?? "",
1182
1532
  state: v(i).model.value.length ? "" : "selected",
1183
- onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
1184
- }, null, 8, ["name", "state"])) : O("", !0),
1185
- (h(!0), A(Q, null, me(l.value, (S) => (h(), C(Ae, {
1186
- key: S.id,
1187
- id: S.id,
1188
- colorId: S.color_id,
1189
- name: S.name,
1190
- state: d(S.id),
1533
+ onSelect: p[3] || (p[3] = (x) => v(i).model.value = [])
1534
+ }, null, 8, ["name", "state"])) : E("", !0),
1535
+ (h(!0), T(D, null, me(l.value, (x) => (h(), j(Ke, {
1536
+ key: x.id,
1537
+ id: x.id,
1538
+ colorId: x.color_id,
1539
+ name: x.name,
1540
+ state: s(x.id),
1191
1541
  canExclude: v(i).mode === "filter" && !e.singleMode,
1192
1542
  editable: e.tagsEditable,
1193
- disabled: m.value && d(S.id) === "",
1194
- onUnselect: (k) => s(S.id, "unselect"),
1195
- onSelect: (k) => s(S.id, "select"),
1196
- onExclude: (k) => s(S.id, "exclude"),
1543
+ disabled: g.value && s(x.id) === "",
1544
+ onUnselect: (k) => u(x.id, "unselect"),
1545
+ onSelect: (k) => u(x.id, "select"),
1546
+ onExclude: (k) => u(x.id, "exclude"),
1197
1547
  "onUpdate:name": (k) => {
1198
- S.name = k, v(u)("tagsChanged", l.value);
1548
+ x.name = k, v(d)("tagsChanged", l.value);
1199
1549
  }
1200
1550
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1201
- e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
1551
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j(Te, {
1202
1552
  key: 1,
1203
1553
  "data-top-icon": "",
1204
- onClick: U(_, ["stop"])
1554
+ onClick: H(W, ["stop"])
1205
1555
  }, {
1206
- default: B(() => [
1207
- J(b(p.$i18n.Common.Add), 1)
1556
+ default: A(() => [
1557
+ q(b(y.$i18n.Common.Add), 1)
1208
1558
  ]),
1209
1559
  _: 1
1210
- })) : O("", !0)
1560
+ })) : E("", !0)
1211
1561
  ]),
1212
1562
  _: 2
1213
1563
  }, [
1214
1564
  v(i).mode === "setter" && v(i).filters ? {
1215
1565
  name: "header",
1216
- fn: B(() => [
1217
- P(ce, {
1218
- modelValue: c.value,
1219
- "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
1220
- options: x()
1566
+ fn: A(() => [
1567
+ O(Se, {
1568
+ modelValue: f.value,
1569
+ "onUpdate:modelValue": p[1] || (p[1] = (x) => f.value = x),
1570
+ options: C()
1221
1571
  }, null, 8, ["modelValue", "options"])
1222
1572
  ]),
1223
1573
  key: "0"
1224
1574
  } : void 0,
1225
1575
  v(i).mode === "setter" && v(i).filters ? {
1226
1576
  name: "footer",
1227
- fn: B(() => [
1228
- P(H, { color: "theme" }, {
1229
- default: B(() => [
1230
- J(b(p.$i18n.Common.Cancel), 1)
1577
+ fn: A(() => [
1578
+ O(te, { color: "theme" }, {
1579
+ default: A(() => [
1580
+ q(b(y.$i18n.Common.Cancel), 1)
1231
1581
  ]),
1232
1582
  _: 1
1233
1583
  }),
1234
- P(H, {
1235
- onClick: I[2] || (I[2] = (S) => v(u)("setter", {
1584
+ O(te, {
1585
+ onClick: p[2] || (p[2] = (x) => v(d)("setter", {
1236
1586
  tagsIds: v(i).model.value,
1237
1587
  filters: v(i).filters,
1238
- filtersAction: c.value,
1588
+ filtersAction: f.value,
1239
1589
  payload: v(i).payload
1240
1590
  }))
1241
1591
  }, {
1242
- default: B(() => [
1243
- 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)
1592
+ default: A(() => [
1593
+ q(b(f.value === "add" ? y.$i18n.Common.Add : "") + " " + b(f.value === "replace" ? y.$i18n.Common.Replace : "") + " " + b(f.value === "delete" ? y.$i18n.Common.Delete : ""), 1)
1244
1594
  ]),
1245
1595
  _: 1
1246
1596
  })
@@ -1252,17 +1602,19 @@ const mt = /* @__PURE__ */ R({
1252
1602
  }
1253
1603
  });
1254
1604
  export {
1255
- Rt as TopCompetitorSelector,
1256
- qt as TopGroupSelector,
1257
- Nt as TopRegionSelector,
1258
- Ut as TopTagSelector,
1259
- At as TopTagSelectorPopupOpener,
1260
- fe as TopTagSelectorTagIcon,
1261
- it as dialogRegionSelector,
1262
- rt as findRegion,
1263
- Dt as genElTopTagSelectorPopupOpener,
1264
- Ke as genSearcherByKey,
1265
- Ft as renderElTopTagSelectorPopupOpener,
1266
- Pt as useItemsFromCompetitors
1605
+ To as TopCompetitorSelector,
1606
+ Bo as TopGroupSelector,
1607
+ $o as TopProjectSelector,
1608
+ Ao as TopRegionSelector,
1609
+ Po as TopTagSelector,
1610
+ so as TopTagSelectorPopupOpener,
1611
+ Ce as TopTagSelectorTagIcon,
1612
+ Xt as clearCache,
1613
+ kt as dialogRegionSelector,
1614
+ Ct as findRegion,
1615
+ bo as genElTopTagSelectorPopupOpener,
1616
+ He as genSearcherByKey,
1617
+ wo as renderElTopTagSelectorPopupOpener,
1618
+ jo as useItemsFromCompetitors
1267
1619
  };
1268
1620
  //# sourceMappingURL=project.js.map