@opengis/admin 0.4.21 → 0.4.22
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.
- package/README.md +97 -97
- package/dist/{add-page-DX8I-Ibw.js → add-page-CvVDuWhT.js} +1 -1
- package/dist/{admin-interface-Cq3LktJQ.js → admin-interface-Da-_i-IA.js} +2 -2
- package/dist/{admin-view-CyZiD4rI.js → admin-view-ccrTnaDh.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +1 -1
- package/dist/assets/logo.svg +41 -41
- package/dist/{card-view-SjNlmAdw.js → card-view-BDclnnUd.js} +1 -1
- package/dist/{edit-page-CNbf1qdc.js → edit-page-Czruo01t.js} +1 -1
- package/dist/{import-file-Dl5JtLqU.js → import-file-DcpjZvgK.js} +7 -7
- package/dist/{profile-page-4x0ereNR.js → profile-page-CrxFfeAq.js} +1 -1
- package/dist/style.css +1 -1
- package/module/settings/card/admin.accounts.table/index.yml +7 -7
- package/module/settings/card/admin.accounts.table/rules.hbs +18 -18
- package/module/settings/card/admin.accounts.table/users.hbs +13 -13
- package/module/settings/card/admin.routes.table/groups.hbs +11 -11
- package/module/settings/card/admin.routes.table/users.hbs +16 -16
- package/module/settings/cls/core.actions.json +17 -17
- package/module/settings/cls/core.scope.json +13 -13
- package/module/settings/cls/properties.site_status.json +13 -13
- package/module/settings/cls/properties.widget_status.json +13 -13
- package/module/settings/cls/yes_no.json +11 -11
- package/module/settings/form/admin.accounts.form.json +13 -13
- package/module/settings/form/admin.properties.form.json +15 -15
- package/module/settings/form/admin.roles.form.json +21 -21
- package/module/settings/form/admin.user_properties.form.json +15 -15
- package/module/settings/form/admin.user_roles_card.form.json +13 -13
- package/module/settings/interface/admin.properties.json +4 -4
- package/module/settings/interface/admin.roles.json +4 -4
- package/module/settings/interface/admin.routes.json +4 -4
- package/module/settings/interface/admin.users.json +4 -4
- package/module/settings/select/core.routes.sql +1 -1
- package/module/settings/select/core.user_mentioned.sql +1 -1
- package/module/settings/select/core.user_uid.sql +1 -1
- package/module/settings/table/admin.properties.table.json +39 -39
- package/module/settings/table/admin.user_properties.table.json +34 -34
- package/package.json +1 -1
- package/server/helpers/core/coalesce.js +7 -7
- package/server/helpers/core/select.js +48 -48
- package/server/helpers/core/token.js +18 -18
- package/server/helpers/list/buttonHelper.js +21 -21
- package/server/helpers/list/utils/button.js +5 -5
- package/server/helpers/temp/contentList.js +58 -58
- package/server/helpers/temp/ifCond.js +101 -101
- package/server/helpers/utils/button.js +5 -5
- package/server/helpers/utils/mdToHTML.js +17 -17
- package/server/plugins/access/index.mjs +6 -6
- package/server/plugins/cron.js +10 -10
- package/server/plugins/docs.js +28 -28
- package/server/routes/access/controllers/access.group.js +28 -29
- package/server/routes/access/controllers/access.group.post.js +53 -54
- package/server/routes/access/index.mjs +11 -11
- package/server/routes/access/schema.mjs +67 -67
- package/server/routes/calendar/controllers/calendar.data.js +124 -125
- package/server/routes/calendar/index.mjs +7 -7
- package/server/routes/notifications/controllers/readNotifications.js +18 -18
- package/server/routes/notifications/controllers/testEmail.js +35 -35
- package/server/routes/notifications/controllers/userNotifications.js +53 -53
- package/server/routes/notifications/hook/onWidgetSet.js +56 -56
- package/server/routes/notifications/index.mjs +26 -26
- package/server/routes/root.mjs +3 -3
- package/server/routes/user/controllers/user.cls.id.js +14 -14
- package/server/routes/user/controllers/user.cls.js +72 -72
- package/server/routes/user/controllers/user.info.js +17 -17
- package/server/routes/util/controllers/code.generator.js +89 -89
- package/server/templates/cls/itree.recrzone_category.json +73 -73
- package/server/templates/cls/test.json +9 -9
- package/server/templates/form/admin.user_cls.data.form.json +49 -49
- package/server/templates/form/admin.user_group_rel.form.json +21 -21
- package/server/templates/form/form-user-pass.json +10 -10
- package/server/templates/form/form-user_group.json +39 -39
- package/server/templates/form/form-users.json +156 -156
- package/server/templates/form/user_group_access.form.json +22 -22
- package/server/templates/select/account_id.json +2 -2
- package/server/templates/table/gis.dataset.table.json +43 -43
- package/server/templates/table/management.user_group.table.json +112 -112
- package/server/templates/table/management.users.table.json +126 -126
- package/server/utils/addNotification.js +21 -21
- package/server/utils/sendNotification.js +89 -89
package/dist/admin.umd.cjs
CHANGED
@@ -657,4 +657,4 @@ uniform ${O} ${L} u_${G};
|
|
657
657
|
</div>
|
658
658
|
`}).mount(p)},{Fancybox:h9}=Hh,Ry={$form:l9,$api:d9,$map:u9,$preview:({media:t})=>{const e=document.querySelector("#app");if(!e){console.error('Modal root element with id "#app" not found!');return}const n=document.createElement("div");e.appendChild(n),a.createApp({data(){return{items:Array.isArray(t)?t:[t]}},mounted(){this.$nextTick(()=>{h9.show(this.items.map(o=>{const d=typeof o=="string"&&o.endsWith(".pdf");return{src:o,type:d?"iframe":"image"}}),{groupAll:!0,Thumbs:{autoStart:!0}})})},template:`
|
659
659
|
<div style="display: none;"></div> <!-- Keeps container hidden -->
|
660
|
-
`}).mount(n)}};window.addEventListener("click",t=>{var n,r,o;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const d=e==null?void 0:e.getAttribute("_href");(o=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||o.push(d),t==null||t.preventDefault()}});const p9=()=>{const t=a.defineCustomElement(Iy);customElements.define("admin-info",t)},f9=["black","gray","red","yellow","green","blue","indigo","purple","pink","rose","amber","lime","emerald","teal","cyan","sky","violet","fuchsia","lavender","zinc","neutral","stone"],m9=["white"];let Nd,A2;const g9=async()=>{try{const{data:t}=await Le.get("/api/user-menu"),e=t.menus;return ei.value=e,Nd=t.settings,A2=t.user,Ty(e)}catch(t){return console.error(t),[]}},y9=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},D2={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){try{p9(),(n.sidebarDark??!0)&&(n.sidebarDark=!m9.includes(n.sidebarColor)),n.buttonColor||(n.buttonColor=f9.includes(n.sidebarColor)?n.sidebarColor:"blue");const d=(await g9()).filter(c=>c==null?void 0:c.component).map(c=>({...c,component:{...Py,...e}[c==null?void 0:c.component]}));et.value={...et.value,...n,...(Nd==null?void 0:Nd.admin)||{}},y9(t,{...Py,...e}),t.component("admin",XC);const{router:p}=await PT(d.concat(r));window.app={...t,router:p},window.v3plugin={...t.config.globalProperties,...Ry},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...vx,componentsApp:e},$router:p,$v3plugin:Ry,$utils:{reloadCardPage:th},$settings:Nd,$adminSettings:et.value,$user:A2},t.use(p)}catch(o){console.error(o)}},components:Py,plugins:Ry};typeof window<"u"&&(window.v3Admin=D2);const _9={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},computed:{color(){return et.value.buttonColor||"blue"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:d}}=await Le.get(`/api/template/table/${n}`),{data:p}=await Le.get(`/api/table/${this.table}/${(o=(r=this.$route)==null?void 0:r.query)==null?void 0:o.id}`);this.token=(p==null?void 0:p.token)||"",this.formValues=p||{};const{data:c}=await Le.get(`/api/template/form/${d}`);this.scheme=(c==null?void 0:c.schema)||c,this.style=(c==null?void 0:c.style)||null}catch{}},async onlyEditObject(){var e,n,r,o,d,p,c,b,k,E,C;const t=(n=(e=this.$refs.form)==null?void 0:e.$refs)==null?void 0:n.form;try{await t.doValidation(),await Le.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(T){const I=((r=T==null?void 0:T.response)==null?void 0:r.data)||"";let N=((c=(p=(d=(o=Object.entries(t==null?void 0:t.formErrors))==null?void 0:o[0])==null?void 0:d[1])==null?void 0:p[0])==null?void 0:c.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(C=(E=(k=(b=Object.entries(t==null?void 0:t.formErrors))==null?void 0:b[0])==null?void 0:k[1])==null?void 0:E[0])==null?void 0:C.message;this.$notify({title:"Помилка!",message:I||N||"Сталася помилка валідаціі",type:"error"})}},getGroupedErrorNotification(t,e){if(!t||!e)return"";const n={};return Object.entries(t).forEach(([o,d])=>{var c;const p=((c=e[o])==null?void 0:c.ua)||o;d.forEach(b=>{const k=b.message;n[k]||(n[k]=[]),n[k].push(`"${p}"`)})}),Object.entries(n).map(([o,d])=>`<b>${o}:</b> ${d.join(", ")}`).join("<br>")||"Сталася помилка валідації"},async editObjectAndRedirect(t=!0){var n,r;const e=(r=(n=this.$refs.form)==null?void 0:n.$refs)==null?void 0:r.form;try{t&&await e.doValidation(),await Le.put(`/api/table/${this.token}${t?"":"?draft=1"}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{const d=this.getGroupedErrorNotification(e==null?void 0:e.formErrors,e==null?void 0:e.scheme);this.$notify({title:"Помилка!",message:d,type:"error"})}}}},b9={class:"bg-gray-100 lg:w-[calc(100vw-260px)] w-[100vw]"},x9={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},v9={class:"flex items-center gap-[6px]"},w9={class:"bg-white w-full rounded-xl"};function k9(t,e,n,r,o,d){var c,b,k;const p=a.resolveComponent("VsFormWithNavigation");return a.openBlock(),a.createElementBlock("div",b9,[a.createElementVNode("div",x9,[e[4]||(e[4]=a.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),a.createElementVNode("div",v9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=E=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),(c=o.style)!=null&&c.draft?(a.openBlock(),a.createElementBlock("button",{key:0,onClick:e[1]||(e[1]=E=>d.editObjectAndRedirect(!1)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти DRAFT ",2)):a.createCommentVNode("",!0),a.createElementVNode("button",{onClick:e[2]||(e[2]=(...E)=>d.editObjectAndRedirect&&d.editObjectAndRedirect(...E)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти ",2)])]),a.createElementVNode("div",{style:a.normalizeStyle({height:((b=t.$adminSettings)==null?void 0:b.header)===!1?"calc(100vh - 91px)":"calc(100vh - 150px)"}),class:"bg-gray-100 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw] overflow-hidden"},[a.createElementVNode("div",w9,[o.scheme?(a.openBlock(),a.createBlock(p,{key:0,ref:"form",scheme:o.scheme,columns:(k=o.style)==null?void 0:k.columns,style:a.normalizeStyle(o.style),modelValue:o.formValues,"onUpdate:modelValue":e[3]||(e[3]=E=>o.formValues=E),class:"p-[20px] h-full"},null,8,["scheme","columns","style","modelValue"])):a.createCommentVNode("",!0)])],4)])}const E9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(_9,[["render",k9]])},Symbol.toStringTag,{value:"Module"})),C9={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},computed:{color(){return et.value.buttonColor||"blue"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const d=await Le.get(`/api/table-data/${n}`),{data:p}=await Le.get(`/api/template/form/${(r=d==null?void 0:d.data)==null?void 0:r.form}`);this.scheme=(p==null?void 0:p.schema)||p,this.style=(p==null?void 0:p.style)||null,this.api=(p==null?void 0:p.api)||"",this.token=((o=d==null?void 0:d.data)==null?void 0:o.addToken)||""}catch{}},getGroupedErrorNotification(t,e){if(!t||!e)return"";const n={};return Object.entries(t).forEach(([o,d])=>{var c;const p=((c=e[o])==null?void 0:c.ua)||o;d.forEach(b=>{const k=b.message;n[k]||(n[k]=[]),n[k].push(`"${p}"`)})}),Object.entries(n).map(([o,d])=>`<b>${o}:</b> ${d.join(", ")}`).join("<br>")||"Сталася помилка валідації"},async createObject(){var e,n,r;const t=(n=(e=this.$refs.form)==null?void 0:e.$refs)==null?void 0:n.form;try{await t.doValidation(),await Le.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(o){const d=this.getGroupedErrorNotification(t==null?void 0:t.formErrors,t==null?void 0:t.scheme);this.$notify({title:"Помилка!",message:((r=o==null?void 0:o.response)==null?void 0:r.data)||d,type:"error"})}}}},S9={class:"bg-gray-100 lg:w-[calc(100vw-260px)] w-[100vw]"},T9={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},A9={class:"flex items-center gap-[6px]"},D9={class:"bg-white w-full rounded-xl"};function M9(t,e,n,r,o,d){var c;const p=a.resolveComponent("VsFormWithNavigation");return a.openBlock(),a.createElementBlock("div",S9,[a.createElementVNode("div",T9,[e[3]||(e[3]=a.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),a.createElementVNode("div",A9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=b=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),a.createElementVNode("button",{onClick:e[1]||(e[1]=(...b)=>d.createObject&&d.createObject(...b)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти ",2)])]),a.createElementVNode("div",{style:a.normalizeStyle({height:((c=t.$adminSettings)==null?void 0:c.header)===!1?"calc(100vh - 91px)":"calc(100vh - 150px)"}),class:"bg-gray-100 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw] overflow-hidden"},[a.createElementVNode("div",D9,[o.scheme?(a.openBlock(),a.createBlock(p,{key:0,ref:"form",scheme:o.scheme,style:a.normalizeStyle(o.style),modelValue:o.formValues,"onUpdate:modelValue":e[2]||(e[2]=b=>o.formValues=b),class:"h-full p-[20px]"},null,8,["scheme","style","modelValue"])):a.createCommentVNode("",!0)])],4)])}const I9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(C9,[["render",M9]])},Symbol.toStringTag,{value:"Module"})),P9=a.ref(null),R9={data(){return{formScheme:null,formValues:{}}},mounted(){this.getFormScheme()},computed:{userData(){return P9.value}},methods:{async updateUser(){var t;try{await Le.put(`/user/${(t=this.userData.user)==null?void 0:t.uid}`,this.formValues),await this.$notify({title:"Успішно!",message:"Дані успішно оновлені",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},async getFormScheme(){var t,e,n,r;try{const{data:o}=await Le.get("/api/template/form/admin.profile.form");console.log(this.userData);for(const d in o==null?void 0:o.schema)(e=(t=this.userData)==null?void 0:t.user)!=null&&e[d]&&(this.formValues[d]=(r=(n=this.userData)==null?void 0:n.user)==null?void 0:r[d]);this.formScheme=o.schema}catch(o){console.error(o)}}}},N9={class:"flex justify-center pt-[20px] pb-[20px] pl-[20px] h-[calc(100vh-58px)]"},B9={class:"bg-white rounded-xl p-[20px]"},V9={class:"flex-1 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},z9={class:"flex"};function O9(t,e,n,r,o,d){const p=a.resolveComponent("VsForm");return a.openBlock(),a.createElementBlock("div",N9,[a.createElementVNode("div",B9,[e[2]||(e[2]=a.createElementVNode("h2",{class:"mb-[20px] text-center"},"Профіль",-1)),a.createElementVNode("div",V9,[o.formScheme?(a.openBlock(),a.createBlock(p,{key:0,scheme:o.formScheme,modelValue:o.formValues,"onUpdate:modelValue":e[0]||(e[0]=c=>o.formValues=c),class:"pb-0"},null,8,["scheme","modelValue"])):a.createCommentVNode("",!0),a.createElementVNode("div",z9,[a.createElementVNode("button",{onClick:e[1]||(e[1]=(...c)=>d.updateUser&&d.updateUser(...c)),class:"ml-auto text-[18px] bg-blue-500 text-white px-[8px] py-[4px] rounded hover:bg-blue-700 duration-300"}," Зберегти ")])])])])}const L9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(R9,[["render",O9]])},Symbol.toStringTag,{value:"Module"})),F9={};function $9(t,e,n,r,o,d){const p=a.resolveComponent("router-view");return a.openBlock(),a.createBlock(p)}const M2=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(F9,[["render",$9]])},Symbol.toStringTag,{value:"Module"})),j9={},U9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function H9(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",U9,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),a.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),a.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const Ny=Oe(j9,[["render",H9]]),W9={},q9={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function G9(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",q9,e[0]||(e[0]=[a.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const I2=Oe(W9,[["render",G9]]),Z9={components:{IconChevronDown:Rd},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,o;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,o,d)=>`<span style="color:#1989fa;">${o}</span>${d}`)}}},Y9={key:0,class:""},X9={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},K9={key:1},J9=["innerHTML"];function Q9(t,e,n,r,o,d){var b,k,E,C,T,I,N,$,F,q,J,Q,me,ke,Re;const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("router-link");return(b=n.route)!=null&&b.menu?(a.openBlock(),a.createElementBlock("div",Y9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=Ee=>o.isOpen=!o.isOpen),class:a.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((E=(k=n.route)==null?void 0:k.menu)==null?void 0:E.some(Ee=>{var Ve,Be;return(Ee==null?void 0:Ee.path)===t.$route.path.replace("/","")||(Ee==null?void 0:Ee.table)===((Be=(Ve=t.$route)==null?void 0:Ve.params)==null?void 0:Be.table)&&(Ee==null?void 0:Ee.table)}))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!d.darkMode}]])},[a.createTextVNode(a.toDisplayString((C=n.route)==null?void 0:C.ua)+" ",1),(T=n.route)!=null&&T.new?(a.openBlock(),a.createElementBlock("span",X9,"Нове")):a.createCommentVNode("",!0),a.createVNode(p,{class:a.normalizeClass([[o.isOpen&&"-rotate-180"],"ml-auto duration-300 flex-shrink-0"]),width:"14",height:"14"},null,8,["class"])],2),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var Ee;return[a.withDirectives(a.createElementVNode("ul",{class:a.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",d.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Ee=n.route)==null?void 0:Ee.menu,(Ve,Be)=>{var Ze,tt;return a.openBlock(),a.createElementBlock("li",{key:Be,class:"w-full"},[a.createVNode(c,{innerHTML:d.highLight(Ve==null?void 0:Ve.ua),to:"/"+(Ve==null?void 0:Ve.path),class:a.normalizeClass([[((Ve==null?void 0:Ve.path)===t.$route.path.replace("/","")||((tt=(Ze=t.$route)==null?void 0:Ze.params)==null?void 0:tt.table)===(Ve==null?void 0:Ve.table)&&(Ve==null?void 0:Ve.table))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!d.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[a.vShow,o.isOpen]])]}),_:1})])):(I=n.route)!=null&&I.hidden?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",K9,[a.createVNode(c,{to:(($=(N=n.route)==null?void 0:N.path)==null?void 0:$[0])==="/"?(F=n.route)==null?void 0:F.path:"/"+((q=n.route)==null?void 0:q.path),class:a.normalizeClass([[(((J=n.route)==null?void 0:J.path.replace("/",""))===t.$route.path.replace("/","")||((me=(Q=t.$route)==null?void 0:Q.params)==null?void 0:me.table)===((ke=n.route)==null?void 0:ke.table)&&((Re=n.route)==null?void 0:Re.table))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!d.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:a.withCtx(()=>{var Ee;return[a.createElementVNode("span",{innerHTML:d.highLight((Ee=n.route)==null?void 0:Ee.ua)},null,8,J9)]}),_:1},8,["to","class"])]))}const eW=Oe(Z9,[["render",Q9]]),tW={},nW={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",nW,e[0]||(e[0]=[a.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),a.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),a.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const P2=Oe(tW,[["render",rW]]),iW={},sW={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function oW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",sW,e[0]||(e[0]=[a.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const aW=Oe(iW,[["render",oW]]),lW={},cW={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function dW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",cW,e[0]||(e[0]=[a.createElementVNode("defs",null,null,-1),a.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[a.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const uW=Oe(lW,[["render",dW]]),hW={},pW={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function fW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",pW,e[0]||(e[0]=[a.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const mW={components:{IconQuestion:P2,IconUSA:aW,IconUkraine:uW,IconTick:Oe(hW,[["render",fW]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},gW={class:"flex justify-center items-center gap-x-2"},yW=["onClick"],_W={class:"text-gray-800"},bW={class:"ms-auto"},xW={class:"truncate"};function vW(t,e,n,r,o,d){const p=a.resolveComponent("IconTick"),c=a.resolveComponent("VsPopover");return n.docs||n.languages?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",d.darkMode?"border-white/10 ":"border-gray-200"])},[a.createElementVNode("div",gW,[a.createVNode(c,{trigger:"click",placement:"top",ref:"langPopover"},{reference:a.withCtx(()=>{var b,k,E;return[a.createElementVNode("button",{type:"button","aria-expanded":"false",class:a.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",d.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[a.createElementVNode("div",null,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent((b=d.selectedLang)==null?void 0:b.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),a.createElementVNode("span",xW,a.toDisplayString(o.currentLang==="ukraine"?(k=d.selectedLang)==null?void 0:k.titleUA:(E=d.selectedLang)==null?void 0:E.titleEN),1)],2)]}),default:a.withCtx(()=>[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.languagesOptions,b=>(a.openBlock(),a.createElementBlock("button",{key:b.id,type:"button",onClick:k=>d.changeLang(b.id),class:a.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(b==null?void 0:b.id)===o.currentLang?"bg-gray-100":""])},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b==null?void 0:b.icon),{class:"w-[16px] h-[16px] rounded-full"})),a.createElementVNode("div",_W,a.toDisplayString(o.currentLang==="ukraine"?b==null?void 0:b.titleUA:b==null?void 0:b.titleEN),1),a.createElementVNode("span",bW,[(b==null?void 0:b.id)===o.currentLang?(a.openBlock(),a.createBlock(p,{key:0})):a.createCommentVNode("",!0)])],10,yW))),128))])]),_:1},512)])],2)):a.createCommentVNode("",!0)}const R2=Oe(mW,[["render",vW]]),wW={components:{IconLogout:Ny,NavbarItem:eW,IconLogo:I2,IconSearch:Dp,NavbarFooter:R2},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(ei.value,this.searchValue):ei.value},logo(){var t,e,n;return((e=(t=this.$settings)==null?void 0:t.admin)==null?void 0:e.logo)||((n=et.value)==null?void 0:n.logo)||"/assets/logo.svg"},docs(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.docs},languages(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.languages},darkMode(){var t;return((t=et==null?void 0:et.value)==null?void 0:t.sidebarDark)||!1},darkColor(){var e,n,r;const t=((e=et==null?void 0:et.value)==null?void 0:e.sidebarColor)||((n=et==null?void 0:et.value)==null?void 0:n.color)||((r=et==null?void 0:et.value)!=null&&r.sidebarDark?"blue":"white");return t.includes("-")||t.includes("[")?t:t+"-950"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,o;if(n.menu){const d=this.filterMenu(n.menu,e);if(d.length>0)return{...n,menu:d,open:!0}}else if((o=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&o.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},kW={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},EW={href:"/"},CW=["src"],SW={class:"px-2 lg:px-5"},TW={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},AW={key:0,class:"flex flex-col gap-y-1"};function DW(t,e,n,r,o,d){var k;const p=a.resolveComponent("VsText"),c=a.resolveComponent("NavbarItem"),b=a.resolveComponent("NavbarFooter");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+d.darkColor]:d.darkColor,"bg-white":!d.darkMode&&!d.darkColor}])},[a.createElementVNode("div",kW,[a.createElementVNode("a",EW,[a.createElementVNode("img",{src:d.logo,class:"object-contain w-full h-full"},null,8,CW)])]),a.createElementVNode("div",SW,[a.createVNode(p,{type:"text",modelValue:o.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>o.searchValue=E),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:a.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":d.darkMode,["[&>input]:bg-"+d.darkColor]:d.darkColor,["focus:[&>input]:border-"+d.darkColor+"-500"]:d.darkMode}])},null,8,["modelValue","class"])]),a.createElementVNode("div",{class:a.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",d.languages||d.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[a.createElementVNode("nav",TW,[(k=d.data)!=null&&k.length?(a.openBlock(),a.createElementBlock("ul",AW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.data,(E,C)=>(a.openBlock(),a.createElementBlock("li",{key:C,class:"flex flex-col gap-[6px]"},[a.createVNode(c,{route:E,searchable:o.searchValue},null,8,["route","searchable"])]))),128))])):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["text-lg mt-[20px]",{"text-white/80":d.darkMode,"text-gray-800":!d.darkMode}])}," Не знайдено ",2))])],2),d.docs||d.languages?(a.openBlock(),a.createBlock(b,{key:0,docs:d.docs,languages:d.languages},null,8,["docs","languages"])):a.createCommentVNode("",!0)],2)}const N2=Oe(wW,[["render",DW],["__scopeId","data-v-7817bab2"]]),MW={components:{IconChevronDown:Rd},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,o;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,o,d)=>`<span style="color:#1989fa;">${o}</span>${d}`)}}},IW={key:0,class:""},PW={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},RW={class:"ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] before:bg-gray-200 flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer"},NW={key:1},BW=["innerHTML"];function VW(t,e,n,r,o,d){var b,k,E,C,T,I,N,$,F,q,J,Q,me,ke,Re;const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("router-link");return(b=n.route)!=null&&b.menu?(a.openBlock(),a.createElementBlock("div",IW,[a.createElementVNode("button",{onClick:e[0]||(e[0]=Ee=>o.isOpen=!o.isOpen),class:a.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-200",[((E=(k=n.route)==null?void 0:k.menu)==null?void 0:E.some(Ee=>{var Ve,Be;return(Ee==null?void 0:Ee.path)===t.$route.path.replace("/","")||(Ee==null?void 0:Ee.table)===((Be=(Ve=t.$route)==null?void 0:Ve.params)==null?void 0:Be.table)&&(Ee==null?void 0:Ee.table)}))&&"bg-gray-200"]])},[a.createTextVNode(a.toDisplayString((C=n.route)==null?void 0:C.ua)+" ",1),(T=n.route)!=null&&T.new?(a.openBlock(),a.createElementBlock("span",PW,"Нове")):a.createCommentVNode("",!0),a.createVNode(p,{class:a.normalizeClass([[o.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var Ee;return[a.withDirectives(a.createElementVNode("ul",RW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Ee=n.route)==null?void 0:Ee.menu,(Ve,Be)=>{var Ze,tt;return a.openBlock(),a.createElementBlock("li",{key:Be,class:"w-full"},[a.createVNode(c,{innerHTML:d.highLight(Ve==null?void 0:Ve.ua),to:"/"+(Ve==null?void 0:Ve.path),class:a.normalizeClass([[((Ve==null?void 0:Ve.path)===t.$route.path.replace("/","")||((tt=(Ze=t.$route)==null?void 0:Ze.params)==null?void 0:tt.table)===(Ve==null?void 0:Ve.table)&&(Ve==null?void 0:Ve.table))&&"bg-gray-200"],"block px-3 py-2 text-sm rounded-lg focus:outline-none hover:bg-gray-200 focus:bg-gray-200"])},null,8,["innerHTML","to","class"])])}),128))],512),[[a.vShow,o.isOpen]])]}),_:1})])):(I=n.route)!=null&&I.hidden?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",NW,[a.createVNode(c,{to:(($=(N=n.route)==null?void 0:N.path)==null?void 0:$[0])==="/"?(F=n.route)==null?void 0:F.path:"/"+((q=n.route)==null?void 0:q.path),class:a.normalizeClass([[(((J=n.route)==null?void 0:J.path.replace("/",""))===t.$route.path.replace("/","")||((me=(Q=t.$route)==null?void 0:Q.params)==null?void 0:me.table)===((ke=n.route)==null?void 0:ke.table)&&((Re=n.route)==null?void 0:Re.table))&&"bg-gray-200"],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3 hover:bg-gray-200 focus:bg-gray-200"])},{default:a.withCtx(()=>{var Ee;return[a.createElementVNode("span",{innerHTML:d.highLight((Ee=n.route)==null?void 0:Ee.ua)},null,8,BW)]}),_:1},8,["to","class"])]))}const zW=Oe(MW,[["render",VW]]),OW={class:"relative w-fit mx-auto"},LW={key:0,class:"w-60 duration absolute top-full left-0 z-20 bg-white rounded-xl shadow-xl block"},FW={class:"p-1"},$W={__name:"navbar-gray-dropdown",setup(t){const e=a.ref(!1);return a.onMounted(()=>{document.addEventListener("click",n=>{n.target.closest(".navbar-gray-dropdown")||(e.value=!1)})}),(n,r)=>{var d;const o=a.resolveComponent("router-link");return a.openBlock(),a.createElementBlock("div",OW,[a.createElementVNode("button",{onClick:r[0]||(r[0]=p=>e.value=!e.value),type:"button",class:"py-1 px-2 navbar-gray-dropdown inline-flex justify-center items-center gap-x-1 font-semibold rounded-lg text-gray-800 hover:text-purple-600 focus:outline-hidden focus:text-purple-600 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-300 dark:hover:text-purple-500 dark:focus:text-purple-500"},[a.createTextVNode(a.toDisplayString((d=n.$user)==null?void 0:d.user_name)+" ",1),a.createVNode(Mp,{width:"16",height:"16"})]),e.value?(a.openBlock(),a.createElementBlock("div",LW,[a.createElementVNode("div",FW,[r[2]||(r[2]=a.createElementVNode("a",{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",href:"#"}," Профіль ",-1)),a.createVNode(o,{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",to:"/admin.settings"},{default:a.withCtx(()=>r[1]||(r[1]=[a.createTextVNode(" Налаштування ")])),_:1,__:[1]})]),r[3]||(r[3]=a.createElementVNode("div",{class:"p-1 border-t border-gray-200 dark:border-neutral-700"},[a.createElementVNode("a",{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",href:"/logout"}," Вийти ")],-1))])):a.createCommentVNode("",!0)])}}},jW={class:"p-4 flex flex-col justify-center border-b relative max-h-[192px]"},UW={components:{IconLogout:Ny,NavbarItem:zW,IconLogo:I2,IconSearch:Dp,NavbarFooter:R2,NavbarUser:{__name:"navbar-gray-user",setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",jW,[a.createVNode(pg,{class:"!absolute top-[8px] right-[8px]",placement:"left"}),n[0]||(n[0]=a.createElementVNode("div",{class:"flex size-24 justify-center items-center shrink-0 rounded-full overflow-hidden mx-auto mb-2"},[a.createElementVNode("img",{class:"object-cover h-[130px] w-[130px]",src:"https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=",alt:"Avatar"})],-1)),a.createVNode($W)]))}}},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(ei.value,this.searchValue):ei.value},logo(){var t,e,n;return((e=(t=this.$settings)==null?void 0:t.admin)==null?void 0:e.logo)||((n=et.value)==null?void 0:n.logo)||"/assets/logo.svg"},docs(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.docs},languages(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.languages},darkMode(){var t;return((t=et==null?void 0:et.value)==null?void 0:t.sidebarDark)||!1},darkColor(){var e,n,r;const t=((e=et==null?void 0:et.value)==null?void 0:e.sidebarColor)||((n=et==null?void 0:et.value)==null?void 0:n.color)||((r=et==null?void 0:et.value)!=null&&r.sidebarDark?"blue":"white");return t.includes("-")||t.includes("[")?t:t+"-950"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,o;if(n.menu){const d=this.filterMenu(n.menu,e);if(d.length>0)return{...n,menu:d,open:!0}}else if((o=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&o.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},HW={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},WW={key:0,class:"flex flex-col gap-y-1"},qW={class:"h-[55px] border-t w-full px-5 shrink-0 lg:px-5 flex items-center"},GW={href:"/"},ZW=["src"];function YW(t,e,n,r,o,d){var b;const p=a.resolveComponent("NavbarUser"),c=a.resolveComponent("NavbarItem");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] bg-gray-100 top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu}])},[a.createVNode(p),a.createElementVNode("div",{class:a.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",d.languages||d.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[a.createElementVNode("nav",HW,[(b=d.data)!=null&&b.length?(a.openBlock(),a.createElementBlock("ul",WW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.data,(k,E)=>(a.openBlock(),a.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[a.createVNode(c,{route:k,searchable:o.searchValue},null,8,["route","searchable"])]))),128))])):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["text-lg mt-[20px]",{"text-white/80":d.darkMode,"text-gray-800":!d.darkMode}])}," Не знайдено ",2))])],2),a.createElementVNode("div",qW,[a.createElementVNode("a",GW,[a.createElementVNode("img",{src:d.logo,class:"object-contain max-h-[40px]"},null,8,ZW)])])],2)}const XW=Oe(UW,[["render",YW],["__scopeId","data-v-3cea82a7"]]),KW={__name:"navbar",setup(t){const e={default:N2,gray:XW},n=a.computed(()=>{var r;return e[(r=et.value)==null?void 0:r.navbar]||N2});return(r,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value)))}},JW={components:{IconQuestion:P2,IconUser:Iv,AdminNotification:pg,IconUserOutline:Tv,IconLogout:Ny},data(){return{userData:null,isVisible:!1}},computed:{headerBadgeTitle(){var t;return(t=et.value)==null?void 0:t.headerBadge},headerBadgeColor(){var t;return(t=et.value)==null?void 0:t.headerBadgeColor}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},created(){this.userData=this.$user,Dy.value=this.$settings},methods:{async logout(){try{await Le.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},QW={class:"flex items-center gap-[6px]"},eq={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},tq={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},nq={class:"relative"},rq=["src"],iq={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},sq=["src"],oq={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},aq={class:"grow"},lq={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},cq={class:"text-xs text-gray-500 dark:text-neutral-500"},dq={class:"flex flex-col space-y-0.5"};function uq(t,e,n,r,o,d){const p=a.resolveComponent("IconQuestion"),c=a.resolveComponent("VsPopover"),b=a.resolveComponent("AdminNotification"),k=a.resolveComponent("IconUser"),E=a.resolveComponent("router-link"),C=a.resolveComponent("IconUserOutline"),T=a.resolveComponent("IconLogout");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["h-[58px] border-b flex items-center px-[20px]",d.headerBadgeTitle?"justify-between":"justify-end"])},[d.headerBadgeTitle?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["py-1.5 px-2.5 flex justify-center items-center text-white hover:bg-gray-900 focus:bg-gray-900 dark:bg-neutral-100 dark:text-neutral-800 dark:hover:bg-white dark:focus:bg-white.class text-nowrap text-xs sm:text-[13px] rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none dark:text-neutral-400",{["bg-"+d.headerBadgeColor]:d.headerBadgeColor,"bg-gray-800":!d.headerBadgeColor}])},a.toDisplayString(d.headerBadgeTitle),3)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=I=>t.$parent.showMenu=!0)},e[4]||(e[4]=[a.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),a.createElementVNode("div",QW,[a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>[a.createElementVNode("a",eq,[a.createVNode(p,{height:"24",width:"24"})])]),default:a.withCtx(()=>[e[5]||(e[5]=a.createTextVNode(" Допомога "))]),_:1,__:[5]}),a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>[a.createElementVNode("a",tq,[a.createVNode(b)])]),default:a.withCtx(()=>[e[6]||(e[6]=a.createTextVNode(" Сповіщення "))]),_:1,__:[6]}),e[12]||(e[12]=a.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),a.createElementVNode("div",nq,[a.createElementVNode("div",{onClick:e[1]||(e[1]=I=>o.isVisible=!0),class:"cursor-pointer"},[a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>{var I,N,$,F;return[(N=(I=o.userData)==null?void 0:I.user)!=null&&N.avatar?(a.openBlock(),a.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(F=($=o.userData)==null?void 0:$.user)==null?void 0:F.avatar,alt:"Image Description"},null,8,rq)):(a.openBlock(),a.createElementBlock("div",iq,[a.createVNode(k)]))]}),default:a.withCtx(()=>[e[7]||(e[7]=a.createTextVNode(" Профіль "))]),_:1,__:[7]})]),o.isVisible?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=a.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[a.createVNode(E,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:a.withCtx(()=>{var I,N,$,F,q,J,Q,me,ke,Re;return[(N=(I=o.userData)==null?void 0:I.user)!=null&&N.avatar?(a.openBlock(),a.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(F=($=o.userData)==null?void 0:$.user)==null?void 0:F.avatar,alt:"Image Description"},null,8,sq)):(a.openBlock(),a.createElementBlock("div",oq,[a.createVNode(k,{class:"w-[16px]"})])),a.createElementVNode("div",aq,[a.createElementVNode("span",lq,a.toDisplayString(((J=(q=o.userData)==null?void 0:q.user)==null?void 0:J.username)||((me=(Q=o.userData)==null?void 0:Q.user)==null?void 0:me.user_name)||"User User"),1),a.createElementVNode("p",cq,a.toDisplayString(((Re=(ke=o.userData)==null?void 0:ke.user)==null?void 0:Re.email)||"email не вказано"),1)])]}),_:1}),e[10]||(e[10]=a.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),a.createElementVNode("ul",dq,[a.createElementVNode("li",null,[a.createVNode(E,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:a.withCtx(()=>[a.createVNode(C,{class:"size-4"}),e[8]||(e[8]=a.createTextVNode(" Профіль "))]),_:1,__:[8]})])]),e[11]||(e[11]=a.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),a.createElementVNode("p",null,[a.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...I)=>d.logout&&d.logout(...I)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[a.createVNode(T,{class:"size-4"}),e[9]||(e[9]=a.createTextVNode(" Вийти "))])])])):a.createCommentVNode("",!0)])])],2)}const hq={components:{navbar:KW,AdminHeader:Oe(JW,[["render",uq]])},data(){return{showMenu:!1}},computed:{isMenu(){return ei.value||null},header(){var t,e;return((t=et.value)==null?void 0:t.header)===!1?!1:((e=et.value)==null?void 0:e.header)||"admin-header"}}},pq={class:"admin-wrapper"},fq={class:"flex flex-col w-full"};function mq(t,e,n,r,o,d){const p=a.resolveComponent("navbar"),c=a.resolveComponent("router-view");return a.openBlock(),a.createElementBlock("div",pq,[a.createVNode(p),o.showMenu?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=b=>o.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):a.createCommentVNode("",!0),a.createElementVNode("div",fq,[d.isMenu?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[d.header?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(d.header),{key:0})):a.createCommentVNode("",!0),a.createVNode(c)],64)):a.createCommentVNode("",!0)])])}const gq=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(hq,[["render",mq],["__scopeId","data-v-804a7309"]])},Symbol.toStringTag,{value:"Module"})),yq={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},mounted(){this.$emit("update-ref",this.$refs.column)},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,o=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...o&&{sort:o}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},_q={scope:"col",class:"text-start",ref:"column"},bq={class:"w-[24px]"},xq={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function vq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("th",_q,[d.getVisibleIcon?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-2 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=p=>d.handleClickSortBtn(o.currentSort))},[a.createTextVNode(a.toDisplayString(d.label)+" ",1),a.createElementVNode("span",bq,[o.currentSort?(a.openBlock(),a.createElementBlock("svg",{key:0,class:a.normalizeClass(["shrink-0 size-3.5",{"rotate-180":o.currentSort==="asc"}]),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e[1]||(e[1]=[a.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),a.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):a.createCommentVNode("",!0)])])):(a.openBlock(),a.createElementBlock("p",xq,a.toDisplayString(d.label),1))],512)}const wq=Oe(yq,[["render",vq]]),kq={},Eq={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-link"};function Cq(t,e){return a.openBlock(),a.createElementBlock("svg",Eq,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M9 15l6 -6"},null,-1),a.createElementVNode("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"},null,-1),a.createElementVNode("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"},null,-1)]))}const Sq={components:{IconMore:cg,IconDelete:dg,IconEdit:ug,IconLink:Oe(kq,[["render",Cq]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await Le.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await Le.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await Le.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n,r;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):t!=null&&t.api?(await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1}),await this.$emit("update-table")):t!=null&&t.href&&this.$router.push((t==null?void 0:t.href)+((r=this.item)==null?void 0:r.id))}}},Tq={class:"inline-flex"},Aq={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},Dq={class:"flex flex-col items-start"},Mq=["onClick"],Iq={class:"text-gray-800"},Pq={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},Rq={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Nq(t,e,n,r,o,d){const p=a.resolveComponent("IconMore"),c=a.resolveComponent("IconEdit"),b=a.resolveComponent("router-link"),k=a.resolveComponent("IconLink"),E=a.resolveComponent("IconDelete"),C=a.resolveComponent("VsPopover"),T=a.resolveComponent("VsConfirm");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Tq,[a.createVNode(C,{trigger:"click",placement:"bottom-left"},{reference:a.withCtx(()=>[a.createElementVNode("button",Aq,[a.createVNode(p,{height:"16",width:"16"})])]),default:a.withCtx(()=>{var I,N,$,F,q;return[a.createElementVNode("div",Dq,[(I=n.actions)!=null&&I.includes("edit")&&n.isForm?(a.openBlock(),a.createBlock(b,{key:0,to:`/edit?table=${($=(N=t.$route)==null?void 0:N.params)==null?void 0:$.catchAll}&id=${(F=n.item)==null?void 0:F.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:a.withCtx(()=>[a.createVNode(c,{color:"#000"}),e[4]||(e[4]=a.createTextVNode(" Редагувати "))]),_:1,__:[4]},8,["to"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.getCustomActions,(J,Q)=>(a.openBlock(),a.createElementBlock("button",{key:Q,onClick:me=>d.customButtonAction(J),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[J!=null&&J.href?(a.openBlock(),a.createBlock(k,{key:0,class:"size-3.5"})):a.createCommentVNode("",!0),a.createElementVNode("span",Iq,a.toDisplayString(J==null?void 0:J.label),1)],8,Mq))),128)),n.isForm?(a.openBlock(),a.createElementBlock("div",Pq)):a.createCommentVNode("",!0),(q=n.actions)!=null&&q.includes("del")?(a.openBlock(),a.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=a.withModifiers((...J)=>d.openConfirm&&d.openConfirm(...J),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[a.createVNode(E),e[5]||(e[5]=a.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):a.createCommentVNode("",!0)])]}),_:1})]),a.createVNode(T,{visible:o.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=I=>o.isDeleteConfirm=I),size:"small",title:"Ви впевнені?"},{default:a.withCtx(()=>[e[6]||(e[6]=a.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),a.createElementVNode("div",Rq,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=I=>o.isDeleteConfirm=!1)}," Скасувати "),a.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...I)=>d.deleteElement&&d.deleteElement(...I))}," Так, я впевнена(ий) ")])]),_:1,__:[6]},8,["visible"])],64)}const Bq=Oe(Sq,[["render",Nq]]),Vq={},zq={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Oq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",zq,e[0]||(e[0]=[a.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),a.createElementVNode("path",{d:"M7 20V4"},null,-1),a.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),a.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Lq=Oe(Vq,[["render",Oq]]),Fq={},$q={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function jq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",$q,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),a.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const Uq={components:{IconExport:Lq,IconChevronDown:Rd,IconSuccess:Oe(Fq,[["render",jq]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}],es:null,progress:0}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},computed:{color(){return et.value.buttonColor||"blue"}},methods:{async downloadBlob(t){const e=await Le.get(t||"/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=new Blob([e.data],{type:"application/octet-stream"}),r=document.createElement("a");r.href=URL.createObjectURL(n),r.download=`${this.table.split(".")[0]}.${this.format}`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href),this.isSuccessTemplate=!0,this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})},async exportTable(){var e;try{await Le.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null,stream:!0},validateStatus:n=>n===200}),await this.downloadBlob();return}catch{}const t=new URLSearchParams({table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||"",state:this.filterState||"",custom:this.filterCustom||""});(e=this.es)==null||e.close(),this.es=new EventSource(`/api/export?${t.toString()}`),this.es.addEventListener("progress",n=>{try{const{percent:r}=JSON.parse(n.data);this.progress=r}catch{console.log("progress",n.data)}}),this.es.addEventListener("done",async n=>{this.es.close(),this.es=null;const{url:r}=JSON.parse(n.data||"{}");await this.downloadBlob(r)}),this.es.onerror=n=>{var r;console.error("SSE error",n),this.$notify({type:"error",title:"Помилка",message:"Потік експорту перервано."}),(r=this.es)==null||r.close()}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},Hq={key:0,class:"flex flex-col items-center"},Wq={key:1,class:"p-4"},qq={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Gq={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},Zq=["onClick"],Yq={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Xq={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Kq={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Jq={class:"mt-2 space-y-2"},Qq=["id","onChange"],eG=["for"],tG={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},nG={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function rG(t,e,n,r,o,d){const p=a.resolveComponent("IconExport"),c=a.resolveComponent("IconSuccess"),b=a.resolveComponent("VsCheckbox"),k=a.resolveComponent("VsDialog");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("button",{onClick:e[0]||(e[0]=E=>o.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[a.createVNode(p,{height:"16",width:"16"}),e[7]||(e[7]=a.createTextVNode(" Експорт "))]),a.createVNode(k,{visible:o.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>o.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:a.withCtx(()=>[o.isSuccessTemplate?(a.openBlock(),a.createElementBlock("div",tG,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=E=>o.isOpen=!1)}," Закрити "),a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=E=>o.isSuccessTemplate=!1)}," Вигрузити ще ")])):(a.openBlock(),a.createElementBlock("div",nG,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=E=>o.isOpen=!1)}," Скасувати "),a.createElementVNode("button",{type:"button",class:a.normalizeClass(`inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-${d.color}-700 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-${d.color}-800 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-${d.color}-300 dark:focus:ring-${d.color}-500`),onClick:e[5]||(e[5]=(...E)=>d.exportTable&&d.exportTable(...E))}," Завантажити таблицю ",2)]))]),default:a.withCtx(()=>[o.isSuccessTemplate?(a.openBlock(),a.createElementBlock("div",Hq,[a.createVNode(c,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=a.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(a.openBlock(),a.createElementBlock("div",Wq,[a.createElementVNode("div",qq,[e[9]||(e[9]=a.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),a.createElementVNode("div",Gq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.actions,E=>(a.openBlock(),a.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[a.createElementVNode("span",{class:a.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===o.activeAction}])},[(E==null?void 0:E.name)===o.activeAction?(a.openBlock(),a.createElementBlock("span",Yq)):a.createCommentVNode("",!0)],2),a.createTextVNode(" "+a.toDisplayString(E==null?void 0:E.label),1)],8,Zq))),128))]),a.createElementVNode("div",Xq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.columns,(E,C)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[a.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:o.cols,"onUpdate:modelValue":e[1]||(e[1]=T=>o.cols=T),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),a.createElementVNode("div",Kq,[e[10]||(e[10]=a.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть формат таблиці: ",-1)),a.createElementVNode("div",Jq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.tableFormats,(E,C)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center",key:C},[a.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:E,onChange:T=>d.selectFormat(E)},null,40,Qq),a.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+a.toDisplayString(E),9,eG)]))),128))])])]))]),_:1},8,["visible"])],64)}const iG=Oe(Uq,[["render",rG]]),sG={},oG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function aG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",oG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const lG={components:{IconPlus:$l,IconMinus:Oe(sG,[["render",aG]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},cG={class:"hs-accordion"},dG={class:"py-0.5 flex items-center gap-x-0.5 w-full"},uG={class:"text-sm font-medium"},hG={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function pG(t,e,n,r,o,d){const p=a.resolveComponent("IconPlus"),c=a.resolveComponent("IconMinus");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("div",cG,[a.createElementVNode("div",dG,[a.createElementVNode("div",{onClick:e[0]||(e[0]=b=>o.expanded=!o.expanded),class:"rounded-md cursor-pointer grow"},[a.createElementVNode("span",uG,a.toDisplayString(n.title),1)]),a.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=b=>o.expanded=!o.expanded)},[o.expanded?(a.openBlock(),a.createBlock(c,{key:1,width:"14"})):(a.openBlock(),a.createBlock(p,{key:0}))])]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",hG,[a.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[a.vShow,o.expanded]])]),_:3})])])])}const fG={components:{AdminComponentIs:bd,AdminTree:Oe(lG,[["render",pG],["__scopeId","data-v-c6318482"]]),VsNoData:Ha,VsWidgetComments:Cv,VsWidgetMap:Lm,VsWidgetFileList:Ev},props:{table:String,columns:Array,row:Object}},mG={class:"pl-2 hs-accordion w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 229px)"}},gG={style:{height:"calc(100vh - 360px)"},class:"pl-2"},yG={class:"flow-root mt-[10px]"},_G={class:"divide-y divide-gray-100 text-[12px]"},bG={class:"grid grid-cols-1 gap-1 py-3 even:bg-gray-50 sm:grid-cols-3 sm:gap-4"},xG={class:"font-medium text-gray-900"},vG={class:"text-gray-700 sm:col-span-2"};function wG(t,e,n,r,o,d){var k,E,C,T;const p=a.resolveComponent("AdminComponentIs"),c=a.resolveComponent("VsWidgetFileList"),b=a.resolveComponent("VsNoData");return a.openBlock(),a.createElementBlock("div",mG,[e[0]||(e[0]=a.createElementVNode("div",{class:"pl-[10px] py-[9px]"},[a.createElementVNode("h2",{class:"text-sm font-medium text-center"},"Інформація про об'єкт")],-1)),a.createElementVNode("div",gG,[(E=(k=t.$route)==null?void 0:k.query)!=null&&E.card?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",yG,[a.createElementVNode("dl",_G,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.columns,I=>(a.openBlock(),a.createElementBlock("div",bG,[a.createElementVNode("dt",xG,a.toDisplayString((I==null?void 0:I.ua)||(I==null?void 0:I.title)),1),a.createElementVNode("dd",vG,[a.createVNode(p,{row:n.row,column:I,table:n.table},null,8,["row","column","table"])])]))),256))])]),(a.openBlock(),a.createBlock(c,{key:(C=n.row)==null?void 0:C.id,id:(T=n.row)==null?void 0:T.id,class:"mt-10"},null,8,["id"]))],64)):(a.openBlock(),a.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const kG=Oe(fG,[["render",wG]]),EG={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:Av},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},CG={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},SG={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function TG(t,e,n,r,o,d){const p=a.resolveComponent("IconFilter"),c=a.resolveComponent("VsFilter");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("button",{onClick:e[0]||(e[0]=b=>o.isFilters=!o.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[a.createVNode(p,{height:"16",width:"16"}),e[4]||(e[4]=a.createTextVNode(" Фільтри ")),n.onFilters?(a.openBlock(),a.createElementBlock("span",CG,a.toDisplayString(n.onFilters),1)):a.createCommentVNode("",!0)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var b;return[(a.openBlock(),a.createBlock(a.Teleport,{to:"#modal"},[a.withDirectives(a.createElementVNode("div",{onClick:e[3]||(e[3]=(...k)=>d.closeFilter&&d.closeFilter(...k)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[a.createElementVNode("div",SG,[(b=n.scheme)!=null&&b.length?(a.openBlock(),a.createBlock(c,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=k=>t.$emit("filterChange",k)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=k=>o.isFilters=!1)},null,8,["scheme"])):a.createCommentVNode("",!0)])],512),[[a.vShow,o.isFilters]])]))]}),_:1})],64)}const AG=Oe(EG,[["render",TG]]),DG={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},MG={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},IG=["onClick"];function PG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("nav",MG,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.tabsList,p=>(a.openBlock(),a.createElementBlock("button",{onClick:c=>t.$emit("update:filterState",p==null?void 0:p.name),class:a.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(p==null?void 0:p.name)===n.filterState}])},a.toDisplayString(p==null?void 0:p.label),11,IG))),256))])}const RG=Oe(DG,[["render",PG]]),NG={},BG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function VG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",BG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const zG={components:{IconFilter2:Oe(NG,[["render",VG]]),IconCheck2:kl},props:{filterCustom:String,customList:Array}},OG={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},LG={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},FG=["onClick"],$G={class:"text-sm text-gray-800"};function jG(t,e,n,r,o,d){const p=a.resolveComponent("IconFilter2"),c=a.resolveComponent("IconCheck2"),b=a.resolveComponent("VsPopover");return a.openBlock(),a.createBlock(b,{ref:"popover",placement:"bottom"},{reference:a.withCtx(()=>[a.createElementVNode("button",OG,[a.createVNode(p,{height:"20",width:"20"})])]),default:a.withCtx(()=>[a.createElementVNode("div",LG,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customList,(k,E)=>(a.openBlock(),a.createElementBlock("button",{onClick:C=>{var T;t.$emit("update:filterCustom",k==null?void 0:k.name),(T=t.$refs)==null||T.popover.togglePopover()},key:E,class:a.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(k==null?void 0:k.name)}])},[a.createElementVNode("span",$G,a.toDisplayString(k==null?void 0:k.label),1),n.filterCustom===(k==null?void 0:k.name)?(a.openBlock(),a.createBlock(c,{key:0,class:"ml-auto size-3 shrink-0"})):a.createCommentVNode("",!0)],10,FG))),128)),a.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=k=>{var E;t.$emit("update:filterCustom",void 0),(E=t.$refs)==null||E.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const UG=Oe(zG,[["render",jG]]),HG={class:"flex items-center gap-x-2"},WG={__name:"admin-table-custom-buttons",props:{slots:Object,data:Object},setup(t){var c,b,k,E,C;const{asyncTemplateSlot:e}=(C=(E=(k=(b=(c=a.getCurrentInstance())==null?void 0:c.appContext)==null?void 0:b.app)==null?void 0:k.config)==null?void 0:E.globalProperties)==null?void 0:C.utils,n=a.ref(""),r=a.ref(""),o=t,d=()=>{var T,I,N,$,F;if((T=o.slots)!=null&&T.panelLeft||(r.value="div"),(N=(I=o.slots)==null?void 0:I.panelLeft)!=null&&N.includes("<")){const q=e("PanelLeft",($=o.slots)==null?void 0:$.panelLeft,["name"]);r.value=q}else r.value=(F=o.slots)==null?void 0:F.panelLeft},p=()=>{var T,I,N,$,F;if((T=o.slots)!=null&&T.panelRight||(n.value="div"),(N=(I=o.slots)==null?void 0:I.panelRight)!=null&&N.includes("<")){const q=e("PanelRight",($=o.slots)==null?void 0:$.panelRight,["name"]);n.value=q}else n.value=(F=o.slots)==null?void 0:F.panelRight};return d(),p(),(T,I)=>(a.openBlock(),a.createElementBlock("div",HG,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r.value),{data:t.data},null,8,["data"])),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value),{data:t.data},null,8,["data"]))]))}},qG={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var d,p,c,b,k;const{asyncTemplateSlot:e}=(k=(b=(c=(p=(d=a.getCurrentInstance())==null?void 0:d.appContext)==null?void 0:p.app)==null?void 0:c.config)==null?void 0:b.globalProperties)==null?void 0:k.utils,n=a.ref(""),r=t;return(()=>{var E,C,T,I,N;if((E=r.slots)!=null&&E.addButton||(n.value="div"),(T=(C=r.slots)==null?void 0:C.addButton)!=null&&T.includes("<")){const $=e("addButton",(I=r.slots)==null?void 0:I.addButton,["IconPlus"]);n.value=$}else n.value=(N=r.slots)==null?void 0:N.addButton})(),(E,C)=>n.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value),{key:0,IconPlus:$l})):a.createCommentVNode("",!0)}},GG={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},ZG={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},YG={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("tr",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,r=>{var o;return a.openBlock(),a.createElementBlock(a.Fragment,{key:r==null?void 0:r.name},[(o=t.agg)!=null&&o[r==null?void 0:r.name]?(a.openBlock(),a.createElementBlock("td",GG,[a.createVNode(bd,{column:r,row:t.agg},null,8,["column","row"])])):(a.openBlock(),a.createElementBlock("td",ZG))],64)}),128))]))}},XG={},KG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function JG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",KG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const QG=Oe(XG,[["render",JG]]),eZ=a.defineComponent({components:{IconChevronDown:Mp,IconCheck:QG},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(o,d)=>n+d)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t)},keydownEnter(t){t.preventDefault(),t.target.blur()}}}),tZ={class:"flex items-center w-full"},nZ={class:"flex items-center mx-[8px]"},rZ={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},iZ={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},sZ={class:"relative"},oZ={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},aZ=["onClick"];function lZ(t,e,n,r,o,d){const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("IconCheck");return a.openBlock(),a.createElementBlock("nav",tZ,[a.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...b)=>t.handleClickPrev&&t.handleClickPrev(...b)),class:a.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[a.createVNode(p,{height:"16",width:"16",class:"rotate-90"})],2),a.createElementVNode("div",nZ,[a.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onKeydown:e[1]||(e[1]=a.withKeys((...b)=>t.keydownEnter&&t.keydownEnter(...b),["enter"])),onBlur:e[2]||(e[2]=b=>t.handleSetPage(b.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 outline-blue-600 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},a.toDisplayString(t.page),545),e[5]||(e[5]=a.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),a.createElementVNode("span",rZ,a.toDisplayString(t.pagesCount),1)]),a.createElementVNode("button",{type:"button",onClick:e[3]||(e[3]=(...b)=>t.handleClickNext&&t.handleClickNext(...b)),class:a.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[a.createVNode(p,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(a.openBlock(),a.createElementBlock("div",iZ,[a.createElementVNode("div",sZ,[a.withDirectives(a.createElementVNode("div",oZ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.pageSizes,b=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:k=>t.pageSizeLocal=b},[a.createTextVNode(a.toDisplayString(b)+" ",1),b===t.pageSizeLocal?(a.openBlock(),a.createBlock(c,{key:0,width:"14",height:"14",class:"text-blue-600"})):a.createCommentVNode("",!0)],8,aZ))),256))],512),[[a.vShow,t.isDropdownOpen]]),t.pageSizes.length?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=b=>t.isDropdownOpen=!t.isDropdownOpen)},[a.createTextVNode(a.toDisplayString(t.pageSizeLocal)+" ",1),a.createVNode(p,{height:"16",width:"16"})])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)])}const cZ={props:{table:String,title:String,search:String},components:{AdminTableControl:Bq,AdminTableExport:iG,AdminTableColumnsHidden:Mv,AdminTableColumn:wq,AdminNodata:hg,IconPlus:$l,IconSearch:Dp,AdminTableCardInfo:kG,IconOpenCard:k2,AdminComponentIs:bd,AdminTableFilters:AG,AdminTableTabs:RG,AdminTableCustomFilters:UG,AdminTableCustomButtons:WG,AdminCustomButtonAdd:qG,AdminTableTotalsList:YG,AdminTablePagination:Oe(eZ,[["render",lZ]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:"",columnsWidth:{}}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{color(){return et.value.buttonColor||"blue"},fontSize(){return`text-[${et.value.fontSize||13}px]`},defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n,r,o;return((t=this.tableData)==null?void 0:t.form)&&(((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))||((o=(r=this.tableData)==null?void 0:r.actions)==null?void 0:o.includes("edit")))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,o;return(n==null?void 0:n.id)===((o=(r=this.$route)==null?void 0:r.query)==null?void 0:o.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{searchValue:{handler:My(async function(t){var e;this.page=1,await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0,page:1}})},500)},$route:{async handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.tableData=null,this.columnsWidth={},this.unmountedData(),this.getFilters(),await this.getTableData())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,state:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,o;this.visibleColumns=t==null?void 0:t.map(d=>d==null?void 0:d.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(o=this.visibleColumns)==null?void 0:o.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,o,d,p,c,b,k,E,C,T,I,N,$,F,q,J,Q,me;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,(d=(o=this.$route)==null?void 0:o.query)!=null&&d.filter&&(this.filters=((b=decodeURI((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.filter))==null?void 0:b.replaceAll("+"," "))||null),this.filters&&(this.onFilters=((E=(k=this.filters)==null?void 0:k.split("="))==null?void 0:E.length)-1),this.filterState=((T=(C=this.$route)==null?void 0:C.query)==null?void 0:T.state)||null,this.filterCustom=((N=(I=this.$route)==null?void 0:I.query)==null?void 0:N.custom)||null,this.searchValue=((F=($=this.$route)==null?void 0:$.query)==null?void 0:F.search)||"",this.visibleColumns=((Q=(J=(q=this.$route)==null?void 0:q.query)==null?void 0:J.columns)==null?void 0:Q.split(","))||[],(me=this.$route)!=null&&me.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(o=>o.name===t);if(e){const o=e==null?void 0:e.width;return typeof o=="number"?`${o}px`:o!=null&&o.includes("px")?o:`${o}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,o,d,p,c,b,k,E;try{const{data:C}=await Le.get(`/api/template/table/${this.table}`),T=await Le.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...C,...(T==null?void 0:T.data)||{}},this.initialHiddenColumns=(d=(o=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:o.map(I=>I==null?void 0:I.name))==null?void 0:d.join(","),(p=this.visibleColumns)!=null&&p.length?(c=this.tableData)==null||c.columns.forEach(I=>{var N;(N=this.visibleColumns)!=null&&N.includes(I==null?void 0:I.name)?I.hidden=!1:I.hidden=!0}):this.visibleColumns=(E=(k=(b=this.tableData)==null?void 0:b.columns)==null?void 0:k.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:E.map(I=>I==null?void 0:I.name),setTimeout(()=>{var I,N;(N=(I=this.tableData)==null?void 0:I.columns)==null||N.forEach(({name:$})=>{var F,q,J,Q,me,ke;(q=(F=this.columnsWidth)==null?void 0:F[$])!=null&&q.ref&&(this.columnsWidth[$].width=parseInt((ke=(me=(Q=(J=this.columnsWidth)==null?void 0:J[$])==null?void 0:Q.ref)==null?void 0:me.getBoundingClientRect())==null?void 0:ke.width)+"px")})})}catch{}},async getFilters(){var t;try{const{data:e}=await Le.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,this.limit=e,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-800 hover:underline decoration-1":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},dZ={class:"w-[calc(100vw - 320px)] bg-gray-100"},uZ={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},hZ={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},pZ={class:"bg-white w-full rounded-xl p-[20px] pr-0"},fZ={class:"flex"},mZ={class:"flex gap-[6px] ml-auto"},gZ={class:"inline-block w-full align-middle"},yZ={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},_Z={class:"right-0"},bZ={key:0,class:"w-[70px] sticky right-0 top-0"},xZ={class:"divide-y divide-gray-200 z-[1] relative text-gray-600"},vZ=["onClick"],wZ=["onClick"],kZ=["onClick"],EZ={class:"flex items-center justify-start w-full px-1 py-2"},CZ={class:"w-[200px] md:inline-flex hidden"},SZ={class:"text-sm text-gray-600 dark:text-neutral-400"},TZ={class:"font-semibold text-gray-800 dark:text-neutral-200"},AZ={key:0};function DZ(t,e,n,r,o,d){var Be,Ze,tt,Xe,ot,ue,Ut,wt,$t,an,xn,mn,hn,vn,Dn,In,Hn,Wn,Te,Ke,nt,yt,qt,ln,Vt,Bt,pn,Ce,Vn,Ps,Qt,zn,Rs;const p=a.resolveComponent("AdminCustomButtonAdd"),c=a.resolveComponent("IconPlus"),b=a.resolveComponent("router-link"),k=a.resolveComponent("AdminTableTabs"),E=a.resolveComponent("IconSearch"),C=a.resolveComponent("VsText"),T=a.resolveComponent("AdminTableCustomButtons"),I=a.resolveComponent("AdminTableCustomFilters"),N=a.resolveComponent("AdminTableColumnsHidden"),$=a.resolveComponent("AdminTableExport"),F=a.resolveComponent("AdminTableFilters"),q=a.resolveComponent("IconOpenCard"),J=a.resolveComponent("AdminTableColumn"),Q=a.resolveComponent("AdminComponentIs"),me=a.resolveComponent("AdminTableControl"),ke=a.resolveComponent("AdminTableTotalsList"),Re=a.resolveComponent("AdminNodata"),Ee=a.resolveComponent("AdminTablePagination"),Ve=a.resolveComponent("AdminTableCardInfo");return a.openBlock(),a.createElementBlock("div",dZ,[a.createElementVNode("div",uZ,[a.createElementVNode("h2",hZ,a.toDisplayString(n.title),1),d.isForm?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[(Ze=(Be=o.tableData)==null?void 0:Be.slots)!=null&&Ze.addButton?(a.openBlock(),a.createBlock(p,{key:0,slots:(tt=o.tableData)==null?void 0:tt.slots},null,8,["slots"])):(a.openBlock(),a.createBlock(b,{key:1,to:`/add?table=${(ot=(Xe=t.$route)==null?void 0:Xe.params)==null?void 0:ot.catchAll}`,class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)},{default:a.withCtx(()=>[a.createVNode(c,{height:"16",width:"16"}),e[5]||(e[5]=a.createTextVNode(" Додати "))]),_:1,__:[5]},8,["to","class"]))],64)):a.createCommentVNode("",!0)]),a.createElementVNode("div",{style:a.normalizeStyle({height:((ue=t.$adminSettings)==null?void 0:ue.header)===!1?"calc(100vh - 91px)":"calc(100vh - 155px)"}),class:"bg-gray-100 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},[a.createElementVNode("div",pZ,[(wt=(Ut=o.tableData)==null?void 0:Ut.filterState)!=null&&wt.length?(a.openBlock(),a.createBlock(k,{key:0,tabsList:($t=o.tableData)==null?void 0:$t.filterState,filterState:o.filterState,"onUpdate:filterState":e[0]||(e[0]=ut=>o.filterState=ut)},null,8,["tabsList","filterState"])):a.createCommentVNode("",!0),a.createElementVNode("div",fZ,[a.createElementVNode("div",{class:a.normalizeClass([o.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[a.createElementVNode("div",{class:a.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!o.isVisibleCardInfo}])},[a.createVNode(E,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),a.createVNode(C,{modelValue:o.searchValue,"onUpdate:modelValue":e[1]||(e[1]=ut=>o.searchValue=ut),placeholder:n.search||"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue","placeholder"]),a.createElementVNode("div",mZ,[(an=o.tableData)!=null&&an.slots?(a.openBlock(),a.createBlock(T,{key:0,data:o.tableData,slots:(xn=o.tableData)==null?void 0:xn.slots},null,8,["data","slots"])):a.createCommentVNode("",!0),(hn=(mn=o.tableData)==null?void 0:mn.filterCustom)!=null&&hn.length?(a.openBlock(),a.createBlock(I,{key:1,customList:(vn=o.tableData)==null?void 0:vn.filterCustom,filterCustom:o.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=ut=>o.filterCustom=ut)},null,8,["customList","filterCustom"])):a.createCommentVNode("",!0),a.createVNode(N,{columns:(Dn=o.tableData)==null?void 0:Dn.columns,onUpdateColumns:e[3]||(e[3]=ut=>o.tableData.columns=ut)},null,8,["columns"]),((In=o.tableData)==null?void 0:In.export)!==!1?(a.openBlock(),a.createBlock($,{key:2,table:n.table,columns:(Hn=o.tableData)==null?void 0:Hn.columns,page:o.page,"filter-state":o.filterState,"filter-custom":o.filterCustom,filters:o.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):a.createCommentVNode("",!0),(Wn=o.filterScheme)!=null&&Wn.length?(a.openBlock(),a.createBlock(F,{key:3,scheme:o.filterScheme,onFilters:o.onFilters,table:n.table,onFilterChange:d.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):a.createCommentVNode("",!0),a.createElementVNode("button",{onClick:e[4]||(e[4]=(...ut)=>d.toggleCardInfo&&d.toggleCardInfo(...ut)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[a.createVNode(q,{class:a.normalizeClass({"rotate-180 duration-300":!o.isVisibleCardInfo})},null,8,["class"])])])],2),a.createElementVNode("div",{class:a.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!o.isVisibleCardInfo}])},[a.createElementVNode("div",{style:a.normalizeStyle({height:`calc(100vh - ${((Te=t.$adminSettings)==null?void 0:Te.header)===!1?(nt=(Ke=o.tableData)==null?void 0:Ke.filterState)!=null&&nt.length?330:270:(qt=(yt=o.tableData)==null?void 0:yt.filterState)!=null&&qt.length?380:320}px)`}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[a.createElementVNode("div",gZ,[d.isNoData?(a.openBlock(),a.createBlock(Re,{key:1})):(a.openBlock(),a.createElementBlock("table",{key:0,class:a.normalizeClass([d.fontSize,"relative min-w-full my-2 divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"])},[a.createElementVNode("thead",yZ,[a.createElementVNode("tr",_Z,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.columns,ut=>{var Cr,yi;return a.openBlock(),a.createBlock(J,{key:ut.name,style:a.normalizeStyle({width:((yi=(Cr=o.columnsWidth)==null?void 0:Cr[ut==null?void 0:ut.name])==null?void 0:yi.width)||d.rowWidth(ut==null?void 0:ut.name),textAlign:ut==null?void 0:ut.align,wordBreak:ut==null?void 0:ut.wrap}),data:ut,activeColumn:o.activeColumn,onUpdateRef:_r=>{var Mi,Ii;(Ii=(Mi=o.columnsWidth)==null?void 0:Mi[ut==null?void 0:ut.name])!=null&&Ii.ref||(o.columnsWidth[ut.name]={ref:_r})},onChangeActive:d.changeActiveColumn},null,8,["style","data","activeColumn","onUpdateRef","onChangeActive"])}),128)),(Vt=(ln=d.getActions)==null?void 0:ln.filter(ut=>ut!=="add"&&ut!=="view"))!=null&&Vt.length?(a.openBlock(),a.createElementBlock("th",bZ)):a.createCommentVNode("",!0)])]),a.createElementVNode("tbody",xZ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Bt=o.tableData)==null?void 0:Bt.rows,(ut,Cr)=>{var yi,_r,Mi,Ii,je,ti,hr,ni,Pi,He,Ot,At,br,Hr;return a.openBlock(),a.createElementBlock("tr",{key:(ut==null?void 0:ut.id)||Cr,class:a.normalizeClass({"bg-gray-100":((_r=(yi=t.$route)==null?void 0:yi.query)==null?void 0:_r.card)===(ut==null?void 0:ut.id),"odd:bg-gray-50":((Ii=(Mi=t.$route)==null?void 0:Mi.query)==null?void 0:Ii.card)!==(ut==null?void 0:ut.id)})},[a.createElementVNode("td",{class:a.normalizeClass(["px-1 py-2.5 pr-5",[(je=d.columns[0])!=null&&je.align?`text-${((ti=d.columns[0])==null?void 0:ti.align)||"left"}`:""]]),onClick:Et=>d.changeActiveCardInfo(ut==null?void 0:ut.id)},[a.createElementVNode("button",{onClick:Et=>{d.pushToCard(ut==null?void 0:ut.id),d.pushToLinkCard(d.columns[0],ut)},class:a.normalizeClass(["font-medium text-start",[...d.getCustomStyles(d.columns[0]),((hr=this.tableData)==null?void 0:hr.card)===!1?"":` text-${d.color}-800 decoration-2 focus:outline-none focus:underline hover:text-${d.color}-700 hover:underline`]])},[a.createVNode(Q,{row:ut,column:d.columns[0],table:n.table,onUpdateTable:d.getTableData},null,8,["row","column","table","onUpdateTable"])],10,wZ)],10,vZ),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((ni=d.columns)==null?void 0:ni.slice(1),Et=>(a.openBlock(),a.createElementBlock("td",{onClick:Ri=>{d.changeActiveCardInfo(ut==null?void 0:ut.id),d.pushToLinkCard(Et,ut)},class:a.normalizeClass(["px-1 py-2.5 pr-5",d.getCustomStyles(Et)]),key:Et.name},[a.createVNode(Q,{row:ut,column:Et,table:n.table,onUpdateTable:d.getTableData},null,8,["row","column","table","onUpdateTable"])],10,kZ))),128)),(He=(Pi=d.getActions)==null?void 0:Pi.filter(Et=>Et!=="add"&&Et!=="view"))!=null&&He.length?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((At=(Ot=t.$route)==null?void 0:Ot.query)==null?void 0:At.card)===(ut==null?void 0:ut.id)||!(Cr%2),"bg-white":((Hr=(br=t.$route)==null?void 0:br.query)==null?void 0:Hr.card)!==(ut==null?void 0:ut.id)&&Cr%2}])},[a.createVNode(me,{actions:d.getActions,isForm:d.isForm,item:ut,table:n.table,onUpdateTable:d.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):a.createCommentVNode("",!0)],2)}),128))]),a.createVNode(ke,{columns:d.columns,agg:(pn=o.tableData)==null?void 0:pn.agg},null,8,["columns","agg"])],2))])],4)],2),a.createElementVNode("div",EZ,[a.createElementVNode("div",CZ,[a.createElementVNode("p",SZ,[a.createElementVNode("span",TZ,[a.createTextVNode(" Об'єктів: "+a.toDisplayString(Intl.NumberFormat("ua").format(o.limit<((Ce=o.tableData)==null?void 0:Ce.filtered)?o.limit:((Vn=o.tableData)==null?void 0:Vn.filtered)||0))+" ",1),o.limit<((Ps=o.tableData)==null?void 0:Ps.filtered)?(a.openBlock(),a.createElementBlock("span",AZ," з "+a.toDisplayString(Intl.NumberFormat("ua").format(((Qt=o.tableData)==null?void 0:Qt.filtered)||0)),1)):a.createCommentVNode("",!0)])])]),Math.ceil((zn=o.tableData)==null?void 0:zn.filtered)>10?(a.openBlock(),a.createBlock(Ee,{key:0,class:"justify-end mr-10","default-page":parseInt(d.defaultPage),total:((Rs=o.tableData)==null?void 0:Rs.filtered)||0,onPageChange:d.handlePageChange,pageSize:parseInt(o.limit),pageSizes:[10,20,50,100]},null,8,["default-page","total","onPageChange","pageSize"])):a.createCommentVNode("",!0)])],2),a.createVNode(a.Transition,{name:"slide-fade"},{default:a.withCtx(()=>{var ut;return[o.isVisibleCardInfo?(a.openBlock(),a.createBlock(Ve,{key:0,table:n.table,columns:(ut=o.tableData)==null?void 0:ut.columns,row:d.activeCardRow},null,8,["table","columns","row"])):a.createCommentVNode("",!0)]}),_:1})])])],4)])}const MZ={components:{AdminTable:Oe(cZ,[["render",DZ],["__scopeId","data-v-ca941f11"]])},data(){return{table:!1,interface:"",search:""}},watch:{$route:{async handler(){ei!=null&&ei.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=et.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.params)==null?void 0:c.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,this.search=(e==null?void 0:e.search)||"",!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await Le.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},IZ=["innerHTML"];function PZ(t,e,n,r,o,d){const p=a.resolveComponent("AdminTable");return o.table?(a.openBlock(),a.createBlock(p,{key:0,table:o.table,title:t.title,search:o.search},null,8,["table","title","search"])):(a.openBlock(),a.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:o.interface},null,8,IZ))}const RZ=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(MZ,[["render",PZ]])},Symbol.toStringTag,{value:"Module"}));return D2});
|
660
|
+
`}).mount(n)}};window.addEventListener("click",t=>{var n,r,o;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const d=e==null?void 0:e.getAttribute("_href");(o=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||o.push(d),t==null||t.preventDefault()}});const p9=()=>{const t=a.defineCustomElement(Iy);customElements.define("admin-info",t)},f9=["black","gray","red","yellow","green","blue","indigo","purple","pink","rose","amber","lime","emerald","teal","cyan","sky","violet","fuchsia","lavender","zinc","neutral","stone"],m9=["white"];let Nd,A2;const g9=async()=>{try{const{data:t}=await Le.get("/api/user-menu"),e=t.menus;return ei.value=e,Nd=t.settings,A2=t.user,Ty(e)}catch(t){return console.error(t),[]}},y9=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},D2={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){try{p9(),(n.sidebarDark??!0)&&(n.sidebarDark=!m9.includes(n.sidebarColor)),n.buttonColor||(n.buttonColor=f9.includes(n.sidebarColor)?n.sidebarColor:"blue");const d=(await g9()).filter(c=>c==null?void 0:c.component).map(c=>({...c,component:{...Py,...e}[c==null?void 0:c.component]}));et.value={...et.value,...n,...(Nd==null?void 0:Nd.admin)||{}},y9(t,{...Py,...e}),t.component("admin",XC);const{router:p}=await PT(d.concat(r));window.app={...t,router:p},window.v3plugin={...t.config.globalProperties,...Ry},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...vx,componentsApp:e},$router:p,$v3plugin:Ry,$utils:{reloadCardPage:th},$settings:Nd,$adminSettings:et.value,$user:A2},t.use(p)}catch(o){console.error(o)}},components:Py,plugins:Ry};typeof window<"u"&&(window.v3Admin=D2);const _9={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},computed:{color(){return et.value.buttonColor||"blue"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:d}}=await Le.get(`/api/template/table/${n}`),{data:p}=await Le.get(`/api/table/${this.table}/${(o=(r=this.$route)==null?void 0:r.query)==null?void 0:o.id}`);this.token=(p==null?void 0:p.token)||"",this.formValues=p||{};const{data:c}=await Le.get(`/api/template/form/${d}`);this.scheme=(c==null?void 0:c.schema)||c,this.style=(c==null?void 0:c.style)||null}catch{}},async onlyEditObject(){var e,n,r,o,d,p,c,b,k,E,C;const t=(n=(e=this.$refs.form)==null?void 0:e.$refs)==null?void 0:n.form;try{await t.doValidation(),await Le.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(T){const I=((r=T==null?void 0:T.response)==null?void 0:r.data)||"";let N=((c=(p=(d=(o=Object.entries(t==null?void 0:t.formErrors))==null?void 0:o[0])==null?void 0:d[1])==null?void 0:p[0])==null?void 0:c.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(C=(E=(k=(b=Object.entries(t==null?void 0:t.formErrors))==null?void 0:b[0])==null?void 0:k[1])==null?void 0:E[0])==null?void 0:C.message;this.$notify({title:"Помилка!",message:I||N||"Сталася помилка валідаціі",type:"error"})}},getGroupedErrorNotification(t,e){if(!t||!e)return"";const n={};return Object.entries(t).forEach(([o,d])=>{var c;const p=((c=e[o])==null?void 0:c.ua)||o;d.forEach(b=>{const k=b.message;n[k]||(n[k]=[]),n[k].push(`"${p}"`)})}),Object.entries(n).map(([o,d])=>`<b>${o}:</b> ${d.join(", ")}`).join("<br>")||"Сталася помилка валідації"},async editObjectAndRedirect(t=!0){var n,r;const e=(r=(n=this.$refs.form)==null?void 0:n.$refs)==null?void 0:r.form;try{t&&await e.doValidation(),await Le.put(`/api/table/${this.token}${t?"":"?draft=1"}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{const d=this.getGroupedErrorNotification(e==null?void 0:e.formErrors,e==null?void 0:e.scheme);this.$notify({title:"Помилка!",message:d,type:"error"})}}}},b9={class:"bg-gray-100 lg:w-[calc(100vw-260px)] w-[100vw]"},x9={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},v9={class:"flex items-center gap-[6px]"},w9={class:"bg-white w-full rounded-xl"};function k9(t,e,n,r,o,d){var c,b,k;const p=a.resolveComponent("VsFormWithNavigation");return a.openBlock(),a.createElementBlock("div",b9,[a.createElementVNode("div",x9,[e[4]||(e[4]=a.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),a.createElementVNode("div",v9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=E=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),(c=o.style)!=null&&c.draft?(a.openBlock(),a.createElementBlock("button",{key:0,onClick:e[1]||(e[1]=E=>d.editObjectAndRedirect(!1)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти DRAFT ",2)):a.createCommentVNode("",!0),a.createElementVNode("button",{onClick:e[2]||(e[2]=(...E)=>d.editObjectAndRedirect&&d.editObjectAndRedirect(...E)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти ",2)])]),a.createElementVNode("div",{style:a.normalizeStyle({height:((b=t.$adminSettings)==null?void 0:b.header)===!1?"calc(100vh - 91px)":"calc(100vh - 150px)"}),class:"bg-gray-100 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw] overflow-hidden"},[a.createElementVNode("div",w9,[o.scheme?(a.openBlock(),a.createBlock(p,{key:0,ref:"form",scheme:o.scheme,columns:(k=o.style)==null?void 0:k.columns,style:a.normalizeStyle(o.style),modelValue:o.formValues,"onUpdate:modelValue":e[3]||(e[3]=E=>o.formValues=E),class:"p-[20px] h-full"},null,8,["scheme","columns","style","modelValue"])):a.createCommentVNode("",!0)])],4)])}const E9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(_9,[["render",k9]])},Symbol.toStringTag,{value:"Module"})),C9={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},computed:{color(){return et.value.buttonColor||"blue"}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const d=await Le.get(`/api/table-data/${n}`),{data:p}=await Le.get(`/api/template/form/${(r=d==null?void 0:d.data)==null?void 0:r.form}`);this.scheme=(p==null?void 0:p.schema)||p,this.style=(p==null?void 0:p.style)||null,this.api=(p==null?void 0:p.api)||"",this.token=((o=d==null?void 0:d.data)==null?void 0:o.addToken)||""}catch{}},getGroupedErrorNotification(t,e){if(!t||!e)return"";const n={};return Object.entries(t).forEach(([o,d])=>{var c;const p=((c=e[o])==null?void 0:c.ua)||o;d.forEach(b=>{const k=b.message;n[k]||(n[k]=[]),n[k].push(`"${p}"`)})}),Object.entries(n).map(([o,d])=>`<b>${o}:</b> ${d.join(", ")}`).join("<br>")||"Сталася помилка валідації"},async createObject(){var e,n,r;const t=(n=(e=this.$refs.form)==null?void 0:e.$refs)==null?void 0:n.form;try{await t.doValidation(),await Le.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(o){const d=this.getGroupedErrorNotification(t==null?void 0:t.formErrors,t==null?void 0:t.scheme);this.$notify({title:"Помилка!",message:((r=o==null?void 0:o.response)==null?void 0:r.data)||d,type:"error"})}}}},S9={class:"bg-gray-100 lg:w-[calc(100vw-260px)] w-[100vw]"},T9={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},A9={class:"flex items-center gap-[6px]"},D9={class:"bg-white w-full rounded-xl"};function M9(t,e,n,r,o,d){var c;const p=a.resolveComponent("VsFormWithNavigation");return a.openBlock(),a.createElementBlock("div",S9,[a.createElementVNode("div",T9,[e[3]||(e[3]=a.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),a.createElementVNode("div",A9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=b=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),a.createElementVNode("button",{onClick:e[1]||(e[1]=(...b)=>d.createObject&&d.createObject(...b)),class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)}," Зберегти ",2)])]),a.createElementVNode("div",{style:a.normalizeStyle({height:((c=t.$adminSettings)==null?void 0:c.header)===!1?"calc(100vh - 91px)":"calc(100vh - 150px)"}),class:"bg-gray-100 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw] overflow-hidden"},[a.createElementVNode("div",D9,[o.scheme?(a.openBlock(),a.createBlock(p,{key:0,ref:"form",scheme:o.scheme,style:a.normalizeStyle(o.style),modelValue:o.formValues,"onUpdate:modelValue":e[2]||(e[2]=b=>o.formValues=b),class:"h-full p-[20px]"},null,8,["scheme","style","modelValue"])):a.createCommentVNode("",!0)])],4)])}const I9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(C9,[["render",M9]])},Symbol.toStringTag,{value:"Module"})),P9=a.ref(null),R9={data(){return{formScheme:null,formValues:{}}},mounted(){this.getFormScheme()},computed:{userData(){return P9.value}},methods:{async updateUser(){var t;try{await Le.put(`/user/${(t=this.userData.user)==null?void 0:t.uid}`,this.formValues),await this.$notify({title:"Успішно!",message:"Дані успішно оновлені",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},async getFormScheme(){var t,e,n,r;try{const{data:o}=await Le.get("/api/template/form/admin.profile.form");console.log(this.userData);for(const d in o==null?void 0:o.schema)(e=(t=this.userData)==null?void 0:t.user)!=null&&e[d]&&(this.formValues[d]=(r=(n=this.userData)==null?void 0:n.user)==null?void 0:r[d]);this.formScheme=o.schema}catch(o){console.error(o)}}}},N9={class:"flex justify-center pt-[20px] pb-[20px] pl-[20px] h-[calc(100vh-58px)]"},B9={class:"bg-white rounded-xl p-[20px]"},V9={class:"flex-1 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},z9={class:"flex"};function O9(t,e,n,r,o,d){const p=a.resolveComponent("VsForm");return a.openBlock(),a.createElementBlock("div",N9,[a.createElementVNode("div",B9,[e[2]||(e[2]=a.createElementVNode("h2",{class:"mb-[20px] text-center"},"Профіль",-1)),a.createElementVNode("div",V9,[o.formScheme?(a.openBlock(),a.createBlock(p,{key:0,scheme:o.formScheme,modelValue:o.formValues,"onUpdate:modelValue":e[0]||(e[0]=c=>o.formValues=c),class:"pb-0"},null,8,["scheme","modelValue"])):a.createCommentVNode("",!0),a.createElementVNode("div",z9,[a.createElementVNode("button",{onClick:e[1]||(e[1]=(...c)=>d.updateUser&&d.updateUser(...c)),class:"ml-auto text-[18px] bg-blue-500 text-white px-[8px] py-[4px] rounded hover:bg-blue-700 duration-300"}," Зберегти ")])])])])}const L9=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(R9,[["render",O9]])},Symbol.toStringTag,{value:"Module"})),F9={};function $9(t,e,n,r,o,d){const p=a.resolveComponent("router-view");return a.openBlock(),a.createBlock(p)}const M2=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(F9,[["render",$9]])},Symbol.toStringTag,{value:"Module"})),j9={},U9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function H9(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",U9,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),a.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),a.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const Ny=Oe(j9,[["render",H9]]),W9={},q9={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function G9(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",q9,e[0]||(e[0]=[a.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const I2=Oe(W9,[["render",G9]]),Z9={components:{IconChevronDown:Rd},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,o;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,o,d)=>`<span style="color:#1989fa;">${o}</span>${d}`)}}},Y9={key:0,class:""},X9={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},K9={key:1},J9=["innerHTML"];function Q9(t,e,n,r,o,d){var b,k,E,C,T,I,N,$,F,q,J,Q,me,ke,Re;const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("router-link");return(b=n.route)!=null&&b.menu?(a.openBlock(),a.createElementBlock("div",Y9,[a.createElementVNode("button",{onClick:e[0]||(e[0]=Ee=>o.isOpen=!o.isOpen),class:a.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((E=(k=n.route)==null?void 0:k.menu)==null?void 0:E.some(Ee=>{var Ve,Be;return(Ee==null?void 0:Ee.path)===t.$route.path.replace("/","")||(Ee==null?void 0:Ee.table)===((Be=(Ve=t.$route)==null?void 0:Ve.params)==null?void 0:Be.table)&&(Ee==null?void 0:Ee.table)}))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!d.darkMode}]])},[a.createTextVNode(a.toDisplayString((C=n.route)==null?void 0:C.ua)+" ",1),(T=n.route)!=null&&T.new?(a.openBlock(),a.createElementBlock("span",X9,"Нове")):a.createCommentVNode("",!0),a.createVNode(p,{class:a.normalizeClass([[o.isOpen&&"-rotate-180"],"ml-auto duration-300 flex-shrink-0"]),width:"14",height:"14"},null,8,["class"])],2),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var Ee;return[a.withDirectives(a.createElementVNode("ul",{class:a.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",d.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Ee=n.route)==null?void 0:Ee.menu,(Ve,Be)=>{var Ze,tt;return a.openBlock(),a.createElementBlock("li",{key:Be,class:"w-full"},[a.createVNode(c,{innerHTML:d.highLight(Ve==null?void 0:Ve.ua),to:"/"+(Ve==null?void 0:Ve.path),class:a.normalizeClass([[((Ve==null?void 0:Ve.path)===t.$route.path.replace("/","")||((tt=(Ze=t.$route)==null?void 0:Ze.params)==null?void 0:tt.table)===(Ve==null?void 0:Ve.table)&&(Ve==null?void 0:Ve.table))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!d.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[a.vShow,o.isOpen]])]}),_:1})])):(I=n.route)!=null&&I.hidden?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",K9,[a.createVNode(c,{to:(($=(N=n.route)==null?void 0:N.path)==null?void 0:$[0])==="/"?(F=n.route)==null?void 0:F.path:"/"+((q=n.route)==null?void 0:q.path),class:a.normalizeClass([[(((J=n.route)==null?void 0:J.path.replace("/",""))===t.$route.path.replace("/","")||((me=(Q=t.$route)==null?void 0:Q.params)==null?void 0:me.table)===((ke=n.route)==null?void 0:ke.table)&&((Re=n.route)==null?void 0:Re.table))&&(d.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":d.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!d.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:a.withCtx(()=>{var Ee;return[a.createElementVNode("span",{innerHTML:d.highLight((Ee=n.route)==null?void 0:Ee.ua)},null,8,J9)]}),_:1},8,["to","class"])]))}const eW=Oe(Z9,[["render",Q9]]),tW={},nW={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",nW,e[0]||(e[0]=[a.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),a.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),a.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const P2=Oe(tW,[["render",rW]]),iW={},sW={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function oW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",sW,e[0]||(e[0]=[a.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const aW=Oe(iW,[["render",oW]]),lW={},cW={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function dW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",cW,e[0]||(e[0]=[a.createElementVNode("defs",null,null,-1),a.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[a.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const uW=Oe(lW,[["render",dW]]),hW={},pW={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function fW(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",pW,e[0]||(e[0]=[a.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const mW={components:{IconQuestion:P2,IconUSA:aW,IconUkraine:uW,IconTick:Oe(hW,[["render",fW]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},gW={class:"flex justify-center items-center gap-x-2"},yW=["onClick"],_W={class:"text-gray-800"},bW={class:"ms-auto"},xW={class:"truncate"};function vW(t,e,n,r,o,d){const p=a.resolveComponent("IconTick"),c=a.resolveComponent("VsPopover");return n.docs||n.languages?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",d.darkMode?"border-white/10 ":"border-gray-200"])},[a.createElementVNode("div",gW,[a.createVNode(c,{trigger:"click",placement:"top",ref:"langPopover"},{reference:a.withCtx(()=>{var b,k,E;return[a.createElementVNode("button",{type:"button","aria-expanded":"false",class:a.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",d.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[a.createElementVNode("div",null,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent((b=d.selectedLang)==null?void 0:b.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),a.createElementVNode("span",xW,a.toDisplayString(o.currentLang==="ukraine"?(k=d.selectedLang)==null?void 0:k.titleUA:(E=d.selectedLang)==null?void 0:E.titleEN),1)],2)]}),default:a.withCtx(()=>[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.languagesOptions,b=>(a.openBlock(),a.createElementBlock("button",{key:b.id,type:"button",onClick:k=>d.changeLang(b.id),class:a.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(b==null?void 0:b.id)===o.currentLang?"bg-gray-100":""])},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b==null?void 0:b.icon),{class:"w-[16px] h-[16px] rounded-full"})),a.createElementVNode("div",_W,a.toDisplayString(o.currentLang==="ukraine"?b==null?void 0:b.titleUA:b==null?void 0:b.titleEN),1),a.createElementVNode("span",bW,[(b==null?void 0:b.id)===o.currentLang?(a.openBlock(),a.createBlock(p,{key:0})):a.createCommentVNode("",!0)])],10,yW))),128))])]),_:1},512)])],2)):a.createCommentVNode("",!0)}const R2=Oe(mW,[["render",vW]]),wW={components:{IconLogout:Ny,NavbarItem:eW,IconLogo:I2,IconSearch:Dp,NavbarFooter:R2},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(ei.value,this.searchValue):ei.value},logo(){var t,e,n;return((e=(t=this.$settings)==null?void 0:t.admin)==null?void 0:e.logo)||((n=et.value)==null?void 0:n.logo)||"/assets/logo.svg"},docs(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.docs},languages(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.languages},darkMode(){var t;return((t=et==null?void 0:et.value)==null?void 0:t.sidebarDark)||!1},darkColor(){var e,n,r;const t=((e=et==null?void 0:et.value)==null?void 0:e.sidebarColor)||((n=et==null?void 0:et.value)==null?void 0:n.color)||((r=et==null?void 0:et.value)!=null&&r.sidebarDark?"blue":"white");return t.includes("-")||t.includes("[")?t:t+"-950"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,o;if(n.menu){const d=this.filterMenu(n.menu,e);if(d.length>0)return{...n,menu:d,open:!0}}else if((o=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&o.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},kW={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},EW={href:"/"},CW=["src"],SW={class:"px-2 lg:px-5"},TW={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},AW={key:0,class:"flex flex-col gap-y-1"};function DW(t,e,n,r,o,d){var k;const p=a.resolveComponent("VsText"),c=a.resolveComponent("NavbarItem"),b=a.resolveComponent("NavbarFooter");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+d.darkColor]:d.darkColor,"bg-white":!d.darkMode&&!d.darkColor}])},[a.createElementVNode("div",kW,[a.createElementVNode("a",EW,[a.createElementVNode("img",{src:d.logo,class:"object-contain w-full h-full"},null,8,CW)])]),a.createElementVNode("div",SW,[a.createVNode(p,{type:"text",modelValue:o.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>o.searchValue=E),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:a.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":d.darkMode,["[&>input]:bg-"+d.darkColor]:d.darkColor,["focus:[&>input]:border-"+d.darkColor+"-500"]:d.darkMode}])},null,8,["modelValue","class"])]),a.createElementVNode("div",{class:a.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",d.languages||d.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[a.createElementVNode("nav",TW,[(k=d.data)!=null&&k.length?(a.openBlock(),a.createElementBlock("ul",AW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.data,(E,C)=>(a.openBlock(),a.createElementBlock("li",{key:C,class:"flex flex-col gap-[6px]"},[a.createVNode(c,{route:E,searchable:o.searchValue},null,8,["route","searchable"])]))),128))])):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["text-lg mt-[20px]",{"text-white/80":d.darkMode,"text-gray-800":!d.darkMode}])}," Не знайдено ",2))])],2),d.docs||d.languages?(a.openBlock(),a.createBlock(b,{key:0,docs:d.docs,languages:d.languages},null,8,["docs","languages"])):a.createCommentVNode("",!0)],2)}const N2=Oe(wW,[["render",DW],["__scopeId","data-v-7817bab2"]]),MW={components:{IconChevronDown:Rd},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,o;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,o,d)=>`<span style="color:#1989fa;">${o}</span>${d}`)}}},IW={key:0,class:""},PW={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},RW={class:"ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] before:bg-gray-200 flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer"},NW={key:1},BW=["innerHTML"];function VW(t,e,n,r,o,d){var b,k,E,C,T,I,N,$,F,q,J,Q,me,ke,Re;const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("router-link");return(b=n.route)!=null&&b.menu?(a.openBlock(),a.createElementBlock("div",IW,[a.createElementVNode("button",{onClick:e[0]||(e[0]=Ee=>o.isOpen=!o.isOpen),class:a.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-200",[((E=(k=n.route)==null?void 0:k.menu)==null?void 0:E.some(Ee=>{var Ve,Be;return(Ee==null?void 0:Ee.path)===t.$route.path.replace("/","")||(Ee==null?void 0:Ee.table)===((Be=(Ve=t.$route)==null?void 0:Ve.params)==null?void 0:Be.table)&&(Ee==null?void 0:Ee.table)}))&&"bg-gray-200"]])},[a.createTextVNode(a.toDisplayString((C=n.route)==null?void 0:C.ua)+" ",1),(T=n.route)!=null&&T.new?(a.openBlock(),a.createElementBlock("span",PW,"Нове")):a.createCommentVNode("",!0),a.createVNode(p,{class:a.normalizeClass([[o.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var Ee;return[a.withDirectives(a.createElementVNode("ul",RW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Ee=n.route)==null?void 0:Ee.menu,(Ve,Be)=>{var Ze,tt;return a.openBlock(),a.createElementBlock("li",{key:Be,class:"w-full"},[a.createVNode(c,{innerHTML:d.highLight(Ve==null?void 0:Ve.ua),to:"/"+(Ve==null?void 0:Ve.path),class:a.normalizeClass([[((Ve==null?void 0:Ve.path)===t.$route.path.replace("/","")||((tt=(Ze=t.$route)==null?void 0:Ze.params)==null?void 0:tt.table)===(Ve==null?void 0:Ve.table)&&(Ve==null?void 0:Ve.table))&&"bg-gray-200"],"block px-3 py-2 text-sm rounded-lg focus:outline-none hover:bg-gray-200 focus:bg-gray-200"])},null,8,["innerHTML","to","class"])])}),128))],512),[[a.vShow,o.isOpen]])]}),_:1})])):(I=n.route)!=null&&I.hidden?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",NW,[a.createVNode(c,{to:(($=(N=n.route)==null?void 0:N.path)==null?void 0:$[0])==="/"?(F=n.route)==null?void 0:F.path:"/"+((q=n.route)==null?void 0:q.path),class:a.normalizeClass([[(((J=n.route)==null?void 0:J.path.replace("/",""))===t.$route.path.replace("/","")||((me=(Q=t.$route)==null?void 0:Q.params)==null?void 0:me.table)===((ke=n.route)==null?void 0:ke.table)&&((Re=n.route)==null?void 0:Re.table))&&"bg-gray-200"],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3 hover:bg-gray-200 focus:bg-gray-200"])},{default:a.withCtx(()=>{var Ee;return[a.createElementVNode("span",{innerHTML:d.highLight((Ee=n.route)==null?void 0:Ee.ua)},null,8,BW)]}),_:1},8,["to","class"])]))}const zW=Oe(MW,[["render",VW]]),OW={class:"relative w-fit mx-auto"},LW={key:0,class:"w-60 duration absolute top-full left-0 z-20 bg-white rounded-xl shadow-xl block"},FW={class:"p-1"},$W={__name:"navbar-gray-dropdown",setup(t){const e=a.ref(!1);return a.onMounted(()=>{document.addEventListener("click",n=>{n.target.closest(".navbar-gray-dropdown")||(e.value=!1)})}),(n,r)=>{var d;const o=a.resolveComponent("router-link");return a.openBlock(),a.createElementBlock("div",OW,[a.createElementVNode("button",{onClick:r[0]||(r[0]=p=>e.value=!e.value),type:"button",class:"py-1 px-2 navbar-gray-dropdown inline-flex justify-center items-center gap-x-1 font-semibold rounded-lg text-gray-800 hover:text-purple-600 focus:outline-hidden focus:text-purple-600 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-300 dark:hover:text-purple-500 dark:focus:text-purple-500"},[a.createTextVNode(a.toDisplayString((d=n.$user)==null?void 0:d.user_name)+" ",1),a.createVNode(Mp,{width:"16",height:"16"})]),e.value?(a.openBlock(),a.createElementBlock("div",LW,[a.createElementVNode("div",FW,[r[2]||(r[2]=a.createElementVNode("a",{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",href:"#"}," Профіль ",-1)),a.createVNode(o,{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",to:"/admin.settings"},{default:a.withCtx(()=>r[1]||(r[1]=[a.createTextVNode(" Налаштування ")])),_:1,__:[1]})]),r[3]||(r[3]=a.createElementVNode("div",{class:"p-1 border-t border-gray-200 dark:border-neutral-700"},[a.createElementVNode("a",{class:"flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",href:"/logout"}," Вийти ")],-1))])):a.createCommentVNode("",!0)])}}},jW={class:"p-4 flex flex-col justify-center border-b relative max-h-[192px]"},UW={components:{IconLogout:Ny,NavbarItem:zW,IconLogo:I2,IconSearch:Dp,NavbarFooter:R2,NavbarUser:{__name:"navbar-gray-user",setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",jW,[a.createVNode(pg,{class:"!absolute top-[8px] right-[8px]",placement:"left"}),n[0]||(n[0]=a.createElementVNode("div",{class:"flex size-24 justify-center items-center shrink-0 rounded-full overflow-hidden mx-auto mb-2"},[a.createElementVNode("img",{class:"object-cover h-[130px] w-[130px]",src:"https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=",alt:"Avatar"})],-1)),a.createVNode($W)]))}}},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(ei.value,this.searchValue):ei.value},logo(){var t,e,n;return((e=(t=this.$settings)==null?void 0:t.admin)==null?void 0:e.logo)||((n=et.value)==null?void 0:n.logo)||"/assets/logo.svg"},docs(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.docs},languages(){var t;return(t=et==null?void 0:et.value)==null?void 0:t.languages},darkMode(){var t;return((t=et==null?void 0:et.value)==null?void 0:t.sidebarDark)||!1},darkColor(){var e,n,r;const t=((e=et==null?void 0:et.value)==null?void 0:e.sidebarColor)||((n=et==null?void 0:et.value)==null?void 0:n.color)||((r=et==null?void 0:et.value)!=null&&r.sidebarDark?"blue":"white");return t.includes("-")||t.includes("[")?t:t+"-950"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,o;if(n.menu){const d=this.filterMenu(n.menu,e);if(d.length>0)return{...n,menu:d,open:!0}}else if((o=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&o.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},HW={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},WW={key:0,class:"flex flex-col gap-y-1"},qW={class:"h-[55px] border-t w-full px-5 shrink-0 lg:px-5 flex items-center"},GW={href:"/"},ZW=["src"];function YW(t,e,n,r,o,d){var b;const p=a.resolveComponent("NavbarUser"),c=a.resolveComponent("NavbarItem");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] bg-gray-100 top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu}])},[a.createVNode(p),a.createElementVNode("div",{class:a.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",d.languages||d.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[a.createElementVNode("nav",HW,[(b=d.data)!=null&&b.length?(a.openBlock(),a.createElementBlock("ul",WW,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.data,(k,E)=>(a.openBlock(),a.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[a.createVNode(c,{route:k,searchable:o.searchValue},null,8,["route","searchable"])]))),128))])):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["text-lg mt-[20px]",{"text-white/80":d.darkMode,"text-gray-800":!d.darkMode}])}," Не знайдено ",2))])],2),a.createElementVNode("div",qW,[a.createElementVNode("a",GW,[a.createElementVNode("img",{src:d.logo,class:"object-contain max-h-[40px]"},null,8,ZW)])])],2)}const XW=Oe(UW,[["render",YW],["__scopeId","data-v-3cea82a7"]]),KW={__name:"navbar",setup(t){const e={default:N2,gray:XW},n=a.computed(()=>{var r;return e[(r=et.value)==null?void 0:r.navbar]||N2});return(r,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value)))}},JW={components:{IconQuestion:P2,IconUser:Iv,AdminNotification:pg,IconUserOutline:Tv,IconLogout:Ny},data(){return{userData:null,isVisible:!1}},computed:{headerBadgeTitle(){var t;return(t=et.value)==null?void 0:t.headerBadge},headerBadgeColor(){var t;return(t=et.value)==null?void 0:t.headerBadgeColor}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},created(){this.userData=this.$user,Dy.value=this.$settings},methods:{async logout(){try{await Le.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},QW={class:"flex items-center gap-[6px]"},eq={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},tq={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},nq={class:"relative"},rq=["src"],iq={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},sq=["src"],oq={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},aq={class:"grow"},lq={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},cq={class:"text-xs text-gray-500 dark:text-neutral-500"},dq={class:"flex flex-col space-y-0.5"};function uq(t,e,n,r,o,d){const p=a.resolveComponent("IconQuestion"),c=a.resolveComponent("VsPopover"),b=a.resolveComponent("AdminNotification"),k=a.resolveComponent("IconUser"),E=a.resolveComponent("router-link"),C=a.resolveComponent("IconUserOutline"),T=a.resolveComponent("IconLogout");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["h-[58px] border-b flex items-center px-[20px]",d.headerBadgeTitle?"justify-between":"justify-end"])},[d.headerBadgeTitle?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["py-1.5 px-2.5 flex justify-center items-center text-white hover:bg-gray-900 focus:bg-gray-900 dark:bg-neutral-100 dark:text-neutral-800 dark:hover:bg-white dark:focus:bg-white.class text-nowrap text-xs sm:text-[13px] rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none dark:text-neutral-400",{["bg-"+d.headerBadgeColor]:d.headerBadgeColor,"bg-gray-800":!d.headerBadgeColor}])},a.toDisplayString(d.headerBadgeTitle),3)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=I=>t.$parent.showMenu=!0)},e[4]||(e[4]=[a.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),a.createElementVNode("div",QW,[a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>[a.createElementVNode("a",eq,[a.createVNode(p,{height:"24",width:"24"})])]),default:a.withCtx(()=>[e[5]||(e[5]=a.createTextVNode(" Допомога "))]),_:1,__:[5]}),a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>[a.createElementVNode("a",tq,[a.createVNode(b)])]),default:a.withCtx(()=>[e[6]||(e[6]=a.createTextVNode(" Сповіщення "))]),_:1,__:[6]}),e[12]||(e[12]=a.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),a.createElementVNode("div",nq,[a.createElementVNode("div",{onClick:e[1]||(e[1]=I=>o.isVisible=!0),class:"cursor-pointer"},[a.createVNode(c,{trigger:"hover"},{reference:a.withCtx(()=>{var I,N,$,F;return[(N=(I=o.userData)==null?void 0:I.user)!=null&&N.avatar?(a.openBlock(),a.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(F=($=o.userData)==null?void 0:$.user)==null?void 0:F.avatar,alt:"Image Description"},null,8,rq)):(a.openBlock(),a.createElementBlock("div",iq,[a.createVNode(k)]))]}),default:a.withCtx(()=>[e[7]||(e[7]=a.createTextVNode(" Профіль "))]),_:1,__:[7]})]),o.isVisible?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=a.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[a.createVNode(E,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:a.withCtx(()=>{var I,N,$,F,q,J,Q,me,ke,Re;return[(N=(I=o.userData)==null?void 0:I.user)!=null&&N.avatar?(a.openBlock(),a.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(F=($=o.userData)==null?void 0:$.user)==null?void 0:F.avatar,alt:"Image Description"},null,8,sq)):(a.openBlock(),a.createElementBlock("div",oq,[a.createVNode(k,{class:"w-[16px]"})])),a.createElementVNode("div",aq,[a.createElementVNode("span",lq,a.toDisplayString(((J=(q=o.userData)==null?void 0:q.user)==null?void 0:J.username)||((me=(Q=o.userData)==null?void 0:Q.user)==null?void 0:me.user_name)||"User User"),1),a.createElementVNode("p",cq,a.toDisplayString(((Re=(ke=o.userData)==null?void 0:ke.user)==null?void 0:Re.email)||"email не вказано"),1)])]}),_:1}),e[10]||(e[10]=a.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),a.createElementVNode("ul",dq,[a.createElementVNode("li",null,[a.createVNode(E,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:a.withCtx(()=>[a.createVNode(C,{class:"size-4"}),e[8]||(e[8]=a.createTextVNode(" Профіль "))]),_:1,__:[8]})])]),e[11]||(e[11]=a.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),a.createElementVNode("p",null,[a.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...I)=>d.logout&&d.logout(...I)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[a.createVNode(T,{class:"size-4"}),e[9]||(e[9]=a.createTextVNode(" Вийти "))])])])):a.createCommentVNode("",!0)])])],2)}const hq={components:{navbar:KW,AdminHeader:Oe(JW,[["render",uq]])},data(){return{showMenu:!1}},computed:{isMenu(){return ei.value||null},header(){var t,e;return((t=et.value)==null?void 0:t.header)===!1?!1:((e=et.value)==null?void 0:e.header)||"admin-header"}}},pq={class:"admin-wrapper"},fq={class:"flex flex-col w-full"};function mq(t,e,n,r,o,d){const p=a.resolveComponent("navbar"),c=a.resolveComponent("router-view");return a.openBlock(),a.createElementBlock("div",pq,[a.createVNode(p),o.showMenu?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=b=>o.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):a.createCommentVNode("",!0),a.createElementVNode("div",fq,[d.isMenu?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[d.header?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(d.header),{key:0})):a.createCommentVNode("",!0),a.createVNode(c)],64)):a.createCommentVNode("",!0)])])}const gq=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(hq,[["render",mq],["__scopeId","data-v-804a7309"]])},Symbol.toStringTag,{value:"Module"})),yq={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},mounted(){this.$emit("update-ref",this.$refs.column)},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,o=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...o&&{sort:o}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},_q={scope:"col",class:"text-start",ref:"column"},bq={class:"w-[24px]"},xq={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function vq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("th",_q,[d.getVisibleIcon?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-2 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=p=>d.handleClickSortBtn(o.currentSort))},[a.createTextVNode(a.toDisplayString(d.label)+" ",1),a.createElementVNode("span",bq,[o.currentSort?(a.openBlock(),a.createElementBlock("svg",{key:0,class:a.normalizeClass(["shrink-0 size-3.5",{"rotate-180":o.currentSort==="asc"}]),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e[1]||(e[1]=[a.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),a.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):a.createCommentVNode("",!0)])])):(a.openBlock(),a.createElementBlock("p",xq,a.toDisplayString(d.label),1))],512)}const wq=Oe(yq,[["render",vq]]),kq={},Eq={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-link"};function Cq(t,e){return a.openBlock(),a.createElementBlock("svg",Eq,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M9 15l6 -6"},null,-1),a.createElementVNode("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"},null,-1),a.createElementVNode("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"},null,-1)]))}const Sq={components:{IconMore:cg,IconDelete:dg,IconEdit:ug,IconLink:Oe(kq,[["render",Cq]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await Le.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await Le.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await Le.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n,r;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):t!=null&&t.api?(await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1}),await this.$emit("update-table")):t!=null&&t.href&&this.$router.push((t==null?void 0:t.href)+((r=this.item)==null?void 0:r.id))}}},Tq={class:"inline-flex"},Aq={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},Dq={class:"flex flex-col items-start"},Mq=["onClick"],Iq={class:"text-gray-800"},Pq={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},Rq={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Nq(t,e,n,r,o,d){const p=a.resolveComponent("IconMore"),c=a.resolveComponent("IconEdit"),b=a.resolveComponent("router-link"),k=a.resolveComponent("IconLink"),E=a.resolveComponent("IconDelete"),C=a.resolveComponent("VsPopover"),T=a.resolveComponent("VsConfirm");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",Tq,[a.createVNode(C,{trigger:"click",placement:"bottom-left"},{reference:a.withCtx(()=>[a.createElementVNode("button",Aq,[a.createVNode(p,{height:"16",width:"16"})])]),default:a.withCtx(()=>{var I,N,$,F,q;return[a.createElementVNode("div",Dq,[(I=n.actions)!=null&&I.includes("edit")&&n.isForm?(a.openBlock(),a.createBlock(b,{key:0,to:`/edit?table=${($=(N=t.$route)==null?void 0:N.params)==null?void 0:$.catchAll}&id=${(F=n.item)==null?void 0:F.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:a.withCtx(()=>[a.createVNode(c,{color:"#000"}),e[4]||(e[4]=a.createTextVNode(" Редагувати "))]),_:1,__:[4]},8,["to"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.getCustomActions,(J,Q)=>(a.openBlock(),a.createElementBlock("button",{key:Q,onClick:me=>d.customButtonAction(J),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[J!=null&&J.href?(a.openBlock(),a.createBlock(k,{key:0,class:"size-3.5"})):a.createCommentVNode("",!0),a.createElementVNode("span",Iq,a.toDisplayString(J==null?void 0:J.label),1)],8,Mq))),128)),n.isForm?(a.openBlock(),a.createElementBlock("div",Pq)):a.createCommentVNode("",!0),(q=n.actions)!=null&&q.includes("del")?(a.openBlock(),a.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=a.withModifiers((...J)=>d.openConfirm&&d.openConfirm(...J),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[a.createVNode(E),e[5]||(e[5]=a.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):a.createCommentVNode("",!0)])]}),_:1})]),a.createVNode(T,{visible:o.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=I=>o.isDeleteConfirm=I),size:"small",title:"Ви впевнені?"},{default:a.withCtx(()=>[e[6]||(e[6]=a.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),a.createElementVNode("div",Rq,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=I=>o.isDeleteConfirm=!1)}," Скасувати "),a.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...I)=>d.deleteElement&&d.deleteElement(...I))}," Так, я впевнена(ий) ")])]),_:1,__:[6]},8,["visible"])],64)}const Bq=Oe(Sq,[["render",Nq]]),Vq={},zq={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Oq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",zq,e[0]||(e[0]=[a.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),a.createElementVNode("path",{d:"M7 20V4"},null,-1),a.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),a.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Lq=Oe(Vq,[["render",Oq]]),Fq={},$q={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function jq(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",$q,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),a.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const Uq={components:{IconExport:Lq,IconChevronDown:Rd,IconSuccess:Oe(Fq,[["render",jq]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}],es:null,progress:0}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},computed:{color(){return et.value.buttonColor||"blue"}},methods:{async downloadBlob(t){const e=await Le.get(t||"/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=new Blob([e.data],{type:"application/octet-stream"}),r=document.createElement("a");r.href=URL.createObjectURL(n),r.download=`${this.table.split(".")[0]}.${this.format}`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href),this.isSuccessTemplate=!0,this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})},async exportTable(){var e;try{await Le.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null,stream:!0},validateStatus:n=>n===200}),await this.downloadBlob();return}catch{}const t=new URLSearchParams({table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||"",state:this.filterState||"",custom:this.filterCustom||""});(e=this.es)==null||e.close(),this.es=new EventSource(`/api/export?${t.toString()}`),this.es.addEventListener("progress",n=>{try{const{percent:r}=JSON.parse(n.data);this.progress=r}catch{console.log("progress",n.data)}}),this.es.addEventListener("done",async n=>{this.es.close(),this.es=null;const{url:r}=JSON.parse(n.data||"{}");await this.downloadBlob(r)}),this.es.onerror=n=>{var r;console.error("SSE error",n),this.$notify({type:"error",title:"Помилка",message:"Потік експорту перервано."}),(r=this.es)==null||r.close()}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},Hq={key:0,class:"flex flex-col items-center"},Wq={key:1,class:"p-4"},qq={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Gq={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},Zq=["onClick"],Yq={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},Xq={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Kq={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},Jq={class:"mt-2 space-y-2"},Qq=["id","onChange"],eG=["for"],tG={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},nG={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function rG(t,e,n,r,o,d){const p=a.resolveComponent("IconExport"),c=a.resolveComponent("IconSuccess"),b=a.resolveComponent("VsCheckbox"),k=a.resolveComponent("VsDialog");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("button",{onClick:e[0]||(e[0]=E=>o.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[a.createVNode(p,{height:"16",width:"16"}),e[7]||(e[7]=a.createTextVNode(" Експорт "))]),a.createVNode(k,{visible:o.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>o.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:a.withCtx(()=>[o.isSuccessTemplate?(a.openBlock(),a.createElementBlock("div",tG,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=E=>o.isOpen=!1)}," Закрити "),a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=E=>o.isSuccessTemplate=!1)}," Вигрузити ще ")])):(a.openBlock(),a.createElementBlock("div",nG,[a.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=E=>o.isOpen=!1)}," Скасувати "),a.createElementVNode("button",{type:"button",class:a.normalizeClass(`inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-${d.color}-700 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-${d.color}-800 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-${d.color}-300 dark:focus:ring-${d.color}-500`),onClick:e[5]||(e[5]=(...E)=>d.exportTable&&d.exportTable(...E))}," Завантажити таблицю ",2)]))]),default:a.withCtx(()=>[o.isSuccessTemplate?(a.openBlock(),a.createElementBlock("div",Hq,[a.createVNode(c,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=a.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(a.openBlock(),a.createElementBlock("div",Wq,[a.createElementVNode("div",qq,[e[9]||(e[9]=a.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),a.createElementVNode("div",Gq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.actions,E=>(a.openBlock(),a.createElementBlock("button",{key:E==null?void 0:E.name,onClick:E==null?void 0:E.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[a.createElementVNode("span",{class:a.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===o.activeAction}])},[(E==null?void 0:E.name)===o.activeAction?(a.openBlock(),a.createElementBlock("span",Yq)):a.createCommentVNode("",!0)],2),a.createTextVNode(" "+a.toDisplayString(E==null?void 0:E.label),1)],8,Zq))),128))]),a.createElementVNode("div",Xq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.columns,(E,C)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[a.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:o.cols,"onUpdate:modelValue":e[1]||(e[1]=T=>o.cols=T),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),a.createElementVNode("div",Kq,[e[10]||(e[10]=a.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть формат таблиці: ",-1)),a.createElementVNode("div",Jq,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.tableFormats,(E,C)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center",key:C},[a.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:E,onChange:T=>d.selectFormat(E)},null,40,Qq),a.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+a.toDisplayString(E),9,eG)]))),128))])])]))]),_:1},8,["visible"])],64)}const iG=Oe(Uq,[["render",rG]]),sG={},oG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function aG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",oG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const lG={components:{IconPlus:$l,IconMinus:Oe(sG,[["render",aG]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},cG={class:"hs-accordion"},dG={class:"py-0.5 flex items-center gap-x-0.5 w-full"},uG={class:"text-sm font-medium"},hG={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function pG(t,e,n,r,o,d){const p=a.resolveComponent("IconPlus"),c=a.resolveComponent("IconMinus");return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",null,[a.createElementVNode("div",cG,[a.createElementVNode("div",dG,[a.createElementVNode("div",{onClick:e[0]||(e[0]=b=>o.expanded=!o.expanded),class:"rounded-md cursor-pointer grow"},[a.createElementVNode("span",uG,a.toDisplayString(n.title),1)]),a.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=b=>o.expanded=!o.expanded)},[o.expanded?(a.openBlock(),a.createBlock(c,{key:1,width:"14"})):(a.openBlock(),a.createBlock(p,{key:0}))])]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",hG,[a.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[a.vShow,o.expanded]])]),_:3})])])])}const fG={components:{AdminComponentIs:bd,AdminTree:Oe(lG,[["render",pG],["__scopeId","data-v-e1f274c9"]]),VsNoData:Ha,VsWidgetComments:Cv,VsWidgetMap:Lm,VsWidgetFileList:Ev},props:{table:String,columns:Array,row:Object}},mG={class:"pl-2 hs-accordion w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 229px)"}},gG={style:{height:"calc(100vh - 360px)"},class:"pl-2"},yG={class:"flow-root mt-[10px]"},_G={class:"divide-y divide-gray-100 text-[12px]"},bG={class:"grid grid-cols-1 gap-1 py-3 even:bg-gray-50 sm:grid-cols-3 sm:gap-4"},xG={class:"font-medium text-gray-900"},vG={class:"text-gray-700 sm:col-span-2"};function wG(t,e,n,r,o,d){var k,E,C,T;const p=a.resolveComponent("AdminComponentIs"),c=a.resolveComponent("VsWidgetFileList"),b=a.resolveComponent("VsNoData");return a.openBlock(),a.createElementBlock("div",mG,[e[0]||(e[0]=a.createElementVNode("div",{class:"pl-[10px] py-[9px]"},[a.createElementVNode("h2",{class:"text-sm font-medium text-center"},"Інформація про об'єкт")],-1)),a.createElementVNode("div",gG,[(E=(k=t.$route)==null?void 0:k.query)!=null&&E.card?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",yG,[a.createElementVNode("dl",_G,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.columns,I=>(a.openBlock(),a.createElementBlock("div",bG,[a.createElementVNode("dt",xG,a.toDisplayString((I==null?void 0:I.ua)||(I==null?void 0:I.title)),1),a.createElementVNode("dd",vG,[a.createVNode(p,{row:n.row,column:I,table:n.table},null,8,["row","column","table"])])]))),256))])]),(a.openBlock(),a.createBlock(c,{key:(C=n.row)==null?void 0:C.id,id:(T=n.row)==null?void 0:T.id,class:"mt-10"},null,8,["id"]))],64)):(a.openBlock(),a.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const kG=Oe(fG,[["render",wG]]),EG={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:Av},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},CG={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},SG={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function TG(t,e,n,r,o,d){const p=a.resolveComponent("IconFilter"),c=a.resolveComponent("VsFilter");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("button",{onClick:e[0]||(e[0]=b=>o.isFilters=!o.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[a.createVNode(p,{height:"16",width:"16"}),e[4]||(e[4]=a.createTextVNode(" Фільтри ")),n.onFilters?(a.openBlock(),a.createElementBlock("span",CG,a.toDisplayString(n.onFilters),1)):a.createCommentVNode("",!0)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>{var b;return[(a.openBlock(),a.createBlock(a.Teleport,{to:"#modal"},[a.withDirectives(a.createElementVNode("div",{onClick:e[3]||(e[3]=(...k)=>d.closeFilter&&d.closeFilter(...k)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[a.createElementVNode("div",SG,[(b=n.scheme)!=null&&b.length?(a.openBlock(),a.createBlock(c,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=k=>t.$emit("filterChange",k)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=k=>o.isFilters=!1)},null,8,["scheme"])):a.createCommentVNode("",!0)])],512),[[a.vShow,o.isFilters]])]))]}),_:1})],64)}const AG=Oe(EG,[["render",TG]]),DG={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},MG={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},IG=["onClick"];function PG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("nav",MG,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.tabsList,p=>(a.openBlock(),a.createElementBlock("button",{onClick:c=>t.$emit("update:filterState",p==null?void 0:p.name),class:a.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(p==null?void 0:p.name)===n.filterState}])},a.toDisplayString(p==null?void 0:p.label),11,IG))),256))])}const RG=Oe(DG,[["render",PG]]),NG={},BG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function VG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",BG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const zG={components:{IconFilter2:Oe(NG,[["render",VG]]),IconCheck2:kl},props:{filterCustom:String,customList:Array}},OG={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},LG={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},FG=["onClick"],$G={class:"text-sm text-gray-800"};function jG(t,e,n,r,o,d){const p=a.resolveComponent("IconFilter2"),c=a.resolveComponent("IconCheck2"),b=a.resolveComponent("VsPopover");return a.openBlock(),a.createBlock(b,{ref:"popover",placement:"bottom"},{reference:a.withCtx(()=>[a.createElementVNode("button",OG,[a.createVNode(p,{height:"20",width:"20"})])]),default:a.withCtx(()=>[a.createElementVNode("div",LG,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customList,(k,E)=>(a.openBlock(),a.createElementBlock("button",{onClick:C=>{var T;t.$emit("update:filterCustom",k==null?void 0:k.name),(T=t.$refs)==null||T.popover.togglePopover()},key:E,class:a.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(k==null?void 0:k.name)}])},[a.createElementVNode("span",$G,a.toDisplayString(k==null?void 0:k.label),1),n.filterCustom===(k==null?void 0:k.name)?(a.openBlock(),a.createBlock(c,{key:0,class:"ml-auto size-3 shrink-0"})):a.createCommentVNode("",!0)],10,FG))),128)),a.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=k=>{var E;t.$emit("update:filterCustom",void 0),(E=t.$refs)==null||E.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const UG=Oe(zG,[["render",jG]]),HG={class:"flex items-center gap-x-2"},WG={__name:"admin-table-custom-buttons",props:{slots:Object,data:Object},setup(t){var c,b,k,E,C;const{asyncTemplateSlot:e}=(C=(E=(k=(b=(c=a.getCurrentInstance())==null?void 0:c.appContext)==null?void 0:b.app)==null?void 0:k.config)==null?void 0:E.globalProperties)==null?void 0:C.utils,n=a.ref(""),r=a.ref(""),o=t,d=()=>{var T,I,N,$,F;if((T=o.slots)!=null&&T.panelLeft||(r.value="div"),(N=(I=o.slots)==null?void 0:I.panelLeft)!=null&&N.includes("<")){const q=e("PanelLeft",($=o.slots)==null?void 0:$.panelLeft,["name"]);r.value=q}else r.value=(F=o.slots)==null?void 0:F.panelLeft},p=()=>{var T,I,N,$,F;if((T=o.slots)!=null&&T.panelRight||(n.value="div"),(N=(I=o.slots)==null?void 0:I.panelRight)!=null&&N.includes("<")){const q=e("PanelRight",($=o.slots)==null?void 0:$.panelRight,["name"]);n.value=q}else n.value=(F=o.slots)==null?void 0:F.panelRight};return d(),p(),(T,I)=>(a.openBlock(),a.createElementBlock("div",HG,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r.value),{data:t.data},null,8,["data"])),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value),{data:t.data},null,8,["data"]))]))}},qG={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var d,p,c,b,k;const{asyncTemplateSlot:e}=(k=(b=(c=(p=(d=a.getCurrentInstance())==null?void 0:d.appContext)==null?void 0:p.app)==null?void 0:c.config)==null?void 0:b.globalProperties)==null?void 0:k.utils,n=a.ref(""),r=t;return(()=>{var E,C,T,I,N;if((E=r.slots)!=null&&E.addButton||(n.value="div"),(T=(C=r.slots)==null?void 0:C.addButton)!=null&&T.includes("<")){const $=e("addButton",(I=r.slots)==null?void 0:I.addButton,["IconPlus"]);n.value=$}else n.value=(N=r.slots)==null?void 0:N.addButton})(),(E,C)=>n.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.value),{key:0,IconPlus:$l})):a.createCommentVNode("",!0)}},GG={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},ZG={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},YG={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("tr",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,r=>{var o;return a.openBlock(),a.createElementBlock(a.Fragment,{key:r==null?void 0:r.name},[(o=t.agg)!=null&&o[r==null?void 0:r.name]?(a.openBlock(),a.createElementBlock("td",GG,[a.createVNode(bd,{column:r,row:t.agg},null,8,["column","row"])])):(a.openBlock(),a.createElementBlock("td",ZG))],64)}),128))]))}},XG={},KG={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function JG(t,e,n,r,o,d){return a.openBlock(),a.createElementBlock("svg",KG,e[0]||(e[0]=[a.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),a.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const QG=Oe(XG,[["render",JG]]),eZ=a.defineComponent({components:{IconChevronDown:Mp,IconCheck:QG},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(o,d)=>n+d)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t)},keydownEnter(t){t.preventDefault(),t.target.blur()}}}),tZ={class:"flex items-center w-full"},nZ={class:"flex items-center mx-[8px]"},rZ={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},iZ={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},sZ={class:"relative"},oZ={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},aZ=["onClick"];function lZ(t,e,n,r,o,d){const p=a.resolveComponent("IconChevronDown"),c=a.resolveComponent("IconCheck");return a.openBlock(),a.createElementBlock("nav",tZ,[a.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...b)=>t.handleClickPrev&&t.handleClickPrev(...b)),class:a.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[a.createVNode(p,{height:"16",width:"16",class:"rotate-90"})],2),a.createElementVNode("div",nZ,[a.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onKeydown:e[1]||(e[1]=a.withKeys((...b)=>t.keydownEnter&&t.keydownEnter(...b),["enter"])),onBlur:e[2]||(e[2]=b=>t.handleSetPage(b.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 outline-blue-600 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},a.toDisplayString(t.page),545),e[5]||(e[5]=a.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),a.createElementVNode("span",rZ,a.toDisplayString(t.pagesCount),1)]),a.createElementVNode("button",{type:"button",onClick:e[3]||(e[3]=(...b)=>t.handleClickNext&&t.handleClickNext(...b)),class:a.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[a.createVNode(p,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(a.openBlock(),a.createElementBlock("div",iZ,[a.createElementVNode("div",sZ,[a.withDirectives(a.createElementVNode("div",oZ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.pageSizes,b=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:k=>t.pageSizeLocal=b},[a.createTextVNode(a.toDisplayString(b)+" ",1),b===t.pageSizeLocal?(a.openBlock(),a.createBlock(c,{key:0,width:"14",height:"14",class:"text-blue-600"})):a.createCommentVNode("",!0)],8,aZ))),256))],512),[[a.vShow,t.isDropdownOpen]]),t.pageSizes.length?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=b=>t.isDropdownOpen=!t.isDropdownOpen)},[a.createTextVNode(a.toDisplayString(t.pageSizeLocal)+" ",1),a.createVNode(p,{height:"16",width:"16"})])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)])}const cZ={props:{table:String,title:String,search:String},components:{AdminTableControl:Bq,AdminTableExport:iG,AdminTableColumnsHidden:Mv,AdminTableColumn:wq,AdminNodata:hg,IconPlus:$l,IconSearch:Dp,AdminTableCardInfo:kG,IconOpenCard:k2,AdminComponentIs:bd,AdminTableFilters:AG,AdminTableTabs:RG,AdminTableCustomFilters:UG,AdminTableCustomButtons:WG,AdminCustomButtonAdd:qG,AdminTableTotalsList:YG,AdminTablePagination:Oe(eZ,[["render",lZ]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:"",columnsWidth:{}}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{color(){return et.value.buttonColor||"blue"},fontSize(){return`text-[${et.value.fontSize||13}px]`},defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n,r,o;return((t=this.tableData)==null?void 0:t.form)&&(((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))||((o=(r=this.tableData)==null?void 0:r.actions)==null?void 0:o.includes("edit")))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,o;return(n==null?void 0:n.id)===((o=(r=this.$route)==null?void 0:r.query)==null?void 0:o.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{searchValue:{handler:My(async function(t){var e;this.page=1,await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0,page:1}})},500)},$route:{async handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.tableData=null,this.columnsWidth={},this.unmountedData(),this.getFilters(),await this.getTableData())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,state:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,o;this.visibleColumns=t==null?void 0:t.map(d=>d==null?void 0:d.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(o=this.visibleColumns)==null?void 0:o.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,o,d,p,c,b,k,E,C,T,I,N,$,F,q,J,Q,me;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,(d=(o=this.$route)==null?void 0:o.query)!=null&&d.filter&&(this.filters=((b=decodeURI((c=(p=this.$route)==null?void 0:p.query)==null?void 0:c.filter))==null?void 0:b.replaceAll("+"," "))||null),this.filters&&(this.onFilters=((E=(k=this.filters)==null?void 0:k.split("="))==null?void 0:E.length)-1),this.filterState=((T=(C=this.$route)==null?void 0:C.query)==null?void 0:T.state)||null,this.filterCustom=((N=(I=this.$route)==null?void 0:I.query)==null?void 0:N.custom)||null,this.searchValue=((F=($=this.$route)==null?void 0:$.query)==null?void 0:F.search)||"",this.visibleColumns=((Q=(J=(q=this.$route)==null?void 0:q.query)==null?void 0:J.columns)==null?void 0:Q.split(","))||[],(me=this.$route)!=null&&me.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(o=>o.name===t);if(e){const o=e==null?void 0:e.width;return typeof o=="number"?`${o}px`:o!=null&&o.includes("px")?o:`${o}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,o,d,p,c,b,k,E;try{const{data:C}=await Le.get(`/api/template/table/${this.table}`),T=await Le.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...C,...(T==null?void 0:T.data)||{}},this.initialHiddenColumns=(d=(o=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:o.map(I=>I==null?void 0:I.name))==null?void 0:d.join(","),(p=this.visibleColumns)!=null&&p.length?(c=this.tableData)==null||c.columns.forEach(I=>{var N;(N=this.visibleColumns)!=null&&N.includes(I==null?void 0:I.name)?I.hidden=!1:I.hidden=!0}):this.visibleColumns=(E=(k=(b=this.tableData)==null?void 0:b.columns)==null?void 0:k.filter(I=>(I==null?void 0:I.hidden)!==!0))==null?void 0:E.map(I=>I==null?void 0:I.name),setTimeout(()=>{var I,N;(N=(I=this.tableData)==null?void 0:I.columns)==null||N.forEach(({name:$})=>{var F,q,J,Q,me,ke;(q=(F=this.columnsWidth)==null?void 0:F[$])!=null&&q.ref&&(this.columnsWidth[$].width=parseInt((ke=(me=(Q=(J=this.columnsWidth)==null?void 0:J[$])==null?void 0:Q.ref)==null?void 0:me.getBoundingClientRect())==null?void 0:ke.width)+"px")})})}catch{}},async getFilters(){var t;try{const{data:e}=await Le.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,this.limit=e,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-800 hover:underline decoration-1":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},dZ={class:"w-[calc(100vw - 320px)] bg-gray-100"},uZ={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white rounded-xl"},hZ={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},pZ={class:"bg-white w-full rounded-xl p-[20px] pr-0"},fZ={class:"flex"},mZ={class:"flex gap-[6px] ml-auto"},gZ={class:"inline-block w-full align-middle"},yZ={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},_Z={class:"right-0"},bZ={key:0,class:"w-[70px] sticky right-0 top-0"},xZ={class:"divide-y divide-gray-200 z-[1] relative text-gray-600"},vZ=["onClick"],wZ=["onClick"],kZ=["onClick"],EZ={class:"flex items-center justify-start w-full px-1 py-2"},CZ={class:"w-[200px] md:inline-flex hidden"},SZ={class:"text-sm text-gray-600 dark:text-neutral-400"},TZ={class:"font-semibold text-gray-800 dark:text-neutral-200"},AZ={key:0};function DZ(t,e,n,r,o,d){var Be,Ze,tt,Xe,ot,ue,Ut,wt,$t,an,xn,mn,hn,vn,Dn,In,Hn,Wn,Te,Ke,nt,yt,qt,ln,Vt,Bt,pn,Ce,Vn,Ps,Qt,zn,Rs;const p=a.resolveComponent("AdminCustomButtonAdd"),c=a.resolveComponent("IconPlus"),b=a.resolveComponent("router-link"),k=a.resolveComponent("AdminTableTabs"),E=a.resolveComponent("IconSearch"),C=a.resolveComponent("VsText"),T=a.resolveComponent("AdminTableCustomButtons"),I=a.resolveComponent("AdminTableCustomFilters"),N=a.resolveComponent("AdminTableColumnsHidden"),$=a.resolveComponent("AdminTableExport"),F=a.resolveComponent("AdminTableFilters"),q=a.resolveComponent("IconOpenCard"),J=a.resolveComponent("AdminTableColumn"),Q=a.resolveComponent("AdminComponentIs"),me=a.resolveComponent("AdminTableControl"),ke=a.resolveComponent("AdminTableTotalsList"),Re=a.resolveComponent("AdminNodata"),Ee=a.resolveComponent("AdminTablePagination"),Ve=a.resolveComponent("AdminTableCardInfo");return a.openBlock(),a.createElementBlock("div",dZ,[a.createElementVNode("div",uZ,[a.createElementVNode("h2",hZ,a.toDisplayString(n.title),1),d.isForm?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[(Ze=(Be=o.tableData)==null?void 0:Be.slots)!=null&&Ze.addButton?(a.openBlock(),a.createBlock(p,{key:0,slots:(tt=o.tableData)==null?void 0:tt.slots},null,8,["slots"])):(a.openBlock(),a.createBlock(b,{key:1,to:`/add?table=${(ot=(Xe=t.$route)==null?void 0:Xe.params)==null?void 0:ot.catchAll}`,class:a.normalizeClass(`inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-${d.color}-700 border border-transparent rounded-lg gap-x-2 hover:bg-${d.color}-800 hover:text-white`)},{default:a.withCtx(()=>[a.createVNode(c,{height:"16",width:"16"}),e[5]||(e[5]=a.createTextVNode(" Додати "))]),_:1,__:[5]},8,["to","class"]))],64)):a.createCommentVNode("",!0)]),a.createElementVNode("div",{style:a.normalizeStyle({height:((ue=t.$adminSettings)==null?void 0:ue.header)===!1?"calc(100vh - 91px)":"calc(100vh - 155px)"}),class:"bg-gray-100 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},[a.createElementVNode("div",pZ,[(wt=(Ut=o.tableData)==null?void 0:Ut.filterState)!=null&&wt.length?(a.openBlock(),a.createBlock(k,{key:0,tabsList:($t=o.tableData)==null?void 0:$t.filterState,filterState:o.filterState,"onUpdate:filterState":e[0]||(e[0]=ut=>o.filterState=ut)},null,8,["tabsList","filterState"])):a.createCommentVNode("",!0),a.createElementVNode("div",fZ,[a.createElementVNode("div",{class:a.normalizeClass([o.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[a.createElementVNode("div",{class:a.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!o.isVisibleCardInfo}])},[a.createVNode(E,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),a.createVNode(C,{modelValue:o.searchValue,"onUpdate:modelValue":e[1]||(e[1]=ut=>o.searchValue=ut),placeholder:n.search||"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue","placeholder"]),a.createElementVNode("div",mZ,[(an=o.tableData)!=null&&an.slots?(a.openBlock(),a.createBlock(T,{key:0,data:o.tableData,slots:(xn=o.tableData)==null?void 0:xn.slots},null,8,["data","slots"])):a.createCommentVNode("",!0),(hn=(mn=o.tableData)==null?void 0:mn.filterCustom)!=null&&hn.length?(a.openBlock(),a.createBlock(I,{key:1,customList:(vn=o.tableData)==null?void 0:vn.filterCustom,filterCustom:o.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=ut=>o.filterCustom=ut)},null,8,["customList","filterCustom"])):a.createCommentVNode("",!0),a.createVNode(N,{columns:(Dn=o.tableData)==null?void 0:Dn.columns,onUpdateColumns:e[3]||(e[3]=ut=>o.tableData.columns=ut)},null,8,["columns"]),((In=o.tableData)==null?void 0:In.export)!==!1?(a.openBlock(),a.createBlock($,{key:2,table:n.table,columns:(Hn=o.tableData)==null?void 0:Hn.columns,page:o.page,"filter-state":o.filterState,"filter-custom":o.filterCustom,filters:o.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):a.createCommentVNode("",!0),(Wn=o.filterScheme)!=null&&Wn.length?(a.openBlock(),a.createBlock(F,{key:3,scheme:o.filterScheme,onFilters:o.onFilters,table:n.table,onFilterChange:d.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):a.createCommentVNode("",!0),a.createElementVNode("button",{onClick:e[4]||(e[4]=(...ut)=>d.toggleCardInfo&&d.toggleCardInfo(...ut)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[a.createVNode(q,{class:a.normalizeClass({"rotate-180 duration-300":!o.isVisibleCardInfo})},null,8,["class"])])])],2),a.createElementVNode("div",{class:a.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!o.isVisibleCardInfo}])},[a.createElementVNode("div",{style:a.normalizeStyle({height:`calc(100vh - ${((Te=t.$adminSettings)==null?void 0:Te.header)===!1?(nt=(Ke=o.tableData)==null?void 0:Ke.filterState)!=null&&nt.length?330:270:(qt=(yt=o.tableData)==null?void 0:yt.filterState)!=null&&qt.length?380:320}px)`}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[a.createElementVNode("div",gZ,[d.isNoData?(a.openBlock(),a.createBlock(Re,{key:1})):(a.openBlock(),a.createElementBlock("table",{key:0,class:a.normalizeClass([d.fontSize,"relative min-w-full my-2 divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"])},[a.createElementVNode("thead",yZ,[a.createElementVNode("tr",_Z,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.columns,ut=>{var Cr,yi;return a.openBlock(),a.createBlock(J,{key:ut.name,style:a.normalizeStyle({width:((yi=(Cr=o.columnsWidth)==null?void 0:Cr[ut==null?void 0:ut.name])==null?void 0:yi.width)||d.rowWidth(ut==null?void 0:ut.name),textAlign:ut==null?void 0:ut.align,wordBreak:ut==null?void 0:ut.wrap}),data:ut,activeColumn:o.activeColumn,onUpdateRef:_r=>{var Mi,Ii;(Ii=(Mi=o.columnsWidth)==null?void 0:Mi[ut==null?void 0:ut.name])!=null&&Ii.ref||(o.columnsWidth[ut.name]={ref:_r})},onChangeActive:d.changeActiveColumn},null,8,["style","data","activeColumn","onUpdateRef","onChangeActive"])}),128)),(Vt=(ln=d.getActions)==null?void 0:ln.filter(ut=>ut!=="add"&&ut!=="view"))!=null&&Vt.length?(a.openBlock(),a.createElementBlock("th",bZ)):a.createCommentVNode("",!0)])]),a.createElementVNode("tbody",xZ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Bt=o.tableData)==null?void 0:Bt.rows,(ut,Cr)=>{var yi,_r,Mi,Ii,je,ti,hr,ni,Pi,He,Ot,At,br,Hr;return a.openBlock(),a.createElementBlock("tr",{key:(ut==null?void 0:ut.id)||Cr,class:a.normalizeClass({"bg-gray-100":((_r=(yi=t.$route)==null?void 0:yi.query)==null?void 0:_r.card)===(ut==null?void 0:ut.id),"odd:bg-gray-50":((Ii=(Mi=t.$route)==null?void 0:Mi.query)==null?void 0:Ii.card)!==(ut==null?void 0:ut.id)})},[a.createElementVNode("td",{class:a.normalizeClass(["px-1 py-2.5 pr-5",[(je=d.columns[0])!=null&&je.align?`text-${((ti=d.columns[0])==null?void 0:ti.align)||"left"}`:""]]),onClick:Et=>d.changeActiveCardInfo(ut==null?void 0:ut.id)},[a.createElementVNode("button",{onClick:Et=>{d.pushToCard(ut==null?void 0:ut.id),d.pushToLinkCard(d.columns[0],ut)},class:a.normalizeClass(["font-medium text-start",[...d.getCustomStyles(d.columns[0]),((hr=this.tableData)==null?void 0:hr.card)===!1?"":` text-${d.color}-800 decoration-2 focus:outline-none focus:underline hover:text-${d.color}-700 hover:underline`]])},[a.createVNode(Q,{row:ut,column:d.columns[0],table:n.table,onUpdateTable:d.getTableData},null,8,["row","column","table","onUpdateTable"])],10,wZ)],10,vZ),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((ni=d.columns)==null?void 0:ni.slice(1),Et=>(a.openBlock(),a.createElementBlock("td",{onClick:Ri=>{d.changeActiveCardInfo(ut==null?void 0:ut.id),d.pushToLinkCard(Et,ut)},class:a.normalizeClass(["px-1 py-2.5 pr-5",d.getCustomStyles(Et)]),key:Et.name},[a.createVNode(Q,{row:ut,column:Et,table:n.table,onUpdateTable:d.getTableData},null,8,["row","column","table","onUpdateTable"])],10,kZ))),128)),(He=(Pi=d.getActions)==null?void 0:Pi.filter(Et=>Et!=="add"&&Et!=="view"))!=null&&He.length?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((At=(Ot=t.$route)==null?void 0:Ot.query)==null?void 0:At.card)===(ut==null?void 0:ut.id)||!(Cr%2),"bg-white":((Hr=(br=t.$route)==null?void 0:br.query)==null?void 0:Hr.card)!==(ut==null?void 0:ut.id)&&Cr%2}])},[a.createVNode(me,{actions:d.getActions,isForm:d.isForm,item:ut,table:n.table,onUpdateTable:d.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):a.createCommentVNode("",!0)],2)}),128))]),a.createVNode(ke,{columns:d.columns,agg:(pn=o.tableData)==null?void 0:pn.agg},null,8,["columns","agg"])],2))])],4)],2),a.createElementVNode("div",EZ,[a.createElementVNode("div",CZ,[a.createElementVNode("p",SZ,[a.createElementVNode("span",TZ,[a.createTextVNode(" Об'єктів: "+a.toDisplayString(Intl.NumberFormat("ua").format(o.limit<((Ce=o.tableData)==null?void 0:Ce.filtered)?o.limit:((Vn=o.tableData)==null?void 0:Vn.filtered)||0))+" ",1),o.limit<((Ps=o.tableData)==null?void 0:Ps.filtered)?(a.openBlock(),a.createElementBlock("span",AZ," з "+a.toDisplayString(Intl.NumberFormat("ua").format(((Qt=o.tableData)==null?void 0:Qt.filtered)||0)),1)):a.createCommentVNode("",!0)])])]),Math.ceil((zn=o.tableData)==null?void 0:zn.filtered)>10?(a.openBlock(),a.createBlock(Ee,{key:0,class:"justify-end mr-10","default-page":parseInt(d.defaultPage),total:((Rs=o.tableData)==null?void 0:Rs.filtered)||0,onPageChange:d.handlePageChange,pageSize:parseInt(o.limit),pageSizes:[10,20,50,100]},null,8,["default-page","total","onPageChange","pageSize"])):a.createCommentVNode("",!0)])],2),a.createVNode(a.Transition,{name:"slide-fade"},{default:a.withCtx(()=>{var ut;return[o.isVisibleCardInfo?(a.openBlock(),a.createBlock(Ve,{key:0,table:n.table,columns:(ut=o.tableData)==null?void 0:ut.columns,row:d.activeCardRow},null,8,["table","columns","row"])):a.createCommentVNode("",!0)]}),_:1})])])],4)])}const MZ={components:{AdminTable:Oe(cZ,[["render",DZ],["__scopeId","data-v-ca941f11"]])},data(){return{table:!1,interface:"",search:""}},watch:{$route:{async handler(){ei!=null&&ei.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=et.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,o;const t=this.flattenMenu(ei.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(d=>{var p,c;return(d==null?void 0:d.path)==((c=(p=this.$route)==null?void 0:p.params)==null?void 0:c.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((o=(r=this.$route)==null?void 0:r.params)==null?void 0:o.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,this.search=(e==null?void 0:e.search)||"",!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await Le.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},IZ=["innerHTML"];function PZ(t,e,n,r,o,d){const p=a.resolveComponent("AdminTable");return o.table?(a.openBlock(),a.createBlock(p,{key:0,table:o.table,title:t.title,search:o.search},null,8,["table","title","search"])):(a.openBlock(),a.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:o.interface},null,8,IZ))}const RZ=Object.freeze(Object.defineProperty({__proto__:null,default:Oe(MZ,[["render",PZ]])},Symbol.toStringTag,{value:"Module"}));return D2});
|