@topvisor/ui 1.0.8 → 1.0.9-fix-css

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