@topvisor/ui 1.5.7-3 → 1.5.7-5

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 (127) hide show
  1. package/.chunks/{api-7QFznvLR.amd.js → api-Dy2x6A8L.amd.js} +2 -2
  2. package/.chunks/{api-7QFznvLR.amd.js.map → api-Dy2x6A8L.amd.js.map} +1 -1
  3. package/.chunks/{api-7QFznvLR.esm.js → api-Dy2x6A8L.esm.js} +2 -2
  4. package/.chunks/{api-7QFznvLR.esm.js.map → api-Dy2x6A8L.esm.js.map} +1 -1
  5. package/.chunks/app-CyODeY0D.amd.js +2 -0
  6. package/.chunks/app-CyODeY0D.amd.js.map +1 -0
  7. package/.chunks/{app-BI7BuMMX.esm.js → app-CyODeY0D.esm.js} +146 -141
  8. package/.chunks/app-CyODeY0D.esm.js.map +1 -0
  9. package/.chunks/{datepicker-DYdxOiJC.amd.js → datepicker-CBAwfPPW.amd.js} +2 -2
  10. package/.chunks/{datepicker-DYdxOiJC.amd.js.map → datepicker-CBAwfPPW.amd.js.map} +1 -1
  11. package/.chunks/{datepicker-DYdxOiJC.esm.js → datepicker-CBAwfPPW.esm.js} +2 -2
  12. package/.chunks/{datepicker-DYdxOiJC.esm.js.map → datepicker-CBAwfPPW.esm.js.map} +1 -1
  13. package/.chunks/{dialog-YkK3k6Ei.amd.js → dialog-C8fss11q.amd.js} +2 -2
  14. package/.chunks/{dialog-YkK3k6Ei.amd.js.map → dialog-C8fss11q.amd.js.map} +1 -1
  15. package/.chunks/{dialog-YkK3k6Ei.esm.js → dialog-C8fss11q.esm.js} +3 -3
  16. package/.chunks/{dialog-YkK3k6Ei.esm.js.map → dialog-C8fss11q.esm.js.map} +1 -1
  17. package/.chunks/{dialog_regionSelectorRegions-BGboPhrg.amd.js → dialog_regionSelectorRegions-zJShjr2f.amd.js} +2 -2
  18. package/.chunks/{dialog_regionSelectorRegions-BGboPhrg.amd.js.map → dialog_regionSelectorRegions-zJShjr2f.amd.js.map} +1 -1
  19. package/.chunks/{dialog_regionSelectorRegions-BGboPhrg.esm.js → dialog_regionSelectorRegions-zJShjr2f.esm.js} +4 -4
  20. package/.chunks/{dialog_regionSelectorRegions-BGboPhrg.esm.js.map → dialog_regionSelectorRegions-zJShjr2f.esm.js.map} +1 -1
  21. package/.chunks/{forms-3EhjGbIm.amd.js → forms-LywqKN9I.amd.js} +2 -2
  22. package/.chunks/forms-LywqKN9I.amd.js.map +1 -0
  23. package/.chunks/{forms-3EhjGbIm.esm.js → forms-LywqKN9I.esm.js} +13 -17
  24. package/.chunks/{forms-3EhjGbIm.esm.js.map → forms-LywqKN9I.esm.js.map} +1 -1
  25. package/.chunks/{formsExt-Bwe_GFoI.amd.js → formsExt-D16-9Jor.amd.js} +2 -2
  26. package/.chunks/{formsExt-Bwe_GFoI.amd.js.map → formsExt-D16-9Jor.amd.js.map} +1 -1
  27. package/.chunks/{formsExt-Bwe_GFoI.esm.js → formsExt-D16-9Jor.esm.js} +4 -4
  28. package/.chunks/{formsExt-Bwe_GFoI.esm.js.map → formsExt-D16-9Jor.esm.js.map} +1 -1
  29. package/.chunks/{notice-CAZoT0RU.amd.js → notice-Dw5ZUJxW.amd.js} +2 -2
  30. package/.chunks/{notice-CAZoT0RU.amd.js.map → notice-Dw5ZUJxW.amd.js.map} +1 -1
  31. package/.chunks/{notice-CAZoT0RU.esm.js → notice-Dw5ZUJxW.esm.js} +2 -2
  32. package/.chunks/{notice-CAZoT0RU.esm.js.map → notice-Dw5ZUJxW.esm.js.map} +1 -1
  33. package/.chunks/{popup-DhySIsg9.amd.js → popup-BWD4eASc.amd.js} +2 -2
  34. package/.chunks/{popup-DhySIsg9.amd.js.map → popup-BWD4eASc.amd.js.map} +1 -1
  35. package/.chunks/{popup-DhySIsg9.esm.js → popup-BWD4eASc.esm.js} +3 -3
  36. package/.chunks/{popup-DhySIsg9.esm.js.map → popup-BWD4eASc.esm.js.map} +1 -1
  37. package/.chunks/{popup-w1mbbfr8.amd.js → popup-BqacuTuJ.amd.js} +2 -2
  38. package/.chunks/{popup-w1mbbfr8.amd.js.map → popup-BqacuTuJ.amd.js.map} +1 -1
  39. package/.chunks/{popup-w1mbbfr8.esm.js → popup-BqacuTuJ.esm.js} +3 -3
  40. package/.chunks/{popup-w1mbbfr8.esm.js.map → popup-BqacuTuJ.esm.js.map} +1 -1
  41. package/.chunks/{utils-Db5TDjU8.amd.js → utils-CZnFOkS6.amd.js} +2 -2
  42. package/.chunks/{utils-Db5TDjU8.amd.js.map → utils-CZnFOkS6.amd.js.map} +1 -1
  43. package/.chunks/{utils-Db5TDjU8.esm.js → utils-CZnFOkS6.esm.js} +3 -3
  44. package/.chunks/{utils-Db5TDjU8.esm.js.map → utils-CZnFOkS6.esm.js.map} +1 -1
  45. package/.chunks/{utils-D3lUe-RP.amd.js → utils-ZgQqVN0T.amd.js} +2 -2
  46. package/.chunks/{utils-D3lUe-RP.amd.js.map → utils-ZgQqVN0T.amd.js.map} +1 -1
  47. package/.chunks/{utils-D3lUe-RP.esm.js → utils-ZgQqVN0T.esm.js} +4 -4
  48. package/.chunks/{utils-D3lUe-RP.esm.js.map → utils-ZgQqVN0T.esm.js.map} +1 -1
  49. package/.chunks/{worker-DNQ_Rvpj.amd.js → worker-a6MSM1uV.amd.js} +2 -2
  50. package/.chunks/{worker-DNQ_Rvpj.amd.js.map → worker-a6MSM1uV.amd.js.map} +1 -1
  51. package/.chunks/{worker-DNQ_Rvpj.esm.js → worker-a6MSM1uV.esm.js} +3 -3
  52. package/.chunks/{worker-DNQ_Rvpj.esm.js.map → worker-a6MSM1uV.esm.js.map} +1 -1
  53. package/api/index.amd.js +1 -1
  54. package/api/index.amd.js.map +1 -1
  55. package/api/index.js +1 -1
  56. package/assets/forms.css +1 -1
  57. package/assets/schedule.css +1 -1
  58. package/autoload-css-manifest.amd.json +4 -4
  59. package/autoload-css-manifest.json +4 -4
  60. package/charts/charts.amd.js +1 -1
  61. package/charts/charts.amd.js.map +1 -1
  62. package/charts/charts.js +1 -1
  63. package/core/app.amd.js +1 -1
  64. package/core/app.amd.js.map +1 -1
  65. package/core/app.js +3 -3
  66. package/dialog/dialog.amd.js +1 -1
  67. package/dialog/dialog.amd.js.map +1 -1
  68. package/dialog/dialog.js +2 -2
  69. package/extra/extra.amd.js +1 -1
  70. package/extra/extra.amd.js.map +1 -1
  71. package/extra/extra.js +2 -0
  72. package/extra/extra.js.map +1 -1
  73. package/forms/forms.amd.js +1 -1
  74. package/forms/forms.amd.js.map +1 -1
  75. package/forms/forms.js +1 -1
  76. package/formsExt/formsExt.amd.js +1 -1
  77. package/formsExt/formsExt.amd.js.map +1 -1
  78. package/formsExt/formsExt.js +1 -1
  79. package/layout/layout.amd.js +1 -1
  80. package/layout/layout.amd.js.map +1 -1
  81. package/layout/layout.js +1 -1
  82. package/package.json +1 -1
  83. package/popup/popup.amd.js +1 -1
  84. package/popup/popup.amd.js.map +1 -1
  85. package/popup/popup.js +1 -1
  86. package/popup/worker.amd.js +1 -1
  87. package/popup/worker.amd.js.map +1 -1
  88. package/popup/worker.js +1 -1
  89. package/project/project.amd.js +1 -1
  90. package/project/project.amd.js.map +1 -1
  91. package/project/project.js +8 -8
  92. package/schedule/schedule.amd.js +1 -1
  93. package/schedule/schedule.amd.js.map +1 -1
  94. package/schedule/schedule.js +37 -36
  95. package/schedule/schedule.js.map +1 -1
  96. package/src/components/forms/avatar/types.d.ts +0 -9
  97. package/src/components/schedule/schedule/compoents/calendar/utils.d.ts +1 -1
  98. package/src/components/schedule/schedule/types.d.ts +48 -3
  99. package/src/core/directives/swimUp.d.ts +1 -1
  100. package/tabsView/tabsView.amd.js +1 -1
  101. package/tabsView/tabsView.amd.js.map +1 -1
  102. package/tabsView/tabsView.js +2 -2
  103. package/utils/clipboard.amd.js +1 -1
  104. package/utils/clipboard.amd.js.map +1 -1
  105. package/utils/clipboard.js +1 -1
  106. package/utils/date.amd.js +1 -1
  107. package/utils/date.amd.js.map +1 -1
  108. package/utils/date.js +1 -1
  109. package/utils/device.amd.js +1 -1
  110. package/utils/device.amd.js.map +1 -1
  111. package/utils/device.js +1 -1
  112. package/utils/lodash.amd.js +1 -1
  113. package/utils/lodash.amd.js.map +1 -1
  114. package/utils/lodash.js +1 -1
  115. package/utils/price.amd.js +1 -1
  116. package/utils/price.amd.js.map +1 -1
  117. package/utils/price.js +1 -1
  118. package/utils/searchers.amd.js +1 -1
  119. package/utils/searchers.amd.js.map +1 -1
  120. package/utils/searchers.js +1 -1
  121. package/utils/string.amd.js +1 -1
  122. package/utils/string.amd.js.map +1 -1
  123. package/utils/string.js +1 -1
  124. package/.chunks/app-BI7BuMMX.amd.js +0 -2
  125. package/.chunks/app-BI7BuMMX.amd.js.map +0 -1
  126. package/.chunks/app-BI7BuMMX.esm.js.map +0 -1
  127. package/.chunks/forms-3EhjGbIm.amd.js.map +0 -1
@@ -1,4 +1,4 @@
1
- define([`require`,`exports`,`./forms-3EhjGbIm.amd`,`../utils/string.amd`,`vue`,`../require/css.amd!../assets/notice.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.show=t.default=void 0;var o=(0,i.reactive)(new Map),s=(e,t,n)=>`top-notice_`+(0,r.genIntHash)(e+t+JSON.stringify(n)),c=(e,t=`info`,r)=>{let i=``;e=String(e);let a=s(e,t,r);if(r?.title)i=r.title;else{let t=e.split(`
1
+ define([`require`,`exports`,`./forms-LywqKN9I.amd`,`../utils/string.amd`,`vue`,`../require/css.amd!../assets/notice.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.show=t.default=void 0;var o=(0,i.reactive)(new Map),s=(e,t,n)=>`top-notice_`+(0,r.genIntHash)(e+t+JSON.stringify(n)),c=(e,t=`info`,r)=>{let i=``;e=String(e);let a=s(e,t,r);if(r?.title)i=r.title;else{let t=e.split(`
2
2
  `);t.length&&(i=String(t.shift()),e=t.join(`
3
3
  `))}let c=o.get(a);if(c){l(c);return}let d={id:a,title:i,text:e,style:t,buttonProps:r?.buttonProps,buttonsProps:r?.buttonsProps,metaText:r?.metaText,isSafeHTML:r?.isSafeHTML,selectToClose:r?.selectToClose,onClose:r?.onClose};if(o.set(d.id,d),o.size>5){let[e,t]=[...o].at(0)||[];t&&u(t)}n.O.state.isMobile&&$(`input`).one(`click`,()=>u(d))},l=e=>{e.hightlight=!0,setTimeout(()=>e.hightlight=!1,300)},u=e=>{e.forceClosed=!0,setTimeout(()=>{e.onClose?.(),o.delete(e.id)},300)},d=e=>{let t=`hacking was detected`;return e=e.replace(/<script/gi,t),e=e.replace(/<img/gi,t),e=e.replace(/<iframe/gi,t),e=e.replace(/javascript:/gi,t),e=e.replace(/<[^>]+ (@|on)\w+=[^>]+>?/gi,t),e},f={class:`top-notice_itemTextWrapper`},p=[`innerHTML`],m=[`innerHTML`],h={key:1,class:`top-notice_itemButtons`},g=[`innerHTML`],_=[`title`],v=(0,i.defineComponent)({__name:`item`,props:{id:{},title:{},text:{},style:{},metaText:{},buttonProps:{},buttonsProps:{},isSafeHTML:{type:Boolean},hightlight:{type:Boolean},selectToClose:{type:Boolean,default:!0},forceClosed:{type:Boolean}},emits:[`close`],setup(e,{emit:t}){let a=e,o=t,s=(0,i.ref)(!1);setTimeout(()=>s.value=!0,10);let c=(0,i.ref)(!1),l=(0,i.ref)(`right`),u=(0,i.computed)(()=>{let e=a.title.replace(/ {2}/g,`&nbsp;`);return a.isSafeHTML||(e=d(e)),e}),v=(0,i.computed)(()=>{let e=(0,r.nl2br)(a.text);return e=e.replace(/ {2}/g,`&nbsp;`),a.isSafeHTML||(e=d(e)),e}),y=e=>{c.value=!0,e&&(l.value=e),setTimeout(()=>o(`close`),300)},b=e=>{if(!a.selectToClose)return;let{tagName:t}=e.target;t===`A`&&y(),t===`BUTTON`&&y()},x={mounted:e=>{if(!n.O.state.isMobile||!n.O.$||!n.O.$.ui.draggable)return;let t=`right`;n.O.$(e).draggable({revert:!1,axis:`x`,drag:(e,n)=>{t=n.position.left>0?`right`:`left`},stop:(e,n)=>{y(t)}})}};return(t,n)=>{let r=(0,i.resolveComponent)(`TopButton`);return(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:(0,i.normalizeClass)([`top-notice_item`,{[`top-notice_item-`+e.style]:!0,"top-notice_item-hightlight":e.hightlight,"top-notice_item-showed":s.value,"top-notice_item-closed":c.value||e.forceClosed,[`top-notice_item-closed_`+l.value]:c.value}]),onClick:b},[(0,i.createElementVNode)(`div`,f,[u.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`top-notice_itemTitle`,innerHTML:u.value},null,8,p)):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:`top-notice_itemText`,innerHTML:v.value},null,8,m)):(0,i.createCommentVNode)(``,!0)]),e.buttonProps?((0,i.openBlock)(),(0,i.createBlock)(r,(0,i.mergeProps)({key:0,class:`top-notice_itemButton`,size:`s`},e.buttonProps,{title:e.buttonProps.title,innerHTML:e.buttonProps.default,onClick:n[0]||=e=>y()}),null,16,[`title`,`innerHTML`])):(0,i.createCommentVNode)(``,!0),e.buttonsProps?.length?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,h,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(e.buttonsProps,e=>((0,i.openBlock)(),(0,i.createBlock)(r,(0,i.mergeProps)({class:`top-notice_itemButton`,size:`s`},{ref_for:!0},e,{title:e.title,innerHTML:e.default,onClick:n[1]||=e=>y()}),null,16,[`title`,`innerHTML`]))),256))])):(0,i.createCommentVNode)(``,!0),e.metaText?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:2,class:`top-notice_itemMetaText`,innerHTML:e.metaText},null,8,g)):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`div`,{class:`top-notice_itemClose`,"data-top-icon":``,title:t.$i18n.Common.Close,onClick:n[2]||=()=>y()},null,8,_)],2)),[[x]])}}}),y={class:`top-notice`},b=(0,i.defineComponent)({__name:`notice`,setup(e){let t=e=>{e.onClose?.(),o.delete(e.id)};return(e,n)=>((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{to:`body`},[(0,i.createElementVNode)(`div`,y,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(o),([e,n])=>((0,i.openBlock)(),(0,i.createBlock)(v,{key:n.id,id:n.id,title:n.title,text:n.text,style:(0,i.normalizeStyle)(n.style),buttonProps:n.buttonProps,buttonsProps:n.buttonsProps,metaText:n.metaText,isSafeHTML:n.isSafeHTML,forceClosed:n.forceClosed,hightlight:n.hightlight,onClose:e=>t(n)},null,8,[`id`,`title`,`text`,`style`,`buttonProps`,`buttonsProps`,`metaText`,`isSafeHTML`,`forceClosed`,`hightlight`,`onClose`]))),128))])]))}});t.show=c,t.default=b});
4
- //# sourceMappingURL=notice-CAZoT0RU.amd.js.map
4
+ //# sourceMappingURL=notice-Dw5ZUJxW.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[".chunks/notice-CAZoT0RU.esm.js","../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue"],"names":["vue","exports","x","vue_1","S","string_js_1","n","r","C","t","e","o","w","s","T","forms_3EhjGbIm_esm_js_1","E","D","O","k","A","j","M","N","i","u","p","h","y","P","F"],"mappings":"AAAA,OAAO,CAAC,UAAW,UAAW,uBAA2B,sBAAsB,MAAK,yCAAA,EAAA,SAAa,EAAS,EAAS,EAAyB,EAAa,EAAO,CAC5J,aAAA,GAAAA,IAAA,OAAA,IAAAA,EAAA,OAAA,IACA,OAAO,eAAeC,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,ECOnD,EAAW,KAAA,EAAS,QAAuB,IAElD,GAsBL,IAAIC,GAAQ,EAAAC,EAAA,SAAA,CAAA,IAAA,GAAA,EAAAC,GAAA,EAAA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,EAAA,CACM,IAAA,EAAA,GACC,GAAA,EAAA,GACC,MAAA,EAAA,MACJ,KAAA,EAAA,KACE,OAAA,EAAApB,EAAA,eAAA,CAAA,EAAA,KAAA,EACC,YAAA,EAAA,YACD,aAAA,EAAA,aACM,SAAA,EAAA,SHgIJ,WAAY,EAAE,WACd,YAAa,EAAE,YACf,WAAY,EAAE,WACd,QAAU,GAAM,EAAE,CAAC,CACvB,EAAG,KAAM,EAAG,CACR,KACA,QACA,OACA,QACA,cACA,eACA,WACA,aACA,cACA,aACA,SACJ,CAAC,EAAE,EAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAC1B,CACJ,CAAC,EACD,EAAQ,KAAOK,EACf,EAAQ,QAAUsB,CACtB,CAAC","sourcesContent":["define([\"require\", \"exports\", \"./forms-3EhjGbIm.esm.js\", \"../utils/string.js\", \"vue\"], function (require, exports, forms_3EhjGbIm_esm_js_1, string_js_1, vue_1) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.show = exports.default = void 0;\n var x = (0, vue_1.reactive)(/* @__PURE__ */ new Map()), S = (e, n, r) => \"top-notice_\" + (0, string_js_1.genIntHash)(e + n + JSON.stringify(r)), C = (t, n = \"info\", r) => {\n let i = \"\";\n t = String(t);\n let a = S(t, n, r);\n if (r?.title)\n i = r.title;\n else {\n let e = t.split(\"\\n\");\n e.length && (i = String(e.shift()), t = e.join(\"\\n\"));\n }\n let o = x.get(a);\n if (o) {\n w(o);\n return;\n }\n let s = {\n id: a,\n title: i,\n text: t,\n style: n,\n buttonProps: r?.buttonProps,\n buttonsProps: r?.buttonsProps,\n metaText: r?.metaText,\n isSafeHTML: r?.isSafeHTML,\n selectToClose: r?.selectToClose,\n onClose: r?.onClose\n };\n if (x.set(s.id, s), x.size > 5) {\n let [e, t] = [...x].at(0) || [];\n t && T(t);\n }\n forms_3EhjGbIm_esm_js_1.O.state.isMobile && $(\"input\").one(\"click\", () => T(s));\n }, w = (e) => {\n e.hightlight = !0, setTimeout(() => e.hightlight = !1, 300);\n }, T = (e) => {\n e.forceClosed = !0, setTimeout(() => {\n e.onClose?.(), x.delete(e.id);\n }, 300);\n }, E = (e) => {\n let t = \"hacking was detected\";\n return e = e.replace(/<script/gi, t), e = e.replace(/<img/gi, t), e = e.replace(/<iframe/gi, t), e = e.replace(/javascript:/gi, t), e = e.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, t), e;\n }, D = { class: \"top-notice_itemTextWrapper\" }, O = [\"innerHTML\"], k = [\"innerHTML\"], A = {\n key: 1,\n class: \"top-notice_itemButtons\"\n }, j = [\"innerHTML\"], M = [\"title\"], N = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"item\",\n props: {\n id: {},\n title: {},\n text: {},\n style: {},\n metaText: {},\n buttonProps: {},\n buttonsProps: {},\n isSafeHTML: { type: Boolean },\n hightlight: { type: Boolean },\n selectToClose: {\n type: Boolean,\n default: !0\n },\n forceClosed: { type: Boolean }\n },\n emits: [\"close\"],\n setup(t, { emit: i }) {\n let u = t, p = i, h = (0, vue_1.ref)(!1);\n setTimeout(() => h.value = !0, 10);\n let y = (0, vue_1.ref)(!1), x = (0, vue_1.ref)(\"right\"), S = (0, vue_1.computed)(() => {\n let e = u.title.replace(/ {2}/g, \"&nbsp;\");\n return u.isSafeHTML || (e = E(e)), e;\n }), C = (0, vue_1.computed)(() => {\n let e = (0, string_js_1.nl2br)(u.text);\n return e = e.replace(/ {2}/g, \"&nbsp;\"), u.isSafeHTML || (e = E(e)), e;\n }), w = (e) => {\n y.value = !0, e && (x.value = e), setTimeout(() => p(\"close\"), 300);\n }, T = (e) => {\n if (!u.selectToClose)\n return;\n let { tagName: t } = e.target;\n t === \"A\" && w(), t === \"BUTTON\" && w();\n }, N = { mounted: (t) => {\n if (!forms_3EhjGbIm_esm_js_1.O.state.isMobile || !forms_3EhjGbIm_esm_js_1.O.$ || !forms_3EhjGbIm_esm_js_1.O.$.ui.draggable)\n return;\n let n = \"right\";\n forms_3EhjGbIm_esm_js_1.O.$(t).draggable({\n revert: !1,\n axis: \"x\",\n drag: (e, t) => {\n n = t.position.left > 0 ? \"right\" : \"left\";\n },\n stop: (e, t) => {\n w(n);\n }\n });\n } };\n return (e, n) => {\n let i = (0, vue_1.resolveComponent)(\"TopButton\");\n return (0, vue_1.withDirectives)(((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n class: (0, vue_1.normalizeClass)([\"top-notice_item\", {\n [\"top-notice_item-\" + t.style]: !0,\n \"top-notice_item-hightlight\": t.hightlight,\n \"top-notice_item-showed\": h.value,\n \"top-notice_item-closed\": y.value || t.forceClosed,\n [\"top-notice_item-closed_\" + x.value]: y.value\n }]),\n onClick: T\n }, [\n (0, vue_1.createElementVNode)(\"div\", D, [S.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 0,\n class: \"top-notice_itemTitle\",\n innerHTML: S.value\n }, null, 8, O)) : (0, vue_1.createCommentVNode)(\"\", !0), C.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 1,\n class: \"top-notice_itemText\",\n innerHTML: C.value\n }, null, 8, k)) : (0, vue_1.createCommentVNode)(\"\", !0)]),\n t.buttonProps ? ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n key: 0,\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, t.buttonProps, {\n title: t.buttonProps.title,\n innerHTML: t.buttonProps.default,\n onClick: n[0] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.buttonsProps?.length ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", A, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)(t.buttonsProps, (e) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, { ref_for: !0 }, e, {\n title: e.title,\n innerHTML: e.default,\n onClick: n[1] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"]))), 256))])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.metaText ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 2,\n class: \"top-notice_itemMetaText\",\n innerHTML: t.metaText\n }, null, 8, j)) : (0, vue_1.createCommentVNode)(\"\", !0),\n (0, vue_1.createElementVNode)(\"div\", {\n class: \"top-notice_itemClose\",\n \"data-top-icon\": \"\",\n title: e.$i18n.Common.Close,\n onClick: n[2] ||= () => w()\n }, null, 8, M)\n ], 2)), [[N]]);\n };\n }\n }), P = { class: \"top-notice\" }, F = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"notice\",\n setup(e) {\n let t = (e) => {\n e.onClose?.(), x.delete(e.id);\n };\n return (e, n) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(vue_1.Teleport, { to: \"body\" }, [(0, vue_1.createElementVNode)(\"div\", P, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)((0, vue_1.unref)(x), ([e, n]) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(N, {\n key: n.id,\n id: n.id,\n title: n.title,\n text: n.text,\n style: (0, vue_1.normalizeStyle)(n.style),\n buttonProps: n.buttonProps,\n buttonsProps: n.buttonsProps,\n metaText: n.metaText,\n isSafeHTML: n.isSafeHTML,\n forceClosed: n.forceClosed,\n hightlight: n.hightlight,\n onClose: (e) => t(n)\n }, null, 8, [\n \"id\",\n \"title\",\n \"text\",\n \"style\",\n \"buttonProps\",\n \"buttonsProps\",\n \"metaText\",\n \"isSafeHTML\",\n \"forceClosed\",\n \"hightlight\",\n \"onClose\"\n ]))), 128))])]));\n }\n });\n exports.show = C;\n exports.default = F;\n});\n//# sourceMappingURL=notice-CAZoT0RU.esm.js.map\n","import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/gi, textNoSafety);\n\ttext = text.replace(/<img/gi, textNoSafety);\n\ttext = text.replace(/<iframe/gi, textNoSafety);\n\ttext = text.replace(/javascript:/gi, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"]}
1
+ {"version":3,"sources":[".chunks/notice-Dw5ZUJxW.esm.js","../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue"],"names":["vue","exports","x","vue_1","S","string_js_1","n","r","C","t","e","o","w","s","T","forms_LywqKN9I_esm_js_1","E","D","O","k","A","j","M","N","i","u","p","h","y","P","F"],"mappings":"AAAA,OAAO,CAAC,UAAW,UAAW,uBAA2B,sBAAsB,MAAK,yCAAA,EAAA,SAAa,EAAS,EAAS,EAAyB,EAAa,EAAO,CAC5J,aAAA,GAAAA,IAAA,OAAA,IAAAA,EAAA,OAAA,IACA,OAAO,eAAeC,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,ECOnD,EAAW,KAAA,EAAS,QA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CAAA,GAAA,CAAA,EAAA,OAAA,EAAAC,EAAA,UAAA,CAAA,GAAA,EAAAA,EAAA,YAAA,CAAAoB,EAAA,CACM,IAAA,EAAA,GACC,GAAA,EAAA,GACC,MAAA,EAAA,MACJ,KAAA,EAAA,KACE,OAAA,EAAApB,EAAA,eAAA,CAAA,EAAA,KAAA,EACC,YAAA,EAAA,YACD,aAAA,EAAA,aACM,SAAA,EAAA,SHgIJ,WAAY,EAAE,WACd,YAAa,EAAE,YACf,WAAY,EAAE,WACd,QAAU,GAAM,EAAE,CAAC,CACvB,EAAG,KAAM,EAAG,CACR,KACA,QACA,OACA,QACA,cACA,eACA,WACA,aACA,cACA,aACA,SACJ,CAAC,EAAE,EAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAC1B,CACJ,CAAC,EACD,EAAQ,KAAOK,EACf,EAAQ,QAAUsB,CACtB,CAAC","sourcesContent":["define([\"require\", \"exports\", \"./forms-LywqKN9I.esm.js\", \"../utils/string.js\", \"vue\"], function (require, exports, forms_LywqKN9I_esm_js_1, string_js_1, vue_1) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.show = exports.default = void 0;\n var x = (0, vue_1.reactive)(/* @__PURE__ */ new Map()), S = (e, n, r) => \"top-notice_\" + (0, string_js_1.genIntHash)(e + n + JSON.stringify(r)), C = (t, n = \"info\", r) => {\n let i = \"\";\n t = String(t);\n let a = S(t, n, r);\n if (r?.title)\n i = r.title;\n else {\n let e = t.split(\"\\n\");\n e.length && (i = String(e.shift()), t = e.join(\"\\n\"));\n }\n let o = x.get(a);\n if (o) {\n w(o);\n return;\n }\n let s = {\n id: a,\n title: i,\n text: t,\n style: n,\n buttonProps: r?.buttonProps,\n buttonsProps: r?.buttonsProps,\n metaText: r?.metaText,\n isSafeHTML: r?.isSafeHTML,\n selectToClose: r?.selectToClose,\n onClose: r?.onClose\n };\n if (x.set(s.id, s), x.size > 5) {\n let [e, t] = [...x].at(0) || [];\n t && T(t);\n }\n forms_LywqKN9I_esm_js_1.O.state.isMobile && $(\"input\").one(\"click\", () => T(s));\n }, w = (e) => {\n e.hightlight = !0, setTimeout(() => e.hightlight = !1, 300);\n }, T = (e) => {\n e.forceClosed = !0, setTimeout(() => {\n e.onClose?.(), x.delete(e.id);\n }, 300);\n }, E = (e) => {\n let t = \"hacking was detected\";\n return e = e.replace(/<script/gi, t), e = e.replace(/<img/gi, t), e = e.replace(/<iframe/gi, t), e = e.replace(/javascript:/gi, t), e = e.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, t), e;\n }, D = { class: \"top-notice_itemTextWrapper\" }, O = [\"innerHTML\"], k = [\"innerHTML\"], A = {\n key: 1,\n class: \"top-notice_itemButtons\"\n }, j = [\"innerHTML\"], M = [\"title\"], N = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"item\",\n props: {\n id: {},\n title: {},\n text: {},\n style: {},\n metaText: {},\n buttonProps: {},\n buttonsProps: {},\n isSafeHTML: { type: Boolean },\n hightlight: { type: Boolean },\n selectToClose: {\n type: Boolean,\n default: !0\n },\n forceClosed: { type: Boolean }\n },\n emits: [\"close\"],\n setup(t, { emit: i }) {\n let u = t, p = i, h = (0, vue_1.ref)(!1);\n setTimeout(() => h.value = !0, 10);\n let y = (0, vue_1.ref)(!1), x = (0, vue_1.ref)(\"right\"), S = (0, vue_1.computed)(() => {\n let e = u.title.replace(/ {2}/g, \"&nbsp;\");\n return u.isSafeHTML || (e = E(e)), e;\n }), C = (0, vue_1.computed)(() => {\n let e = (0, string_js_1.nl2br)(u.text);\n return e = e.replace(/ {2}/g, \"&nbsp;\"), u.isSafeHTML || (e = E(e)), e;\n }), w = (e) => {\n y.value = !0, e && (x.value = e), setTimeout(() => p(\"close\"), 300);\n }, T = (e) => {\n if (!u.selectToClose)\n return;\n let { tagName: t } = e.target;\n t === \"A\" && w(), t === \"BUTTON\" && w();\n }, N = { mounted: (t) => {\n if (!forms_LywqKN9I_esm_js_1.O.state.isMobile || !forms_LywqKN9I_esm_js_1.O.$ || !forms_LywqKN9I_esm_js_1.O.$.ui.draggable)\n return;\n let n = \"right\";\n forms_LywqKN9I_esm_js_1.O.$(t).draggable({\n revert: !1,\n axis: \"x\",\n drag: (e, t) => {\n n = t.position.left > 0 ? \"right\" : \"left\";\n },\n stop: (e, t) => {\n w(n);\n }\n });\n } };\n return (e, n) => {\n let i = (0, vue_1.resolveComponent)(\"TopButton\");\n return (0, vue_1.withDirectives)(((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n class: (0, vue_1.normalizeClass)([\"top-notice_item\", {\n [\"top-notice_item-\" + t.style]: !0,\n \"top-notice_item-hightlight\": t.hightlight,\n \"top-notice_item-showed\": h.value,\n \"top-notice_item-closed\": y.value || t.forceClosed,\n [\"top-notice_item-closed_\" + x.value]: y.value\n }]),\n onClick: T\n }, [\n (0, vue_1.createElementVNode)(\"div\", D, [S.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 0,\n class: \"top-notice_itemTitle\",\n innerHTML: S.value\n }, null, 8, O)) : (0, vue_1.createCommentVNode)(\"\", !0), C.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 1,\n class: \"top-notice_itemText\",\n innerHTML: C.value\n }, null, 8, k)) : (0, vue_1.createCommentVNode)(\"\", !0)]),\n t.buttonProps ? ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n key: 0,\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, t.buttonProps, {\n title: t.buttonProps.title,\n innerHTML: t.buttonProps.default,\n onClick: n[0] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.buttonsProps?.length ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", A, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)(t.buttonsProps, (e) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, { ref_for: !0 }, e, {\n title: e.title,\n innerHTML: e.default,\n onClick: n[1] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"]))), 256))])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.metaText ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 2,\n class: \"top-notice_itemMetaText\",\n innerHTML: t.metaText\n }, null, 8, j)) : (0, vue_1.createCommentVNode)(\"\", !0),\n (0, vue_1.createElementVNode)(\"div\", {\n class: \"top-notice_itemClose\",\n \"data-top-icon\": \"\",\n title: e.$i18n.Common.Close,\n onClick: n[2] ||= () => w()\n }, null, 8, M)\n ], 2)), [[N]]);\n };\n }\n }), P = { class: \"top-notice\" }, F = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"notice\",\n setup(e) {\n let t = (e) => {\n e.onClose?.(), x.delete(e.id);\n };\n return (e, n) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(vue_1.Teleport, { to: \"body\" }, [(0, vue_1.createElementVNode)(\"div\", P, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)((0, vue_1.unref)(x), ([e, n]) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(N, {\n key: n.id,\n id: n.id,\n title: n.title,\n text: n.text,\n style: (0, vue_1.normalizeStyle)(n.style),\n buttonProps: n.buttonProps,\n buttonsProps: n.buttonsProps,\n metaText: n.metaText,\n isSafeHTML: n.isSafeHTML,\n forceClosed: n.forceClosed,\n hightlight: n.hightlight,\n onClose: (e) => t(n)\n }, null, 8, [\n \"id\",\n \"title\",\n \"text\",\n \"style\",\n \"buttonProps\",\n \"buttonsProps\",\n \"metaText\",\n \"isSafeHTML\",\n \"forceClosed\",\n \"hightlight\",\n \"onClose\"\n ]))), 128))])]));\n }\n });\n exports.show = C;\n exports.default = F;\n});\n//# sourceMappingURL=notice-Dw5ZUJxW.esm.js.map\n","import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/gi, textNoSafety);\n\ttext = text.replace(/<img/gi, textNoSafety);\n\ttext = text.replace(/<iframe/gi, textNoSafety);\n\ttext = text.replace(/javascript:/gi, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"]}
@@ -5,7 +5,7 @@
5
5
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
6
6
  /* end import css */
7
7
 
8
- import { O as e } from "./forms-3EhjGbIm.esm.js";
8
+ import { O as e } from "./forms-LywqKN9I.esm.js";
9
9
  import { genIntHash as t, nl2br as n } from "../utils/string.js";
10
10
  import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, openBlock as m, reactive as h, ref as g, renderList as _, resolveComponent as v, unref as y, withDirectives as b } from "vue";
11
11
  var x = h(/* @__PURE__ */ new Map()), S = (e, n, r) => "top-notice_" + t(e + n + JSON.stringify(r)), C = (t, n = "info", r) => {
@@ -188,4 +188,4 @@ var x = h(/* @__PURE__ */ new Map()), S = (e, n, r) => "top-notice_" + t(e + n +
188
188
  //#endregion
189
189
  export { F as default, C as show };
190
190
 
191
- //# sourceMappingURL=notice-CAZoT0RU.esm.js.map
191
+ //# sourceMappingURL=notice-Dw5ZUJxW.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-CAZoT0RU.esm.js","names":["$i18n"],"sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue","../../src/components/core/notice/notice.vue"],"sourcesContent":["import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/gi, textNoSafety);\n\ttext = text.replace(/<img/gi, textNoSafety);\n\ttext = text.replace(/<iframe/gi, textNoSafety);\n\ttext = text.replace(/javascript:/gi, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"],"mappings":";;;AASA,IAAa,IAAW,kBAAS,IAAI,IAAkB,CAAC,GAElD,KAAa,GAAyB,GAA2B,MAC/D,gBAAgB,EAAW,IAAO,IAAQ,KAAK,UAAU,CAAO,CAAC,GAoB5D,KAAQ,GAAc,IAAe,QAAQ,MAAsB;CAC/E,IAAI,IAAQ;CAEZ,IAAO,OAAO,CAAI;CAElB,IAAM,IAAK,EAAU,GAAM,GAAO,CAAO;CAEzC,IAAI,GAAS,OACZ,IAAQ,EAAQ;MACV;EACN,IAAM,IAAS,EAAK,MAAM,IAAI;EAE9B,AAAI,EAAO,WACV,IAAQ,OAAO,EAAO,MAAM,CAAC,GAC7B,IAAO,EAAO,KAAK,IAAI;CAEzB;CAEA,IAAM,IAAa,EAAS,IAAI,CAAE;CAClC,IAAI,GAAY;EACf,EAAW,CAAU;EAErB;CACD;CAEA,IAAM,IAAa;EAClB;EACA;EACA;EACA;EACA,aAAa,GAAS;EACtB,cAAc,GAAS;EACvB,UAAU,GAAS;EACnB,YAAY,GAAS;EACrB,eAAe,GAAS;EACxB,SAAS,GAAS;CACnB;CAIA,IAFA,EAAS,IAAI,EAAK,IAAI,CAAI,GAEtB,EAAS,OAAO,GAAG;EACtB,IAAM,CAAC,GAAU,KAAa,CAAC,GAAG,CAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;EACtD,AAAI,KAAW,EAAM,CAAS;CAC/B;CAOA,AAAI,EAAK,MAAM,YACd,EAAE,OAAO,CAAC,CAAC,IAAI,eAAe,EAAM,CAAI,CAAC;AAE3C,GAEM,KAAc,MAAe;CAGlC,AAFA,EAAK,aAAa,IAElB,iBAAiB,EAAK,a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;;EE1ItB,IAAM,KAAe,MAAe;GAGnC,AAFA,EAAK,UAAU,GAEf,EAAS,OAAO,EAAK,EAAE;EACxB;yBAIC,EAkBW,GAAA,EAlBD,IAAG,OAAM,GAAA,CAClB,EAgBM,OAhBN,GAgBM,EAAA,EAAA,EAAA,GAfL,EAcE,GAAA,MAAA,EAbwB,EAAA,CAAA,IAAQ,CAAzB,GAAQ,aADjB,EAcE,GAAA;GAZA,KAAK,EAAK;GACV,IAAI,EAAK;GACT,OAAO,EAAK;GACZ,MAAM,EAAK;GACX,OAAK,EAAE,EAAK,KAAK;GACjB,aAAa,EAAK;GAClB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,YAAY,EAAK;GACjB,aAAa,EAAK;GAClB,YAAY,EAAK;GACjB,UAAK,MAAE,EAAY,CAAI"}
1
+ {"version":3,"file":"notice-Dw5ZUJxW.esm.js","names":["$i18n"],"sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue","../../src/components/core/notice/notice.vue"],"sourcesContent":["import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/gi, textNoSafety);\n\ttext = text.replace(/<img/gi, textNoSafety);\n\ttext = text.replace(/<iframe/gi, textNoSafety);\n\ttext = text.replace(/javascript:/gi, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/gi, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, '&nbsp;');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tconst axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"],"mappings":";;;AASA,IAAa,IAAW,kBAAS,IAAI,IAAkB,CAAC,GAElD,KAAa,GAAyB,GAA2B,MAC/D,gBAAgB,EAAW,IAAO,IAAQ,KAAK,UAAU,CAAO,CAAC,GAoB5D,KAAQ,GAAc,IAAe,QAAQ,MAAsB;CAC/E,IAAI,IAAQ;CAEZ,IAAO,OAAO,CAAI;CAElB,IAAM,IAAK,EAAU,GAAM,GAAO,CAAO;CAEzC,IAAI,GAAS,OACZ,IAAQ,EAAQ;MACV;EACN,IAAM,IAAS,EAAK,MAAM,IAAI;EAE9B,AAAI,EAAO,WACV,IAAQ,OAAO,EAAO,MAAM,CAAC,GAC7B,IAAO,EAAO,KAAK,IAAI;CAEzB;CAEA,IAAM,IAAa,EAAS,IAAI,CAAE;CAClC,IAAI,GAAY;EACf,EAAW,CAAU;EAErB;CACD;CAEA,IAAM,IAAa;EAClB;EACA;EACA;EACA;EACA,aAAa,GAAS;EACtB,cAAc,GAAS;EACvB,UAAU,GAAS;EACnB,YAAY,GAAS;EACrB,eAAe,GAAS;EACxB,SAAS,GAAS;CACnB;CAIA,IAFA,EAAS,IAAI,EAAK,IAAI,CAAI,GAEtB,EAAS,OAAO,GAAG;EACtB,IAAM,CAAC,GAAU,KAAa,CAAC,GAAG,CAAQ,CAAC,CAAC,GAA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,MAAE,EAAK;;IAIJ,EAAA,YAAA,EAAA,GAAX,EAA6E,OAAA;;KAAxD,OAAM;KAA0B,WAAQ,EAAA;;IAE7D,EAKO,OAAA;KAJN,OAAM;KACN,iBAAc;KACb,OAAOA,EAAAA,MAAM,OAAO;KACpB,SAAK,AAAA,EAAA,aAAQ,EAAK;;;;;;;;EE1ItB,IAAM,KAAe,MAAe;GAGnC,AAFA,EAAK,UAAU,GAEf,EAAS,OAAO,EAAK,EAAE;EACxB;yBAIC,EAkBW,GAAA,EAlBD,IAAG,OAAM,GAAA,CAClB,EAgBM,OAhBN,GAgBM,EAAA,EAAA,EAAA,GAfL,EAcE,GAAA,MAAA,EAbwB,EAAA,CAAA,IAAQ,CAAzB,GAAQ,aADjB,EAcE,GAAA;GAZA,KAAK,EAAK;GACV,IAAI,EAAK;GACT,OAAO,EAAK;GACZ,MAAM,EAAK;GACX,OAAK,EAAE,EAAK,KAAK;GACjB,aAAa,EAAK;GAClB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,YAAY,EAAK;GACjB,aAAa,EAAK;GAClB,YAAY,EAAK;GACjB,UAAK,MAAE,EAAY,CAAI"}
@@ -1,2 +1,2 @@
1
- define([`require`,`exports`,`./forms-3EhjGbIm.amd`,`./worker-DNQ_Rvpj.amd`,`vue`,`../require/css.amd!../assets/popup.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.c=t.a=void 0;var o=(0,i.defineComponent)({__name:`opener`,props:{id:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},setup(e){let t=e,n=t.id||Math.random()+``,a;function o(e){setTimeout(()=>{a=e.nextElementSibling,a&&s(a)})}(0,i.onUpdated)(()=>{a&&s(a)});function s(e){e.dataset.topPopup=`#`+n;let i=!!e.dataset.topPopupDisabled;if(e.dataset.topPopupId=n,e.dataset.topPopupPos=t.pos,e.dataset.topPopupPosBy=t.posBy,e.dataset.topPopupNotch=t.notch?`true`:``,e.dataset.topPopupOpenByHover=t.openByHover?`true`:``,e.dataset.topPopupDisabled=t.disabled?`true`:``,e.__TopPopupOpenerProps=t,t.openByFocusInput&&e.classList.contains(`top-input`)){let n=e.querySelector(`input`);if(n.onfocus=()=>{e.dataset.topPopupDisabled||r.t.getPopupFromOpener(e)?.vueGetComponent()?.opened||r.t.openByOpener(e)},t.disabled!==i&&n===document.activeElement){let n=r.t.getPopupFromOpener(e);!t.disabled&&!n&&r.t.openByOpener(e),t.disabled&&n&&n.close()}}}return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[(0,i.createElementVNode)(`template`,{ref:o}),(0,i.renderSlot)(e.$slots,`default`)],64))}}),s={key:0,class:`top-popup_header`},c={key:0,class:`top-as-a closer`},l={key:1,class:`top-popup_widget`},u={key:2,class:`top-popup_content`},d={key:4,class:`top-popup_footer`},f=[`href`],p=(0,i.defineComponent)({__name:`popup`,props:{id:{default:``},class:{},transitionDuration:{},footerSupportLink:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e,{expose:t,emit:a}){let p=e,m=a,h=p.id||`top-popup-id-`+Math.random(),g={id:h,popup:void 0};t(g);let _=(0,i.ref)(null),v=(0,i.ref)(null),y=(0,i.ref)(),b={onOpen:async e=>{e.elPopup&&(_.value=e.elPopup),e.elPopupInner&&(e.elPopupInner.innerText=``,v.value=e.elPopupInner),b.opened=!0,b.popup=e,g.popup=e,y.value=e.el.__TopPopupOpenerProps.data,m(`open`,{elPopup:e.elPopup,elPopupOpener:e.el,data:y.value})},onClose:e=>{v.value=null,b.opened=!1,b.popup=void 0,y.value=void 0,m(`close`,{elPopup:e.elPopup,elPopupOpener:e.el,data:e.el.__TopPopupOpenerProps.data})},classRef:(0,i.toRef)(p,`class`),opened:!1,popup:void 0,transitionDurationRef:(0,i.toRef)(p,`transitionDuration`)};return(0,i.watch)(()=>p.class,(e,t)=>{if(!_.value)return;let n=e?.split(` `)??[],r=(t?.split(` `)??[]).filter(e=>!n.includes(e));_.value.classList.remove(...r),_.value.classList.add(...n)}),r.t.regVueComponent(h,b),(0,i.onUnmounted)(()=>{r.t.unregVueComponent(h)}),(t,r)=>{let a=(0,i.resolveDirective)(`top-scroll-shadow`);return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[t.$slots.opener?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,id:(0,i.unref)(h),pos:e.pos,posBy:e.posBy,notch:e.notch,openByFocusInput:e.openByFocusInput,openByHover:t.$core.state.isMobile||t.$core.state.isMobileUA?!1:e.openByHover,disabled:e.disabled},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`opener`)]),_:3},8,[`id`,`pos`,`posBy`,`notch`,`openByFocusInput`,`openByHover`,`disabled`])):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{key:1,to:v.value},[t.$slots.header||t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,s,[t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,(0,i.toDisplayString)(t.$i18n.Common.Close),1)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`header`,{data:y.value})])):(0,i.createCommentVNode)(``,!0),t.$slots.widget?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,l,[(0,i.renderSlot)(t.$slots,`widget`)])):(0,i.createCommentVNode)(``,!0),t.$slots.content?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,u,[(0,i.renderSlot)(t.$slots,`content`,{data:y.value})])),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.contentList?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:3,class:`top-popup_content`,onScroll:r[0]||=e=>t.$emit(`scrollContentList`,e)},[(0,i.renderSlot)(t.$slots,`contentList`,{data:y.value})],32)),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.footer||e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,d,[e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`a`,{key:0,class:`top-popup_footerSupportLink`,href:e.footerSupportLink,target:`_blank`},[(0,i.createVNode)(n.d,{hint:``})],8,f)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`footer`,{data:y.value})])):(0,i.createCommentVNode)(``,!0)],8,[`to`])):(0,i.createCommentVNode)(``,!0)],64)}}}),m={class:`top-popup_listItemActionsLabel top-ellipsis1`},h={class:`top-popup_listItemActions`},g=(0,i.defineComponent)({inheritAttrs:!1,__name:`listItem`,props:{type:{default:`button`},closeByClick:{type:Boolean,default:!0},class:{},attrs:{}},setup(e){let t=e;return(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{class:(0,i.normalizeClass)({"top-popup_liNoSelectable":t.type!==`button`})},[((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.$attrs.href?`a`:`div`),(0,i.mergeProps)({class:{"top-popup_listItem":!0,[`top-popup_listItem-`+t.type]:!!t.type,"top-popup_liastItem-withActions":n.$slots.actions,"top-popup-noCloser":!e.closeByClick,[t.class??``]:!!t.class,a:t.type===`button`}},{...n.$attrs,...e.attrs}),{default:(0,i.withCtx)(()=>[n.$slots.actions?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createElementVNode)(`div`,m,[(0,i.renderSlot)(n.$slots,`default`)]),(0,i.createElementVNode)(`div`,h,[(0,i.renderSlot)(n.$slots,`actions`)])],64)):(0,i.renderSlot)(n.$slots,`default`,{},void 0,void 0,1)]),_:3},16,[`class`])),(0,i.renderSlot)(n.$slots,`buttons`)],2))}}),_=(0,i.defineComponent)({__name:`widgetInput`,props:(0,i.mergeModels)({modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{},styling:{},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{},addCleaner:{type:Boolean,default:!0},title:{},captionType:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=(0,i.useModel)(e,`modelValue`);return(e,r)=>((0,i.openBlock)(),(0,i.createBlock)(n.c,(0,i.mergeProps)(e.$props,{modificator:`popupWidgetInput`,modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e}),null,16,[`modelValue`]))}}),v=(0,i.defineComponent)({__name:`popupAlert`,props:{submitText:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e){let{submitText:t,...r}=e;return(e,a)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupAlert`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,null,{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(t)||e.$i18n.Common.Close),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),y=(0,i.defineComponent)({__name:`popupConfirm`,props:{cancelText:{},submitText:{},isWarning:{type:Boolean},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=(0,i.ref)(!1),s=()=>{o.value=!0,a(`submit`)},c=e=>{if(o.value){o.value=!1;return}a(`close`,e)},{submitText:l,cancelText:u,isWarning:d,...f}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupConfirm`},f,{onOpen:t[0]||=t=>e.$emit(`open`,t),onClose:t[1]||=e=>c(e),onScrollContentList:t[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(u)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:s,color:(0,i.unref)(d)?`red`:`blue`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(l)||e.$i18n.Common.Continue),1)]),_:1},8,[`color`])]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),b=(0,i.defineComponent)({__name:`popupPrompt`,props:{submitText:{},cancelText:{},defaultValue:{},inputProps:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=()=>c.value=r.defaultValue??``,s=(0,i.ref)(!1),c=(0,i.ref)();(0,i.watch)(()=>r.defaultValue,()=>o(),{immediate:!0});let l=()=>{s.value=!0},u=e=>{if(s.value){s.value=!1,a(`submit`,c.value),o();return}o(),a(`close`,e)},{submitText:d,cancelText:f,defaultValue:m,inputProps:h,...g}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupPrompt`},g,{onOpen:t[1]||=t=>e.$emit(`open`,t),onClose:t[2]||=e=>u(e),onScrollContentList:t[3]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(f)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:l},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(d)||e.$i18n.Common.OK),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`),(0,i.createVNode)(_,(0,i.mergeProps)({modelValue:c.value,"onUpdate:modelValue":t[0]||=e=>c.value=e,modelModifiers:{trim:!0}},(0,i.unref)(h)),null,16,[`modelValue`])]),key:`1`}:void 0]),1040))}}),x=(0,i.defineComponent)({__name:`popupHint`,props:{hint:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},setup(e){let{hint:t,...r}=e;return(e,a)=>{let o=(0,i.resolveDirective)(`top-tooltip`);return(0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupHint`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.withDirectives)((0,i.createVNode)(n.d,{hint:(0,i.unref)(t),class:`top-popupHint_opener`},null,8,[`hint`]),[[o]])]),_:2},[e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`0`}:void 0]),1040)}}});t.c=o,t.s=p,t.o=g,t.a=_,t.i=v,t.r=y,t.n=b,t.t=x});
2
- //# sourceMappingURL=popup-DhySIsg9.amd.js.map
1
+ define([`require`,`exports`,`./forms-LywqKN9I.amd`,`./worker-a6MSM1uV.amd`,`vue`,`../require/css.amd!../assets/popup.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.c=t.a=void 0;var o=(0,i.defineComponent)({__name:`opener`,props:{id:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},setup(e){let t=e,n=t.id||Math.random()+``,a;function o(e){setTimeout(()=>{a=e.nextElementSibling,a&&s(a)})}(0,i.onUpdated)(()=>{a&&s(a)});function s(e){e.dataset.topPopup=`#`+n;let i=!!e.dataset.topPopupDisabled;if(e.dataset.topPopupId=n,e.dataset.topPopupPos=t.pos,e.dataset.topPopupPosBy=t.posBy,e.dataset.topPopupNotch=t.notch?`true`:``,e.dataset.topPopupOpenByHover=t.openByHover?`true`:``,e.dataset.topPopupDisabled=t.disabled?`true`:``,e.__TopPopupOpenerProps=t,t.openByFocusInput&&e.classList.contains(`top-input`)){let n=e.querySelector(`input`);if(n.onfocus=()=>{e.dataset.topPopupDisabled||r.t.getPopupFromOpener(e)?.vueGetComponent()?.opened||r.t.openByOpener(e)},t.disabled!==i&&n===document.activeElement){let n=r.t.getPopupFromOpener(e);!t.disabled&&!n&&r.t.openByOpener(e),t.disabled&&n&&n.close()}}}return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[(0,i.createElementVNode)(`template`,{ref:o}),(0,i.renderSlot)(e.$slots,`default`)],64))}}),s={key:0,class:`top-popup_header`},c={key:0,class:`top-as-a closer`},l={key:1,class:`top-popup_widget`},u={key:2,class:`top-popup_content`},d={key:4,class:`top-popup_footer`},f=[`href`],p=(0,i.defineComponent)({__name:`popup`,props:{id:{default:``},class:{},transitionDuration:{},footerSupportLink:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e,{expose:t,emit:a}){let p=e,m=a,h=p.id||`top-popup-id-`+Math.random(),g={id:h,popup:void 0};t(g);let _=(0,i.ref)(null),v=(0,i.ref)(null),y=(0,i.ref)(),b={onOpen:async e=>{e.elPopup&&(_.value=e.elPopup),e.elPopupInner&&(e.elPopupInner.innerText=``,v.value=e.elPopupInner),b.opened=!0,b.popup=e,g.popup=e,y.value=e.el.__TopPopupOpenerProps.data,m(`open`,{elPopup:e.elPopup,elPopupOpener:e.el,data:y.value})},onClose:e=>{v.value=null,b.opened=!1,b.popup=void 0,y.value=void 0,m(`close`,{elPopup:e.elPopup,elPopupOpener:e.el,data:e.el.__TopPopupOpenerProps.data})},classRef:(0,i.toRef)(p,`class`),opened:!1,popup:void 0,transitionDurationRef:(0,i.toRef)(p,`transitionDuration`)};return(0,i.watch)(()=>p.class,(e,t)=>{if(!_.value)return;let n=e?.split(` `)??[],r=(t?.split(` `)??[]).filter(e=>!n.includes(e));_.value.classList.remove(...r),_.value.classList.add(...n)}),r.t.regVueComponent(h,b),(0,i.onUnmounted)(()=>{r.t.unregVueComponent(h)}),(t,r)=>{let a=(0,i.resolveDirective)(`top-scroll-shadow`);return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[t.$slots.opener?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,id:(0,i.unref)(h),pos:e.pos,posBy:e.posBy,notch:e.notch,openByFocusInput:e.openByFocusInput,openByHover:t.$core.state.isMobile||t.$core.state.isMobileUA?!1:e.openByHover,disabled:e.disabled},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`opener`)]),_:3},8,[`id`,`pos`,`posBy`,`notch`,`openByFocusInput`,`openByHover`,`disabled`])):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{key:1,to:v.value},[t.$slots.header||t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,s,[t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,(0,i.toDisplayString)(t.$i18n.Common.Close),1)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`header`,{data:y.value})])):(0,i.createCommentVNode)(``,!0),t.$slots.widget?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,l,[(0,i.renderSlot)(t.$slots,`widget`)])):(0,i.createCommentVNode)(``,!0),t.$slots.content?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,u,[(0,i.renderSlot)(t.$slots,`content`,{data:y.value})])),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.contentList?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:3,class:`top-popup_content`,onScroll:r[0]||=e=>t.$emit(`scrollContentList`,e)},[(0,i.renderSlot)(t.$slots,`contentList`,{data:y.value})],32)),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.footer||e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,d,[e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`a`,{key:0,class:`top-popup_footerSupportLink`,href:e.footerSupportLink,target:`_blank`},[(0,i.createVNode)(n.d,{hint:``})],8,f)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`footer`,{data:y.value})])):(0,i.createCommentVNode)(``,!0)],8,[`to`])):(0,i.createCommentVNode)(``,!0)],64)}}}),m={class:`top-popup_listItemActionsLabel top-ellipsis1`},h={class:`top-popup_listItemActions`},g=(0,i.defineComponent)({inheritAttrs:!1,__name:`listItem`,props:{type:{default:`button`},closeByClick:{type:Boolean,default:!0},class:{},attrs:{}},setup(e){let t=e;return(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{class:(0,i.normalizeClass)({"top-popup_liNoSelectable":t.type!==`button`})},[((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.$attrs.href?`a`:`div`),(0,i.mergeProps)({class:{"top-popup_listItem":!0,[`top-popup_listItem-`+t.type]:!!t.type,"top-popup_liastItem-withActions":n.$slots.actions,"top-popup-noCloser":!e.closeByClick,[t.class??``]:!!t.class,a:t.type===`button`}},{...n.$attrs,...e.attrs}),{default:(0,i.withCtx)(()=>[n.$slots.actions?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createElementVNode)(`div`,m,[(0,i.renderSlot)(n.$slots,`default`)]),(0,i.createElementVNode)(`div`,h,[(0,i.renderSlot)(n.$slots,`actions`)])],64)):(0,i.renderSlot)(n.$slots,`default`,{},void 0,void 0,1)]),_:3},16,[`class`])),(0,i.renderSlot)(n.$slots,`buttons`)],2))}}),_=(0,i.defineComponent)({__name:`widgetInput`,props:(0,i.mergeModels)({modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{},styling:{},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{},addCleaner:{type:Boolean,default:!0},title:{},captionType:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=(0,i.useModel)(e,`modelValue`);return(e,r)=>((0,i.openBlock)(),(0,i.createBlock)(n.c,(0,i.mergeProps)(e.$props,{modificator:`popupWidgetInput`,modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e}),null,16,[`modelValue`]))}}),v=(0,i.defineComponent)({__name:`popupAlert`,props:{submitText:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e){let{submitText:t,...r}=e;return(e,a)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupAlert`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,null,{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(t)||e.$i18n.Common.Close),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),y=(0,i.defineComponent)({__name:`popupConfirm`,props:{cancelText:{},submitText:{},isWarning:{type:Boolean},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=(0,i.ref)(!1),s=()=>{o.value=!0,a(`submit`)},c=e=>{if(o.value){o.value=!1;return}a(`close`,e)},{submitText:l,cancelText:u,isWarning:d,...f}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupConfirm`},f,{onOpen:t[0]||=t=>e.$emit(`open`,t),onClose:t[1]||=e=>c(e),onScrollContentList:t[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(u)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:s,color:(0,i.unref)(d)?`red`:`blue`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(l)||e.$i18n.Common.Continue),1)]),_:1},8,[`color`])]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),b=(0,i.defineComponent)({__name:`popupPrompt`,props:{submitText:{},cancelText:{},defaultValue:{},inputProps:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=()=>c.value=r.defaultValue??``,s=(0,i.ref)(!1),c=(0,i.ref)();(0,i.watch)(()=>r.defaultValue,()=>o(),{immediate:!0});let l=()=>{s.value=!0},u=e=>{if(s.value){s.value=!1,a(`submit`,c.value),o();return}o(),a(`close`,e)},{submitText:d,cancelText:f,defaultValue:m,inputProps:h,...g}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupPrompt`},g,{onOpen:t[1]||=t=>e.$emit(`open`,t),onClose:t[2]||=e=>u(e),onScrollContentList:t[3]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(f)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:l},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(d)||e.$i18n.Common.OK),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`),(0,i.createVNode)(_,(0,i.mergeProps)({modelValue:c.value,"onUpdate:modelValue":t[0]||=e=>c.value=e,modelModifiers:{trim:!0}},(0,i.unref)(h)),null,16,[`modelValue`])]),key:`1`}:void 0]),1040))}}),x=(0,i.defineComponent)({__name:`popupHint`,props:{hint:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},setup(e){let{hint:t,...r}=e;return(e,a)=>{let o=(0,i.resolveDirective)(`top-tooltip`);return(0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupHint`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.withDirectives)((0,i.createVNode)(n.d,{hint:(0,i.unref)(t),class:`top-popupHint_opener`},null,8,[`hint`]),[[o]])]),_:2},[e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`0`}:void 0]),1040)}}});t.c=o,t.s=p,t.o=g,t.a=_,t.i=v,t.r=y,t.n=b,t.t=x});
2
+ //# sourceMappingURL=popup-BWD4eASc.amd.js.map