@topvisor/ui 1.3.5-5.0 → 1.4.0-TopGroupSelector.10

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 (216) hide show
  1. package/.chunks/core-BL-38XF7.es.js +196 -0
  2. package/.chunks/core-BL-38XF7.es.js.map +1 -0
  3. package/.chunks/core-BsPx05H9.amd.js +2 -0
  4. package/.chunks/core-BsPx05H9.amd.js.map +1 -0
  5. package/.chunks/{datepicker-CPrHVH4x.amd.js → datepicker-3coUsFW2.amd.js} +2 -2
  6. package/.chunks/{datepicker-CPrHVH4x.amd.js.map → datepicker-3coUsFW2.amd.js.map} +1 -1
  7. package/.chunks/{datepicker-J8Zg9mKt.es.js → datepicker-D1Hw3a3o.es.js} +14 -17
  8. package/.chunks/{datepicker-J8Zg9mKt.es.js.map → datepicker-D1Hw3a3o.es.js.map} +1 -1
  9. package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js +180 -0
  10. package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js.map +1 -0
  11. package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js +2 -0
  12. package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js.map +1 -0
  13. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js} +111 -112
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js.map} +1 -1
  15. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js +2 -0
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js.map} +1 -1
  17. package/.chunks/forms-BseC3Ftz.es.js +2035 -0
  18. package/.chunks/{forms-COXAfg9G.es.js.map → forms-BseC3Ftz.es.js.map} +1 -1
  19. package/.chunks/forms-CUSCBQu3.amd.js +3 -0
  20. package/.chunks/{forms-DXX5M4DO.amd.js.map → forms-CUSCBQu3.amd.js.map} +1 -1
  21. package/.chunks/index-DLUtoTUg.amd.js +2 -0
  22. package/.chunks/index-DLUtoTUg.amd.js.map +1 -0
  23. package/.chunks/index-DkQWJkMc.es.js +54 -0
  24. package/.chunks/index-DkQWJkMc.es.js.map +1 -0
  25. package/.chunks/notice-Cl3ZgiHm.es.js +191 -0
  26. package/.chunks/{notice-P7CXfEuX.es.js.map → notice-Cl3ZgiHm.es.js.map} +1 -1
  27. package/.chunks/notice-DwjipV21.amd.js +4 -0
  28. package/.chunks/{notice-CSGn_jTM.amd.js.map → notice-DwjipV21.amd.js.map} +1 -1
  29. package/.chunks/page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js +2 -0
  30. package/.chunks/{page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js.map → page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js.map} +1 -1
  31. package/.chunks/page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js +139 -0
  32. package/.chunks/{page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js.map → page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js.map} +1 -1
  33. package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js +496 -0
  34. package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js.map +1 -0
  35. package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js +2 -0
  36. package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js.map +1 -0
  37. package/.chunks/popup-DRuyYFGB.amd.js +2 -0
  38. package/.chunks/popup-DRuyYFGB.amd.js.map +1 -0
  39. package/.chunks/popup-Jw_Yyg3U.es.js +470 -0
  40. package/.chunks/popup-Jw_Yyg3U.es.js.map +1 -0
  41. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js +209 -0
  42. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js.map +1 -0
  43. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js +2 -0
  44. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js.map +1 -0
  45. package/.chunks/utils-CzHUG_xz.amd.js +2 -0
  46. package/.chunks/{utils-D505nRsu.amd.js.map → utils-CzHUG_xz.amd.js.map} +1 -1
  47. package/.chunks/utils-D9nYQabE.amd.js +2 -0
  48. package/.chunks/{utils-DmxcQpWA.amd.js.map → utils-D9nYQabE.amd.js.map} +1 -1
  49. package/.chunks/{utils-CWm0zAtM.es.js → utils-Q69SXlnV.es.js} +192 -208
  50. package/.chunks/{utils-CWm0zAtM.es.js.map → utils-Q69SXlnV.es.js.map} +1 -1
  51. package/.chunks/{utils-Rbz9mxy6.es.js → utils-YrUExsH7.es.js} +23 -24
  52. package/.chunks/{utils-Rbz9mxy6.es.js.map → utils-YrUExsH7.es.js.map} +1 -1
  53. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js} +2 -2
  54. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js.map} +1 -1
  55. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js} +2 -2
  56. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js.map} +1 -1
  57. package/api/index.amd.js +1 -1
  58. package/api/index.amd.js.map +1 -1
  59. package/api/index.js +138 -133
  60. package/api/index.js.map +1 -1
  61. package/assets/dialog_regionSelectorRegions.css +1 -0
  62. package/assets/forms.css +1 -1
  63. package/assets/policy.css +1 -0
  64. package/assets/popupHint.css +1 -1
  65. package/assets/project.css +1 -1
  66. package/charts/charts.amd.js +1 -1
  67. package/charts/charts.amd.js.map +1 -1
  68. package/charts/charts.js +80 -80
  69. package/charts/charts.js.map +1 -1
  70. package/core/app.amd.js +1 -1
  71. package/core/app.amd.js.map +1 -1
  72. package/core/app.js +93 -96
  73. package/core/app.js.map +1 -1
  74. package/dialog/dialog.amd.js +1 -1
  75. package/dialog/dialog.amd.js.map +1 -1
  76. package/dialog/dialog.js +13 -13
  77. package/dialog/dialog.js.map +1 -1
  78. package/extra/extra.amd.js +1 -1
  79. package/extra/extra.amd.js.map +1 -1
  80. package/extra/extra.js +20 -23
  81. package/extra/extra.js.map +1 -1
  82. package/forms/forms.amd.js +1 -1
  83. package/forms/forms.js +5 -5
  84. package/formsExt/formsExt.amd.js +1 -1
  85. package/formsExt/formsExt.amd.js.map +1 -1
  86. package/formsExt/formsExt.js +180 -541
  87. package/formsExt/formsExt.js.map +1 -1
  88. package/layout/layout.amd.js +1 -1
  89. package/layout/layout.js +6 -6
  90. package/package.json +1 -1
  91. package/popup/popup.amd.js +1 -1
  92. package/popup/popup.amd.js.map +1 -1
  93. package/popup/popup.js +43 -46
  94. package/popup/popup.js.map +1 -1
  95. package/popup/worker.amd.js +1 -1
  96. package/popup/worker.amd.js.map +1 -1
  97. package/popup/worker.js +11 -9
  98. package/popup/worker.js.map +1 -1
  99. package/project/project.amd.js +1 -1
  100. package/project/project.amd.js.map +1 -1
  101. package/project/project.js +847 -579
  102. package/project/project.js.map +1 -1
  103. package/src/api/api/client/client.d.ts +5 -0
  104. package/src/api/api/mocker/index.d.ts +3 -3
  105. package/src/api/api/types/client/request.d.ts +6 -0
  106. package/src/api/api/types/mocker.d.ts +2 -2
  107. package/src/components/formsExt/formsExt.d.ts +1 -0
  108. package/src/components/formsExt/selector2/cache.d.ts +12 -0
  109. package/src/components/formsExt/selector2/composables/useAPI.d.ts +2033 -0
  110. package/src/components/formsExt/selector2/composables/useMenu.d.ts +2045 -5
  111. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +3 -3
  112. package/src/components/formsExt/selector2/selector2.vue.d.ts +9 -3
  113. package/src/components/formsExt/selector2/types.d.ts +25 -8
  114. package/src/components/formsExt/selector2/utils.d.ts +16 -0
  115. package/src/components/popup/lib/popup.d.ts +1 -2
  116. package/src/components/popup/popup/opener/types.d.ts +6 -2
  117. package/src/components/popup/popup/types.d.ts +3 -2
  118. package/src/components/popup/popup.d.ts +1 -1
  119. package/src/components/project/groupSelector/folders/folders.vue.d.ts +18 -0
  120. package/src/components/project/groupSelector/folders/types.d.ts +63 -0
  121. package/src/components/project/groupSelector/folders/utils.d.ts +63 -0
  122. package/src/components/project/groupSelector/groupSelector.vue.d.ts +33 -0
  123. package/src/components/project/groupSelector/groups/groups.vue.d.ts +126 -0
  124. package/src/components/project/groupSelector/groups/types.d.ts +58 -0
  125. package/src/components/project/groupSelector/groups/utils.d.ts +92 -0
  126. package/src/components/project/groupSelector/stories/mocks/folders.d.ts +4 -0
  127. package/src/components/project/groupSelector/stories/mocks/groups.d.ts +2 -0
  128. package/src/components/project/groupSelector/stories/mocks/index.d.ts +7 -0
  129. package/src/components/project/groupSelector/types.d.ts +133 -0
  130. package/src/components/project/project.d.ts +5 -4
  131. package/src/components/project/{selectorRegion → regionSelector}/utils/utils.d.ts +3 -3
  132. package/src/core/utils/composables/useWatch.d.ts +32 -0
  133. package/tabs/tabs.amd.js +1 -1
  134. package/tabs/tabs.amd.js.map +1 -1
  135. package/tabs/tabs.js +24 -24
  136. package/tabs/tabs.js.map +1 -1
  137. package/tabsView/tabsView.amd.js +1 -1
  138. package/tabsView/tabsView.amd.js.map +1 -1
  139. package/tabsView/tabsView.js +131 -133
  140. package/tabsView/tabsView.js.map +1 -1
  141. package/utils/clipboard.amd.js +1 -1
  142. package/utils/clipboard.js +1 -1
  143. package/utils/date.amd.js +1 -1
  144. package/utils/date.js +1 -1
  145. package/utils/device.amd.js +1 -1
  146. package/utils/device.js +1 -1
  147. package/utils/lodash.amd.js +1 -1
  148. package/utils/lodash.js +1 -1
  149. package/utils/price.amd.js +1 -1
  150. package/utils/price.js +1 -1
  151. package/utils/scroll.amd.js +1 -1
  152. package/utils/scroll.amd.js.map +1 -1
  153. package/utils/scroll.js +14 -14
  154. package/utils/scroll.js.map +1 -1
  155. package/utils/searchers.amd.js +1 -1
  156. package/utils/searchers.js +3 -3
  157. package/utils/string.amd.js +1 -1
  158. package/utils/string.amd.js.map +1 -1
  159. package/utils/string.js +3 -7
  160. package/utils/string.js.map +1 -1
  161. package/.chunks/core-CaWxDXrZ.es.js +0 -197
  162. package/.chunks/core-CaWxDXrZ.es.js.map +0 -1
  163. package/.chunks/core-DmO1i1Ua.amd.js +0 -2
  164. package/.chunks/core-DmO1i1Ua.amd.js.map +0 -1
  165. package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js +0 -190
  166. package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js.map +0 -1
  167. package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js +0 -2
  168. package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js.map +0 -1
  169. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js +0 -2
  170. package/.chunks/forms-COXAfg9G.es.js +0 -2047
  171. package/.chunks/forms-DXX5M4DO.amd.js +0 -3
  172. package/.chunks/index-BEI7XZmU.amd.js +0 -2
  173. package/.chunks/index-BEI7XZmU.amd.js.map +0 -1
  174. package/.chunks/index-igPkes8X.es.js +0 -48
  175. package/.chunks/index-igPkes8X.es.js.map +0 -1
  176. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js +0 -199
  177. package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js.map +0 -1
  178. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js +0 -2
  179. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js.map +0 -1
  180. package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js +0 -112
  181. package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js.map +0 -1
  182. package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js +0 -2
  183. package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js.map +0 -1
  184. package/.chunks/notice-CSGn_jTM.amd.js +0 -4
  185. package/.chunks/notice-P7CXfEuX.es.js +0 -194
  186. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +0 -36
  187. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +0 -1
  188. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +0 -2
  189. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +0 -1
  190. package/.chunks/page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js +0 -143
  191. package/.chunks/page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js +0 -2
  192. package/.chunks/popup-CF4k7j3U.amd.js +0 -2
  193. package/.chunks/popup-CF4k7j3U.amd.js.map +0 -1
  194. package/.chunks/popup-G7FYKscC.es.js +0 -485
  195. package/.chunks/popup-G7FYKscC.es.js.map +0 -1
  196. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js +0 -2
  197. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js.map +0 -1
  198. package/.chunks/utils-D505nRsu.amd.js +0 -2
  199. package/.chunks/utils-DmxcQpWA.amd.js +0 -2
  200. package/assets/dialog_selectorRegions.css +0 -1
  201. package/assets/formsExt.css +0 -1
  202. package/assets/listItem.css +0 -1
  203. package/assets/menu.css +0 -1
  204. package/src/components/popup/popup/opener.vue.d.ts +0 -17
  205. /package/src/components/project/{selectorCompetitors/selectorCompetitors.vue.d.ts → competitorSelector/competitorSelector.vue.d.ts} +0 -0
  206. /package/src/components/project/{selectorCompetitors → competitorSelector}/composables.d.ts +0 -0
  207. /package/src/components/project/{selectorCompetitors → competitorSelector}/types.d.ts +0 -0
  208. /package/src/components/project/{selectorRegion → regionSelector}/composables/compare.d.ts +0 -0
  209. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectRegion.d.ts +0 -0
  210. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectSearcher.d.ts +0 -0
  211. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectorRegion.d.ts +0 -0
  212. /package/src/components/project/{selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts → regionSelector/dialog_regionSelectorRegions/dialog_regionSelectorRegions.vue.d.ts} +0 -0
  213. /package/src/components/project/{selectorRegion/dialog_selectorRegions → regionSelector/dialog_regionSelectorRegions}/types.d.ts +0 -0
  214. /package/src/components/project/{selectorRegion/selectorRegion.vue.d.ts → regionSelector/regionSelector.vue.d.ts} +0 -0
  215. /package/src/components/project/{selectorRegion → regionSelector}/types.d.ts +0 -0
  216. /package/src/components/project/{selectorRegion → regionSelector}/utils/consts.d.ts +0 -0
@@ -3,18 +3,20 @@
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 U, mergeModels as N, useModel as D, computed as E, createElementBlock as b, openBlock as k, createBlock as _, unref as y, withCtx as B, Fragment as Y, renderList as se, normalizeClass as X, createElementVNode as he, toDisplayString as K, createVNode as A, createTextVNode as G, toValue as de, ref as F, watch as w, createCommentVNode as q, isRef as ce, withModifiers as J, mergeProps as Se, withKeys as ge, nextTick as Be, resolveDirective as _e, withDirectives as be, resolveDynamicComponent as Ve, renderSlot as Ee, shallowRef as Me, createSlots as Ke, reactive as $e } from "vue";
7
- import { u as R, C as j, c as H, o as re, d as we } from "../.chunks/forms-COXAfg9G.es.js";
8
- import { _ as Ie, a as ue } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js";
9
- import { _ as Le } from "../.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js";
10
- import { u as Ae } from "../.chunks/utils-Rbz9mxy6.es.js";
11
- import { getSearcherGIcon as Re, getLangLabel as Oe, getDeviceGIcon as Ne } from "../utils/searchers.js";
12
- import { storage as W } from "../utils/dom.js";
13
- import { TopPopupWorker as De } from "../popup/worker.js";
14
- import { _ as Fe } from "../.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js";
15
- const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }, ft = /* @__PURE__ */ U({
16
- __name: "selectorCompetitors",
17
- props: /* @__PURE__ */ N({
6
+ import { defineComponent as R, mergeModels as V, useModel as T, computed as w, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as me, normalizeClass as X, createElementVNode as oe, toDisplayString as b, createVNode as N, createTextVNode as z, 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 Ne, withDirectives as Pe, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Fe, createSlots as Ue } from "vue";
7
+ import { u as M, C as _, e as Q, p as ce, d as _e } from "../.chunks/forms-BseC3Ftz.es.js";
8
+ import { _ as Me, b as ve, a as ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js";
9
+ import { a as Je, _ as we, b as Ee, c as $e, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js";
10
+ import { u as We } from "../.chunks/utils-YrUExsH7.es.js";
11
+ import { getSearcherGIcon as Ye, getLangLabel as Qe, getDeviceGIcon as He } from "../utils/searchers.js";
12
+ import "../.chunks/core-BL-38XF7.es.js";
13
+ import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js";
14
+ import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
15
+ import { storage as J } from "../utils/dom.js";
16
+ import { TopPopupWorker as Xe } from "../popup/worker.js";
17
+ const Ze = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
18
+ __name: "competitorSelector",
19
+ props: /* @__PURE__ */ V({
18
20
  modelValue: {},
19
21
  items: {},
20
22
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -23,74 +25,65 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
23
25
  modelModifiers: {}
24
26
  }),
25
27
  emits: ["update:modelValue"],
26
- setup(t) {
27
- const l = t, n = D(t, "modelValue"), e = E(() => {
28
- if (l.showSelectAllItem)
28
+ setup(e) {
29
+ const a = e, o = T(e, "modelValue"), t = w(() => {
30
+ if (a.showSelectAllItem)
29
31
  return {
30
32
  icon: "",
31
- title: R().Common.Select_all,
33
+ title: M().Common.Select_all,
32
34
  value: "all",
33
35
  content: ""
34
36
  };
35
37
  });
36
- return (i, a) => (k(), b("div", qe, [
37
- y(j).state.isMobile ? (k(), _(Ie, { key: 0 }, {
38
+ return (r, l) => (h(), A("div", Ze, [
39
+ v(_).state.isMobile ? (h(), C(Me, { key: 0 }, {
38
40
  opener: B(() => [
39
- A(H, {
40
- class: "top-selectorCompetitors_opener",
41
+ N(Q, {
42
+ class: "top-competitorSelector_opener",
41
43
  color: "theme",
42
44
  icon: "",
43
45
  icon2: ""
44
46
  }, {
45
- default: B(() => {
46
- var o;
47
- return [
48
- G(K((o = i.items.find((u) => {
49
- var f;
50
- return u.value === ((f = n.value) == null ? void 0 : f[0]);
51
- })) == null ? void 0 : o.content), 1)
52
- ];
53
- }),
47
+ default: B(() => [
48
+ z(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
49
+ ]),
54
50
  _: 1
55
51
  })
56
52
  ]),
57
53
  contentList: B(() => [
58
- (k(!0), b(Y, null, se(i.items, (o) => {
59
- var u;
60
- return k(), _(ue, {
61
- class: X({
62
- "top-active": (u = n.value) == null ? void 0 : u.includes(o.value)
63
- }),
64
- "data-top-icon": o.icon,
65
- title: o.title,
66
- onClick: () => n.value = [o.value]
67
- }, {
68
- default: B(() => [
69
- he("span", Ue, K(o.content), 1)
70
- ]),
71
- _: 2
72
- }, 1032, ["class", "data-top-icon", "title", "onClick"]);
73
- }), 256))
54
+ (h(!0), A(Y, null, me(e.items, (n) => (h(), C(ve, {
55
+ class: X({
56
+ "top-active": o.value?.includes(n.value)
57
+ }),
58
+ "data-top-icon": n.icon,
59
+ title: n.title,
60
+ onClick: () => o.value = [n.value]
61
+ }, {
62
+ default: B(() => [
63
+ oe("span", et, b(n.content), 1)
64
+ ]),
65
+ _: 2
66
+ }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
74
67
  ]),
75
68
  _: 1
76
- })) : (k(), _(Le, {
69
+ })) : (h(), C(Je, {
77
70
  key: 1,
78
- modelValue: n.value,
79
- "onUpdate:modelValue": a[0] || (a[0] = (o) => n.value = o),
80
- items: i.items,
71
+ modelValue: o.value,
72
+ "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
73
+ items: e.items,
81
74
  isMultiple: !0,
82
75
  styling: "bar",
83
76
  canBeEmptyMultiple: !1,
84
- selectAllItem: e.value
77
+ selectAllItem: t.value
85
78
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
86
79
  ]));
87
80
  }
88
- }), vt = (t, l) => E(() => de(t).filter((i) => i.on >= 0 || i.id === l).map((i) => ({
89
- value: i.id,
90
- title: i.url + ` [${i.id}]`,
91
- icon: i.id === de(l) ? "" : "",
92
- content: i.name
93
- }))), M = -1, p = -2, te = -1, Pe = {
81
+ }), Nt = (e, a) => w(() => 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 = {
94
87
  0: "Yandex",
95
88
  1: "Google",
96
89
  4: "YouTube",
@@ -100,247 +93,241 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
100
93
  9: "GoogleStore",
101
94
  20: "Yandex.com",
102
95
  21: "Yandex.com.tr"
103
- }, me = {
104
- key: p,
105
- name: "--",
106
- index: p
107
96
  }, xe = {
108
- key: p,
97
+ key: y,
98
+ name: "--",
99
+ index: y
100
+ }, Ge = {
101
+ key: y,
109
102
  name: "--",
110
- regions: [me],
111
- regionByIndex: /* @__PURE__ */ new Map([[p, me]])
112
- }, le = {
113
- key: p,
103
+ regions: [xe],
104
+ regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
105
+ }, ae = {
106
+ key: y,
114
107
  name: "Autoselect",
115
- index: p
116
- }, ne = {
117
- key: p,
108
+ index: y
109
+ }, se = {
110
+ key: y,
118
111
  name: "Autoselect",
119
- regions: [le],
120
- regionByIndex: /* @__PURE__ */ new Map([[p, le]])
121
- }, fe = {
112
+ regions: [ae],
113
+ regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
114
+ }, ke = {
122
115
  countryCode: "00",
123
116
  depth: 1,
124
117
  device: 0,
125
- key: te,
126
- index: te,
118
+ key: le,
119
+ index: le,
127
120
  lang: "ru",
128
121
  name: "Without region"
129
- }, ze = () => (le.name = R().Common.Autoselect, le), Je = () => (ze(), ne.name = R().Common.Autoselect, console.log(ne), ne), je = () => (fe.name = R().Keywords.Without_region, fe), ke = (t = !1, l = !1, n = []) => {
130
- let e;
131
- return t ? e = Ge(n) : e = Te(n), l && e.set(p, Je()), e.size || e.set(p, xe), e;
132
- }, Te = (t, l = !0, n = [], e = !1) => {
133
- const i = /* @__PURE__ */ new Map();
134
- return t.forEach((a) => {
135
- if (!a.enabled || e && typeof a.key == "number" && a.key > 1) return;
136
- const o = { ...a };
137
- o.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((u) => {
138
- if (l && !u.enabled) return;
122
+ }, ot = () => (ae.name = M().Common.Autoselect, ae), lt = () => (ot(), se.name = M().Common.Autoselect, console.log(se), se), at = () => (ke.name = M().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();
127
+ 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;
139
132
  const f = { ...u };
140
- o.regionByIndex.set(f.index, f);
141
- }), !o.regionByIndex.size && n.length, // режим вывода ПС без регионов
142
- (!a.regions || // есть включенные регионы
143
- o.regionByIndex.size || // запрошен вывод конкретных ПС
144
- n.length) && typeof o.key == "number" && i.set(o.key, o);
145
- }), n.forEach((a) => {
146
- if (i.has(a)) return;
147
- const o = {
148
- key: a,
149
- name: Pe[a],
133
+ n.regionByIndex.set(f.index, f);
134
+ }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
135
+ (!l.regions || // есть включенные регионы
136
+ n.regionByIndex.size || // запрошен вывод конкретных ПС
137
+ o.length) && typeof n.key == "number" && r.set(n.key, n);
138
+ }), o.forEach((l) => {
139
+ if (r.has(l)) return;
140
+ const n = {
141
+ key: l,
142
+ name: tt[l],
150
143
  regions: [],
151
144
  regionByIndex: /* @__PURE__ */ new Map()
152
145
  };
153
- i.set(o.key, o);
154
- }), i;
155
- }, Ge = (t) => {
156
- const l = Te(t, !1, [0, 1], !0);
157
- if (l.has(2)) {
158
- const n = l.get(2);
159
- n && (n.regionByIndex = /* @__PURE__ */ new Map());
146
+ r.set(n.key, n);
147
+ }), r;
148
+ }, nt = (e) => {
149
+ const a = Oe(e, !1, [0, 1], !0);
150
+ if (a.has(2)) {
151
+ const o = a.get(2);
152
+ o && (o.regionByIndex = /* @__PURE__ */ new Map());
160
153
  }
161
- return l.forEach((n) => {
162
- if (!n.regionByIndex) return;
163
- const e = { ...je() };
164
- n.regionByIndex.set(e.index, e);
165
- }), l;
166
- }, We = (t, l, n = []) => {
167
- const e = ke(t, !1, n);
168
- let i;
169
- return e.forEach((a) => {
170
- if (!(l.searcher_key !== void 0 && l.searcher_key != a.key) && a.regions && (a.regions.forEach((o) => {
171
- if (!i && !(l.key !== void 0 && l.key != o.key) && !(l.index !== void 0 && l.index != o.index) && !(!t && (l.lang !== void 0 && l.lang != o.lang || l.device !== void 0 && l.device != o.device)))
172
- return o.searcher_key = a.key, i = o, !1;
173
- }), i))
154
+ return a.forEach((o) => {
155
+ if (!o.regionByIndex) return;
156
+ const t = { ...at() };
157
+ o.regionByIndex.set(t.index, t);
158
+ }), a;
159
+ }, rt = (e, a, o = []) => {
160
+ const t = Ke(e, !1, o);
161
+ let r;
162
+ return t.forEach((l) => {
163
+ if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
164
+ if (!r && !(a.key !== void 0 && a.key != n.key) && !(a.index !== void 0 && a.index != n.index) && !(!e && (a.lang !== void 0 && a.lang != n.lang || a.device !== void 0 && a.device != n.device)))
165
+ return n.searcher_key = l.key, r = n, !1;
166
+ }), r))
174
167
  return !1;
175
- }), i;
176
- }, Ye = Ae(() => import("../.chunks/dialog_selectorRegions-DoEjgXtb.es.js")), He = (t, l) => {
177
- const n = R(), e = F(l.value.keys().next().value ?? p), i = E(() => {
178
- const a = /* @__PURE__ */ new Map();
179
- if (l.value.forEach((o) => {
168
+ }), r;
169
+ }, it = We(() => import("../.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js")), dt = (e, a) => {
170
+ const o = M(), t = K(a.value.keys().next().value ?? y), r = w(() => {
171
+ const l = /* @__PURE__ */ new Map();
172
+ if (a.value.forEach((n) => {
180
173
  let u = {
181
- value: o.key,
182
- title: o.name
174
+ value: n.key,
175
+ title: n.name
183
176
  };
184
- t.addSearcherIcon && (u.icon = Re(o.key)), a.set(o.key, u);
185
- }), t.addCompare && !a.has(p)) {
186
- const o = {
177
+ e.addSearcherIcon && (u.icon = Ye(n.key)), l.set(n.key, u);
178
+ }), e.addCompare && !l.has(y)) {
179
+ const n = {
187
180
  value: "",
188
181
  title: "--------------------",
189
182
  disabled: !0
190
183
  };
191
- a.set(o.value, o);
184
+ l.set(n.value, n);
192
185
  const u = {
193
- value: M,
194
- title: n.Common.Compare
186
+ value: L,
187
+ title: o.Common.Compare
195
188
  };
196
- a.set(u.value, u);
189
+ l.set(u.value, u);
197
190
  }
198
- return a;
191
+ return l;
199
192
  });
200
193
  return {
201
- searcherKey: e,
202
- optionBySearcherKey: i
194
+ searcherKey: t,
195
+ optionBySearcherKey: r
203
196
  };
204
- }, Qe = (t, l) => {
205
- var a, o, u;
206
- const n = R(), e = F(p);
207
- t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === p && (t.forFrequency ? e.value = ((o = (a = l.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : o.key) ?? p : e.value = ((u = l.value) == null ? void 0 : u.regionByIndex.keys().next().value) ?? p);
208
- const i = E(() => {
209
- var h;
210
- const f = /* @__PURE__ */ new Map();
211
- return (h = l.value.regionByIndex) == null || h.forEach((S) => {
212
- let r = S.name;
213
- if (t.forFrequency) {
197
+ }, ut = (e, a) => {
198
+ const o = M(), 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 = w(() => {
201
+ const l = /* @__PURE__ */ new Map();
202
+ return a.value.regionByIndex?.forEach((n) => {
203
+ let u = n.name;
204
+ if (e.forFrequency) {
214
205
  const x = {
215
- value: S.key,
216
- title: r
206
+ value: n.key,
207
+ title: u
217
208
  };
218
- f.has(S.key) || f.set(S.key, x);
209
+ l.has(n.key) || l.set(n.key, x);
219
210
  return;
220
211
  }
221
- S.device && (r += " (" + n.Common["Device_" + S.device] + ")");
222
- const g = Oe(l.value.key || 0, S.lang ?? "");
223
- g && (r += " / " + g);
224
- const d = {
225
- value: S.index,
226
- title: r,
227
- icon: S.device ? Ne(S.device) : void 0
212
+ n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
213
+ const f = Qe(a.value.key || 0, n.lang ?? "");
214
+ f && (u += " / " + f);
215
+ const c = {
216
+ value: n.index,
217
+ title: u,
218
+ icon: n.device ? He(n.device) : void 0
228
219
  };
229
- f.set(S.index, d);
230
- }), f;
220
+ l.set(n.index, c);
221
+ }), l;
231
222
  });
232
- return w(i, (f, h) => {
233
- var d;
234
- if (t.onlySearcher || e.value !== void 0 && f.get(e.value))
223
+ return E(r, (l, n) => {
224
+ if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
235
225
  return;
236
- let S = f.keys().next().value;
237
- if (e.value === p || S === p) {
238
- e.value = S;
226
+ let u = l.keys().next().value;
227
+ if (t.value === y || u === y) {
228
+ t.value = u;
239
229
  return;
240
230
  }
241
- let r = ((d = h == null ? void 0 : h.get(e.value)) == null ? void 0 : d.title) || "", g = -1;
242
- for (const [x, C] of f.entries()) {
243
- const T = C.title;
244
- if (typeof T != "string" || typeof x == "string")
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")
245
235
  break;
246
- if (T === r) {
247
- S = x;
236
+ if (m === f) {
237
+ u = x;
248
238
  break;
249
239
  }
250
- const V = new RegExp(` \\((${n.Common.Device_1}|${n.Common.Device_2})\\)`);
251
- let m = r, s = 3;
252
- T.indexOf(m) === -1 && (m = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), T.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), s--), T.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), m = m.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), T.indexOf(m) !== -1 && (s <= g || (g = s, S = x));
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));
253
243
  }
254
- e.value = S;
244
+ t.value = u;
255
245
  }), {
256
- regionIndex: e,
257
- optionByRegionIndex: i
246
+ regionIndex: t,
247
+ optionByRegionIndex: r
258
248
  };
259
- }, Xe = (t, l, n) => {
260
- const e = F([]), i = () => {
261
- if (t.onlySearcher && l.value) {
262
- e.value = Array.from(l.value.keys());
249
+ }, st = (e, a, o) => {
250
+ const t = K([]), r = () => {
251
+ if (e.onlySearcher && a.value) {
252
+ t.value = Array.from(a.value.keys());
263
253
  return;
264
254
  }
265
- let o = [];
266
- if (t.modelValue.length > 1)
267
- o = [...t.modelValue];
255
+ let n = [];
256
+ if (e.modelValue.length > 1)
257
+ n = [...e.modelValue];
268
258
  else
269
259
  try {
270
- o = JSON.parse(
271
- localStorage.getItem("ui:project:regionSelector" + t.projectId + ":regionsIndexes")
260
+ n = JSON.parse(
261
+ localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
272
262
  ) ?? [];
273
263
  } catch {
274
264
  }
275
- o.length && (o = o.filter((u) => n.value.has(u))), o.length || (o = Array.from(n.value)), e.value = [...o];
276
- }, a = () => {
277
- e.value.length ? localStorage.setItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes", JSON.stringify(e.value)) : localStorage.removeItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes");
265
+ n.length && (n = n.filter((u) => o.value.has(u))), n.length || (n = Array.from(o.value)), t.value = [...n];
266
+ }, 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");
278
268
  };
279
- return w(e, () => {
280
- a();
281
- }), t.addCompare && i(), {
282
- regionsIndexes: e
269
+ return E(t, () => {
270
+ l();
271
+ }), e.addCompare && r(), {
272
+ regionsIndexes: t
283
273
  };
284
- }, Ze = (t) => {
285
- const l = E(() => ke(t.forFrequency, t.autoRegion, t.searchers)), n = E(() => l.value.get(i.searcherKey.value) || xe), e = E(() => {
286
- const r = /* @__PURE__ */ new Set();
287
- return l.value.forEach((g) => {
288
- g.regionByIndex.forEach((d) => {
289
- d.index !== te && d.index !== p && r.add(d.index);
274
+ }, ct = (e) => {
275
+ const a = w(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = w(() => a.value.get(r.searcherKey.value) || Ge), t = w(() => {
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);
290
280
  });
291
- }), r;
292
- }), i = He(t, l), a = Qe(t, n), o = Xe(t, l, e);
293
- w(l, () => {
294
- var g, d, x, C;
295
- if (t.onlySearcher ? o.regionsIndexes.value = Array.from(l.value.keys()) : o.regionsIndexes.value = o.regionsIndexes.value.filter((T) => e.value.has(T)), i.searcherKey.value === M) return;
296
- let r = l.value.keys().next().value;
297
- l.value.forEach((T) => {
298
- var V, m, s;
299
- if (t.onlySearcher && T.key === i.searcherKey.value) {
300
- r = i.searcherKey.value;
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;
301
289
  return;
302
290
  }
303
- if (a.regionIndex.value && ((V = T.regionByIndex) != null && V.has(a.regionIndex.value)) && (r = T.key), !t.onlySearcher) {
304
- let c;
305
- r !== void 0 && (c = (m = l.value.get(r)) == null ? void 0 : m.regionByIndex);
306
- const v = (s = l.value.get(T.key)) == null ? void 0 : s.regionByIndex;
307
- c != null && c.has(p) && !(v != null && v.has(p)) && (r = T.key);
291
+ if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
292
+ let d;
293
+ i !== void 0 && (d = a.value.get(i)?.regionByIndex);
294
+ const s = a.value.get(m.key)?.regionByIndex;
295
+ d?.has(y) && !s?.has(y) && (i = m.key);
308
296
  }
309
- }), r !== void 0 && (i.searcherKey.value = r), a.regionIndex.value !== void 0 && !((d = (g = n.value) == null ? void 0 : g.regionByIndex) != null && d.has(a.regionIndex.value)) && (a.regionIndex.value = (C = (x = n.value) == null ? void 0 : x.regions) == null ? void 0 : C.keys().next().value);
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);
310
298
  }, { immediate: !0 });
311
299
  const u = () => {
312
- if (!(i.searcherKey.value === M || i.searcherKey.value === p))
313
- return i.searcherKey.value;
300
+ if (!(r.searcherKey.value === L || r.searcherKey.value === y))
301
+ return r.searcherKey.value;
314
302
  }, f = () => {
315
- if (t.onlySearcher || a.regionIndex.value === p) return;
316
- let r = a.regionIndex.value;
317
- if (t.forFrequency) {
318
- const g = a.regionIndex.value, d = We(t.forFrequency, { searcher_key: u(), key: g }, t.searchers);
319
- r = d == null ? void 0 : d.index;
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;
320
308
  }
321
- return r;
322
- }, h = () => {
323
- const r = u();
324
- if (r !== void 0)
325
- return l.value.get(r);
309
+ return i;
310
+ }, c = () => {
311
+ const i = u();
312
+ if (i !== void 0)
313
+ return a.value.get(i);
326
314
  };
327
315
  return {
328
- selectSearcher: i,
329
- selectRegion: a,
330
- compare: o,
331
- searcherByKey: l,
332
- allRegionsIndexes: e,
333
- getSearcher: h,
316
+ selectSearcher: r,
317
+ selectRegion: l,
318
+ compare: n,
319
+ searcherByKey: a,
320
+ allRegionsIndexes: t,
321
+ getSearcher: c,
334
322
  getRegion: () => {
335
- var g, d;
336
- const r = f();
337
- if (r !== void 0)
338
- return (d = (g = h()) == null ? void 0 : g.regionByIndex) == null ? void 0 : d.get(r);
323
+ const i = f();
324
+ if (i !== void 0)
325
+ return c()?.regionByIndex?.get(i);
339
326
  }
340
327
  };
341
- }, yt = /* @__PURE__ */ U({
342
- __name: "selectorRegion",
343
- props: /* @__PURE__ */ N({
328
+ }, Pt = /* @__PURE__ */ R({
329
+ __name: "regionSelector",
330
+ props: /* @__PURE__ */ V({
344
331
  projectId: {},
345
332
  searchers: { default: () => [] },
346
333
  modelValue: {},
@@ -359,191 +346,479 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
359
346
  modelValueSingleModifiers: {}
360
347
  }),
361
348
  emits: ["update:modelValue", "update:modelValueSingle"],
362
- setup(t, { expose: l }) {
363
- const n = t, e = D(t, "modelValue"), i = D(t, "modelValueSingle"), {
364
- selectSearcher: a,
365
- selectRegion: o,
349
+ setup(e, { expose: a }) {
350
+ const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
351
+ selectSearcher: l,
352
+ selectRegion: n,
366
353
  compare: u,
367
354
  searcherByKey: f,
368
- allRegionsIndexes: h,
369
- getSearcher: S,
370
- getRegion: r
371
- } = Ze(n), g = () => {
355
+ allRegionsIndexes: c,
356
+ getSearcher: x,
357
+ getRegion: i
358
+ } = ct(o), m = () => {
372
359
  const d = [];
373
- f.value.forEach((x) => {
374
- x.enabled && x.regions.forEach((C) => {
375
- C.enabled && d.push(C);
360
+ f.value.forEach((s) => {
361
+ s.enabled && s.regions.forEach((g) => {
362
+ g.enabled && d.push(g);
376
363
  });
377
- }), Ye.open("selectorRegions", {
364
+ }), it.open("regions", {
378
365
  regions: d,
379
366
  regionsIndexes: u.regionsIndexes.value,
380
- "@update:regionsIndexes": (x) => u.regionsIndexes.value = x
367
+ "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
381
368
  });
382
369
  };
383
- return w([o.regionIndex, a.searcherKey, u.regionsIndexes], () => {
384
- if (a.searcherKey.value === M && u.regionsIndexes.value.length) {
385
- if (JSON.stringify(e.value) === JSON.stringify(u.regionsIndexes.value))
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))
386
373
  return;
387
- e.value = [...u.regionsIndexes.value];
374
+ t.value = [...u.regionsIndexes.value];
388
375
  } else
389
- n.onlySearcher ? (e.value = [a.searcherKey.value], a.searcherKey.value === p && !n.autoRegion && (e.value.length = 0)) : (e.value = [o.regionIndex.value], o.regionIndex.value === p && !n.autoRegion && (e.value.length = 0));
390
- !n.onlySearcher && !h.value.size && (a.searcherKey.value = p);
391
- }), i.value && w(i, () => {
392
- i.value && (e.value = [i.value]);
393
- }, { immediate: !0 }), w(e, () => {
394
- var d, x, C, T, V;
395
- if (e.value[0] && (i.value = e.value[0]), n.onlySearcher) {
396
- if (!e.value.length || e.value.length === 1 && !f.value.has(e.value[0]) || e.value.length === 1 && e.value[0] === p && !n.autoRegion) {
397
- let m = f.value.keys().next().value;
398
- m === p && !n.autoRegion && (m = void 0, i.value = p), m !== void 0 ? e.value = [m] : e.value.length = 0;
376
+ o.onlySearcher ? (t.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (t.value.length = 0)) : (t.value = [n.regionIndex.value], n.regionIndex.value === y && !o.autoRegion && (t.value.length = 0));
377
+ !o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
378
+ }), r.value && E(r, () => {
379
+ r.value && (t.value = [r.value]);
380
+ }, { immediate: !0 }), E(t, () => {
381
+ if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
382
+ if (!t.value.length || t.value.length === 1 && !f.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
383
+ let d = f.value.keys().next().value;
384
+ d === y && !o.autoRegion && (d = void 0, r.value = y), d !== void 0 ? t.value = [d] : t.value.length = 0;
399
385
  return;
400
386
  }
401
- if (e.value.length > 1 && JSON.stringify(e.value) !== JSON.stringify(u.regionsIndexes.value)) {
402
- e.value = [...u.regionsIndexes.value];
387
+ if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
388
+ t.value = [...u.regionsIndexes.value];
403
389
  return;
404
390
  }
405
391
  } else {
406
- let m = [...new Set(e.value)], s = (x = (d = f.value.values().next().value) == null ? void 0 : d.regionByIndex) == null ? void 0 : x.keys().next().value;
407
- if (n.forFrequency && (s = (V = (T = (C = f.value.values().next().value) == null ? void 0 : C.regionByIndex) == null ? void 0 : T.values().next().value) == null ? void 0 : V.key), s === p && !n.autoRegion && (s = void 0, i.value = p), !m.length)
408
- s !== void 0 && m.push(s);
409
- else if (m.length === 1) {
410
- let c = h.value;
411
- n.forFrequency && (c = /* @__PURE__ */ new Set(), f.value.forEach((v) => {
412
- v.regionByIndex.forEach((I) => {
413
- I.index !== te && I.index !== p && c.add(I.key);
392
+ let d = [...new Set(t.value)], s = f.value.values().next().value?.regionByIndex?.keys().next().value;
393
+ if (o.forFrequency && (s = f.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !d.length)
394
+ s !== void 0 && d.push(s);
395
+ else if (d.length === 1) {
396
+ let g = c.value;
397
+ o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
398
+ Z.regionByIndex.forEach((P) => {
399
+ P.index !== le && P.index !== y && g.add(P.key);
414
400
  });
415
- })), c.has(m[0]) || (m = [], s !== void 0 && m.push(s));
401
+ })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
416
402
  } else
417
- m = m.filter((c) => h.value.has(c)), !m.length && s !== void 0 && m.push(s);
418
- if (JSON.stringify(e.value) !== JSON.stringify(m)) {
419
- e.value = m;
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;
420
406
  return;
421
407
  }
422
408
  }
423
- if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : o.regionIndex.value)))
424
- if (n.onlySearcher) {
425
- if (e.value.length === 1) {
426
- a.searcherKey.value = e.value[0];
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];
427
413
  return;
428
414
  }
429
- a.searcherKey.value = M;
415
+ l.searcherKey.value = L;
430
416
  return;
431
417
  } else {
432
- if (!e.value.length)
418
+ if (!t.value.length)
433
419
  return;
434
- if (e.value.length === 1 && a.searcherKey.value !== M) {
435
- o.regionIndex.value = e.value[0];
436
- let m;
420
+ if (t.value.length === 1 && l.searcherKey.value !== L) {
421
+ n.regionIndex.value = t.value[0];
422
+ let d;
437
423
  for (const s of f.value.values()) {
438
- for (const c of s.regionByIndex.values())
439
- if ((n.forFrequency ? c.key : c.index) === o.regionIndex.value) {
440
- m = s.key;
424
+ for (const g of s.regionByIndex.values())
425
+ if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
426
+ d = s.key;
441
427
  break;
442
428
  }
443
- if (m !== void 0)
429
+ if (d !== void 0)
444
430
  break;
445
431
  }
446
- m !== void 0 && (a.searcherKey.value = m);
432
+ d !== void 0 && (l.searcherKey.value = d);
447
433
  } else
448
- a.searcherKey.value = M, u.regionsIndexes.value = [...e.value];
434
+ l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
449
435
  }
450
- }, { immediate: !0 }), l({
451
- getSearcher: S,
452
- getRegion: r
453
- }), (d, x) => (k(), b("div", {
436
+ }, { immediate: !0 }), a({
437
+ getSearcher: x,
438
+ getRegion: i
439
+ }), (d, s) => (h(), A("div", {
454
440
  class: X({
455
441
  "top-selectorRegion": !0,
456
- "top-selectorRegion-onlySearcher": d.onlySearcher
442
+ "top-selectorRegion-onlySearcher": e.onlySearcher
457
443
  })
458
444
  }, [
459
- A(re, {
460
- options: y(a).optionBySearcherKey.value,
461
- modelValue: y(a).searcherKey.value,
462
- "onUpdate:modelValue": x[0] || (x[0] = (C) => y(a).searcherKey.value = C),
445
+ N(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),
463
449
  name: "searcher_key",
464
- addChanger: d.addChanger
450
+ addChanger: e.addChanger
465
451
  }, null, 8, ["options", "modelValue", "addChanger"]),
466
- !d.onlySearcher && y(a).searcherKey.value !== y(M) ? (k(), _(re, {
452
+ !e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
467
453
  key: 0,
468
454
  class: "top-select-region",
469
- options: y(o).optionByRegionIndex.value,
470
- modelValue: y(o).regionIndex.value,
471
- "onUpdate:modelValue": x[1] || (x[1] = (C) => y(o).regionIndex.value = C),
472
- name: d.forFrequency ? "region_key" : "region_index",
473
- addChanger: d.addChanger,
474
- "data-top-icon": d.addRegionIcon ? "" : void 0
475
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : q("", !0),
476
- d.addCompare && !d.onlySearcher && y(a).searcherKey.value === y(M) ? (k(), _(H, {
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",
459
+ addChanger: e.addChanger,
460
+ "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(Q, {
477
463
  key: 1,
478
464
  name: "compare",
479
- onClick: g,
480
- "data-count-compare-regions-indexes": y(u).regionsIndexes.value.length
465
+ onClick: m,
466
+ "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
481
467
  }, {
482
468
  default: B(() => [
483
- G(K(d.$i18n.Common.Selected_regions), 1)
469
+ z(b(d.$i18n.Common.Selected_regions), 1)
484
470
  ]),
485
471
  _: 1
486
- }, 8, ["data-count-compare-regions-indexes"])) : q("", !0)
472
+ }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
487
473
  ], 2));
488
474
  }
489
- }), ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, ae = (t, l) => {
490
- t = Q(t);
491
- const n = l.find((e) => e.id === t);
492
- if (n)
493
- return n;
494
- }, pt = (t, l, n) => {
495
- l || (l = { id: t.id }), l.id = t.id, l.pos ??= "3", l.notch ??= !0, l.posBy ??= "fixed";
496
- const e = De.genElPopupOpener("div", l);
497
- return e.classList.add("top-tagSelector"), t.useTopButton && e.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), t.useTopButton || e.classList.add("top-tagSelector-custom"), t.mode === "filter" && e.classList.add("top-tagSelector-filter"), t.mode === "setter" && !t.filters && e.classList.add("top-tagSelector-setter_single"), t.mode === "setter" && t.filters && e.classList.add("top-tagSelector-setter_several"), e.onclick = (i) => {
498
- i.preventDefault(), i.stopPropagation(), e.onclick = null;
499
- const a = F(t.modelValue), o = {
500
- model: a,
501
- mode: t.mode,
502
- targetId: t.targetId,
503
- filters: t.filters,
504
- payload: t.payload
475
+ }), j = {
476
+ id: 0,
477
+ name: "/",
478
+ path: "/"
479
+ };
480
+ function gt(e) {
481
+ return e ? M()?.Common.All_folders : "/ (" + M()?.Keywords.Root_folder + ")";
482
+ }
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) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
488
+ function ge(e, a, o) {
489
+ const t = Object.keys(e), r = t.map((l) => e[l]);
490
+ return E(r, (l, n, u) => {
491
+ const f = {};
492
+ l.forEach((c, x) => {
493
+ if (!Object.is(c, n[x])) {
494
+ const i = t[x];
495
+ f[i] = {
496
+ old: n[x],
497
+ new: c
498
+ };
499
+ }
500
+ }), Object.keys(f).length && a(f, u);
501
+ }, o);
502
+ }
503
+ const mt = /* @__PURE__ */ R({
504
+ __name: "folders",
505
+ props: /* @__PURE__ */ V({
506
+ folderId: {},
507
+ folder: {},
508
+ folders: {},
509
+ projectId: {},
510
+ canSelectAll: { type: Boolean },
511
+ addChanger: { type: Boolean },
512
+ addIcon: { type: Boolean, default: !0 },
513
+ client: {}
514
+ }, {
515
+ folderId: { required: !0 },
516
+ folderIdModifiers: {},
517
+ folder: { default: j },
518
+ folderModifiers: {}
519
+ }),
520
+ emits: ["update:folderId", "update:folder"],
521
+ setup(e) {
522
+ const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client) : void 0, l = K(null);
523
+ E(() => a.projectId, () => {
524
+ r?.changeParams({
525
+ project_id: a.projectId
526
+ }), r?.setOptions({
527
+ checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
528
+ }), l.value?.resetCache();
529
+ }, { immediate: !0 });
530
+ const n = w(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
531
+ return ge({
532
+ modelFolder: t,
533
+ modelFolderId: o
534
+ }, async (u) => {
535
+ if (o.value === t.value.id)
536
+ return;
537
+ if (u.modelFolder && !u.modelFolderId) {
538
+ o.value = t.value.id;
539
+ return;
540
+ }
541
+ let f = n.value.get(a.folderId);
542
+ f || (f = j), t.value = f, o.value = f.id;
543
+ }, { immediate: !0 }), (u, f) => (h(), C(we, {
544
+ class: "top-groupSelector_folder",
545
+ modelValue: t.value,
546
+ "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
547
+ items: e.folders ? [...n.value.values()] : void 0,
548
+ "search-type": "inline",
549
+ icon: e.addIcon ? "" : void 0,
550
+ api: e.folders ? void 0 : v(r),
551
+ apiSetSearchParams: (...c) => v(Ee)(...c, "name"),
552
+ addChanger: e.addChanger,
553
+ useCache: ""
554
+ }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
555
+ }
556
+ }), ne = {
557
+ id: -1,
558
+ name: "--",
559
+ folder_id: j.id,
560
+ folder_path: j.path
561
+ }, re = {
562
+ id: $e,
563
+ name: "All groups",
564
+ folder_id: j.id,
565
+ folder_path: j.path
566
+ }, W = () => (re.name = M()?.Common.All_groups, re), Le = () => (re.name = M()?.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) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), pt = (e) => e.gen("/add/keywords_2/groups/"), yt = { class: "top-groupSelector_groupItem" }, ht = {
567
+ key: 0,
568
+ class: "top-comment"
569
+ }, It = {
570
+ key: 1,
571
+ class: "top-groupSelector_groupItemFolderPath"
572
+ }, St = /* @__PURE__ */ R({
573
+ __name: "groups",
574
+ props: /* @__PURE__ */ V({
575
+ groupId: {},
576
+ group: {},
577
+ projectId: {},
578
+ folder: {},
579
+ groups: {},
580
+ on: { type: Boolean, default: void 0 },
581
+ canAdd: { type: [String, Boolean] },
582
+ canSelectAll: { type: [Boolean, String] },
583
+ autoselect: { default: "first" },
584
+ addChanger: { type: Boolean, default: !0 },
585
+ addIcon: { type: Boolean, default: !0 },
586
+ client: {}
587
+ }, {
588
+ groupId: { required: !0 },
589
+ groupIdModifiers: {},
590
+ group: { required: !0 },
591
+ groupModifiers: {}
592
+ }),
593
+ emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
594
+ setup(e, { emit: a }) {
595
+ const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? pt(o.client) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
596
+ n?.changeParams({
597
+ project_id: o.projectId,
598
+ filters: [
599
+ x
600
+ ]
601
+ }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [o.on]));
602
+ const i = (d) => {
603
+ l.value = d, r.value = d.id;
604
+ };
605
+ ge({
606
+ projectId: () => o.projectId,
607
+ folderId: () => o.folder?.id,
608
+ canSelectAll: () => o.canSelectAll
609
+ }, (d) => {
610
+ if (d.projectId && (n?.changeParams({
611
+ project_id: o.projectId
612
+ }), n?.setOptions({
613
+ checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
614
+ })), d.folderId && (x.values = [
615
+ o.folder?.id ?? 0
616
+ ], 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) {
617
+ let s;
618
+ o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(W()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
619
+ }
620
+ }, { immediate: !0 }), ge({
621
+ modelGroup: l,
622
+ modelGroupId: r
623
+ }, async (d) => {
624
+ if (r.value !== l.value.id) {
625
+ if (d.modelGroup && !d.modelGroupId) {
626
+ r.value = l.value.id;
627
+ return;
628
+ }
629
+ if (!(o.canAdd && r.value === ue)) {
630
+ if (o.groups) {
631
+ let s = c.value?.find((g) => g.id === r.value);
632
+ if (!s && o.canSelectAll && (s = W()), s)
633
+ i(s);
634
+ else {
635
+ const g = c.value?.[0];
636
+ g && !r.value ? i(g) : i(ne);
637
+ }
638
+ }
639
+ if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
640
+ const s = Ce(o.client).changeParams({
641
+ project_id: o.projectId,
642
+ id: r.value,
643
+ filters: [
644
+ x
645
+ ]
646
+ });
647
+ s?.setOptions({
648
+ checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
649
+ });
650
+ const g = await s.call();
651
+ if (!g.errors?.length && !g.result) return;
652
+ !g.errors && g.result[0] ? i(g.result[0]) : i(ne);
653
+ }
654
+ }
655
+ }
656
+ }, { immediate: !0 });
657
+ const m = async (d) => {
658
+ if (o.canAdd !== "api" || !u) return;
659
+ const s = l.value, g = await u.changeParams({
660
+ project_id: o.projectId,
661
+ names: [d.name],
662
+ to_id: o.folder?.id ?? j.id,
663
+ to_type: "in_folder_last"
664
+ }).call();
665
+ g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
666
+ };
667
+ return (d, s) => (h(), C(we, {
668
+ ref_key: "refSelector",
669
+ ref: f,
670
+ class: "top-groupSelector_group",
671
+ modelValue: l.value,
672
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
673
+ items: c.value ?? e.groups,
674
+ searchType: "inline",
675
+ icon: e.addIcon ? "" : void 0,
676
+ api: e.groups ? void 0 : v(n),
677
+ apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
678
+ appendSearchToResult: !!e.canAdd,
679
+ useAllItem: e.canSelectAll ? v(W)().name : !1,
680
+ addChanger: e.addChanger,
681
+ useCache: "",
682
+ onAppendItem: m
683
+ }, {
684
+ item: B(({ item: g }) => [
685
+ oe("div", yt, [
686
+ g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
687
+ oe("span", null, b(g.name), 1),
688
+ g.folder_path ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
689
+ ])
690
+ ]),
691
+ _: 1
692
+ }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
693
+ }
694
+ }), xt = { class: "top-groupSelector" }, Dt = /* @__PURE__ */ R({
695
+ __name: "groupSelector",
696
+ props: /* @__PURE__ */ V({
697
+ folderId: {},
698
+ folder: {},
699
+ groupId: {},
700
+ group: {},
701
+ projectId: {},
702
+ folders: {},
703
+ groups: {},
704
+ on: { type: Boolean, default: void 0 },
705
+ canSelectAllGroups: { type: Boolean },
706
+ canAddGroup: {},
707
+ autoselect: { default: "first" },
708
+ addChanger: { type: Boolean, default: !0 },
709
+ showFolders: { type: Boolean, default: !0 },
710
+ showGroups: { type: Boolean, default: !0 },
711
+ addIcon: { type: Boolean, default: !0 },
712
+ client: {}
713
+ }, {
714
+ folderId: { required: !0 },
715
+ folderIdModifiers: {},
716
+ folder: {},
717
+ folderModifiers: {},
718
+ groupId: { required: !0 },
719
+ groupIdModifiers: {},
720
+ group: { default: ne },
721
+ groupModifiers: {}
722
+ }),
723
+ emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
724
+ setup(e, { emit: a }) {
725
+ 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);
726
+ r.value = f.get(t.value);
727
+ let c = o.groups?.find((i) => i.id === l.value);
728
+ l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
729
+ const x = (i) => {
730
+ let m;
731
+ o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
732
+ };
733
+ return (i, m) => (h(), A("div", xt, [
734
+ e.showFolders ? (h(), C(mt, {
735
+ key: 0,
736
+ folderId: t.value,
737
+ "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
738
+ folder: r.value,
739
+ "onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
740
+ projectId: e.projectId,
741
+ folders: e.folders,
742
+ canSelectAll: e.canSelectAllGroups,
743
+ addChanger: e.addChanger,
744
+ addIcon: e.addIcon,
745
+ client: e.client
746
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
747
+ e.showGroups ? (h(), C(St, {
748
+ key: 1,
749
+ groupId: l.value,
750
+ "onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
751
+ group: n.value,
752
+ "onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
753
+ projectId: e.projectId,
754
+ folder: r.value,
755
+ groups: e.groups,
756
+ on: e.on,
757
+ canAdd: e.canAddGroup,
758
+ canSelectAll: e.canSelectAllGroups,
759
+ autoselect: e.autoselect,
760
+ addChanger: e.addChanger,
761
+ addIcon: e.addIcon,
762
+ client: e.client,
763
+ onAddGroup: x
764
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : O("", !0)
765
+ ]));
766
+ }
767
+ }), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
768
+ e = H(e);
769
+ const o = a.find((t) => t.id === e);
770
+ if (o)
771
+ return o;
772
+ }, qt = (e, a, o) => {
773
+ a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
774
+ const t = Xe.genElPopupOpener("div", a);
775
+ 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) => {
776
+ r.preventDefault(), r.stopPropagation(), t.onclick = null;
777
+ const l = K(e.modelValue), n = {
778
+ model: l,
779
+ mode: e.mode,
780
+ targetId: e.targetId,
781
+ filters: e.filters,
782
+ payload: e.payload
505
783
  };
506
- W(e, "topTagSelectorTarget", o), delete e.dataset.topPopupDisabled, ce(t.modelValue) || w(a, () => {
507
- t.modelValue = a.value, ee(e, t, n);
508
- }), e.click();
509
- }, ce(t.modelValue) ? w(t.modelValue, () => ee(e, t, n)) : W(e, "topTagSelectorRender", (i) => {
510
- t.modelValue = i;
511
- const a = W(e, "topTagSelectorTarget");
512
- a && (a.model.value = i), ee(e, t, n);
513
- }), ee(e, t, n), e;
514
- }, ht = (t, l) => {
515
- var n;
516
- (n = W(t, "topTagSelectorRender")) == null || n(l);
517
- }, ee = (t, l, n) => {
518
- var i;
519
- const e = y(l.modelValue);
520
- if (t.classList.toggle("top-tagSelector-selectedOne", !e.length || e.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", e.length > 5), l.mode === "setter" && l.filters) {
521
- t.innerHTML = `<div>${n}</div>`;
784
+ J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
785
+ e.modelValue = l.value, te(t, e, o);
786
+ }), t.click();
787
+ }, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
788
+ e.modelValue = r;
789
+ const l = J(t, "topTagSelectorTarget");
790
+ l && (l.model.value = r), te(t, e, o);
791
+ }), te(t, e, o), t;
792
+ }, Ft = (e, a) => {
793
+ J(e, "topTagSelectorRender")?.(a);
794
+ }, te = (e, a, o) => {
795
+ const t = v(a.modelValue);
796
+ 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) {
797
+ e.innerHTML = `<div>${o}</div>`;
522
798
  return;
523
799
  }
524
- if (t.innerHTML = "", !e.length && l.mode === "filter") {
525
- const a = ye({
800
+ if (e.innerHTML = "", !t.length && a.mode === "filter") {
801
+ const r = Te({
526
802
  id: "all",
527
803
  colorId: "",
528
- name: ((i = R().Common) == null ? void 0 : i.All_tags) ?? "",
804
+ name: M().Common?.All_tags ?? "",
529
805
  state: ""
530
806
  });
531
- t.append(a);
807
+ e.append(r);
532
808
  }
533
- e.forEach((a) => {
534
- var u, f;
535
- const o = ye({
536
- id: Q(a),
537
- colorId: ((u = ae(a, l.tags)) == null ? void 0 : u.color_id) ?? "",
538
- name: ((f = ae(a, l.tags)) == null ? void 0 : f.name) ?? "",
539
- state: Q(a) === a ? "selected" : "excluded"
809
+ t.forEach((r) => {
810
+ const l = Te({
811
+ id: H(r),
812
+ colorId: ie(r, a.tags)?.color_id ?? "",
813
+ name: ie(r, a.tags)?.name ?? "",
814
+ state: H(r) === r ? "selected" : "excluded"
540
815
  });
541
- t.append(o);
816
+ e.append(l);
542
817
  });
543
- }, ye = (t) => {
544
- const l = document.createElement("div");
545
- return l.classList.add("top-tagSelector_tagIcon"), l.classList.toggle("top-tagSelector-active", !!t.state), l.classList.toggle("top-tagSelector-excluded", t.state === "excluded"), l.dataset.tag_id = t.id, l.dataset.tag_color_id = t.colorId, l.title = t.name, l;
546
- }, et = [
818
+ }, Te = (e) => {
819
+ const a = document.createElement("div");
820
+ 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;
821
+ }, kt = [
547
822
  {
548
823
  id: "1",
549
824
  name: "Without Tag",
@@ -594,7 +869,7 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
594
869
  name: "Turquoise",
595
870
  color_id: "10"
596
871
  }
597
- ], tt = ["data-tag_id", "data-tag_color_id", "title"], ie = /* @__PURE__ */ U({
872
+ ], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
598
873
  __name: "tagIcon",
599
874
  props: {
600
875
  id: {},
@@ -602,21 +877,21 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
602
877
  name: {},
603
878
  state: {}
604
879
  },
605
- setup(t) {
606
- return (l, n) => (k(), b("div", {
880
+ setup(e) {
881
+ return (a, o) => (h(), A("div", {
607
882
  class: X({
608
883
  "top-tagSelector_tagIcon": !0,
609
- "top-tagSelector-active": !!l.state,
610
- "top-tagSelector-excluded": l.state === "excluded"
884
+ "top-tagSelector-active": !!e.state,
885
+ "top-tagSelector-excluded": e.state === "excluded"
611
886
  }),
612
- "data-tag_id": l.id,
613
- "data-tag_color_id": l.colorId,
614
- title: l.name
615
- }, null, 10, tt));
887
+ "data-tag_id": e.id,
888
+ "data-tag_color_id": e.colorId,
889
+ title: e.name
890
+ }, null, 10, Ct));
616
891
  }
617
- }), lt = ["contenteditable", "onKeydown"], pe = /* @__PURE__ */ U({
892
+ }), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
618
893
  __name: "tagPopupListItem",
619
- props: /* @__PURE__ */ N({
894
+ props: /* @__PURE__ */ V({
620
895
  editable: { type: Boolean },
621
896
  disabled: { type: Boolean },
622
897
  canExclude: { type: Boolean },
@@ -630,76 +905,74 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
630
905
  },
631
906
  nameModifiers: {}
632
907
  }),
633
- emits: /* @__PURE__ */ N(["update:name", "unselect", "exclude", "select"], ["update:name"]),
634
- setup(t, { emit: l }) {
635
- const n = t, e = l, i = D(t, "name"), a = F(null), o = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
908
+ emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
909
+ setup(e, { emit: a }) {
910
+ const o = e, t = a, r = T(e, "name"), l = K(null), n = w(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
636
911
  contenteditable: u.value,
637
- onpaste: (g) => g.preventDefault()
638
- } : {}), u = F(!1), f = async () => {
639
- var g;
640
- u.value = !0, await Be(), (g = a.value) == null || g.focus();
641
- }, h = () => {
642
- var d;
643
- const g = (d = a.value) == null ? void 0 : d.innerText;
644
- if (!g) return S();
645
- a.value && (a.value.innerText = g), u.value = !1, e("update:name", g);
646
- }, S = async () => {
647
- a.value && (a.value.innerText = n.name), u.value = !1;
648
- }, r = (g) => {
649
- if (u.value || n.disabled) return;
912
+ onpaste: (m) => m.preventDefault()
913
+ } : {}), u = K(!1), f = async () => {
914
+ u.value = !0, await Re(), l.value?.focus();
915
+ }, c = () => {
916
+ const m = l.value?.innerText;
917
+ if (!m) return x();
918
+ l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
919
+ }, x = async () => {
920
+ l.value && (l.value.innerText = o.name), u.value = !1;
921
+ }, i = (m) => {
922
+ if (u.value || o.disabled) return;
650
923
  let d = "selected";
651
- n.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), n.state == d && (d = ""), d === "" && e("unselect"), d === "selected" && e("select"), d === "excluded" && e("exclude");
924
+ o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
652
925
  };
653
- return (g, d) => (k(), _(ue, {
926
+ return (m, d) => (h(), C(ve, {
654
927
  class: X({
655
928
  "top-tagSelector_tagListItem": !0,
656
929
  "top-tagSelector_tagListItem-inEdit": u.value,
657
- "top-tagSelector_tagListItem-disabled": g.disabled,
658
- "top-tagSelector_tagListItem-canExclude": g.canExclude,
659
- "top-tagSelector-active": !!g.state,
660
- "top-tagSelector-excluded": g.state === "excluded"
930
+ "top-tagSelector_tagListItem-disabled": e.disabled,
931
+ "top-tagSelector_tagListItem-canExclude": e.canExclude,
932
+ "top-tagSelector-active": !!e.state,
933
+ "top-tagSelector-excluded": e.state === "excluded"
661
934
  }),
662
- onClick: J(r, ["stop"])
935
+ onClick: U(i, ["stop"])
663
936
  }, {
664
937
  default: B(() => [
665
- A(ie, {
666
- id: g.id,
667
- name: i.value,
668
- colorId: g.colorId,
669
- state: g.state
938
+ N(fe, {
939
+ id: e.id,
940
+ name: r.value,
941
+ colorId: e.colorId,
942
+ state: e.state
670
943
  }, null, 8, ["id", "name", "colorId", "state"]),
671
- he("span", Se({
944
+ oe("span", Ve({
672
945
  ref_key: "elName",
673
- ref: a,
946
+ ref: l,
674
947
  class: "top-tagSelector_tagListItemName",
675
948
  contenteditable: u.value ? "plaintext-only" : !1
676
- }, o.value, {
949
+ }, n.value, {
677
950
  onKeydown: [
678
- ge(J(h, ["stop"]), ["enter"]),
679
- ge(J(S, ["stop"]), ["esc"])
951
+ Ie(U(c, ["stop"]), ["enter"]),
952
+ Ie(U(x, ["stop"]), ["esc"])
680
953
  ]
681
- }), K(i.value), 17, lt),
682
- g.editable ? (k(), b(Y, { key: 0 }, [
683
- u.value ? (k(), b("span", {
954
+ }), b(r.value), 17, Bt),
955
+ e.editable ? (h(), A(Y, { key: 0 }, [
956
+ u.value ? (h(), A("span", {
684
957
  key: 1,
685
958
  "data-top-icon": "",
686
959
  class: "top-tagSelector_edit",
687
- onClick: J(h, ["stop"])
688
- })) : (k(), b("span", {
960
+ onClick: U(c, ["stop"])
961
+ })) : (h(), A("span", {
689
962
  key: 0,
690
963
  "data-top-icon": "",
691
964
  class: "top-tagSelector_edit",
692
965
  onClick: f
693
966
  }))
694
- ], 64)) : q("", !0)
967
+ ], 64)) : O("", !0)
695
968
  ]),
696
969
  _: 1
697
970
  }, 8, ["class"]));
698
971
  }
699
- }), at = { key: 1 }, ot = /* @__PURE__ */ U({
972
+ }), Tt = { key: 1 }, At = /* @__PURE__ */ R({
700
973
  inheritAttrs: !1,
701
974
  __name: "popupOpener",
702
- props: /* @__PURE__ */ N({
975
+ props: /* @__PURE__ */ V({
703
976
  modelValue: {},
704
977
  id: {},
705
978
  tags: {},
@@ -716,65 +989,62 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
716
989
  modelModifiers: {}
717
990
  }),
718
991
  emits: ["update:modelValue"],
719
- setup(t) {
720
- const l = t, n = D(t, "modelValue"), e = l.useTopButton ? H : "div", i = l.useTopButton ? "html" : "default", a = {
721
- model: n,
722
- mode: l.mode,
723
- targetId: l.targetId,
724
- filters: l.filters,
725
- payload: l.payload
992
+ setup(e) {
993
+ const a = e, o = T(e, "modelValue"), t = a.useTopButton ? Q : "div", r = a.useTopButton ? "html" : "default", l = {
994
+ model: o,
995
+ mode: a.mode,
996
+ targetId: a.targetId,
997
+ filters: a.filters,
998
+ payload: a.payload
726
999
  };
727
- return (o, u) => {
728
- const f = _e("top-data");
729
- return k(), _(Fe, { id: o.id }, {
1000
+ return (n, u) => {
1001
+ const f = Ne("top-data");
1002
+ return h(), C(ze, { id: e.id }, {
730
1003
  default: B(() => [
731
- be((k(), _(Ve(y(e)), Se({
1004
+ Pe((h(), C(De(v(t)), Ve({
732
1005
  class: {
733
1006
  "top-tagSelector": !0,
734
- "top-tagSelector-useTopButton": l.useTopButton,
735
- "top-tagSelector-custom": !l.useTopButton,
736
- "top-as-selector": l.useTopButton,
737
- "top-tagSelector-filter": l.mode === "filter",
738
- "top-tagSelector-setter_single": l.mode === "setter" && !o.filters,
739
- "top-tagSelector-setter_several": l.mode === "setter" && o.filters,
740
- "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
741
- "top-tagSelector-toTwoLine": n.value.length > 5
1007
+ "top-tagSelector-useTopButton": a.useTopButton,
1008
+ "top-tagSelector-custom": !a.useTopButton,
1009
+ "top-as-selector": a.useTopButton,
1010
+ "top-tagSelector-filter": a.mode === "filter",
1011
+ "top-tagSelector-setter_single": a.mode === "setter" && !e.filters,
1012
+ "top-tagSelector-setter_several": a.mode === "setter" && e.filters,
1013
+ "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
1014
+ "top-tagSelector-toTwoLine": o.value.length > 5
742
1015
  },
743
1016
  color: "theme",
744
- styling: o.styling
745
- }, o.$attrs), {
746
- [y(i)]: B(() => [
747
- !n.value.length && o.mode === "filter" ? (k(), _(ie, {
1017
+ styling: e.styling
1018
+ }, n.$attrs), {
1019
+ [v(r)]: B(() => [
1020
+ !o.value.length && e.mode === "filter" ? (h(), C(fe, {
748
1021
  key: 0,
749
1022
  id: "all",
750
1023
  colorId: "",
751
- name: o.$i18n.Common.All_tags ?? "",
1024
+ name: n.$i18n.Common.All_tags ?? "",
752
1025
  state: ""
753
- }, null, 8, ["name"])) : q("", !0),
754
- o.mode === "setter" && o.filters ? (k(), b("div", at, [
755
- Ee(o.$slots, "default")
756
- ])) : (k(!0), b(Y, { key: 2 }, se(n.value, (h) => {
757
- var S, r;
758
- return k(), _(ie, {
759
- id: y(Q)(h),
760
- colorId: ((S = y(ae)(h, o.tags)) == null ? void 0 : S.color_id) ?? "",
761
- name: ((r = y(ae)(h, o.tags)) == null ? void 0 : r.name) ?? "",
762
- state: y(Q)(h) === h ? "selected" : "excluded"
763
- }, null, 8, ["id", "colorId", "name", "state"]);
764
- }), 256))
1026
+ }, null, 8, ["name"])) : O("", !0),
1027
+ e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
1028
+ qe(n.$slots, "default")
1029
+ ])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
1030
+ id: v(H)(c),
1031
+ colorId: v(ie)(c, e.tags)?.color_id ?? "",
1032
+ name: v(ie)(c, e.tags)?.name ?? "",
1033
+ state: v(H)(c) === c ? "selected" : "excluded"
1034
+ }, null, 8, ["id", "colorId", "name", "state"]))), 256))
765
1035
  ]),
766
1036
  _: 2
767
1037
  }, 1040, ["class", "styling"])), [
768
- [f, a, "topTagSelectorTarget"]
1038
+ [f, l, "topTagSelectorTarget"]
769
1039
  ])
770
1040
  ]),
771
1041
  _: 3
772
1042
  }, 8, ["id"]);
773
1043
  };
774
1044
  }
775
- }), St = /* @__PURE__ */ U({
1045
+ }), Ut = /* @__PURE__ */ R({
776
1046
  __name: "tagSelector",
777
- props: /* @__PURE__ */ N({
1047
+ props: /* @__PURE__ */ V({
778
1048
  modelValue: {},
779
1049
  tags: {},
780
1050
  tagsEditable: { type: Boolean },
@@ -792,180 +1062,177 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
792
1062
  },
793
1063
  modelModifiers: {},
794
1064
  tags: {
795
- default: $e(et)
1065
+ default: be(kt)
796
1066
  },
797
1067
  tagsModifiers: {}
798
1068
  }),
799
- emits: /* @__PURE__ */ N(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
800
- setup(t, { emit: l }) {
801
- const n = R(), e = t, i = D(t, "modelValue"), a = D(t, "tags"), o = l, u = we((s, c) => {
802
- o(s, c);
803
- }, e.emitDelay);
804
- e.singleMode && !i.value.length && (i.value = [a.value[0].id]);
805
- const f = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
806
- var v;
807
- const s = " " + ((v = n.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
808
- return c.set("add", { value: "add", title: n.Common.Add + s }), c.set("replace", { value: "replace", title: n.Common.Replace + s }), c.set("delete", { value: "delete", title: n.Common.Delete + s }), c;
1069
+ emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1070
+ setup(e, { emit: a }) {
1071
+ const o = M(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = _e((p, I) => {
1072
+ n(p, I);
1073
+ }, t.emitDelay);
1074
+ t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1075
+ const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
1076
+ const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1077
+ 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;
809
1078
  };
810
- let r = Me({
811
- model: i,
1079
+ let i = Fe({
1080
+ model: r,
812
1081
  mode: "filter",
813
1082
  targetId: void 0,
814
1083
  filters: void 0,
815
1084
  payload: void 0
816
1085
  });
817
- w(i, () => {
818
- u("selector", i.value);
1086
+ E(r, () => {
1087
+ u("selector", r.value);
819
1088
  });
820
- const g = E(() => {
821
- if (r.value.mode === "setter" && e.maxTagsForSetter && !r.value.filters)
822
- return r.value.model.value.length >= e.maxTagsForSetter;
823
- }), d = (s) => {
824
- if (s !== "all") {
825
- if (r.value.model.value.includes(s)) return "selected";
826
- if (r.value.model.value.includes(ve(s))) return "excluded";
1089
+ const m = w(() => {
1090
+ if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1091
+ return i.value.model.value.length >= t.maxTagsForSetter;
1092
+ }), d = (p) => {
1093
+ if (p !== "all") {
1094
+ if (i.value.model.value.includes(p)) return "selected";
1095
+ if (i.value.model.value.includes(Be(p))) return "excluded";
827
1096
  }
828
- return s === "all" && !r.value.model.value.length ? "selected" : "";
829
- }, x = (s, c) => {
830
- const v = ve(s);
831
- let I = r.value.model.value.filter((L) => L !== s && L !== v);
832
- c === "select" && I.push(s), c === "exclude" && I.push(v), r.value.mode === "setter" && r.value.targetId !== void 0 && e.requiredForSetter && (I.length || I.push("1"), I.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (I = I.filter((L) => L !== "1"))), e.singleMode && !r.value.filters && (I.length || (I = r.value.model.value), I.length > 1 && (I = [I[I.length - 1]])), I.sort((L, P) => {
833
- if (!e.tags) return 0;
834
- const Z = e.tags.findIndex((O) => O.id === L), z = e.tags.findIndex((O) => O.id === P);
835
- return Z - z;
836
- }), r.value.model.value = I, r.value.mode === "setter" && r.value.targetId !== void 0 && u("setter", {
837
- tagsIds: I,
838
- targetId: r.value.targetId,
839
- payload: r.value.payload
1097
+ return p === "all" && !i.value.model.value.length ? "selected" : "";
1098
+ }, s = (p, I) => {
1099
+ const S = Be(p);
1100
+ let k = i.value.model.value.filter((G) => G !== p && G !== S);
1101
+ 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) => {
1102
+ if (!t.tags) return 0;
1103
+ const D = t.tags.findIndex((F) => F.id === G), q = t.tags.findIndex((F) => F.id === ee);
1104
+ return D - q;
1105
+ }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1106
+ tagsIds: k,
1107
+ targetId: i.value.targetId,
1108
+ payload: i.value.payload
840
1109
  });
841
- }, C = E(() => {
842
- let s = "top-tagSelector_popup";
843
- return r.value.mode === "filter" && (s += " top-tagSelector_popup-filter"), r.value.mode === "setter" && (s += " top-tagSelector_popup-setter"), s;
844
- }), T = () => {
845
- const s = prompt("", "New tag");
846
- if (!s || s === "New tag") return;
847
- const c = a.value.length + 1;
848
- a.value.push({
849
- id: String(c),
850
- name: s,
851
- color_id: String((c - 1) % 10 + 1)
852
- }), o("tagsChanged", a.value);
853
- }, V = (s) => {
854
- var c;
855
- if (r.value = W(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
856
- if (r.value.filters && (h.value = "add", r.value.model.value = []), !((c = j.$) != null && c.ui.sortable)) {
1110
+ }, g = w(() => {
1111
+ let p = "top-tagSelector_popup";
1112
+ return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
1113
+ }), Z = () => {
1114
+ const p = prompt("", "New tag");
1115
+ if (!p || p === "New tag") return;
1116
+ const I = l.value.length + 1;
1117
+ l.value.push({
1118
+ id: String(I),
1119
+ name: p,
1120
+ color_id: String((I - 1) % 10 + 1)
1121
+ }), n("tagsChanged", l.value);
1122
+ }, P = (p) => {
1123
+ if (i.value = J(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1124
+ if (i.value.filters && (c.value = "add", i.value.model.value = []), !_.$?.ui.sortable) {
857
1125
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
858
1126
  return;
859
1127
  }
860
- !j.state.isMobile && !j.state.isMobileUA && a.value && $(s.elPopup).sortable({
1128
+ !_.state.isMobile && !_.state.isMobileUA && l.value && $(p.elPopup).sortable({
861
1129
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
862
1130
  /**
863
1131
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
864
1132
  */
865
1133
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
866
1134
  distance: 10,
867
- stop: function(v, I) {
868
- if (!a.value) return;
869
- const L = $(I.item).parent().find("[data-tag_id]"), P = [];
870
- L.each((Z, z) => {
871
- if (!a.value) return;
872
- const O = $(z).attr("data-tag_id");
873
- P.push(O);
874
- }), a.value.sort((Z, z) => {
875
- const O = P.findIndex((oe) => oe === Z.id), Ce = P.findIndex((oe) => oe === z.id);
876
- return O - Ce;
877
- }), u("tagsChanged", a.value);
1135
+ stop: function(I, S) {
1136
+ if (!l.value) return;
1137
+ const k = $(S.item).parent().find("[data-tag_id]"), G = [];
1138
+ k.each((ee, D) => {
1139
+ if (!l.value) return;
1140
+ const q = $(D).attr("data-tag_id");
1141
+ G.push(q);
1142
+ }), l.value.sort((ee, D) => {
1143
+ const q = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === D.id);
1144
+ return q - F;
1145
+ }), u("tagsChanged", l.value);
878
1146
  }
879
1147
  });
880
- }, m = (s) => {
881
- var c;
882
- (c = j.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
1148
+ }, je = (p) => {
1149
+ _.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
883
1150
  };
884
- return (s, c) => (k(), b(Y, null, [
885
- A(ot, {
886
- modelValue: i.value,
887
- "onUpdate:modelValue": c[0] || (c[0] = (v) => i.value = v),
888
- id: y(f),
889
- tags: a.value,
890
- styling: s.styling,
1151
+ return (p, I) => (h(), A(Y, null, [
1152
+ N(At, {
1153
+ modelValue: r.value,
1154
+ "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
1155
+ id: v(f),
1156
+ tags: l.value,
1157
+ styling: e.styling,
891
1158
  mode: "filter",
892
- useTopButton: s.useTopButton
1159
+ useTopButton: e.useTopButton
893
1160
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
894
- A(Ie, {
895
- id: y(f),
896
- class: X(C.value),
897
- onOpen: c[4] || (c[4] = (v) => V(v)),
898
- onClose: c[5] || (c[5] = (v) => m(v)),
1161
+ N(Me, {
1162
+ id: v(f),
1163
+ class: X(g.value),
1164
+ onOpen: I[4] || (I[4] = (S) => P(S)),
1165
+ onClose: I[5] || (I[5] = (S) => je(S)),
899
1166
  "transition-duration": 50
900
- }, Ke({
1167
+ }, Ue({
901
1168
  contentList: B(() => [
902
- y(r).mode === "filter" && !s.singleMode ? (k(), _(pe, {
1169
+ v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
903
1170
  key: 0,
904
1171
  id: "all",
905
1172
  colorId: "",
906
- name: s.$i18n.Common.All_tags ?? "",
907
- state: y(r).model.value.length ? "" : "selected",
908
- onSelect: c[3] || (c[3] = (v) => y(r).model.value = [])
909
- }, null, 8, ["name", "state"])) : q("", !0),
910
- (k(!0), b(Y, null, se(a.value, (v) => (k(), _(pe, {
911
- key: v.id,
912
- id: v.id,
913
- colorId: v.color_id,
914
- name: v.name,
915
- state: d(v.id),
916
- canExclude: y(r).mode === "filter" && !s.singleMode,
917
- editable: s.tagsEditable,
918
- disabled: g.value && d(v.id) === "",
919
- onUnselect: (I) => x(v.id, "unselect"),
920
- onSelect: (I) => x(v.id, "select"),
921
- onExclude: (I) => x(v.id, "exclude"),
922
- "onUpdate:name": (I) => {
923
- v.name = I, y(u)("tagsChanged", a.value);
1173
+ name: p.$i18n.Common.All_tags ?? "",
1174
+ state: v(i).model.value.length ? "" : "selected",
1175
+ onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
1176
+ }, null, 8, ["name", "state"])) : O("", !0),
1177
+ (h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
1178
+ key: S.id,
1179
+ id: S.id,
1180
+ colorId: S.color_id,
1181
+ name: S.name,
1182
+ state: d(S.id),
1183
+ canExclude: v(i).mode === "filter" && !e.singleMode,
1184
+ editable: e.tagsEditable,
1185
+ disabled: m.value && d(S.id) === "",
1186
+ onUnselect: (k) => s(S.id, "unselect"),
1187
+ onSelect: (k) => s(S.id, "select"),
1188
+ onExclude: (k) => s(S.id, "exclude"),
1189
+ "onUpdate:name": (k) => {
1190
+ S.name = k, v(u)("tagsChanged", l.value);
924
1191
  }
925
1192
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
926
- s.tagsEditable && a.value.length < s.tagsMax && a.value.length < 20 ? (k(), _(ue, {
1193
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
927
1194
  key: 1,
928
1195
  "data-top-icon": "",
929
- onClick: J(T, ["stop"])
1196
+ onClick: U(Z, ["stop"])
930
1197
  }, {
931
1198
  default: B(() => [
932
- G(K(s.$i18n.Common.Add), 1)
1199
+ z(b(p.$i18n.Common.Add), 1)
933
1200
  ]),
934
1201
  _: 1
935
- })) : q("", !0)
1202
+ })) : O("", !0)
936
1203
  ]),
937
1204
  _: 2
938
1205
  }, [
939
- y(r).mode === "setter" && y(r).filters ? {
1206
+ v(i).mode === "setter" && v(i).filters ? {
940
1207
  name: "header",
941
1208
  fn: B(() => [
942
- A(re, {
943
- modelValue: h.value,
944
- "onUpdate:modelValue": c[1] || (c[1] = (v) => h.value = v),
945
- options: S()
1209
+ N(ce, {
1210
+ modelValue: c.value,
1211
+ "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
1212
+ options: x()
946
1213
  }, null, 8, ["modelValue", "options"])
947
1214
  ]),
948
1215
  key: "0"
949
1216
  } : void 0,
950
- y(r).mode === "setter" && y(r).filters ? {
1217
+ v(i).mode === "setter" && v(i).filters ? {
951
1218
  name: "footer",
952
1219
  fn: B(() => [
953
- A(H, { color: "theme" }, {
1220
+ N(Q, { color: "theme" }, {
954
1221
  default: B(() => [
955
- G(K(s.$i18n.Common.Cancel), 1)
1222
+ z(b(p.$i18n.Common.Cancel), 1)
956
1223
  ]),
957
1224
  _: 1
958
1225
  }),
959
- A(H, {
960
- onClick: c[2] || (c[2] = (v) => y(u)("setter", {
961
- tagsIds: y(r).model.value,
962
- filters: y(r).filters,
963
- filtersAction: h.value,
964
- payload: y(r).payload
1226
+ N(Q, {
1227
+ onClick: I[2] || (I[2] = (S) => v(u)("setter", {
1228
+ tagsIds: v(i).model.value,
1229
+ filters: v(i).filters,
1230
+ filtersAction: c.value,
1231
+ payload: v(i).payload
965
1232
  }))
966
1233
  }, {
967
1234
  default: B(() => [
968
- G(K(h.value === "add" ? s.$i18n.Common.Add : "") + " " + K(h.value === "replace" ? s.$i18n.Common.Replace : "") + " " + K(h.value === "delete" ? s.$i18n.Common.Delete : ""), 1)
1235
+ z(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)
969
1236
  ]),
970
1237
  _: 1
971
1238
  })
@@ -977,16 +1244,17 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
977
1244
  }
978
1245
  });
979
1246
  export {
980
- ft as TopSelectorCompetitors,
981
- yt as TopSelectorRegion,
982
- St as TopTagSelector,
983
- ot as TopTagSelectorPopupOpener,
984
- ie as TopTagSelectorTagIcon,
985
- Ye as dialogSelectorRegions,
986
- We as findRegion,
987
- pt as genElTopTagSelectorPopupOpener,
988
- ke as genSearcherByKey,
989
- ht as renderElTopTagSelectorPopupOpener,
990
- vt as useItemsFromCompetitors
1247
+ Rt as TopCompetitorSelector,
1248
+ Dt as TopGroupSelector,
1249
+ Pt as TopRegionSelector,
1250
+ Ut as TopTagSelector,
1251
+ At as TopTagSelectorPopupOpener,
1252
+ fe as TopTagSelectorTagIcon,
1253
+ it as dialogRegionSelector,
1254
+ rt as findRegion,
1255
+ qt as genElTopTagSelectorPopupOpener,
1256
+ Ke as genSearcherByKey,
1257
+ Ft as renderElTopTagSelectorPopupOpener,
1258
+ Nt as useItemsFromCompetitors
991
1259
  };
992
1260
  //# sourceMappingURL=project.js.map