@topvisor/ui 1.4.3-updateVue.1 → 1.5.0-updates.1

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