@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.
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js +517 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BavS2pf9.es.js.map +1 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js +2 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-gH1s78kS.amd.js.map +1 -0
- package/assets/policy.css +1 -1
- package/assets/project.css +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.js +1 -1
- package/icomoon/Topvisor icons.json +285 -229
- package/icomoon/demo.html +29 -1
- package/icomoon/fonts/Topvisor-2.eot +0 -0
- package/icomoon/fonts/Topvisor-2.svg +2 -0
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +11 -5
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +977 -625
- package/project/project.js.map +1 -1
- package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -1
- package/src/components/formsExt/selector2/selector2.vue.d.ts +2 -0
- package/src/components/formsExt/selector2/types.d.ts +29 -1
- package/src/components/formsExt/selector2/utils.d.ts +2 -0
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +10 -2
- package/src/components/project/groupSelector/groups/utils.d.ts +1 -1
- package/src/components/project/project.d.ts +2 -0
- package/src/components/project/projectSelector/cache.d.ts +29 -0
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +129 -0
- package/src/components/project/projectSelector/submenu/submenu.vue.d.ts +4 -0
- package/src/components/project/projectSelector/submenu/types.d.ts +17 -0
- package/src/components/project/projectSelector/types.d.ts +48 -0
- package/src/components/project/projectSelector/utils.d.ts +230 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js +0 -2
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js.map +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js +0 -498
- package/.chunks/policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -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
|
|
7
|
-
import { u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { u as
|
|
11
|
-
import { getSearcherGIcon as
|
|
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
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
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__ */
|
|
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
|
|
30
|
-
if (
|
|
32
|
+
const t = e, o = w(e, "modelValue"), a = P(() => {
|
|
33
|
+
if (t.showSelectAllItem)
|
|
31
34
|
return {
|
|
32
35
|
icon: "",
|
|
33
|
-
title:
|
|
36
|
+
title: B().Common.Select_all,
|
|
34
37
|
value: "all",
|
|
35
38
|
content: ""
|
|
36
39
|
};
|
|
37
40
|
});
|
|
38
|
-
return (
|
|
39
|
-
v(
|
|
40
|
-
opener:
|
|
41
|
-
|
|
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:
|
|
48
|
-
|
|
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:
|
|
54
|
-
(h(!0),
|
|
55
|
-
class:
|
|
56
|
-
"top-active": o.value?.includes(
|
|
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":
|
|
59
|
-
title:
|
|
60
|
-
onClick: () => o.value = [
|
|
61
|
+
"data-top-icon": r.icon,
|
|
62
|
+
title: r.title,
|
|
63
|
+
onClick: () => o.value = [r.value]
|
|
61
64
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
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(),
|
|
72
|
+
})) : (h(), j(rt, {
|
|
70
73
|
key: 1,
|
|
71
74
|
modelValue: o.value,
|
|
72
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
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:
|
|
80
|
+
selectAllItem: a.value
|
|
78
81
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
79
82
|
]));
|
|
80
83
|
}
|
|
81
|
-
}),
|
|
82
|
-
value:
|
|
83
|
-
title:
|
|
84
|
-
icon:
|
|
85
|
-
content:
|
|
86
|
-
}))),
|
|
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
|
-
},
|
|
97
|
-
key:
|
|
99
|
+
}, we = {
|
|
100
|
+
key: S,
|
|
98
101
|
name: "--",
|
|
99
|
-
index:
|
|
100
|
-
},
|
|
101
|
-
key:
|
|
102
|
+
index: S
|
|
103
|
+
}, We = {
|
|
104
|
+
key: S,
|
|
102
105
|
name: "--",
|
|
103
|
-
regions: [
|
|
104
|
-
regionByIndex: /* @__PURE__ */ new Map([[
|
|
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:
|
|
109
|
+
key: S,
|
|
110
|
+
name: "Autoselect",
|
|
111
|
+
index: S
|
|
112
|
+
}, he = {
|
|
113
|
+
key: S,
|
|
111
114
|
name: "Autoselect",
|
|
112
|
-
regions: [
|
|
113
|
-
regionByIndex: /* @__PURE__ */ new Map([[
|
|
114
|
-
},
|
|
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:
|
|
119
|
-
index:
|
|
121
|
+
key: de,
|
|
122
|
+
index: de,
|
|
120
123
|
lang: "ru",
|
|
121
124
|
name: "Without region"
|
|
122
|
-
},
|
|
123
|
-
let
|
|
124
|
-
return e ?
|
|
125
|
-
},
|
|
126
|
-
const
|
|
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 ||
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
}), !
|
|
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
|
-
|
|
137
|
-
o.length) &&
|
|
139
|
+
r.regionByIndex.size || // запрошен вывод конкретных ПС
|
|
140
|
+
o.length) && n.set(r.key, r);
|
|
138
141
|
}), o.forEach((l) => {
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
142
|
+
if (n.has(l)) return;
|
|
143
|
+
const r = {
|
|
141
144
|
key: l,
|
|
142
|
-
name:
|
|
145
|
+
name: ht[l],
|
|
143
146
|
regions: [],
|
|
144
147
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
145
148
|
};
|
|
146
|
-
|
|
147
|
-
}),
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
const o =
|
|
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
|
|
157
|
+
return t.forEach((o) => {
|
|
155
158
|
if (!o.regionByIndex) return;
|
|
156
|
-
const
|
|
157
|
-
o.regionByIndex.set(
|
|
158
|
-
}),
|
|
159
|
-
},
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
return
|
|
163
|
-
if (!(
|
|
164
|
-
if (!
|
|
165
|
-
return
|
|
166
|
-
}),
|
|
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
|
-
}),
|
|
169
|
-
},
|
|
170
|
-
const o =
|
|
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 (
|
|
173
|
-
let
|
|
174
|
-
value:
|
|
175
|
-
title:
|
|
175
|
+
if (t.value.forEach((r) => {
|
|
176
|
+
let d = {
|
|
177
|
+
value: r.key,
|
|
178
|
+
title: r.name
|
|
176
179
|
};
|
|
177
|
-
e.addSearcherIcon && (
|
|
178
|
-
}), e.addCompare && !l.has(
|
|
179
|
-
const
|
|
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(
|
|
185
|
-
const
|
|
186
|
-
value:
|
|
187
|
+
l.set(r.value, r);
|
|
188
|
+
const d = {
|
|
189
|
+
value: N,
|
|
187
190
|
title: o.Common.Compare
|
|
188
191
|
};
|
|
189
|
-
l.set(
|
|
192
|
+
l.set(d.value, d);
|
|
190
193
|
}
|
|
191
194
|
return l;
|
|
192
195
|
});
|
|
193
196
|
return {
|
|
194
|
-
searcherKey:
|
|
195
|
-
optionBySearcherKey:
|
|
197
|
+
searcherKey: a,
|
|
198
|
+
optionBySearcherKey: n
|
|
196
199
|
};
|
|
197
|
-
},
|
|
198
|
-
const o =
|
|
199
|
-
e.modelValue.length === 1 && (
|
|
200
|
-
const
|
|
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
|
|
203
|
-
let
|
|
205
|
+
return t.value.regionByIndex?.forEach((r) => {
|
|
206
|
+
let d = r.name;
|
|
204
207
|
if (e.forFrequency) {
|
|
205
|
-
const
|
|
206
|
-
value:
|
|
207
|
-
title:
|
|
208
|
+
const C = {
|
|
209
|
+
value: r.key,
|
|
210
|
+
title: d
|
|
208
211
|
};
|
|
209
|
-
l.has(
|
|
212
|
+
l.has(r.key) || l.set(r.key, C);
|
|
210
213
|
return;
|
|
211
214
|
}
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
value:
|
|
217
|
-
title:
|
|
218
|
-
icon:
|
|
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(
|
|
223
|
+
l.set(r.index, f);
|
|
221
224
|
}), l;
|
|
222
225
|
});
|
|
223
|
-
return
|
|
224
|
-
if (e.onlySearcher ||
|
|
226
|
+
return G(n, (l, r) => {
|
|
227
|
+
if (e.onlySearcher || a.value !== void 0 && l.get(a.value))
|
|
225
228
|
return;
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
228
|
-
|
|
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
|
|
232
|
-
for (const [
|
|
233
|
-
const
|
|
234
|
-
if (typeof
|
|
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 (
|
|
237
|
-
|
|
239
|
+
if (g === c) {
|
|
240
|
+
d = C;
|
|
238
241
|
break;
|
|
239
242
|
}
|
|
240
|
-
const
|
|
241
|
-
let
|
|
242
|
-
|
|
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
|
-
|
|
247
|
+
a.value = d;
|
|
245
248
|
}), {
|
|
246
|
-
regionIndex:
|
|
247
|
-
optionByRegionIndex:
|
|
249
|
+
regionIndex: a,
|
|
250
|
+
optionByRegionIndex: n
|
|
248
251
|
};
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
if (e.onlySearcher &&
|
|
252
|
-
|
|
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
|
|
258
|
+
let r = [];
|
|
256
259
|
if (e.modelValue.length > 1)
|
|
257
|
-
|
|
260
|
+
r = [...e.modelValue];
|
|
258
261
|
else
|
|
259
262
|
try {
|
|
260
|
-
|
|
263
|
+
r = JSON.parse(
|
|
261
264
|
localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
|
|
262
265
|
) ?? [];
|
|
263
266
|
} catch {
|
|
264
267
|
}
|
|
265
|
-
|
|
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
|
-
|
|
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
|
|
272
|
+
return G(a, () => {
|
|
270
273
|
l();
|
|
271
|
-
}), e.addCompare &&
|
|
272
|
-
regionsIndexes:
|
|
274
|
+
}), e.addCompare && n(), {
|
|
275
|
+
regionsIndexes: a
|
|
273
276
|
};
|
|
274
|
-
},
|
|
275
|
-
const
|
|
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
|
|
278
|
-
|
|
279
|
-
|
|
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
|
-
}),
|
|
283
|
-
|
|
284
|
-
if (e.onlySearcher ?
|
|
285
|
-
let i =
|
|
286
|
-
|
|
287
|
-
if (e.onlySearcher &&
|
|
288
|
-
i =
|
|
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 &&
|
|
292
|
-
let
|
|
293
|
-
i !== void 0 && (
|
|
294
|
-
const
|
|
295
|
-
|
|
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 && (
|
|
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
|
|
300
|
-
if (!(
|
|
301
|
-
return
|
|
302
|
-
},
|
|
303
|
-
if (e.onlySearcher || l.regionIndex.value ===
|
|
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
|
|
307
|
-
i =
|
|
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
|
-
},
|
|
311
|
-
const i =
|
|
313
|
+
}, f = () => {
|
|
314
|
+
const i = d();
|
|
312
315
|
if (i !== void 0)
|
|
313
|
-
return
|
|
316
|
+
return t.value.get(i);
|
|
314
317
|
};
|
|
315
318
|
return {
|
|
316
|
-
selectSearcher:
|
|
319
|
+
selectSearcher: n,
|
|
317
320
|
selectRegion: l,
|
|
318
|
-
compare:
|
|
319
|
-
searcherByKey:
|
|
320
|
-
allRegionsIndexes:
|
|
321
|
-
getSearcher:
|
|
321
|
+
compare: r,
|
|
322
|
+
searcherByKey: t,
|
|
323
|
+
allRegionsIndexes: a,
|
|
324
|
+
getSearcher: f,
|
|
322
325
|
getRegion: () => {
|
|
323
|
-
const i =
|
|
326
|
+
const i = c();
|
|
324
327
|
if (i !== void 0)
|
|
325
|
-
return
|
|
328
|
+
return f()?.regionByIndex?.get(i);
|
|
326
329
|
}
|
|
327
330
|
};
|
|
328
|
-
},
|
|
331
|
+
}, Ao = /* @__PURE__ */ R({
|
|
329
332
|
__name: "regionSelector",
|
|
330
|
-
props: /* @__PURE__ */
|
|
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:
|
|
350
|
-
const o = e,
|
|
352
|
+
setup(e, { expose: t }) {
|
|
353
|
+
const o = e, a = w(e, "modelValue"), n = w(e, "modelValueSingle"), {
|
|
351
354
|
selectSearcher: l,
|
|
352
|
-
selectRegion:
|
|
353
|
-
compare:
|
|
354
|
-
searcherByKey:
|
|
355
|
-
allRegionsIndexes:
|
|
356
|
-
getSearcher:
|
|
355
|
+
selectRegion: r,
|
|
356
|
+
compare: d,
|
|
357
|
+
searcherByKey: c,
|
|
358
|
+
allRegionsIndexes: f,
|
|
359
|
+
getSearcher: C,
|
|
357
360
|
getRegion: i
|
|
358
|
-
} =
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
}),
|
|
365
|
-
regions:
|
|
366
|
-
regionsIndexes:
|
|
367
|
-
"@update:regionsIndexes": (
|
|
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
|
|
371
|
-
if (l.searcherKey.value ===
|
|
372
|
-
if (JSON.stringify(
|
|
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
|
-
|
|
377
|
+
a.value = [...d.regionsIndexes.value];
|
|
375
378
|
} else
|
|
376
|
-
o.onlySearcher ? (
|
|
377
|
-
!o.onlySearcher && !
|
|
378
|
-
}),
|
|
379
|
-
|
|
380
|
-
}, { immediate: !0 }),
|
|
381
|
-
if (
|
|
382
|
-
if (!
|
|
383
|
-
let
|
|
384
|
-
|
|
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 (
|
|
388
|
-
|
|
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
|
|
393
|
-
if (o.forFrequency && (
|
|
394
|
-
|
|
395
|
-
else if (
|
|
396
|
-
let
|
|
397
|
-
o.forFrequency && (
|
|
398
|
-
|
|
399
|
-
|
|
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
|
-
})),
|
|
404
|
+
})), m.has(s[0]) || (s = [], u !== void 0 && s.push(u));
|
|
402
405
|
} else
|
|
403
|
-
|
|
404
|
-
if (JSON.stringify(
|
|
405
|
-
|
|
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 (!(
|
|
412
|
+
if (!(a.value.length === 1 && a.value[0] === (o.onlySearcher ? l.searcherKey.value : r.regionIndex.value)))
|
|
410
413
|
if (o.onlySearcher) {
|
|
411
|
-
if (
|
|
412
|
-
l.searcherKey.value =
|
|
414
|
+
if (a.value.length === 1) {
|
|
415
|
+
l.searcherKey.value = a.value[0];
|
|
413
416
|
return;
|
|
414
417
|
}
|
|
415
|
-
l.searcherKey.value =
|
|
418
|
+
l.searcherKey.value = N;
|
|
416
419
|
return;
|
|
417
420
|
} else {
|
|
418
|
-
if (!
|
|
421
|
+
if (!a.value.length)
|
|
419
422
|
return;
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
let
|
|
423
|
-
for (const
|
|
424
|
-
for (const
|
|
425
|
-
if ((o.forFrequency ?
|
|
426
|
-
|
|
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 (
|
|
432
|
+
if (s !== void 0)
|
|
430
433
|
break;
|
|
431
434
|
}
|
|
432
|
-
|
|
435
|
+
s !== void 0 && (l.searcherKey.value = s);
|
|
433
436
|
} else
|
|
434
|
-
l.searcherKey.value =
|
|
437
|
+
l.searcherKey.value = N, d.regionsIndexes.value = [...a.value];
|
|
435
438
|
}
|
|
436
|
-
}, { immediate: !0 }),
|
|
437
|
-
getSearcher:
|
|
439
|
+
}, { immediate: !0 }), t({
|
|
440
|
+
getSearcher: C,
|
|
438
441
|
getRegion: i
|
|
439
|
-
}), (
|
|
440
|
-
class:
|
|
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
|
-
|
|
448
|
+
O(Se, {
|
|
446
449
|
options: v(l).optionBySearcherKey.value,
|
|
447
450
|
modelValue: v(l).searcherKey.value,
|
|
448
|
-
"onUpdate:modelValue":
|
|
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(
|
|
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(
|
|
456
|
-
modelValue: v(
|
|
457
|
-
"onUpdate:modelValue":
|
|
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"])) :
|
|
462
|
-
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(
|
|
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:
|
|
466
|
-
"data-count-compare-regions-indexes": v(
|
|
468
|
+
onClick: g,
|
|
469
|
+
"data-count-compare-regions-indexes": v(d).regionsIndexes.value.length
|
|
467
470
|
}, {
|
|
468
|
-
default:
|
|
469
|
-
|
|
471
|
+
default: A(() => [
|
|
472
|
+
q(b(s.$i18n.Common.Selected_regions), 1)
|
|
470
473
|
]),
|
|
471
474
|
_: 1
|
|
472
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
475
|
+
}, 8, ["data-count-compare-regions-indexes"])) : E("", !0)
|
|
473
476
|
], 2));
|
|
474
477
|
}
|
|
475
|
-
}),
|
|
478
|
+
}), F = {
|
|
476
479
|
id: 0,
|
|
477
480
|
name: "/",
|
|
478
481
|
path: "/"
|
|
479
482
|
};
|
|
480
|
-
function
|
|
481
|
-
return e ?
|
|
483
|
+
function $t(e) {
|
|
484
|
+
return e ? B()?.Common.All_folders : "/ (" + B()?.Keywords.Root_folder + ")";
|
|
482
485
|
}
|
|
483
|
-
const
|
|
484
|
-
l = { ...l },
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
}), o),
|
|
488
|
-
function
|
|
489
|
-
const
|
|
490
|
-
return
|
|
491
|
-
const
|
|
492
|
-
l.forEach((
|
|
493
|
-
if (!Object.is(
|
|
494
|
-
const i =
|
|
495
|
-
|
|
496
|
-
old:
|
|
497
|
-
new:
|
|
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(
|
|
503
|
+
}), Object.keys(c).length && t(c, d);
|
|
501
504
|
}, o);
|
|
502
505
|
}
|
|
503
|
-
const
|
|
506
|
+
const wt = /* @__PURE__ */ R({
|
|
504
507
|
__name: "folders",
|
|
505
|
-
props: /* @__PURE__ */
|
|
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:
|
|
521
|
+
folder: { default: F },
|
|
519
522
|
folderModifiers: {}
|
|
520
523
|
}),
|
|
521
524
|
emits: ["update:folderId", "update:folder"],
|
|
522
525
|
setup(e) {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
project_id:
|
|
527
|
-
}),
|
|
528
|
-
checkFingerprint: "TopGroupSelectorFolders:" +
|
|
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
|
|
532
|
-
return
|
|
533
|
-
modelFolder:
|
|
534
|
+
const r = P(() => Ae(t.folders ?? { root: [F] }, t.canSelectAll));
|
|
535
|
+
return Ie({
|
|
536
|
+
modelFolder: a,
|
|
534
537
|
modelFolderId: o
|
|
535
|
-
}, async (
|
|
536
|
-
if (o.value ===
|
|
538
|
+
}, async (d) => {
|
|
539
|
+
if (o.value === a.value.id)
|
|
537
540
|
return;
|
|
538
|
-
if (
|
|
539
|
-
o.value =
|
|
541
|
+
if (d.modelFolder && !d.modelFolderId) {
|
|
542
|
+
o.value = a.value.id;
|
|
540
543
|
return;
|
|
541
544
|
}
|
|
542
|
-
let
|
|
543
|
-
|
|
544
|
-
}, { immediate: !0 }), (
|
|
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:
|
|
547
|
-
"onUpdate:modelValue":
|
|
548
|
-
items: e.folders ? [...
|
|
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(
|
|
552
|
-
apiSetSearchParams: (...
|
|
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
|
-
}),
|
|
560
|
+
}), ue = {
|
|
558
561
|
id: -1,
|
|
559
562
|
name: "--",
|
|
560
|
-
folder_id:
|
|
561
|
-
folder_path:
|
|
562
|
-
},
|
|
563
|
-
id:
|
|
563
|
+
folder_id: F.id,
|
|
564
|
+
folder_path: F.path
|
|
565
|
+
}, ce = {
|
|
566
|
+
id: qe,
|
|
564
567
|
name: "All groups",
|
|
565
|
-
folder_id:
|
|
566
|
-
folder_path:
|
|
567
|
-
},
|
|
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
|
-
},
|
|
573
|
+
}, _t = {
|
|
571
574
|
key: 1,
|
|
572
575
|
class: "top-groupSelector_groupItemFolderPath"
|
|
573
|
-
},
|
|
576
|
+
}, Gt = /* @__PURE__ */ R({
|
|
574
577
|
__name: "groups",
|
|
575
|
-
props: /* @__PURE__ */
|
|
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__ */
|
|
597
|
-
setup(e, { emit:
|
|
598
|
-
const o = e,
|
|
599
|
-
|
|
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
|
-
|
|
606
|
+
C
|
|
604
607
|
]
|
|
605
|
-
}), o.on !== void 0 &&
|
|
606
|
-
const i = (
|
|
607
|
-
l.value =
|
|
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
|
-
|
|
612
|
+
Ie({
|
|
610
613
|
projectId: () => o.projectId,
|
|
611
614
|
folderId: () => o.folder?.id,
|
|
612
615
|
canSelectAll: () => o.canSelectAll
|
|
613
|
-
}, (
|
|
614
|
-
if (
|
|
616
|
+
}, (s) => {
|
|
617
|
+
if (s.projectId && (r?.changeParams({
|
|
615
618
|
project_id: o.projectId
|
|
616
|
-
}),
|
|
619
|
+
}), r?.setOptions({
|
|
617
620
|
checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
|
|
618
|
-
})),
|
|
621
|
+
})), s.folderId && (C.values = [
|
|
619
622
|
o.folder?.id ?? 0
|
|
620
|
-
], o.groups && (
|
|
621
|
-
let
|
|
622
|
-
o.autoselect === "first" && (
|
|
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 }),
|
|
627
|
+
}, { immediate: !0 }), Ie({
|
|
625
628
|
modelGroup: l,
|
|
626
|
-
modelGroupId:
|
|
627
|
-
}, async (
|
|
628
|
-
if (
|
|
629
|
-
if (
|
|
630
|
-
|
|
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 &&
|
|
636
|
+
if (!(o.canAdd && n.value === pe)) {
|
|
634
637
|
if (o.groups) {
|
|
635
|
-
let
|
|
636
|
-
if (!
|
|
637
|
-
i(
|
|
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
|
|
640
|
-
|
|
642
|
+
const m = f.value?.[0];
|
|
643
|
+
m && !n.value ? i(m) : i(ue);
|
|
641
644
|
}
|
|
642
645
|
}
|
|
643
|
-
if (o.client && !o.groups && (
|
|
644
|
-
const
|
|
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:
|
|
649
|
+
id: n.value,
|
|
647
650
|
filters: [
|
|
648
|
-
|
|
651
|
+
C
|
|
649
652
|
]
|
|
650
653
|
});
|
|
651
|
-
|
|
654
|
+
u?.setOptions({
|
|
652
655
|
checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
|
|
653
656
|
});
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
656
|
-
!
|
|
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
|
|
662
|
-
if (o.canAdd !== "api" || !
|
|
663
|
-
const
|
|
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: [
|
|
666
|
-
to_id: o.folder?.id ??
|
|
668
|
+
names: [s.name],
|
|
669
|
+
to_id: o.folder?.id ?? F.id,
|
|
667
670
|
to_type: "in_folder_last"
|
|
668
671
|
}).call();
|
|
669
|
-
|
|
672
|
+
m.result ? (i(m.result), a("addGroup", m.result)) : i(u), c.value?.resetCache(!0);
|
|
670
673
|
};
|
|
671
|
-
return (
|
|
674
|
+
return (s, u) => (h(), j(je, {
|
|
672
675
|
ref_key: "refSelector",
|
|
673
|
-
ref:
|
|
676
|
+
ref: c,
|
|
674
677
|
class: "top-groupSelector_group",
|
|
675
678
|
modelValue: l.value,
|
|
676
|
-
"onUpdate:modelValue":
|
|
677
|
-
items:
|
|
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(
|
|
681
|
-
apiSetSearchParams: (...
|
|
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(
|
|
686
|
+
useAllItem: e.canSelectAll ? v(ee)().name : !1,
|
|
684
687
|
addChanger: e.addChanger,
|
|
685
688
|
useCache: "",
|
|
686
|
-
onAppendItem:
|
|
689
|
+
onAppendItem: g
|
|
687
690
|
}, {
|
|
688
|
-
item:
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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
|
-
}),
|
|
701
|
+
}), Lt = { class: "top-groupSelector" }, Bo = /* @__PURE__ */ R({
|
|
699
702
|
__name: "groupSelector",
|
|
700
|
-
props: /* @__PURE__ */
|
|
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:
|
|
728
|
+
group: { default: ue },
|
|
726
729
|
groupModifiers: {}
|
|
727
730
|
}),
|
|
728
|
-
emits: /* @__PURE__ */
|
|
729
|
-
setup(e, { emit:
|
|
730
|
-
const o = e,
|
|
731
|
-
|
|
732
|
-
let
|
|
733
|
-
l.value || (
|
|
734
|
-
const
|
|
735
|
-
let
|
|
736
|
-
o.groups && i && (
|
|
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,
|
|
739
|
-
e.showFolders ? (h(),
|
|
741
|
+
return (i, g) => (h(), T("div", Lt, [
|
|
742
|
+
e.showFolders ? (h(), j(wt, {
|
|
740
743
|
key: 0,
|
|
741
|
-
folderId:
|
|
742
|
-
"onUpdate:folderId":
|
|
743
|
-
folder:
|
|
744
|
-
"onUpdate:folder":
|
|
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"])) :
|
|
753
|
-
e.showGroups ? (h(),
|
|
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":
|
|
757
|
-
group:
|
|
758
|
-
"onUpdate:group":
|
|
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:
|
|
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:
|
|
772
|
-
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) :
|
|
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
|
-
}),
|
|
776
|
-
|
|
777
|
-
|
|
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
|
-
},
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
return
|
|
784
|
-
|
|
785
|
-
const l =
|
|
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
|
-
|
|
793
|
-
e.modelValue = l.value,
|
|
794
|
-
}),
|
|
795
|
-
},
|
|
796
|
-
e.modelValue =
|
|
797
|
-
const l =
|
|
798
|
-
l && (l.model.value =
|
|
799
|
-
}),
|
|
800
|
-
},
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
const
|
|
804
|
-
if (e.classList.toggle("top-tagSelector-selectedOne", !
|
|
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 = "", !
|
|
809
|
-
const
|
|
1158
|
+
if (e.innerHTML = "", !a.length && t.mode === "filter") {
|
|
1159
|
+
const n = Re({
|
|
810
1160
|
id: "all",
|
|
811
1161
|
colorId: "",
|
|
812
|
-
name:
|
|
1162
|
+
name: B().Common?.All_tags ?? "",
|
|
813
1163
|
state: ""
|
|
814
1164
|
});
|
|
815
|
-
e.append(
|
|
1165
|
+
e.append(n);
|
|
816
1166
|
}
|
|
817
|
-
|
|
818
|
-
const l =
|
|
819
|
-
id:
|
|
820
|
-
colorId:
|
|
821
|
-
name:
|
|
822
|
-
state:
|
|
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
|
-
},
|
|
827
|
-
const
|
|
828
|
-
return
|
|
829
|
-
},
|
|
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
|
-
],
|
|
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 (
|
|
890
|
-
class:
|
|
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,
|
|
1248
|
+
}, null, 10, no));
|
|
899
1249
|
}
|
|
900
|
-
}),
|
|
1250
|
+
}), ro = ["contenteditable", "onKeydown"], Ke = /* @__PURE__ */ R({
|
|
901
1251
|
__name: "tagPopupListItem",
|
|
902
|
-
props: /* @__PURE__ */
|
|
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__ */
|
|
917
|
-
setup(e, { emit:
|
|
918
|
-
const o = e,
|
|
919
|
-
contenteditable:
|
|
920
|
-
onpaste: (
|
|
921
|
-
} : {}),
|
|
922
|
-
|
|
923
|
-
},
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
926
|
-
l.value && (l.value.innerText =
|
|
927
|
-
},
|
|
928
|
-
l.value && (l.value.innerText = o.name),
|
|
929
|
-
}, i = (
|
|
930
|
-
if (
|
|
931
|
-
let
|
|
932
|
-
o.canExclude && (
|
|
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 (
|
|
935
|
-
class:
|
|
1284
|
+
return (g, s) => (h(), j(Te, {
|
|
1285
|
+
class: ae({
|
|
936
1286
|
"top-tagSelector_tagListItem": !0,
|
|
937
|
-
"top-tagSelector_tagListItem-inEdit":
|
|
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:
|
|
1293
|
+
onClick: H(i, ["stop"])
|
|
944
1294
|
}, {
|
|
945
|
-
default:
|
|
946
|
-
|
|
1295
|
+
default: A(() => [
|
|
1296
|
+
O(Ce, {
|
|
947
1297
|
id: e.id,
|
|
948
|
-
name:
|
|
1298
|
+
name: n.value,
|
|
949
1299
|
colorId: e.colorId,
|
|
950
1300
|
state: e.state
|
|
951
1301
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
952
|
-
|
|
1302
|
+
U("span", De({
|
|
953
1303
|
ref_key: "elName",
|
|
954
1304
|
ref: l,
|
|
955
1305
|
class: "top-tagSelector_tagListItemName",
|
|
956
|
-
contenteditable:
|
|
957
|
-
},
|
|
1306
|
+
contenteditable: d.value ? "plaintext-only" : !1
|
|
1307
|
+
}, r.value, {
|
|
958
1308
|
onKeydown: [
|
|
959
|
-
|
|
960
|
-
|
|
1309
|
+
be(H(f, ["stop"]), ["enter"]),
|
|
1310
|
+
be(H(C, ["stop"]), ["esc"])
|
|
961
1311
|
]
|
|
962
|
-
}), b(
|
|
963
|
-
e.editable ? (h(),
|
|
964
|
-
|
|
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:
|
|
969
|
-
})) : (h(),
|
|
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:
|
|
1323
|
+
onClick: c
|
|
974
1324
|
}))
|
|
975
|
-
], 64)) :
|
|
1325
|
+
], 64)) : E("", !0)
|
|
976
1326
|
]),
|
|
977
1327
|
_: 1
|
|
978
1328
|
}, 8, ["class"]));
|
|
979
1329
|
}
|
|
980
|
-
}),
|
|
1330
|
+
}), io = { key: 1 }, so = /* @__PURE__ */ R({
|
|
981
1331
|
inheritAttrs: !1,
|
|
982
1332
|
__name: "popupOpener",
|
|
983
|
-
props: /* @__PURE__ */
|
|
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
|
|
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:
|
|
1004
|
-
targetId:
|
|
1005
|
-
filters:
|
|
1006
|
-
payload:
|
|
1353
|
+
mode: t.mode,
|
|
1354
|
+
targetId: t.targetId,
|
|
1355
|
+
filters: t.filters,
|
|
1356
|
+
payload: t.payload
|
|
1007
1357
|
};
|
|
1008
|
-
return (
|
|
1009
|
-
const
|
|
1010
|
-
return h(),
|
|
1011
|
-
default:
|
|
1012
|
-
|
|
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":
|
|
1016
|
-
"top-tagSelector-custom": !
|
|
1017
|
-
"top-as-selector":
|
|
1018
|
-
"top-tagSelector-filter":
|
|
1019
|
-
"top-tagSelector-setter_single":
|
|
1020
|
-
"top-tagSelector-setter_several":
|
|
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
|
-
},
|
|
1027
|
-
[v(
|
|
1028
|
-
!o.value.length && e.mode === "filter" ? (h(),
|
|
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:
|
|
1382
|
+
name: r.$i18n.Common.All_tags ?? "",
|
|
1033
1383
|
state: ""
|
|
1034
|
-
}, null, 8, ["name"])) :
|
|
1035
|
-
e.mode === "setter" && e.filters ? (h(),
|
|
1036
|
-
|
|
1037
|
-
])) : (h(!0),
|
|
1038
|
-
id: v(
|
|
1039
|
-
colorId: v(
|
|
1040
|
-
name: v(
|
|
1041
|
-
state: v(
|
|
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
|
-
[
|
|
1396
|
+
[c, l, "topTagSelectorTarget"]
|
|
1047
1397
|
])
|
|
1048
1398
|
]),
|
|
1049
1399
|
_: 3
|
|
1050
1400
|
}, 8, ["id"]);
|
|
1051
1401
|
};
|
|
1052
1402
|
}
|
|
1053
|
-
}),
|
|
1403
|
+
}), Po = /* @__PURE__ */ R({
|
|
1054
1404
|
__name: "tagSelector",
|
|
1055
|
-
props: /* @__PURE__ */
|
|
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:
|
|
1423
|
+
default: Oe(lo)
|
|
1074
1424
|
},
|
|
1075
1425
|
tagsModifiers: {}
|
|
1076
1426
|
}),
|
|
1077
|
-
emits: /* @__PURE__ */
|
|
1078
|
-
setup(e, { emit:
|
|
1079
|
-
const o =
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
const
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
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 =
|
|
1088
|
-
model:
|
|
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
|
-
|
|
1095
|
-
|
|
1444
|
+
G(n, () => {
|
|
1445
|
+
d("selector", n.value);
|
|
1096
1446
|
});
|
|
1097
|
-
const
|
|
1098
|
-
if (i.value.mode === "setter" &&
|
|
1099
|
-
return i.value.model.value.length >=
|
|
1100
|
-
}),
|
|
1101
|
-
if (
|
|
1102
|
-
if (i.value.model.value.includes(
|
|
1103
|
-
if (i.value.model.value.includes(
|
|
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
|
|
1106
|
-
},
|
|
1107
|
-
const
|
|
1108
|
-
let k = i.value.model.value.filter((
|
|
1109
|
-
|
|
1110
|
-
if (!
|
|
1111
|
-
const
|
|
1112
|
-
return
|
|
1113
|
-
}), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 &&
|
|
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
|
-
},
|
|
1119
|
-
let
|
|
1120
|
-
return i.value.mode === "filter" && (
|
|
1121
|
-
}),
|
|
1122
|
-
const
|
|
1123
|
-
if (!
|
|
1124
|
-
const
|
|
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(
|
|
1127
|
-
name:
|
|
1128
|
-
color_id: String((
|
|
1129
|
-
}),
|
|
1130
|
-
},
|
|
1131
|
-
if (i.value =
|
|
1132
|
-
if (i.value.filters && (
|
|
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
|
-
!
|
|
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(
|
|
1493
|
+
stop: function(p, x) {
|
|
1144
1494
|
if (!l.value) return;
|
|
1145
|
-
const k = $(
|
|
1146
|
-
k.each((
|
|
1495
|
+
const k = $(x.item).parent().find("[data-tag_id]"), K = [];
|
|
1496
|
+
k.each((le, J) => {
|
|
1147
1497
|
if (!l.value) return;
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
}), l.value.sort((
|
|
1151
|
-
const
|
|
1152
|
-
return
|
|
1153
|
-
}),
|
|
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
|
-
},
|
|
1157
|
-
|
|
1506
|
+
}, L = (y) => {
|
|
1507
|
+
X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
|
|
1158
1508
|
};
|
|
1159
|
-
return (
|
|
1160
|
-
|
|
1161
|
-
modelValue:
|
|
1162
|
-
"onUpdate:modelValue":
|
|
1163
|
-
id: v(
|
|
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
|
-
|
|
1170
|
-
id: v(
|
|
1171
|
-
class:
|
|
1172
|
-
onOpen:
|
|
1173
|
-
onClose:
|
|
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
|
-
},
|
|
1176
|
-
contentList:
|
|
1177
|
-
v(i).mode === "filter" && !e.singleMode ? (h(),
|
|
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:
|
|
1531
|
+
name: y.$i18n.Common.All_tags ?? "",
|
|
1182
1532
|
state: v(i).model.value.length ? "" : "selected",
|
|
1183
|
-
onSelect:
|
|
1184
|
-
}, null, 8, ["name", "state"])) :
|
|
1185
|
-
(h(!0),
|
|
1186
|
-
key:
|
|
1187
|
-
id:
|
|
1188
|
-
colorId:
|
|
1189
|
-
name:
|
|
1190
|
-
state:
|
|
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:
|
|
1194
|
-
onUnselect: (k) =>
|
|
1195
|
-
onSelect: (k) =>
|
|
1196
|
-
onExclude: (k) =>
|
|
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
|
-
|
|
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(),
|
|
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:
|
|
1554
|
+
onClick: H(W, ["stop"])
|
|
1205
1555
|
}, {
|
|
1206
|
-
default:
|
|
1207
|
-
|
|
1556
|
+
default: A(() => [
|
|
1557
|
+
q(b(y.$i18n.Common.Add), 1)
|
|
1208
1558
|
]),
|
|
1209
1559
|
_: 1
|
|
1210
|
-
})) :
|
|
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:
|
|
1217
|
-
|
|
1218
|
-
modelValue:
|
|
1219
|
-
"onUpdate:modelValue":
|
|
1220
|
-
options:
|
|
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:
|
|
1228
|
-
|
|
1229
|
-
default:
|
|
1230
|
-
|
|
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
|
-
|
|
1235
|
-
onClick:
|
|
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:
|
|
1588
|
+
filtersAction: f.value,
|
|
1239
1589
|
payload: v(i).payload
|
|
1240
1590
|
}))
|
|
1241
1591
|
}, {
|
|
1242
|
-
default:
|
|
1243
|
-
|
|
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
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
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
|