@topvisor/ui 1.4.3-updateGroupSelector.2 → 1.4.3-updateRegionSelector.0

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