@opengis/admin 0.2.36 → 0.2.37
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/dist/{add-page-DlAzVcqF.js → add-page-RShqVZ6U.js} +1 -1
- package/dist/{admin-interface-DNWo7SKe.js → admin-interface-CdZNYZko.js} +1 -1
- package/dist/{admin-view-O2VCvJxh.js → admin-view-B4RkRWfj.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +2 -2
- package/dist/{card-view-Cue9tc_s.js → card-view-wiQEWExD.js} +1 -1
- package/dist/{edit-page-Ct5vFga9.js → edit-page-DZ3bue02.js} +1 -1
- package/dist/{import-file-DipOleMT.js → import-file-CspxNIvZ.js} +18 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/admin.umd.cjs
CHANGED
@@ -738,7 +738,7 @@ img.ProseMirror-separator {
|
|
738
738
|
|
739
739
|
`);return!a||!u?!1:n.chain().command(({tr:l})=>(l.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:i}=e,{$from:r,empty:a}=t;if(!a||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const l=r.after();return l===void 0?!1:i.nodeAt(l)?n.commands.command(({tr:b})=>(b.setSelection(Xt.near(i.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[I0({find:oF,type:this.type,getAttributes:n=>({language:n[1]})}),I0({find:aF,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ui({key:new Ir("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),i=e.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=r==null?void 0:r.mode;if(!t||!a)return!1;const{tr:u,schema:l}=n.state,g=l.text(t.replace(/\r\n?/g,`
|
740
740
|
`));return u.replaceSelectionWith(this.type.create({language:a},g)),u.selection.$from.parent.type!==this.type&&u.setSelection(jt.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),n.dispatch(u),!0}}})]}}),lF=ks.create({name:"doc",topNode:!0,content:"block+"});function cF(n={}){return new Ui({view(e){return new uF(e,n)}})}class uF{constructor(e,t){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=t.width)!==null&&i!==void 0?i:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let a=u=>{this[r](u)};return e.dom.addEventListener(r,a),{name:r,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,i;if(t){let l=e.nodeBefore,g=e.nodeAfter;if(l||g){let b=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(b){let w=b.getBoundingClientRect(),E=l?w.bottom:w.top;l&&g&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),i={left:w.left,right:w.right,top:E-this.width/2,bottom:E+this.width/2}}}}if(!i){let l=this.editorView.coordsAtPos(this.cursorPos);i={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let a,u;if(!r||r==document.body&&getComputedStyle(r).position=="static")a=-pageXOffset,u=-pageYOffset;else{let l=r.getBoundingClientRect();a=l.left-r.scrollLeft,u=l.top-r.scrollTop}this.element.style.left=i.left-a+"px",this.element.style.top=i.top-u+"px",this.element.style.width=i.right-i.left+"px",this.element.style.height=i.bottom-i.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=i&&i.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,t,e):r;if(t&&!a){let u=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=zw(this.editorView.state.doc,u,this.editorView.dragging.slice);l!=null&&(u=l)}this.setCursor(u),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const hF=Ii.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cF(this.options)]}});class ri extends Xt{constructor(e){super(e,e)}map(e,t){let i=e.resolve(t.map(this.head));return ri.valid(i)?new ri(i):Xt.near(i)}content(){return ft.empty}eq(e){return e instanceof ri&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ri(e.resolve(t.pos))}getBookmark(){return new Y0(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!dF(e)||!pF(e))return!1;let i=t.type.spec.allowGapCursor;if(i!=null)return i;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,i=!1){e:for(;;){if(!i&&ri.valid(e))return e;let r=e.pos,a=null;for(let u=e.depth;;u--){let l=e.node(u);if(t>0?e.indexAfter(u)<l.childCount:e.index(u)>0){a=l.child(t>0?e.indexAfter(u):e.index(u)-1);break}else if(u==0)return null;r+=t;let g=e.doc.resolve(r);if(ri.valid(g))return g}for(;;){let u=t>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!Bt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*t),i=!1;continue e}break}a=u,r+=t;let l=e.doc.resolve(r);if(ri.valid(l))return l}return null}}}ri.prototype.visible=!1,ri.findFrom=ri.findGapCursorFrom,Xt.jsonID("gapcursor",ri);class Y0{constructor(e){this.pos=e}map(e){return new Y0(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ri.valid(t)?new ri(t):Xt.near(t)}}function dF(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),i=n.node(e);if(t==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function pF(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),i=n.node(e);if(t==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function fF(){return new Ui({props:{decorations:_F,createSelectionBetween(n,e,t){return e.pos==t.pos&&ri.valid(t)?new ri(t):null},handleClick:gF,handleKeyDown:mF,handleDOMEvents:{beforeinput:yF}}})}const mF=l2({ArrowLeft:qf("horiz",-1),ArrowRight:qf("horiz",1),ArrowUp:qf("vert",-1),ArrowDown:qf("vert",1)});function qf(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,a){let u=i.selection,l=e>0?u.$to:u.$from,g=u.empty;if(u instanceof jt){if(!a.endOfTextblock(t)||l.depth==0)return!1;g=!1,l=i.doc.resolve(e>0?l.after():l.before())}let b=ri.findGapCursorFrom(l,e,g);return b?(r&&r(i.tr.setSelection(new ri(b))),!0):!1}}function gF(n,e,t){if(!n||!n.editable)return!1;let i=n.state.doc.resolve(e);if(!ri.valid(i))return!1;let r=n.posAtCoords({left:t.clientX,top:t.clientY});return r&&r.inside>-1&&Bt.isSelectable(n.state.doc.nodeAt(r.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ri(i))),!0)}function yF(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ri))return!1;let{$from:t}=n.state.selection,i=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!i)return!1;let r=$e.empty;for(let u=i.length-1;u>=0;u--)r=$e.from(i[u].createAndFill(null,r));let a=n.state.tr.replace(t.pos,t.pos,new ft(r,0,0));return a.setSelection(jt.near(a.doc.resolve(t.pos+1))),n.dispatch(a),!1}function _F(n){if(!(n.selection instanceof ri))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",mi.create(n.doc,[Yr.widget(n.selection.head,e,{key:"gapcursor"})])}const bF=Ii.create({name:"gapCursor",addProseMirrorPlugins(){return[fF()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=rn(kt(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),xF=ks.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",hi(this.options.HTMLAttributes,n)]},renderText(){return`
|
741
|
-
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:i})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:r,storedMarks:a}=t;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,g=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:b,dispatch:w})=>{if(w&&g&&u){const E=g.filter(C=>l.includes(C.type.name));b.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vF=ks.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,hi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>I0({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Wf=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<Wf&&this.leafAppend(e)||this.length<Wf&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new wF(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},Di.prototype.map=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},t,i),r},Di.from=function(e){return e instanceof Di?e:e&&e.length?new SS(e):Di.empty};var SS=function(n){function e(i){n.call(this),this.values=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var g=a;g<u;g++)if(r(this.values[g],l+g)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var g=a-1;g>=u;g--)if(r(this.values[g],l+g)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Wf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Wf)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Di);Di.empty=new SS([]);var wF=function(n){function e(t,i){n.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Di);const kF=500;class Us{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;t&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,g,b=[],w=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,w.push(E);return}if(r){w.push(new co(E.map));let P=E.step.map(r.slice(a)),D;P&&u.maybeStep(P).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new co(D,void 0,void 0,b.length+w.length))),a--,D&&r.appendMap(D,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,g=new Us(this.items.slice(0,i).append(w.reverse().concat(b)),this.eventCount-1),!1},this.items.length,0),{remaining:g,transform:u,selection:l}}addTransform(e,t,i,r){let a=[],u=this.eventCount,l=this.items,g=!r&&l.length?l.get(l.length-1):null;for(let w=0;w<e.steps.length;w++){let E=e.steps[w].invert(e.docs[w]),C=new co(e.mapping.maps[w],E,t),P;(P=g&&g.merge(C))&&(C=P,w?a.pop():l=l.slice(0,l.length-1)),a.push(C),t&&(u++,t=void 0),r||(g=C)}let b=u-i.depth;return b>EF&&(l=SF(l,b),u-=b),new Us(l.append(a),u)}remapping(e,t){let i=new Pc;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,t),i}addMaps(e){return this.eventCount==0?this:new Us(this.items.append(e.map(t=>new co(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-t),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=t;this.items.forEach(C=>{let P=a.getMirror(--g);if(P==null)return;u=Math.min(u,P);let D=a.maps[P];if(C.step){let R=e.steps[P].invert(e.docs[P]),$=C.selection&&C.selection.map(a.slice(g+1,P));$&&l++,i.push(new co(D,R,$))}else i.push(new co(D))},r);let b=[];for(let C=t;C<u;C++)b.push(new co(a.maps[C]));let w=this.items.slice(0,r).append(b).append(i),E=new Us(w,l);return E.emptyItemCount()>kF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),i=t.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let g=u.step.map(t.slice(i)),b=g&&g.getMap();if(i--,b&&t.appendMap(b,i),g){let w=u.selection&&u.selection.map(t.slice(i));w&&a++;let E=new co(b.invert(),g,w),C,P=r.length-1;(C=r.length&&r[P].merge(E))?r[P]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Di.from(r.reverse()),a)}}Us.empty=new Us(Di.empty,0);function SF(n,e){let t;return n.forEach((i,r)=>{if(i.selection&&e--==0)return t=r,!1}),n.slice(t)}class co{constructor(e,t,i,r){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new co(t.getMap().invert(),t,this.selection)}}}class Ta{constructor(e,t,i,r,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const EF=20;function CF(n,e,t,i){let r=t.getMeta(zl),a;if(r)return r.historyState;t.getMeta(AF)&&(n=new Ta(n.done,n.undone,null,0,-1));let u=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(u&&u.getMeta(zl))return u.getMeta(zl).redo?new Ta(n.done.addTransform(t,void 0,i,Gf(e)),n.undone,ES(t.mapping.maps),n.prevTime,n.prevComposition):new Ta(n.done,n.undone.addTransform(t,void 0,i,Gf(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),g=n.prevTime==0||!u&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-i.newGroupDelay||!TF(t,n.prevRanges)),b=u?X0(n.prevRanges,t.mapping):ES(t.mapping.maps);return new Ta(n.done.addTransform(t,g?e.selection.getBookmark():void 0,i,Gf(e)),Us.empty,b,t.time,l??n.prevComposition)}else return(a=t.getMeta("rebased"))?new Ta(n.done.rebased(t,a),n.undone.rebased(t,a),X0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ta(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),X0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function TF(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(t=!0)}),t}function ES(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((i,r,a,u)=>e.push(a,u));return e}function X0(n,e){if(!n)return null;let t=[];for(let i=0;i<n.length;i+=2){let r=e.map(n[i],1),a=e.map(n[i+1],-1);r<=a&&t.push(r,a)}return t}function MF(n,e,t){let i=Gf(e),r=zl.get(e).spec.config,a=(t?n.undone:n.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(t?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ta(t?l:a.remaining,t?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(zl,{redo:t,historyState:g})}let K0=!1,CS=null;function Gf(n){let e=n.plugins;if(CS!=e){K0=!1,CS=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){K0=!0;break}}return K0}const zl=new Ir("history"),AF=new Ir("closeHistory");function PF(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ui({key:zl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,t,i){return CF(t,i,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let i=t.inputType,r=i=="historyUndo"?MS:i=="historyRedo"?AS:null;return r?(t.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function TS(n,e){return(t,i)=>{let r=zl.getState(t);if(!r||(n?r.undone:r.done).eventCount==0)return!1;if(i){let a=MF(r,t,n);a&&i(e?a.scrollIntoView():a)}return!0}}const MS=TS(!1,!0),AS=TS(!0,!0),IF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>MS(n,e),redo:()=>({state:n,dispatch:e})=>AS(n,e)}},addProseMirrorPlugins(){return[PF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),DF=ks.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",hi(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{selection:t}=e,{$from:i,$to:r}=t,a=n();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):A2(t)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var g;if(l){const{$to:b}=u.selection,w=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(jt.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(Bt.create(u.doc,b.pos)):u.setSelection(jt.create(u.doc,b.pos));else{const E=(g=b.parent.type.contentMatch.defaultType)===null||g===void 0?void 0:g.create();E&&(u.insert(w,E),u.setSelection(jt.create(u.doc,w+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[cL({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),OF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,BF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,NF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,RF=so.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qc({find:OF,type:this.type}),qc({find:NF,type:this.type})]},addPasteRules(){return[Wc({find:BF,type:this.type}),Wc({find:zF,type:this.type})]}}),LF=ks.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",hi(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),VF="listItem",PS="textStyle",IS=/^(\d+)\.\s$/,FF=ks.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",hi(this.options.HTMLAttributes,t),0]:["ol",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VF,this.editor.getAttributes(PS)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Rh({find:IS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Rh({find:IS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(PS)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),$F=ks.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,UF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,HF=so.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qc({find:jF,type:this.type})]},addPasteRules(){return[Wc({find:UF,type:this.type})]}}),DS=ks.create({name:"text",group:"inline"}),qF=Ii.create({name:"starterKit",addExtensions(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$,G;const ee=[];return this.options.bold!==!1&&ee.push(eF.configure((n=this.options)===null||n===void 0?void 0:n.bold)),this.options.blockquote!==!1&&ee.push(YV.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ee.push(nF.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&ee.push(sF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ee.push(kS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ee.push(lF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ee.push(hF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ee.push(bF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ee.push(xF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&ee.push(vF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&ee.push(IF.configure((w=this.options)===null||w===void 0?void 0:w.history)),this.options.horizontalRule!==!1&&ee.push(DF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ee.push(RF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&ee.push(LF.configure((P=this.options)===null||P===void 0?void 0:P.listItem)),this.options.orderedList!==!1&&ee.push(FF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&ee.push($F.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&ee.push(HF.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&ee.push(DS.configure((G=this.options)===null||G===void 0?void 0:G.text)),ee}}),WF=so.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=E0(n,this.type);return Object.entries(t).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),GF=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;return(e=n.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function ZF(n){var e;const{char:t,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=n,l=uL(t),g=new RegExp(`\\s${l}$`),b=a?"^":"",w=i?new RegExp(`${b}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${b}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const C=u.pos-E.length,P=Array.from(E.matchAll(w)).pop();if(!P||P.input===void 0||P.index===void 0)return null;const D=P.input.slice(Math.max(0,P.index-1),P.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+P.index;let G=$+P[0].length;return i&&g.test(E.slice(G-1,G+1))&&(P[0]+=" ",G+=1),$<u.pos&&G>=u.pos?{range:{from:$,to:G},query:P[0].slice(t.length),text:P[0]}:null}const YF=new Ir("suggestion");function XF({pluginKey:n=YF,editor:e,char:t="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:w=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=ZF}){let P;const D=w==null?void 0:w(),R=new Ui({key:n,view(){return{update:async($,G)=>{var ee,ce,U,Me,ke,Pe,Fe;const Be=(ee=this.key)===null||ee===void 0?void 0:ee.getState(G),pt=(ce=this.key)===null||ce===void 0?void 0:ce.getState($.state),tt=Be.active&&pt.active&&Be.range.from!==pt.range.from,Nt=!Be.active&&pt.active,rt=Be.active&&!pt.active,Mt=!Nt&&!rt&&Be.query!==pt.query,Rt=Nt||tt&&Mt,Ft=Mt||tt,zt=rt||tt&&Mt;if(!Rt&&!Ft&&!zt)return;const Ht=zt&&!Rt?Be:pt,yn=$.dom.querySelector(`[data-decoration-id="${Ht.decorationId}"]`);P={editor:e,range:Ht.range,query:Ht.query,text:Ht.text,items:[],command:dn=>g({editor:e,range:Ht.range,props:dn}),decorationNode:yn,clientRect:yn?()=>{var dn;const{decorationId:wn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${wn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Rt&&((U=D==null?void 0:D.onBeforeStart)===null||U===void 0||U.call(D,P)),Ft&&((Me=D==null?void 0:D.onBeforeUpdate)===null||Me===void 0||Me.call(D,P)),(Ft||Rt)&&(P.items=await b({editor:e,query:Ht.query})),zt&&((ke=D==null?void 0:D.onExit)===null||ke===void 0||ke.call(D,P)),Ft&&((Pe=D==null?void 0:D.onUpdate)===null||Pe===void 0||Pe.call(D,P)),Rt&&((Fe=D==null?void 0:D.onStart)===null||Fe===void 0||Fe.call(D,P))},destroy:()=>{var $;P&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,P))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,G,ee,ce){const{isEditable:U}=e,{composing:Me}=e.view,{selection:ke}=$,{empty:Pe,from:Fe}=ke,Be={...G};if(Be.composing=Me,U&&(Pe||e.view.composing)){(Fe<G.range.from||Fe>G.range.to)&&!Me&&!G.composing&&(Be.active=!1);const pt=C({char:t,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:ke.$from}),tt=`id_${Math.floor(Math.random()*4294967295)}`;pt&&E({editor:e,state:ce,range:pt.range,isActive:G.active})?(Be.active=!0,Be.decorationId=G.decorationId?G.decorationId:tt,Be.range=pt.range,Be.query=pt.query,Be.text=pt.text):Be.active=!1}else Be.active=!1;return Be.active||(Be.decorationId=null,Be.range={from:0,to:0},Be.query=null,Be.text=null),Be}},props:{handleKeyDown($,G){var ee;const{active:ce,range:U}=R.getState($.state);return ce&&((ee=D==null?void 0:D.onKeyDown)===null||ee===void 0?void 0:ee.call(D,{view:$,event:G,range:U}))||!1},decorations($){const{active:G,range:ee,decorationId:ce}=R.getState($);return G?mi.create($.doc,[Yr.inline(ee.from,ee.to,{nodeName:u,class:l,"data-decoration-id":ce})]):null}}});return R}const KF=new Ir("mention"),JF=ks.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:n,node:e}){var t;return`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e}){var t;return["span",hi(this.HTMLAttributes,n.HTMLAttributes),`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`]},suggestion:{char:"@",pluginKey:KF,command:({editor:n,range:e,props:t})=>{var i,r,a;const u=n.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),n.chain().focus().insertContentAt(e,[{type:this.name,attrs:t},{type:"text",text:" "}]).run(),(a=(r=n.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:n,range:e})=>{const t=n.doc.resolve(e.from),i=n.schema.nodes[this.name];return!!t.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:n,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",hi({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:n})];const t={...this.options};t.HTMLAttributes=hi({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:t,node:n});return typeof i=="string"?["span",hi({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:n}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:n})):this.options.renderText({options:this.options,node:n})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return t=!0,n.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),t):!1})}},addProseMirrorPlugins(){return[XF({editor:this.editor,...this.options.suggestion})]}}),QF=so.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),e6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function t6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[f.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const n6=Ue(e6,[["render",t6]]),i6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function r6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const s6=Ue(i6,[["render",r6]]),o6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function a6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const l6=Ue(o6,[["render",a6]]),c6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function u6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const h6=Ue(c6,[["render",u6]]),d6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function p6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("bold")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),f.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const f6=Ue(d6,[["render",p6]]),m6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function g6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("italic")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),f.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const y6=Ue(m6,[["render",g6]]),_6={},b6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function x6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",b6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const v6={components:{IconA:Ue(_6,[["render",x6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(n){this.editor&&(this.editor.chain().focus().setColor(n).run(),this.$refs.popover.togglePopover(),this.color=n)}}},w6={class:"relative flex"},k6={class:"flex w-[160px] flex-wrap gap-[4px]"},S6=["onClick"];function E6(n,e,t,i,r,a){const u=f.resolveComponent("IconA"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",w6,[f.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),f.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:f.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",k6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.colors,g=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:g}),onClick:b=>a.setColor(g),key:g},null,12,S6))),128))])])]),_:1},512)}const C6=Ue(v6,[["render",E6]]),T6={},M6={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-dots-vertical"};function A6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",M6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const J0=Ue(T6,[["render",A6]]),P6={components:{IconMore:J0},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function I6(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("underline")||t.editor.isActive("strike")}])},[f.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=(...g)=>a.toggleUnderline&&a.toggleUnderline(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":t.editor.isActive("underline")}])}," Підкресленний ",2),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...g)=>a.toggleStrike&&a.toggleStrike(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":t.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const D6={bold:f6,italic:y6,text_more:Ue(P6,[["render",I6]]),color:C6,bullet_list:s6,ordered_list:l6,blockquote:n6,codeblock:h6},O6={components:{EditorContent:GV},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(D6).filter(([n])=>this.controls.includes(n)).map(([n,e])=>e)}},watch:{modelValue(n){this.editor&&this.editor.getHTML()!==n&&this.editor.commands.setContent(n)},editor(n){n&&this.editor.on("update",({editor:e})=>{const t=e.getHTML();t!==this.modelValue&&this.$emit("update:modelValue",t)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new WV({content:this.modelValue,extensions:[qF,kS,WF,GF,QF,DS,JF.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:n})=>{const e=this.options.filter(t=>{var i,r;return(r=(i=t==null?void 0:t.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(n==null?void 0:n.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let n,e;return{onStart:t=>{n=document.createElement("div"),n.className="mention-popup",t.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{t.command({id:a.id,label:a.email})})),n.appendChild(u)}),document.body.appendChild(n);const{from:i}=t.range,r=t.editor.view.coordsAtPos(i);n.style.position="absolute",n.style.left=`${r.left}px`,n.style.top=`${r.top-n.offsetHeight}px`,e=n},onUpdate:t=>{for(;n.firstChild;)n.removeChild(n.firstChild);t.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{t.command({id:a.id,label:a.email})})),n.appendChild(u)});const{from:i}=t.range,r=t.editor.view.coordsAtPos(i);n.style.left=`${r.left}px`,n.style.top=`${r.top-n.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},B6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},N6={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function z6(n,e,t,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",B6,[r.editor?(f.openBlock(),f.createElementBlock("div",N6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.controlsList,(l,g)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(l),{key:g,editor:r.editor},null,8,["editor"]))),128))])):f.createCommentVNode("",!0),f.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[f.createVNode(u,{editor:r.editor,class:"relative w-full"},null,8,["editor"])])])}const OS=Ue(O6,[["render",z6]]),R6=n=>{const e=/(\b\S)?/g,t=n.match(e);return t?t.join("").toUpperCase():""},L6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return R6(this.name)}}},V6={class:"mr-2"},F6=["src"],$6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},j6={key:0},U6={key:1,class:"text-sm"};function H6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",V6,[t.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:t.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,F6)):t.name?(f.openBlock(),f.createElementBlock("div",$6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",j6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",U6,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const q6={components:{VsWidgetCommentsAvatar:Ue(L6,[["render",H6]]),VsTextEditor:OS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const n=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(n).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(n){n&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await ut.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await ut.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},W6={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},G6={class:"flex justify-between items-center mb-2"},Z6={class:"flex items-center"},Y6={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},X6={class:"text-sm text-gray-600 dark:text-gray-400"},K6={class:"flex flex-col items-center gap-[4px]"},J6=["innerHTML"],Q6={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},e$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function t$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAvatar"),l=f.resolveComponent("VsPopover"),g=f.resolveComponent("VsTextEditor"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",W6,[f.createElementVNode("div",G6,[f.createElementVNode("div",Z6,[f.createElementVNode("p",Y6,[f.createVNode(u,{name:t.comment.username,avatar:t.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(t.comment.username),1)]),f.createElementVNode("p",X6,[f.createElementVNode("time",null,f.toDisplayString(a.createDate),1)])]),f.createVNode(l,{placement:"bottom"},{reference:f.withCtx(()=>e[6]||(e[6]=[f.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[f.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[f.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:f.withCtx(()=>[f.createElementVNode("div",K6,[f.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...w)=>a.openEditModal&&a.openEditModal(...w))}," Редагувати "),f.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=w=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:t.comment.body},null,8,J6)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=w=>r.isOpen=w),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",e$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=w=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...w)=>a.updateComment&&a.updateComment(...w)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:f.withCtx(()=>[f.createElementVNode("div",Q6,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=w=>r.textareaValue=w),options:t.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const n$={components:{VsWidgetCommentsItem:Ue(q6,[["render",t$]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:n}=await ut.get(`/api/widget/comment/${this.id}`);this.comments=n.rows,this.user=n.user}catch(n){this.isLoadFailed=!0,console.error(n)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(n){const e={...n};return n.cancel||(e.cancel=()=>{this.isModalVisible=!1}),n.updateListOnConfirm&&(e.confirm=async()=>{await n.confirm(),this.isModalVisible=!1}),e},handleOpenModal(n){this.modal=this.prepareModal(n),this.isModalVisible=!0}}},i$={class:"flex flex-col"},r$={key:0,class:"max-h-[300px] 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"},s$={key:1},o$={class:"p-4"},a$={class:"mt-1 text-gray-500 dark:text-neutral-500"},l$={class:"mt-4 flex justify-end gap-x-3"};function c$(n,e,t,i,r,a){const u=f.resolveComponent("VsErrorOnLoading"),l=f.resolveComponent("VsWidgetCommentsItem"),g=f.resolveComponent("VsLoader"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock("div",i$,[r.isLoaded?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[r.isLoadFailed?(f.openBlock(),f.createBlock(u,{key:0})):(f.openBlock(),f.createElementBlock(f.Fragment,{key:1},[r.comments.length?(f.openBlock(),f.createElementBlock("div",r$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(w,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:w,user:r.user,options:t.options,index:E,id:t.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=C=>a.handleOpenModal(C))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(f.openBlock(),f.createElementBlock("div",s$,e[4]||(e[4]=[f.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(f.openBlock(),f.createBlock(g,{key:1,class:"justify-center",text:"Please wait..."})),f.createVNode(b,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=w=>r.isModalVisible=w)},{default:f.withCtx(()=>[f.createElementVNode("div",o$,[f.createElementVNode("p",a$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",l$,[f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm 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",onClick:e[1]||(e[1]=(...w)=>r.modal.cancel&&r.modal.cancel(...w))},f.toDisplayString(r.modal.cancelButtonText),1),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...w)=>r.modal.confirm&&r.modal.confirm(...w))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const u$=Ue(n$,[["render",c$]]),h$={components:{VsTextEditor:OS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await ut.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(n){console.error(n)}},setNewContent(n){this.commentContent=n}}},d$={class:"flex flex-col items-start w-full widget-comment-form"},p$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},f$={class:"flex"};function m$(n,e,t,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",d$,[f.createElementVNode("div",p$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:t.options},null,8,["modelValue","options"])]),f.createElementVNode("div",f$,[f.createElementVNode("button",{ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const g$={components:{VsWidgetCommentsList:u$,VsWidgetCommentsAddForm:Ue(h$,[["render",m$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(n){this.$emit("count-change",n.length)}},methods:{async getUsersList(){try{const{data:n}=await ut.get("/api/suggest/core.user_mentioned");this.options=n}catch(n){console.log(n)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},y$={class:"w-full bg-white-200"};function _$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",y$,[e[2]||(e[2]=f.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),f.createVNode(u,{options:r.options,class:"mb-6",id:t.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:t.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":t.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const BS=Ue(g$,[["render",_$]]),NS=n=>new Date(n).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),b$=n=>new Date(n).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),x$=n=>{const e=/(\b\S)?/g,t=n.match(e);return t?t.join("").toUpperCase():""},v$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return x$(this.username)}}}),w$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function k$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",w$,f.toDisplayString(n.inItials),1)}const S$=Ue(v$,[["render",k$]]),Q0={load(){try{const n=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,t=n.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(t.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(n){console.log(n)}},promise(n){return new Promise((e,t)=>{Q0.load(n,()=>{e()})})},loadFile1(n){let e=!1;typeof n=="object"&&(e=n.type,n=n.url);const t=n.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${t}`],window.headLoadedFiles[t]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${t}`]?u=window.headLoadedFiles[`_${t}`]:(t.includes(".css")?(u=document.createElement("link"),u.href=n,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=n,e&&(u.type=e)),window.headLoadedFiles[`_${t}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},E$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await Q0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await Q0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const n=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(n),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(n).bindTooltip(this.tooltipText)}}},C$={id:"map",style:{height:"9rem",width:"24rem"}};function T$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",C$)}const M$=Ue(E$,[["render",T$]]),A$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:S$,VsWidgetHistoryItemMap:M$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(n){return n.title||n.attr},getOldValue(n){return n.old||"Не вказано"},getNewValue(n){return n.new||"Не вказано"},getDate(n){return b$(n.cdate)}}}),P$={class:"relative [&_p]:m-0"},I$={class:"flex items-center gap-3"},D$={class:"w-full flex justify-between"},O$={class:"text-gray-500"},B$={class:"text-gray-800 font-medium"},N$={class:"text-gray-500 text-sm"},z$={class:"mt-2 pl-10"},R$={key:0},L$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},V$={class:"font-medium"},F$={class:"font-medium"};function $$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",P$,[f.createElementVNode("div",I$,[f.createVNode(u,{username:n.item.username},null,8,["username"]),f.createElementVNode("div",D$,[f.createElementVNode("p",O$,[f.createElementVNode("span",B$,f.toDisplayString(n.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",N$,f.toDisplayString(n.getDate(n.item)),1)])]),f.createElementVNode("div",z$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",R$,[e[1]||(e[1]=f.createElementVNode("p",null,"Додана геометрія:",-1)),g.new?(f.openBlock(),f.createBlock(l,{key:0,point:g.new},null,8,["point"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createElementBlock("div",L$,[f.createElementVNode("p",null,f.toDisplayString(`- ${n.getTitle(g)}:`),1),f.createElementVNode("p",V$,f.toDisplayString(n.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",F$,f.toDisplayString(n.getNewValue(g)),1)]))]))),128))])])}const j$=Ue(A$,[["render",$$]]),U$=f.defineComponent({components:{VsWidgetHistoryItem:j$,VsEmptyWidget:Yv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?NS(this.history.data.cdate):""},lastEditDate(){return this.history.data?NS(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:n}=await ut.get(`/api/widget/history/${this.id}`);this.history=n}catch(n){console.error(n)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(n){this.$emit("count-change",n.length)}}}),H$={class:"bg-white"},q$={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] 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"},W$={key:1,class:"w-full h-[330px] flex items-center justify-center"};function G$(n,e,t,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",H$,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=n.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",q$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.history.rows,g=>(f.openBlock(),f.createElementBlock("li",{class:"list-none mr-[10px]",key:g.uid},[f.createVNode(u,{item:g},null,8,["item"])]))),128))])):(f.openBlock(),f.createElementBlock("div",W$," Історія відсутні "))])}const Z$=Ue(U$,[["render",G$]]),Y$={},X$={class:"flex-shrink-0 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 K$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",X$,e[0]||(e[0]=[f.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const zS=Ue(Y$,[["render",K$]]),J$={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},Q$={style:{display:"none"}},e8=["height","width","fill"];function t8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",Q$,e[0]||(e[0]=[f.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[f.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(f.openBlock(),f.createElementBlock("svg",{height:t.height,width:t.width,fill:t.color},e[1]||(e[1]=[f.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,e8))],64)}const RS=Ue(J$,[["render",t8]]),n8={class:"hs-dropdown [--placement:bottom-right] inline-flex"},i8={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"},r8={class:"flex flex-col items-start"},s8={key:0,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},o8={class:"p-4"},a8={class:"flex justify-end mt-4 gap-x-3"},LS={__name:"vs-widget-table-controls",props:{},emits:["updateTable"],setup(n,{emit:e}){const t=n,i=f.ref(!1);f.ref({});const r=()=>{i.value=!0,document.body.click()},a=async()=>{},u=async()=>{};return f.onMounted(()=>{t.isForm&&a()}),(l,g)=>{const b=f.resolveComponent("router-link"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",n8,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",i8,[f.createVNode(J0,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D;return[f.createElementVNode("div",r8,[f.createVNode(b,{to:`/edit?table=${(P=(C=l.$route)==null?void 0:C.params)==null?void 0:P.catchAll}&id=${(D=l.item)==null?void 0:D.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:f.withCtx(()=>[f.createVNode(RS,{color:"#000"}),g[2]||(g[2]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"]),l.isForm?(f.openBlock(),f.createElementBlock("div",s8)):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:f.withModifiers(r,["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"},[f.createVNode(zS),g[3]||(g[3]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]}),_:1})]),f.createVNode(E,{visible:i.value,"onUpdate:visible":g[1]||(g[1]=C=>i.value=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",o8,[g[4]||(g[4]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",a8,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:g[0]||(g[0]=C=>i.value=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:u}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}}},l8={class:"h-full"},c8={class:"inline-block w-full align-middle"},u8={class:"relative min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},h8={class:"dark:bg-neutral-700 sticky top-[-1px] bg-white"},d8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px]"},p8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},f8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},m8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},g8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},y8={key:0,class:"h-[60px] flex items-center justify-center"},Zh=10,_8={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String,api:{type:String,default:()=>""},controls:{type:Array,default:()=>[]}},setup(n){const e=n,t=f.ref([]),i=f.ref([]),r=f.ref(1),a=async()=>{try{const{data:g}=await ut.get((e!=null&&e.api?e.api:"/api/table-data")+(e.token?`/${e.token}`:""));t.value=g.rows,i.value=(g==null?void 0:g.columns)||(e==null?void 0:e.columns)}catch(g){console.error("Ошибка при загрузке данных таблицы:",g)}},u=g=>{r.value=g},l=f.computed(()=>{var b;const g=(r.value-1)*Zh;return(b=t.value)==null?void 0:b.slice(g,g+Zh)});return f.onMounted(()=>{a()}),(g,b)=>{var E,C,P,D,R;const w=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",l8,[f.createElementVNode("div",{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",style:f.normalizeStyle({height:((E=t.value)==null?void 0:E.length)>Zh?"calc(100% - 60px)":"100%"})},[f.createElementVNode("div",c8,[f.createElementVNode("table",u8,[(C=i.value)!=null&&C.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",h8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,($,G)=>(f.openBlock(),f.createElementBlock("th",{key:G,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},f.toDisplayString(($==null?void 0:$.title)||($==null?void 0:$.description)),1))),128)),(P=n.controls)!=null&&P.length?(f.openBlock(),f.createElementBlock("th",d8)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.value,($,G)=>{var ee;return f.openBlock(),f.createElementBlock("tr",{key:G},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(ce,U)=>(f.openBlock(),f.createElementBlock("td",{key:U,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString($==null?void 0:$[ce.name]),1))),128)),(ee=n.controls)!=null&&ee.length?(f.openBlock(),f.createElementBlock("td",f8,[f.createVNode(LS)])):f.createCommentVNode("",!0)])}),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",m8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.value,($,G)=>{var ee;return f.openBlock(),f.createElementBlock("tr",{key:G},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($,(ce,U)=>(f.openBlock(),f.createElementBlock("td",{key:U,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(ce),1))),128)),(ee=n.controls)!=null&&ee.length?(f.openBlock(),f.createElementBlock("td",g8,[f.createVNode(LS)])):f.createCommentVNode("",!0)])}),128))]))])])],4),((D=t.value)==null?void 0:D.length)>Zh?(f.openBlock(),f.createElementBlock("div",y8,[f.createVNode(w,{goTo:!1,"default-page":1,total:(R=t.value)==null?void 0:R.length,class:"w-fit",pageSize:Zh,onPageChange:u,backgroundColor:"#F3F4F6"},null,8,["total"])])):f.createCommentVNode("",!0)])}}},b8={},x8={class:"shrink-0",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"};function v8(n,e){return f.openBlock(),f.createElementBlock("svg",x8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),f.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const w8=Ue(b8,[["render",v8]]),k8={},S8={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function E8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",S8,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),f.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const VS=Ue(k8,[["render",E8]]),C8={},T8={class:"shrink-0 size-4",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"};function M8(n,e){return f.openBlock(),f.createElementBlock("svg",T8,e[0]||(e[0]=[f.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),f.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const A8=Ue(C8,[["render",M8]]),P8={class:"relative shrink-0"},I8=["src"],D8={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},O8={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},B8={class:"grow"},N8={class:"text-xs text-gray-500 dark:text-neutral-500"},z8={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},R8={class:"text-sm text-gray-500 dark:text-neutral-500"},L8={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},V8={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(n,{emit:e}){const t=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await ut.get(`/api/notification-read/${(l=n.item)==null?void 0:l.id}`),await t("update-notification")}catch{}};return(l,g)=>{var w,E,C,P,D,R;const b=f.resolveComponent("VsPopover");return f.openBlock(),f.createElementBlock("li",{class:f.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(w=n.item)!=null&&w.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",P8,[(E=n.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=n.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,I8)):(f.openBlock(),f.createElementBlock("div",D8,[f.createVNode(VS)])),(P=n.item)!=null&&P.read?(f.openBlock(),f.createElementBlock("span",O8)):f.createCommentVNode("",!0)]),f.createElementVNode("div",B8,[f.createElementVNode("p",N8,[f.createVNode(ry,{name:"cdate",data:n.item},null,8,["data"])]),f.createElementVNode("span",z8,f.toDisplayString((D=n.item)==null?void 0:D.author),1),f.createElementVNode("p",R8,f.toDisplayString((R=n.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",L8,[f.createVNode(b,{trigger:"hover",placement:"left"},{reference:f.withCtx(()=>[f.createElementVNode("button",{onClick:u,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[f.createVNode(A8)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},F8={},$8={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 j8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",$8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),f.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const U8=Ue(F8,[["render",j8]]),H8={},q8={class:"shrink-0 size-4",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"};function W8(n,e){return f.openBlock(),f.createElementBlock("svg",q8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),f.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const G8=Ue(H8,[["render",W8]]),Z8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Y8={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},X8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},K8={class:"max-w-sm mx-auto mt-6"},J8={class:"font-medium text-gray-800 dark:text-neutral-200"},Q8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function ej(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",Y8,[f.createElementVNode("div",null,[f.createElementVNode("div",X8,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",K8,[f.createElementVNode("p",J8,f.toDisplayString(t.title),1),f.createElementVNode("p",Q8,f.toDisplayString(t.text),1)])])])])}const e_=Ue(Z8,[["render",ej]]),tj={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},nj={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},ij={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},rj={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},sj={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},oj={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},aj={key:0},lj={key:1},FS={__name:"admin-notification",setup(n){const e=f.ref(0),t=f.ref([]),i=f.ref(!1),r=f.ref(null),{$notify:a}=f.getCurrentInstance().proxy,u=b=>{r.value&&!r.value.contains(b.target)&&(i.value=!1)};f.watch(i,b=>{b?window.addEventListener("click",u):window.removeEventListener("click",u)}),f.onBeforeUnmount(()=>{window.removeEventListener("click",u)});const l=async()=>{try{const{data:b}=await ut.get("/api/notification");t.value=(b==null?void 0:b.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await ut.get("/api/notification-read"),await l()}catch{a({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(b,w)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"notificationRef",ref:r,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[f.createElementVNode("button",{onClick:w[0]||(w[0]=E=>i.value=!i.value),class:"hs-tooltip-toggle relative 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"},[f.createVNode(U8,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",tj,[w[1]||(w[1]=f.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),f.createElementVNode("span",nj,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var E;return[i.value?(f.openBlock(),f.createElementBlock("div",ij,[f.createElementVNode("div",rj,[w[2]||(w[2]=f.createElementVNode("nav",{class:"flex"},[f.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),f.createElementVNode("button",sj,[f.createVNode(G8)])]),f.createElementVNode("div",oj,[(E=t.value)!=null&&E.length?(f.openBlock(),f.createElementBlock("ul",aj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.value,C=>(f.openBlock(),f.createBlock(V8,{key:C==null?void 0:C.id,item:C,onUpdateNotification:l},null,8,["item"]))),128))])):(f.openBlock(),f.createElementBlock("div",lj,[f.createVNode(e_,{class:"[&>div>div]:min-h-[300px]",text:""})]))]),f.createElementVNode("button",{onClick:g,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[f.createVNode(w8,{height:"16",width:"16"}),w[3]||(w[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},cj={"vs-widget-map":sy,"vs-widget-gallery":vz,"vs-widget-comments":BS,"vs-widget-file":Kv,"vs-widget-history":Z$,"vs-widget-table":_8,"admin-notifications":FS},uj={"table-format-text":gp,"table-format-select":Xx,"table-format-badge":Zx,"table-format-swetch":yp,"table-format-check":yp,"table-format-html":gp,"table-format-tags":Kx,"table-format-date":ry,"table-format-number":Y1,"table-format-slot":X1},hj={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},dj={__name:"vs-dashboard",setup(n){return(e,t)=>(f.openBlock(),f.createElementBlock("div",hj,t[0]||(t[0]=[f.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"mb-4 xl:mb-8"},[f.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),f.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),f.createElementVNode("div",{class:"space-y-5"},[f.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[f.createElementVNode("div",{class:"relative w-full"},[f.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[f.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",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"},[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),f.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),f.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),f.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[f.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[f.createElementVNode("span",{class:"sr-only"},"Close"),f.createElementVNode("svg",{class:"shrink-0 size-4",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"},[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),f.createElementVNode("path",{d:"m15 9-6 6"}),f.createElementVNode("path",{d:"m9 9 6 6"})])])])]),f.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[f.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm 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"},[f.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",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"},[f.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),f.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),f.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[f.createElementVNode("span",{class:"hidden sm:block"},"Send"),f.createTextVNode("Invite ")])])]),f.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"})]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),f.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-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"},[f.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[f.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("thead",null,[f.createElementVNode("tr",null,[f.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[f.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),f.createElementVNode("th",{scope:"col",class:"min-w-48"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),f.createElementVNode("th",{scope:"col",class:"min-w-36"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),f.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},pj={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function fj(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",{onClick:e[0]||(e[0]=(...u)=>a.notify&&a.notify(...u)),class:"py-2 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"}," Custom component ")}const mj=Ue(pj,[["render",fj]]),gj={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(n){this.toggletMap[n]=!this.toggletMap[n],this.$emit("on:toggled",{optionID:n,toggled:this.toggletMap[n]})}}},yj={class:"md:col-span-2"},_j={class:"font-semibold text-gray-800 dark:text-neutral-200"},bj={class:"md:block md:col-span-1 md:text-center"},xj=["onClick"];function vj(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700",`grid-cols-${((u=t.actions)==null?void 0:u.length)+2}`])},[f.createElementVNode("li",yj,[f.createElementVNode("h3",_j,f.toDisplayString(t.item.ua),1)]),(l=t.item.menu)!=null&&l.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(t.actions,g=>(f.openBlock(),f.createElementBlock("li",bj,[f.createElementVNode("button",{onClick:b=>a.toggleHandler(g),type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,xj)]))),256)):f.createCommentVNode("",!0)],2)}const wj=Ue(gj,[["render",vj]]),kj={props:{subitem:{type:Object,required:!0},toggled:{type:Boolean,default:!1},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array,required:!0}},data(){return{checkedActions:[]}},watch:{routes:{handler(){this.initializeCheckedActions()},deep:!0,immediate:!0}},methods:{initializeCheckedActions(){const n=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=n?[...n.actions]:[]},inputHandler(n){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},Sj={class:"md:col-span-2"},Ej={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Cj={class:"text-sm text-gray-500 dark:text-neutral-500"},Tj={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Mj=["value","onChange"];function Aj(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${t.actions.length+2}`])},[f.createElementVNode("li",Sj,[f.createElementVNode("p",Ej,f.toDisplayString(((u=t.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",Cj,f.toDisplayString(((l=t.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.actions,(g,b)=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",Tj,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",value:g,onChange:w=>a.inputHandler(g),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500","onUpdate:modelValue":e[0]||(e[0]=w=>r.checkedActions=w)},null,40,Mj),[[f.vModelCheckbox,r.checkedActions]])])]))),128))],2)}const Pj=Ue(kj,[["render",Aj]]),Jr=f.ref(null),t_=n=>{const e=[];return n.forEach(t=>{t.menu?e.push(...t_(t.menu)):e.push(t)}),e},Zf=()=>{const n=new CustomEvent("reloadCardPage");window.dispatchEvent(n)},Ij={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:wj,VsGroupSecondLevel:Pj,AdminNodata:e_},data(){return{list:Jr.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,t;const n={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(i=>!(i!=null&&i.menu))};return this.filterMenu([n,...(t=this.list)==null?void 0:t.filter(i=>i==null?void 0:i.menu)],this.searchValue).filter(i=>{var r;return(r=i==null?void 0:i.menu)==null?void 0:r.length})}},methods:{async Save(){var n,e;try{const t=location.href.split("/").pop();await ut.post(`/api/access-group/${t}`,{routes:(n=this.history)==null?void 0:n.filter(i=>{var r;return(r=i==null?void 0:i.actions)==null?void 0:r.length}).map(({path:i,actions:r})=>({path:i,actions:[...new Set(r)]}))}),await this.$notify({type:"success",title:"Успішно!",message:"Данні успішно оновлені"}),await Zf()}catch(t){console.error(((e=t.response)==null?void 0:e.data)||t.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(n=>({...n,actions:[]}))},async getData(){var n,e;try{const t=location.href.split("/").pop(),r=(await ut.get(`/api/access-group/${t}`)).data;this.history=this.getUniqueByPath([...r.routes,...(n=t_(this.list))==null?void 0:n.map(a=>({path:a==null?void 0:a.path,actions:[]}))])}catch(t){console.error(((e=t.response)==null?void 0:e.data)||t.message)}},toggleCheck(n){var t,i;if(!((t=this.history)!=null&&t.length))return;const e=(i=this.history)==null?void 0:i.findIndex(r=>(r==null?void 0:r.path)===(n==null?void 0:n.subitemPath));this.history[e].actions=n==null?void 0:n.checkedActions},toggleAll(n,e){var i,r,a,u,l,g,b;const t=(a=(r=(i=this.getList)==null?void 0:i[e])==null?void 0:r.menu)==null?void 0:a.map(w=>w==null?void 0:w.path);n!=null&&n.toggled?(l=(u=this.history)==null?void 0:u.filter(w=>t==null?void 0:t.includes(w==null?void 0:w.path)))==null||l.forEach(w=>{var E;(E=w==null?void 0:w.actions)==null||E.push(n==null?void 0:n.optionID)}):(b=(g=this.history)==null?void 0:g.filter(w=>t==null?void 0:t.includes(w==null?void 0:w.path)))==null||b.forEach(w=>{var E;w.actions=(E=w==null?void 0:w.actions)==null?void 0:E.filter(C=>C!==(n==null?void 0:n.optionID))})},getUniqueByPath(n){return n.reduce((e,t)=>(e.some(r=>r.path===t.path)||e.push(t),e),[])},filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a}}return(r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e==null?void 0:e.toLowerCase())?t:null}).filter(Boolean)}},async mounted(){await this.getData()}},Dj={class:"flex gap-[6px]"},Oj={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Bj={key:0,class:"space-y-8"},Nj={class:"space-y-5"};function zj(n,e,t,i,r,a){var w;const u=f.resolveComponent("VsText"),l=f.resolveComponent("VsGrouptFirstLevel"),g=f.resolveComponent("VsGroupSecondLevel"),b=f.resolveComponent("AdminNodata");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",Dj,[f.createVNode(u,{placeholder:"Пошук",class:"flex-grow",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E)},null,8,["modelValue"]),f.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100",onClick:e[1]||(e[1]=(...E)=>a.resetAll&&a.resetAll(...E))}," Скинути всі "),f.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...E)=>a.Save&&a.Save(...E))}," Зберегти ")]),f.createElementVNode("div",{class:f.normalizeClass(["grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5",`grid-cols-${t.options.length+2}`])},[e[3]||(e[3]=f.createElementVNode("div",{class:"self-center col-span-2"},[f.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.options,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:C},[f.createElementVNode("h3",Oj,f.toDisplayString(E),1)]))),128))],2),(w=a.getList)!=null&&w.length?(f.openBlock(),f.createElementBlock("div",Bj,[f.createElementVNode("div",Nj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getList,(E,C)=>(f.openBlock(),f.createElementBlock("div",{key:C},[f.createVNode(l,{item:E,"onOn:toggled":P=>a.toggleAll(P,C),actions:t.options},null,8,["item","onOn:toggled","actions"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.menu,P=>(f.openBlock(),f.createBlock(g,{toggled:(E==null?void 0:E.toggled)||!1,optionID:E==null?void 0:E.optionID,key:P==null?void 0:P.path,subitem:P,actions:t.options,"onOn:checked":D=>a.toggleCheck(D,C),routes:r.history},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))]))),128))])])):(f.openBlock(),f.createBlock(b,{key:1}))])}const Rj=Ue(Ij,[["render",zj]]),Lj={__name:"vs-group-interface-page",setup(n){const e=["view","add","edit","del"];return(t,i)=>(f.openBlock(),f.createBlock(f.unref(Rj),{options:e,routes:t.routes},null,8,["routes"]))}},Vj={},Fj={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",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 $j(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Fj,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),f.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const n_=Ue(Vj,[["render",$j]]),jj={components:{IconSearch:n_},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var n,e;return((e=(n=this.data)==null?void 0:n.rows)==null?void 0:e.filter(t=>{var i;return(i=t==null?void 0:t.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:n}=await ut.get("/api/user-cls?type=json");this.data=n}catch{}}}},Uj={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},Hj={class:"relative"},qj={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Wj={class:"w-[99%] overflow-hidden overflow-ellipsis"},Gj={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function Zj(n,e,t,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Uj,[f.createElementVNode("div",Hj,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=b=>r.searchValue=b),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("ul",qj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var w,E;return f.openBlock(),f.createElementBlock("li",{key:b==null?void 0:b.id,class:"w-full pr-[10px]"},[f.createVNode(g,{to:r.link+"?name="+((b==null?void 0:b.name)||(b==null?void 0:b.id)),class:f.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(w=n.$route)==null?void 0:w.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Wj,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",Gj,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const Yj=Ue(jj,[["render",Zj]]),Xj={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Kj={class:"w-full"},Jj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Qj={class:"max-w-sm mx-auto mt-6"},e7={class:"font-medium text-gray-800 dark:text-neutral-200"},t7={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function n7(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",Kj,[f.createElementVNode("div",Jj,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",Qj,[f.createElementVNode("p",e7,f.toDisplayString(t.title),1),f.createElementVNode("p",t7,f.toDisplayString(t.text),1)])])])}const $S=Ue(Xj,[["render",n7]]),i7={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(n){this.$emit("update:modelValue",n),this.$refs.popover.togglePopover()}}},r7={class:"flex w-[160px] flex-wrap gap-[4px]"},s7=["onClick"];function o7(n,e,t,i,r,a){const u=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(u,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:f.normalizeStyle({backgroundColor:t.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",r7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.colors,l=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:l}),onClick:g=>a.updateColor(l),key:l},null,12,s7))),128))])])]),_:1},512)}const jS=Ue(i7,[["render",o7]]),a7={components:{VsChoceColor:jS},props:{item:Object},data(){var n,e,t;return{color:((n=this.item)==null?void 0:n.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(t=this.item)==null?void 0:t.id}},watch:{color(n){this.$emit("update-item",{...this.item,color:n})},text(n){this.$emit("update-item",{...this.item,text:n})},id(n){this.$emit("update-item",{...this.item},n)}}},l7={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},c7={class:"flex flex-col"},u7={class:"flex gap-[30px]"},h7={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},d7={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},p7={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function f7(n,e,t,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",l7,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",c7,[f.createElementVNode("div",u7,[f.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=b=>r.text=b),onUpdateValue:e[2]||(e[2]=b=>r.text=b)},{default:f.withCtx(()=>[f.createElementVNode("p",h7,f.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),f.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=b=>r.id=b),onUpdateValue:e[4]||(e[4]=b=>r.id=b)},{default:f.withCtx(()=>[f.createElementVNode("p",d7,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",p7,f.toDisplayString((g=t.item)==null?void 0:g.parent),1)])])}const m7={components:{VsReesterUsersItem:Ue(a7,[["render",f7]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(n,e){this.draggedItemIndex=e,n.dataTransfer.effectAllowed="move"},dragOver(n){n.preventDefault()},drop(n,e){n.preventDefault();const t=this.draggedItemIndex;if(t!==e){const i=[...this.list],r=i[t];i.splice(t,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(n,e){var i;const t=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(n==null?void 0:n.id));this.list[t]=n,e&&(this.list[t].id=e),this.$emit("update-list",this.list)}}},g7={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},y7=["onDragstart","onDrop"];function _7(n,e,t,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",g7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.list,(l,g)=>(f.openBlock(),f.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:b=>a.dragStart(b,g),onDragover:e[0]||(e[0]=b=>a.dragOver(b)),onDrop:b=>a.drop(b,g),onDragend:e[1]||(e[1]=(...b)=>a.dragEnd&&a.dragEnd(...b))},[f.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,y7))),128))])}const b7={components:{VsNoData:$S,VsChoceColor:jS,IconCheck:Yx,VsReesterUsersList:Ue(m7,[["render",_7],["__scopeId","data-v-87c0b333"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(n,e){var t,i;((t=n==null?void 0:n.query)==null?void 0:t.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var n;this.data=null;try{const{data:e}=await ut.get(`/api/user-cls/${(n=this.$route.query)==null?void 0:n.name}`);this.data=e}catch{}},async addOneChild(){var n,e,t,i;try{const{form:r}=this.$refs;await r.doValidation(),await ut.post("/api/user-cls",{name:(n=this.$route.query)==null?void 0:n.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(t=this.data)==null?void 0:t.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(n){var e,t;this.data.children=n;try{await ut.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((t=this.data)==null?void 0:t.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},x7={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},v7={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},w7={class:"flex items-end w-full gap-[4px]"};function k7(n,e,t,i,r,a){var E,C,P,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),w=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",x7,[(C=(E=n.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",v7,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",w7,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=$=>r.formValues=$),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0),f.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=$=>r.color=$)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...$)=>a.addOneChild&&a.addOneChild(...$)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[f.createVNode(g,{height:"20",width:"20"})])]),(D=(P=r.data)==null?void 0:P.children)!=null&&D.length?(f.openBlock(),f.createBlock(b,{key:0,list:(R=r.data)==null?void 0:R.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(w,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const S7={components:{VsReesterNavList:Yj,VsReesterContent:Ue(b7,[["render",k7]])}},E7={class:"flex items-start gap-0"};function C7(n,e,t,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",E7,[f.createVNode(u),f.createVNode(l)])}const T7=Ue(S7,[["render",C7]]),M7={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},A7={class:"mr-[10px]"},P7={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},I7={class:"flex items-center gap-[6px] ml-auto"},D7={class:"mr-[10px]"},O7={__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(n){var E,C,P,D,R;const{asyncTemplateSlot:e}=(R=(D=(P=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:P.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,t=n,i=CA(),r=TA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${t.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,G,ee,ce;if(!(($=t.slots)!=null&&$.panelLeft))return"div";if((G=t.slots)!=null&&G.panelLeft.includes("<")){const U=e("PanelLeft",(ee=t.slots)==null?void 0:ee.panelLeft,["name"]);u.value=U}else u.value=(ce=t.slots)==null?void 0:ce.panelLeft},w=()=>{var $,G,ee,ce;if(!(($=t.slots)!=null&&$.panelRight))return"div";if((G=t.slots)!=null&&G.panelRight.includes("<")){const U=e("PanelRight",(ee=t.slots)==null?void 0:ee.panelRight,["name"]);a.value=U}else a.value=(ce=t.slots)==null?void 0:ce.panelRight};return b(),w(),($,G)=>{const ee=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",M7,[f.createElementVNode("div",A7,[f.createElementVNode("button",{onClick:l,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",P7,f.toDisplayString(n.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",I7,[f.createElementVNode("div",D7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),n.isHeaderEditButton?(f.openBlock(),f.createBlock(ee,{key:0,to:g.value,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>G[0]||(G[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])):f.createCommentVNode("",!0)])])}}},B7={__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{const w=e("CustomComponent",i.slot,["data"]);t.value=w})(),(w,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{data:n.objectData},null,8,["data"]))}},N7={},z7={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-chevron-down"};function R7(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",z7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const i_=Ue(N7,[["render",R7]]),L7={props:["table","id"],components:{AdminCardHeader:O7,AdminCardAsyncComponent:B7,IconChevron:i_},data(){return{objectData:null,showTabs:!1,component:""}},computed:{getRoute(){const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(t=>{var i,r;return(t==null?void 0:t.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R;if((t=(e=(n=this.objectData)==null?void 0:n.rows)==null?void 0:e[0])!=null&&t.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(b=(g=(l=this.objectData)==null?void 0:l.rows)==null?void 0:g[0])==null?void 0:b.name:((P=(C=(E=(w=this.objectData)==null?void 0:w.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:P.slice(0,35))+" ...";{const $=(D=this.flattenMenu(Jr.value))==null?void 0:D.find(G=>{var ee,ce;return(G==null?void 0:G.table)===((ce=(ee=this.$route)==null?void 0:ee.params)==null?void 0:ce.table)});return((R=this.objectData)==null?void 0:R.title)||($==null?void 0:$.ua)}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent(),addEventListener("reloadCardPage",this.getObjectData)},unmounted(){removeEventListener("reloadCardPage",this.getObjectData)},watch:{component(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,tab:n}})}},methods:{async getObjectData(){var t,i;const n=this.table||((t=this.$route)==null?void 0:t.params.table),e=this.id||((i=this.$route)==null?void 0:i.params.id);(!n||!e)&&this.$router.replace("/404");try{const{data:r}=await ut.get(`/api/table-data/${n}/${e}`);this.objectData=r}catch(r){console.error(r)}},getColClass(n){return`col-span-${n||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var n,e,t,i,r,a,u,l,g;if((e=(n=this.$route)==null?void 0:n.query)!=null&&e.tab)this.component=(i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.tab;else{const b=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(w=>(w==null?void 0:w.type)==="tabs"||(w==null?void 0:w.type)==="vertical-tabs");(u=b==null?void 0:b.items)!=null&&u.length&&(this.component=((l=b.items[0])==null?void 0:l.component)||((g=b.items[0])==null?void 0:g.name))}},getProps(n){var t,i,r;const e={};for(const a in n)["name","component","title","token"].includes(a)||(e[a]=((r=(i=(t=this.objectData)==null?void 0:t.rows)==null?void 0:i[0])==null?void 0:r[n[a]])||n[a]);return e},flattenMenu(n){const e=[];return n==null||n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e}}},V7={style:{height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},F7={key:0,class:"bg-white border rounded-xl"},$7={class:"p-[10px] pl-[20px] text-md font-[500]"},j7=["innerHTML"],U7={key:1},H7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},q7={key:2,class:"p-[20px] border-t"},W7=["innerHTML"],G7={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},Z7=["onClick"],Y7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},X7={key:0,class:"p-[20px] border-t"},K7={key:1,class:"p-[20px] border-t"},J7=["innerHTML"],Q7={key:3,class:"flex"},eU=["onClick"],tU={class:"flex-grow w-[80%]"},nU={key:0,class:"w-full h-full overflow-auto bg-white border rounded-xl [&::-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"},iU={key:0,class:"p-[20px]"},rU={key:1,class:"p-[20px]"},sU=["innerHTML"];function oU(n,e,t,i,r,a){var b,w,E,C;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent"),g=f.resolveComponent("IconChevron");return f.openBlock(),f.createElementBlock("div",V7,[r.objectData&&((b=r.objectData)==null?void 0:b.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(w=r.objectData)==null?void 0:w.slots,isHeaderEditButton:(E=r.objectData)==null?void 0:E.isHeaderEditButton},null,8,["title","get-route","slots","isHeaderEditButton"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((C=r.objectData)==null?void 0:C.panels,(P,D)=>{var R,$,G,ee,ce;return f.openBlock(),f.createElementBlock("div",{key:D,class:f.normalizeClass(a.getColClass(P.col))},[P!=null&&P.name?(f.openBlock(),f.createElementBlock("div",F7,[f.createElementVNode("h2",$7,f.toDisplayString((P==null?void 0:P.title)||"Панель"),1),(R=r.objectData)!=null&&R.html[P==null?void 0:P.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:($=r.objectData)==null?void 0:$.html[P==null?void 0:P.name]},null,8,j7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(G=r.objectData)==null?void 0:G.vue[P==null?void 0:P.name],data:(ce=(ee=r.objectData)==null?void 0:ee.rows)==null?void 0:ce[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):P.type==="container"?(f.openBlock(),f.createElementBlock("div",U7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn;return f.openBlock(),f.createElementBlock("div",{key:Me,class:f.normalizeClass([{"mb-[20px]":P.items.length>1},"bg-white border rounded-xl"])},[U!=null&&U.title?(f.openBlock(),f.createElementBlock("h2",H7,f.toDisplayString((U==null?void 0:U.title)||"Панель"),1)):f.createCommentVNode("",!0),U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":U==null?void 0:U.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({geometry:(Pe=(ke=r.objectData)==null?void 0:ke.rows[0])==null?void 0:Pe.geom,columns:U==null?void 0:U.columns,token:(Be=(Fe=r.objectData)==null?void 0:Fe.tokens)==null?void 0:Be[U==null?void 0:U.token],zoom:16,ref_for:!0},a.getProps(U),{data:r.objectData,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",q7,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Rt=(Mt=r.objectData)==null?void 0:Mt.html)==null?void 0:Rt[U==null?void 0:U.name]},null,8,W7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(zt=(Ft=r.objectData)==null?void 0:Ft.vue)==null?void 0:zt[U==null?void 0:U.name],data:(yn=(Ht=r.objectData)==null?void 0:Ht.rows)==null?void 0:yn[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(P==null?void 0:P.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",G7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P==null?void 0:P.items,U=>(f.openBlock(),f.createElementBlock("button",{key:(U==null?void 0:U.name)||(U==null?void 0:U.component),onClick:Me=>r.component=(U==null?void 0:U.component)||(U==null?void 0:U.name),class:f.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name),"":r.component!==(U==null?void 0:U.component)&&r.component!==(U==null?void 0:U.name)}])},f.toDisplayString(U==null?void 0:U.title),11,Z7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Me},[r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name)?(f.openBlock(),f.createElementBlock("div",Y7,[U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",X7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({data:r.objectData,token:(Pe=(ke=r.objectData)==null?void 0:ke.tokens)==null?void 0:Pe[U==null?void 0:U.token],columns:U==null?void 0:U.columns,geometry:(Be=(Fe=r.objectData)==null?void 0:Fe.rows[0])==null?void 0:Be.geom,ref_for:!0},a.getProps(U),{zoom:16,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",K7,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Mt=r.objectData)==null?void 0:Mt.html[U==null?void 0:U.name]},null,8,J7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Rt=r.objectData)==null?void 0:Rt.vue[U==null?void 0:U.name],data:(zt=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:zt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(P==null?void 0:P.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",Q7,[f.createElementVNode("div",{class:f.normalizeClass(["p-[5px] bg-white absolute left-0 rounded-lg border rounded-tl-[0] rounded-bl-[0]",[{"left-[260px]":r.showTabs}]]),onClick:e[0]||(e[0]=U=>r.showTabs=!r.showTabs)},[f.createVNode(g,{height:"16",width:"16",class:"-rotate-90"})],2),f.createElementVNode("nav",{class:f.normalizeClass(["lg:relative lg:left-0 flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 items-start pl-[10px] bg-white py-[20px] absolute left-[-100%]",[{"left-0 rounded-tr-[0]":r.showTabs}]])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P==null?void 0:P.items,U=>(f.openBlock(),f.createElementBlock("button",{key:(U==null?void 0:U.name)||(U==null?void 0:U.component),onClick:Me=>r.component=(U==null?void 0:U.component)||(U==null?void 0:U.name),class:f.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm text-left whitespace-pre-wrap border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name),"text-gray-500":r.component!==(U==null?void 0:U.component)&&r.component!==(U==null?void 0:U.name)}])},f.toDisplayString(U==null?void 0:U.title),11,eU))),128))],2),f.createElementVNode("div",tU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Me},[r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name)?(f.openBlock(),f.createElementBlock("div",nU,[U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",iU,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({token:(Pe=(ke=r.objectData)==null?void 0:ke.tokens)==null?void 0:Pe[U==null?void 0:U.token],data:r.objectData,columns:U==null?void 0:U.columns,geometry:(Be=(Fe=r.objectData)==null?void 0:Fe.rows[0])==null?void 0:Be.geom,ref_for:!0},a.getProps(U),{zoom:16,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",rU,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Mt=r.objectData)==null?void 0:Mt.html[U==null?void 0:U.name]},null,8,sU)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Rt=r.objectData)==null?void 0:Rt.vue[U==null?void 0:U.name],data:(zt=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:zt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const r_=Ue(L7,[["render",oU],["__scopeId","data-v-1aa05a3c"]]),aU=Object.freeze(Object.defineProperty({__proto__:null,default:r_},Symbol.toStringTag,{value:"Module"})),s_={...cj,...uj,"vs-dashboard":dj,"vs-custom-button":mj,"vs-group-interface":Lj,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String,geom:null},setup(n){return(e,t)=>(f.openBlock(),f.createElementBlock("div",null,f.toDisplayString(n.dataName)+f.toDisplayString(n.geom),1))}},"vs-card-list":r_,...{"card-page":r_,"user-cls-page":T7}},lU=({token:n,api:e,id:t,form:i,method:r,title:a,init:u})=>new Promise(l=>{var P,D,R,$;const{VsDialog:g,VsForm:b}=(D=(P=window.app)==null?void 0:P._context)==null?void 0:D.components,w=document.querySelector("#modal");if(!w){console.error('Modal root element with id "#modal" not found!');return}const E=document.createElement("div");w.appendChild(E);const C=f.createApp({components:{VsDialog:g,VsForm:b},data(){return{visible:!1,formValues:{},scheme:null}},computed:{title(){return a||"Редагувати"}},methods:{close(G){this.visible=!1,this.$el.remove(),C.unmount(),l(G||"Success")},async getFormScheme(){try{if(n){const ee=await ut.get(`/api/table/${n}`);this.formValues=ee.data}u&&(this.formValues=u);const{data:G}=await ut.get(`/api/template/form/${n||i}`);G!=null&&G.obj&&(this.formValues={...this.formValues,...G.obj}),this.scheme=(G==null?void 0:G.schema)||G}catch(G){console.error("Error fetching form scheme:",G)}finally{this.visible=!0}},async updateData(){var ee;const G=this.$refs.form;try{await G.doValidation();const{data:ce}=await ut({method:r||"PUT",url:`${e||"/api/table/"}${n||t||""}`,data:this.formValues});Zf(),this.visible=!1,this.close(ce),this.$notify({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch(ce){this.$notify({title:"Помилка!",type:"error",message:((ee=ce==null?void 0:ce.response)==null?void 0:ee.data)||"Сталася помилка"})}}},mounted(){this.getFormScheme()},template:`
|
741
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:i})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:r,storedMarks:a}=t;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,g=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:b,dispatch:w})=>{if(w&&g&&u){const E=g.filter(C=>l.includes(C.type.name));b.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vF=ks.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,hi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>I0({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Wf=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<Wf&&this.leafAppend(e)||this.length<Wf&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new wF(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},Di.prototype.map=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},t,i),r},Di.from=function(e){return e instanceof Di?e:e&&e.length?new SS(e):Di.empty};var SS=function(n){function e(i){n.call(this),this.values=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var g=a;g<u;g++)if(r(this.values[g],l+g)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var g=a-1;g>=u;g--)if(r(this.values[g],l+g)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Wf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Wf)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Di);Di.empty=new SS([]);var wF=function(n){function e(t,i){n.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Di);const kF=500;class Us{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;t&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,g,b=[],w=[];return this.items.forEach((E,C)=>{if(!E.step){r||(r=this.remapping(i,C+1),a=r.maps.length),a--,w.push(E);return}if(r){w.push(new co(E.map));let P=E.step.map(r.slice(a)),D;P&&u.maybeStep(P).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new co(D,void 0,void 0,b.length+w.length))),a--,D&&r.appendMap(D,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,g=new Us(this.items.slice(0,i).append(w.reverse().concat(b)),this.eventCount-1),!1},this.items.length,0),{remaining:g,transform:u,selection:l}}addTransform(e,t,i,r){let a=[],u=this.eventCount,l=this.items,g=!r&&l.length?l.get(l.length-1):null;for(let w=0;w<e.steps.length;w++){let E=e.steps[w].invert(e.docs[w]),C=new co(e.mapping.maps[w],E,t),P;(P=g&&g.merge(C))&&(C=P,w?a.pop():l=l.slice(0,l.length-1)),a.push(C),t&&(u++,t=void 0),r||(g=C)}let b=u-i.depth;return b>EF&&(l=SF(l,b),u-=b),new Us(l.append(a),u)}remapping(e,t){let i=new Pc;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,t),i}addMaps(e){return this.eventCount==0?this:new Us(this.items.append(e.map(t=>new co(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-t),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=t;this.items.forEach(C=>{let P=a.getMirror(--g);if(P==null)return;u=Math.min(u,P);let D=a.maps[P];if(C.step){let R=e.steps[P].invert(e.docs[P]),$=C.selection&&C.selection.map(a.slice(g+1,P));$&&l++,i.push(new co(D,R,$))}else i.push(new co(D))},r);let b=[];for(let C=t;C<u;C++)b.push(new co(a.maps[C]));let w=this.items.slice(0,r).append(b).append(i),E=new Us(w,l);return E.emptyItemCount()>kF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),i=t.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let g=u.step.map(t.slice(i)),b=g&&g.getMap();if(i--,b&&t.appendMap(b,i),g){let w=u.selection&&u.selection.map(t.slice(i));w&&a++;let E=new co(b.invert(),g,w),C,P=r.length-1;(C=r.length&&r[P].merge(E))?r[P]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Di.from(r.reverse()),a)}}Us.empty=new Us(Di.empty,0);function SF(n,e){let t;return n.forEach((i,r)=>{if(i.selection&&e--==0)return t=r,!1}),n.slice(t)}class co{constructor(e,t,i,r){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new co(t.getMap().invert(),t,this.selection)}}}class Ta{constructor(e,t,i,r,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const EF=20;function CF(n,e,t,i){let r=t.getMeta(zl),a;if(r)return r.historyState;t.getMeta(AF)&&(n=new Ta(n.done,n.undone,null,0,-1));let u=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(u&&u.getMeta(zl))return u.getMeta(zl).redo?new Ta(n.done.addTransform(t,void 0,i,Gf(e)),n.undone,ES(t.mapping.maps),n.prevTime,n.prevComposition):new Ta(n.done,n.undone.addTransform(t,void 0,i,Gf(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),g=n.prevTime==0||!u&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-i.newGroupDelay||!TF(t,n.prevRanges)),b=u?X0(n.prevRanges,t.mapping):ES(t.mapping.maps);return new Ta(n.done.addTransform(t,g?e.selection.getBookmark():void 0,i,Gf(e)),Us.empty,b,t.time,l??n.prevComposition)}else return(a=t.getMeta("rebased"))?new Ta(n.done.rebased(t,a),n.undone.rebased(t,a),X0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ta(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),X0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function TF(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(t=!0)}),t}function ES(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((i,r,a,u)=>e.push(a,u));return e}function X0(n,e){if(!n)return null;let t=[];for(let i=0;i<n.length;i+=2){let r=e.map(n[i],1),a=e.map(n[i+1],-1);r<=a&&t.push(r,a)}return t}function MF(n,e,t){let i=Gf(e),r=zl.get(e).spec.config,a=(t?n.undone:n.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(t?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ta(t?l:a.remaining,t?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(zl,{redo:t,historyState:g})}let K0=!1,CS=null;function Gf(n){let e=n.plugins;if(CS!=e){K0=!1,CS=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){K0=!0;break}}return K0}const zl=new Ir("history"),AF=new Ir("closeHistory");function PF(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ui({key:zl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,t,i){return CF(t,i,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let i=t.inputType,r=i=="historyUndo"?MS:i=="historyRedo"?AS:null;return r?(t.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function TS(n,e){return(t,i)=>{let r=zl.getState(t);if(!r||(n?r.undone:r.done).eventCount==0)return!1;if(i){let a=MF(r,t,n);a&&i(e?a.scrollIntoView():a)}return!0}}const MS=TS(!1,!0),AS=TS(!0,!0),IF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>MS(n,e),redo:()=>({state:n,dispatch:e})=>AS(n,e)}},addProseMirrorPlugins(){return[PF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),DF=ks.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",hi(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{selection:t}=e,{$from:i,$to:r}=t,a=n();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):A2(t)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var g;if(l){const{$to:b}=u.selection,w=b.end();if(b.nodeAfter)b.nodeAfter.isTextblock?u.setSelection(jt.create(u.doc,b.pos+1)):b.nodeAfter.isBlock?u.setSelection(Bt.create(u.doc,b.pos)):u.setSelection(jt.create(u.doc,b.pos));else{const E=(g=b.parent.type.contentMatch.defaultType)===null||g===void 0?void 0:g.create();E&&(u.insert(w,E),u.setSelection(jt.create(u.doc,w+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[cL({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),OF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,BF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,NF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,RF=so.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qc({find:OF,type:this.type}),qc({find:NF,type:this.type})]},addPasteRules(){return[Wc({find:BF,type:this.type}),Wc({find:zF,type:this.type})]}}),LF=ks.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",hi(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),VF="listItem",PS="textStyle",IS=/^(\d+)\.\s$/,FF=ks.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",hi(this.options.HTMLAttributes,t),0]:["ol",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VF,this.editor.getAttributes(PS)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Rh({find:IS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Rh({find:IS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(PS)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),$F=ks.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,UF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,HF=so.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qc({find:jF,type:this.type})]},addPasteRules(){return[Wc({find:UF,type:this.type})]}}),DS=ks.create({name:"text",group:"inline"}),qF=Ii.create({name:"starterKit",addExtensions(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$,G;const ee=[];return this.options.bold!==!1&&ee.push(eF.configure((n=this.options)===null||n===void 0?void 0:n.bold)),this.options.blockquote!==!1&&ee.push(YV.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ee.push(nF.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&ee.push(sF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ee.push(kS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ee.push(lF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ee.push(hF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ee.push(bF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ee.push(xF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&ee.push(vF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&ee.push(IF.configure((w=this.options)===null||w===void 0?void 0:w.history)),this.options.horizontalRule!==!1&&ee.push(DF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ee.push(RF.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&ee.push(LF.configure((P=this.options)===null||P===void 0?void 0:P.listItem)),this.options.orderedList!==!1&&ee.push(FF.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&ee.push($F.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&ee.push(HF.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&ee.push(DS.configure((G=this.options)===null||G===void 0?void 0:G.text)),ee}}),WF=so.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=E0(n,this.type);return Object.entries(t).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),GF=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;return(e=n.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function ZF(n){var e;const{char:t,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=n,l=uL(t),g=new RegExp(`\\s${l}$`),b=a?"^":"",w=i?new RegExp(`${b}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${b}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const C=u.pos-E.length,P=Array.from(E.matchAll(w)).pop();if(!P||P.input===void 0||P.index===void 0)return null;const D=P.input.slice(Math.max(0,P.index-1),P.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+P.index;let G=$+P[0].length;return i&&g.test(E.slice(G-1,G+1))&&(P[0]+=" ",G+=1),$<u.pos&&G>=u.pos?{range:{from:$,to:G},query:P[0].slice(t.length),text:P[0]}:null}const YF=new Ir("suggestion");function XF({pluginKey:n=YF,editor:e,char:t="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:g=()=>null,items:b=()=>[],render:w=()=>({}),allow:E=()=>!0,findSuggestionMatch:C=ZF}){let P;const D=w==null?void 0:w(),R=new Ui({key:n,view(){return{update:async($,G)=>{var ee,ce,U,Me,ke,Pe,Fe;const Be=(ee=this.key)===null||ee===void 0?void 0:ee.getState(G),pt=(ce=this.key)===null||ce===void 0?void 0:ce.getState($.state),tt=Be.active&&pt.active&&Be.range.from!==pt.range.from,Nt=!Be.active&&pt.active,rt=Be.active&&!pt.active,Mt=!Nt&&!rt&&Be.query!==pt.query,Rt=Nt||tt&&Mt,Ft=Mt||tt,zt=rt||tt&&Mt;if(!Rt&&!Ft&&!zt)return;const Ht=zt&&!Rt?Be:pt,yn=$.dom.querySelector(`[data-decoration-id="${Ht.decorationId}"]`);P={editor:e,range:Ht.range,query:Ht.query,text:Ht.text,items:[],command:dn=>g({editor:e,range:Ht.range,props:dn}),decorationNode:yn,clientRect:yn?()=>{var dn;const{decorationId:wn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${wn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Rt&&((U=D==null?void 0:D.onBeforeStart)===null||U===void 0||U.call(D,P)),Ft&&((Me=D==null?void 0:D.onBeforeUpdate)===null||Me===void 0||Me.call(D,P)),(Ft||Rt)&&(P.items=await b({editor:e,query:Ht.query})),zt&&((ke=D==null?void 0:D.onExit)===null||ke===void 0||ke.call(D,P)),Ft&&((Pe=D==null?void 0:D.onUpdate)===null||Pe===void 0||Pe.call(D,P)),Rt&&((Fe=D==null?void 0:D.onStart)===null||Fe===void 0||Fe.call(D,P))},destroy:()=>{var $;P&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,P))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,G,ee,ce){const{isEditable:U}=e,{composing:Me}=e.view,{selection:ke}=$,{empty:Pe,from:Fe}=ke,Be={...G};if(Be.composing=Me,U&&(Pe||e.view.composing)){(Fe<G.range.from||Fe>G.range.to)&&!Me&&!G.composing&&(Be.active=!1);const pt=C({char:t,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:ke.$from}),tt=`id_${Math.floor(Math.random()*4294967295)}`;pt&&E({editor:e,state:ce,range:pt.range,isActive:G.active})?(Be.active=!0,Be.decorationId=G.decorationId?G.decorationId:tt,Be.range=pt.range,Be.query=pt.query,Be.text=pt.text):Be.active=!1}else Be.active=!1;return Be.active||(Be.decorationId=null,Be.range={from:0,to:0},Be.query=null,Be.text=null),Be}},props:{handleKeyDown($,G){var ee;const{active:ce,range:U}=R.getState($.state);return ce&&((ee=D==null?void 0:D.onKeyDown)===null||ee===void 0?void 0:ee.call(D,{view:$,event:G,range:U}))||!1},decorations($){const{active:G,range:ee,decorationId:ce}=R.getState($);return G?mi.create($.doc,[Yr.inline(ee.from,ee.to,{nodeName:u,class:l,"data-decoration-id":ce})]):null}}});return R}const KF=new Ir("mention"),JF=ks.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:n,node:e}){var t;return`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e}){var t;return["span",hi(this.HTMLAttributes,n.HTMLAttributes),`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`]},suggestion:{char:"@",pluginKey:KF,command:({editor:n,range:e,props:t})=>{var i,r,a;const u=n.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),n.chain().focus().insertContentAt(e,[{type:this.name,attrs:t},{type:"text",text:" "}]).run(),(a=(r=n.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:n,range:e})=>{const t=n.doc.resolve(e.from),i=n.schema.nodes[this.name];return!!t.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:n,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",hi({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:n})];const t={...this.options};t.HTMLAttributes=hi({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:t,node:n});return typeof i=="string"?["span",hi({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:n}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:n})):this.options.renderText({options:this.options,node:n})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return t=!0,n.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),t):!1})}},addProseMirrorPlugins(){return[XF({editor:this.editor,...this.options.suggestion})]}}),QF=so.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",hi(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),e6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function t6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[f.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const n6=Ue(e6,[["render",t6]]),i6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function r6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const s6=Ue(i6,[["render",r6]]),o6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function a6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const l6=Ue(o6,[["render",a6]]),c6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function u6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const h6=Ue(c6,[["render",u6]]),d6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function p6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("bold")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),f.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const f6=Ue(d6,[["render",p6]]),m6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function g6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("italic")}])},e[1]||(e[1]=[f.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),f.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const y6=Ue(m6,[["render",g6]]),_6={},b6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function x6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",b6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const v6={components:{IconA:Ue(_6,[["render",x6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(n){this.editor&&(this.editor.chain().focus().setColor(n).run(),this.$refs.popover.togglePopover(),this.color=n)}}},w6={class:"relative flex"},k6={class:"flex w-[160px] flex-wrap gap-[4px]"},S6=["onClick"];function E6(n,e,t,i,r,a){const u=f.resolveComponent("IconA"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",w6,[f.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),f.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:f.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",k6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.colors,g=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:g}),onClick:b=>a.setColor(g),key:g},null,12,S6))),128))])])]),_:1},512)}const C6=Ue(v6,[["render",E6]]),T6={},M6={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-dots-vertical"};function A6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",M6,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),f.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const J0=Ue(T6,[["render",A6]]),P6={components:{IconMore:J0},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function I6(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:f.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":t.editor.isActive("underline")||t.editor.isActive("strike")}])},[f.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=(...g)=>a.toggleUnderline&&a.toggleUnderline(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":t.editor.isActive("underline")}])}," Підкресленний ",2),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...g)=>a.toggleStrike&&a.toggleStrike(...g)),class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":t.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const D6={bold:f6,italic:y6,text_more:Ue(P6,[["render",I6]]),color:C6,bullet_list:s6,ordered_list:l6,blockquote:n6,codeblock:h6},O6={components:{EditorContent:GV},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(D6).filter(([n])=>this.controls.includes(n)).map(([n,e])=>e)}},watch:{modelValue(n){this.editor&&this.editor.getHTML()!==n&&this.editor.commands.setContent(n)},editor(n){n&&this.editor.on("update",({editor:e})=>{const t=e.getHTML();t!==this.modelValue&&this.$emit("update:modelValue",t)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new WV({content:this.modelValue,extensions:[qF,kS,WF,GF,QF,DS,JF.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:n})=>{const e=this.options.filter(t=>{var i,r;return(r=(i=t==null?void 0:t.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(n==null?void 0:n.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let n,e;return{onStart:t=>{n=document.createElement("div"),n.className="mention-popup",t.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{t.command({id:a.id,label:a.email})})),n.appendChild(u)}),document.body.appendChild(n);const{from:i}=t.range,r=t.editor.view.coordsAtPos(i);n.style.position="absolute",n.style.left=`${r.left}px`,n.style.top=`${r.top-n.offsetHeight}px`,e=n},onUpdate:t=>{for(;n.firstChild;)n.removeChild(n.firstChild);t.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{t.command({id:a.id,label:a.email})})),n.appendChild(u)});const{from:i}=t.range,r=t.editor.view.coordsAtPos(i);n.style.left=`${r.left}px`,n.style.top=`${r.top-n.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},B6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},N6={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function z6(n,e,t,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",B6,[r.editor?(f.openBlock(),f.createElementBlock("div",N6,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.controlsList,(l,g)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(l),{key:g,editor:r.editor},null,8,["editor"]))),128))])):f.createCommentVNode("",!0),f.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[f.createVNode(u,{editor:r.editor,class:"relative w-full"},null,8,["editor"])])])}const OS=Ue(O6,[["render",z6]]),R6=n=>{const e=/(\b\S)?/g,t=n.match(e);return t?t.join("").toUpperCase():""},L6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return R6(this.name)}}},V6={class:"mr-2"},F6=["src"],$6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},j6={key:0},U6={key:1,class:"text-sm"};function H6(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",V6,[t.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:t.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,F6)):t.name?(f.openBlock(),f.createElementBlock("div",$6,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",j6,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",U6,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const q6={components:{VsWidgetCommentsAvatar:Ue(L6,[["render",H6]]),VsTextEditor:OS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const n=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(n).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(n){n&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await ut.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await ut.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},W6={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},G6={class:"flex justify-between items-center mb-2"},Z6={class:"flex items-center"},Y6={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},X6={class:"text-sm text-gray-600 dark:text-gray-400"},K6={class:"flex flex-col items-center gap-[4px]"},J6=["innerHTML"],Q6={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},e$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function t$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAvatar"),l=f.resolveComponent("VsPopover"),g=f.resolveComponent("VsTextEditor"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",W6,[f.createElementVNode("div",G6,[f.createElementVNode("div",Z6,[f.createElementVNode("p",Y6,[f.createVNode(u,{name:t.comment.username,avatar:t.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(t.comment.username),1)]),f.createElementVNode("p",X6,[f.createElementVNode("time",null,f.toDisplayString(a.createDate),1)])]),f.createVNode(l,{placement:"bottom"},{reference:f.withCtx(()=>e[6]||(e[6]=[f.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[f.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[f.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:f.withCtx(()=>[f.createElementVNode("div",K6,[f.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...w)=>a.openEditModal&&a.openEditModal(...w))}," Редагувати "),f.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=w=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),f.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:t.comment.body},null,8,J6)]),f.createVNode(b,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=w=>r.isOpen=w),title:"Редагувати",size:"small"},{footer:f.withCtx(()=>[f.createElementVNode("div",e$,[f.createElementVNode("button",{onClick:e[3]||(e[3]=w=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...w)=>a.updateComment&&a.updateComment(...w)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:f.withCtx(()=>[f.createElementVNode("div",Q6,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=w=>r.textareaValue=w),options:t.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const n$={components:{VsWidgetCommentsItem:Ue(q6,[["render",t$]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:n}=await ut.get(`/api/widget/comment/${this.id}`);this.comments=n.rows,this.user=n.user}catch(n){this.isLoadFailed=!0,console.error(n)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(n){const e={...n};return n.cancel||(e.cancel=()=>{this.isModalVisible=!1}),n.updateListOnConfirm&&(e.confirm=async()=>{await n.confirm(),this.isModalVisible=!1}),e},handleOpenModal(n){this.modal=this.prepareModal(n),this.isModalVisible=!0}}},i$={class:"flex flex-col"},r$={key:0,class:"max-h-[300px] 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"},s$={key:1},o$={class:"p-4"},a$={class:"mt-1 text-gray-500 dark:text-neutral-500"},l$={class:"mt-4 flex justify-end gap-x-3"};function c$(n,e,t,i,r,a){const u=f.resolveComponent("VsErrorOnLoading"),l=f.resolveComponent("VsWidgetCommentsItem"),g=f.resolveComponent("VsLoader"),b=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock("div",i$,[r.isLoaded?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[r.isLoadFailed?(f.openBlock(),f.createBlock(u,{key:0})):(f.openBlock(),f.createElementBlock(f.Fragment,{key:1},[r.comments.length?(f.openBlock(),f.createElementBlock("div",r$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.comments,(w,E)=>(f.openBlock(),f.createBlock(l,{key:E,comment:w,user:r.user,options:t.options,index:E,id:t.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=C=>a.handleOpenModal(C))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(f.openBlock(),f.createElementBlock("div",s$,e[4]||(e[4]=[f.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(f.openBlock(),f.createBlock(g,{key:1,class:"justify-center",text:"Please wait..."})),f.createVNode(b,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=w=>r.isModalVisible=w)},{default:f.withCtx(()=>[f.createElementVNode("div",o$,[f.createElementVNode("p",a$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",l$,[f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm 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",onClick:e[1]||(e[1]=(...w)=>r.modal.cancel&&r.modal.cancel(...w))},f.toDisplayString(r.modal.cancelButtonText),1),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...w)=>r.modal.confirm&&r.modal.confirm(...w))},f.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const u$=Ue(n$,[["render",c$]]),h$={components:{VsTextEditor:OS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await ut.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(n){console.error(n)}},setNewContent(n){this.commentContent=n}}},d$={class:"flex flex-col items-start w-full widget-comment-form"},p$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},f$={class:"flex"};function m$(n,e,t,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",d$,[f.createElementVNode("div",p$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:t.options},null,8,["modelValue","options"])]),f.createElementVNode("div",f$,[f.createElementVNode("button",{ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const g$={components:{VsWidgetCommentsList:u$,VsWidgetCommentsAddForm:Ue(h$,[["render",m$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(n){this.$emit("count-change",n.length)}},methods:{async getUsersList(){try{const{data:n}=await ut.get("/api/suggest/core.user_mentioned");this.options=n}catch(n){console.log(n)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},y$={class:"w-full bg-white-200"};function _$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",y$,[e[2]||(e[2]=f.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),f.createVNode(u,{options:r.options,class:"mb-6",id:t.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:t.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":t.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const BS=Ue(g$,[["render",_$]]),NS=n=>new Date(n).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),b$=n=>new Date(n).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),x$=n=>{const e=/(\b\S)?/g,t=n.match(e);return t?t.join("").toUpperCase():""},v$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return x$(this.username)}}}),w$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function k$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",w$,f.toDisplayString(n.inItials),1)}const S$=Ue(v$,[["render",k$]]),Q0={load(){try{const n=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,t=n.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(t.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(n){console.log(n)}},promise(n){return new Promise((e,t)=>{Q0.load(n,()=>{e()})})},loadFile1(n){let e=!1;typeof n=="object"&&(e=n.type,n=n.url);const t=n.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${t}`],window.headLoadedFiles[t]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${t}`]?u=window.headLoadedFiles[`_${t}`]:(t.includes(".css")?(u=document.createElement("link"),u.href=n,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=n,e&&(u.type=e)),window.headLoadedFiles[`_${t}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},E$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await Q0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await Q0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const n=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(n),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(n).bindTooltip(this.tooltipText)}}},C$={id:"map",style:{height:"9rem",width:"24rem"}};function T$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",C$)}const M$=Ue(E$,[["render",T$]]),A$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:S$,VsWidgetHistoryItemMap:M$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(n){return n.title||n.attr},getOldValue(n){return n.old||"Не вказано"},getNewValue(n){return n.new||"Не вказано"},getDate(n){return b$(n.cdate)}}}),P$={class:"relative [&_p]:m-0"},I$={class:"flex items-center gap-3"},D$={class:"w-full flex justify-between"},O$={class:"text-gray-500"},B$={class:"text-gray-800 font-medium"},N$={class:"text-gray-500 text-sm"},z$={class:"mt-2 pl-10"},R$={key:0},L$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},V$={class:"font-medium"},F$={class:"font-medium"};function $$(n,e,t,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",P$,[f.createElementVNode("div",I$,[f.createVNode(u,{username:n.item.username},null,8,["username"]),f.createElementVNode("div",D$,[f.createElementVNode("p",O$,[f.createElementVNode("span",B$,f.toDisplayString(n.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",N$,f.toDisplayString(n.getDate(n.item)),1)])]),f.createElementVNode("div",z$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",R$,[e[1]||(e[1]=f.createElementVNode("p",null,"Додана геометрія:",-1)),g.new?(f.openBlock(),f.createBlock(l,{key:0,point:g.new},null,8,["point"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createElementBlock("div",L$,[f.createElementVNode("p",null,f.toDisplayString(`- ${n.getTitle(g)}:`),1),f.createElementVNode("p",V$,f.toDisplayString(n.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",F$,f.toDisplayString(n.getNewValue(g)),1)]))]))),128))])])}const j$=Ue(A$,[["render",$$]]),U$=f.defineComponent({components:{VsWidgetHistoryItem:j$,VsEmptyWidget:Yv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?NS(this.history.data.cdate):""},lastEditDate(){return this.history.data?NS(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:n}=await ut.get(`/api/widget/history/${this.id}`);this.history=n}catch(n){console.error(n)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(n){this.$emit("count-change",n.length)}}}),H$={class:"bg-white"},q$={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] 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"},W$={key:1,class:"w-full h-[330px] flex items-center justify-center"};function G$(n,e,t,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",H$,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=n.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",q$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.history.rows,g=>(f.openBlock(),f.createElementBlock("li",{class:"list-none mr-[10px]",key:g.uid},[f.createVNode(u,{item:g},null,8,["item"])]))),128))])):(f.openBlock(),f.createElementBlock("div",W$," Історія відсутні "))])}const Z$=Ue(U$,[["render",G$]]),Y$={},X$={class:"flex-shrink-0 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 K$(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",X$,e[0]||(e[0]=[f.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const zS=Ue(Y$,[["render",K$]]),J$={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},Q$={style:{display:"none"}},e8=["height","width","fill"];function t8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createElementBlock("svg",Q$,e[0]||(e[0]=[f.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[f.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(f.openBlock(),f.createElementBlock("svg",{height:t.height,width:t.width,fill:t.color},e[1]||(e[1]=[f.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,e8))],64)}const RS=Ue(J$,[["render",t8]]),n8={class:"hs-dropdown [--placement:bottom-right] inline-flex"},i8={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"},r8={class:"flex flex-col items-start"},s8={key:0,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},o8={class:"p-4"},a8={class:"flex justify-end mt-4 gap-x-3"},LS={__name:"vs-widget-table-controls",props:{},emits:["updateTable"],setup(n,{emit:e}){const t=n,i=f.ref(!1);f.ref({});const r=()=>{i.value=!0,document.body.click()},a=async()=>{},u=async()=>{};return f.onMounted(()=>{t.isForm&&a()}),(l,g)=>{const b=f.resolveComponent("router-link"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",n8,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",i8,[f.createVNode(J0,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D;return[f.createElementVNode("div",r8,[f.createVNode(b,{to:`/edit?table=${(P=(C=l.$route)==null?void 0:C.params)==null?void 0:P.catchAll}&id=${(D=l.item)==null?void 0:D.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:f.withCtx(()=>[f.createVNode(RS,{color:"#000"}),g[2]||(g[2]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"]),l.isForm?(f.openBlock(),f.createElementBlock("div",s8)):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:f.withModifiers(r,["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"},[f.createVNode(zS),g[3]||(g[3]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]}),_:1})]),f.createVNode(E,{visible:i.value,"onUpdate:visible":g[1]||(g[1]=C=>i.value=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",o8,[g[4]||(g[4]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",a8,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:g[0]||(g[0]=C=>i.value=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:u}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}}},l8={class:"h-full"},c8={class:"inline-block w-full align-middle"},u8={class:"relative min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},h8={class:"dark:bg-neutral-700 sticky top-[-1px] bg-white"},d8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px]"},p8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},f8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},m8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},g8={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},y8={key:0,class:"h-[60px] flex items-center justify-center"},Zh=10,_8={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String,api:{type:String,default:()=>""},controls:{type:Array,default:()=>[]}},setup(n){const e=n,t=f.ref([]),i=f.ref([]),r=f.ref(1),a=async()=>{try{const{data:g}=await ut.get((e!=null&&e.api?e.api:"/api/table-data")+(e.token?`/${e.token}`:""));t.value=g.rows,i.value=(g==null?void 0:g.columns)||(e==null?void 0:e.columns)}catch(g){console.error("Ошибка при загрузке данных таблицы:",g)}},u=g=>{r.value=g},l=f.computed(()=>{var b;const g=(r.value-1)*Zh;return(b=t.value)==null?void 0:b.slice(g,g+Zh)});return f.onMounted(()=>{a()}),(g,b)=>{var E,C,P,D,R;const w=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",l8,[f.createElementVNode("div",{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",style:f.normalizeStyle({height:((E=t.value)==null?void 0:E.length)>Zh?"calc(100% - 60px)":"100%"})},[f.createElementVNode("div",c8,[f.createElementVNode("table",u8,[(C=i.value)!=null&&C.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",h8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,($,G)=>(f.openBlock(),f.createElementBlock("th",{key:G,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},f.toDisplayString(($==null?void 0:$.title)||($==null?void 0:$.description)),1))),128)),(P=n.controls)!=null&&P.length?(f.openBlock(),f.createElementBlock("th",d8)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.value,($,G)=>{var ee;return f.openBlock(),f.createElementBlock("tr",{key:G},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(ce,U)=>(f.openBlock(),f.createElementBlock("td",{key:U,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString($==null?void 0:$[ce.name]),1))),128)),(ee=n.controls)!=null&&ee.length?(f.openBlock(),f.createElementBlock("td",f8,[f.createVNode(LS)])):f.createCommentVNode("",!0)])}),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",m8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.value,($,G)=>{var ee;return f.openBlock(),f.createElementBlock("tr",{key:G},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($,(ce,U)=>(f.openBlock(),f.createElementBlock("td",{key:U,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(ce),1))),128)),(ee=n.controls)!=null&&ee.length?(f.openBlock(),f.createElementBlock("td",g8,[f.createVNode(LS)])):f.createCommentVNode("",!0)])}),128))]))])])],4),((D=t.value)==null?void 0:D.length)>Zh?(f.openBlock(),f.createElementBlock("div",y8,[f.createVNode(w,{goTo:!1,"default-page":1,total:(R=t.value)==null?void 0:R.length,class:"w-fit",pageSize:Zh,onPageChange:u,backgroundColor:"#F3F4F6"},null,8,["total"])])):f.createCommentVNode("",!0)])}}},b8={},x8={class:"shrink-0",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"};function v8(n,e){return f.openBlock(),f.createElementBlock("svg",x8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),f.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const w8=Ue(b8,[["render",v8]]),k8={},S8={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function E8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",S8,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),f.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const VS=Ue(k8,[["render",E8]]),C8={},T8={class:"shrink-0 size-4",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"};function M8(n,e){return f.openBlock(),f.createElementBlock("svg",T8,e[0]||(e[0]=[f.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),f.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const A8=Ue(C8,[["render",M8]]),P8={class:"relative shrink-0"},I8=["src"],D8={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},O8={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},B8={class:"grow"},N8={class:"text-xs text-gray-500 dark:text-neutral-500"},z8={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},R8={class:"text-sm text-gray-500 dark:text-neutral-500"},L8={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},V8={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(n,{emit:e}){const t=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await ut.get(`/api/notification-read/${(l=n.item)==null?void 0:l.id}`),await t("update-notification")}catch{}};return(l,g)=>{var w,E,C,P,D,R;const b=f.resolveComponent("VsPopover");return f.openBlock(),f.createElementBlock("li",{class:f.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(w=n.item)!=null&&w.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",P8,[(E=n.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=n.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,I8)):(f.openBlock(),f.createElementBlock("div",D8,[f.createVNode(VS)])),(P=n.item)!=null&&P.read?(f.openBlock(),f.createElementBlock("span",O8)):f.createCommentVNode("",!0)]),f.createElementVNode("div",B8,[f.createElementVNode("p",N8,[f.createVNode(ry,{name:"cdate",data:n.item},null,8,["data"])]),f.createElementVNode("span",z8,f.toDisplayString((D=n.item)==null?void 0:D.author),1),f.createElementVNode("p",R8,f.toDisplayString((R=n.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",L8,[f.createVNode(b,{trigger:"hover",placement:"left"},{reference:f.withCtx(()=>[f.createElementVNode("button",{onClick:u,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[f.createVNode(A8)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},F8={},$8={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 j8(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",$8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),f.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const U8=Ue(F8,[["render",j8]]),H8={},q8={class:"shrink-0 size-4",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"};function W8(n,e){return f.openBlock(),f.createElementBlock("svg",q8,e[0]||(e[0]=[f.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),f.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const G8=Ue(H8,[["render",W8]]),Z8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Y8={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},X8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},K8={class:"max-w-sm mx-auto mt-6"},J8={class:"font-medium text-gray-800 dark:text-neutral-200"},Q8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function ej(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",Y8,[f.createElementVNode("div",null,[f.createElementVNode("div",X8,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",K8,[f.createElementVNode("p",J8,f.toDisplayString(t.title),1),f.createElementVNode("p",Q8,f.toDisplayString(t.text),1)])])])])}const e_=Ue(Z8,[["render",ej]]),tj={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},nj={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},ij={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},rj={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},sj={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},oj={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},aj={key:0},lj={key:1},FS={__name:"admin-notification",setup(n){const e=f.ref(0),t=f.ref([]),i=f.ref(!1),r=f.ref(null),{$notify:a}=f.getCurrentInstance().proxy,u=b=>{r.value&&!r.value.contains(b.target)&&(i.value=!1)};f.watch(i,b=>{b?window.addEventListener("click",u):window.removeEventListener("click",u)}),f.onBeforeUnmount(()=>{window.removeEventListener("click",u)});const l=async()=>{try{const{data:b}=await ut.get("/api/notification");t.value=(b==null?void 0:b.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await ut.get("/api/notification-read"),await l()}catch{a({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(b,w)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"notificationRef",ref:r,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[f.createElementVNode("button",{onClick:w[0]||(w[0]=E=>i.value=!i.value),class:"hs-tooltip-toggle relative 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"},[f.createVNode(U8,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",tj,[w[1]||(w[1]=f.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),f.createElementVNode("span",nj,f.toDisplayString(e.value),1)])):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,null,{default:f.withCtx(()=>{var E;return[i.value?(f.openBlock(),f.createElementBlock("div",ij,[f.createElementVNode("div",rj,[w[2]||(w[2]=f.createElementVNode("nav",{class:"flex"},[f.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),f.createElementVNode("button",sj,[f.createVNode(G8)])]),f.createElementVNode("div",oj,[(E=t.value)!=null&&E.length?(f.openBlock(),f.createElementBlock("ul",aj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.value,C=>(f.openBlock(),f.createBlock(V8,{key:C==null?void 0:C.id,item:C,onUpdateNotification:l},null,8,["item"]))),128))])):(f.openBlock(),f.createElementBlock("div",lj,[f.createVNode(e_,{class:"[&>div>div]:min-h-[300px]",text:""})]))]),f.createElementVNode("button",{onClick:g,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[f.createVNode(w8,{height:"16",width:"16"}),w[3]||(w[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},cj={"vs-widget-map":sy,"vs-widget-gallery":vz,"vs-widget-comments":BS,"vs-widget-file":Kv,"vs-widget-history":Z$,"vs-widget-table":_8,"admin-notifications":FS},uj={"table-format-text":gp,"table-format-select":Xx,"table-format-badge":Zx,"table-format-swetch":yp,"table-format-check":yp,"table-format-html":gp,"table-format-tags":Kx,"table-format-date":ry,"table-format-number":Y1,"table-format-slot":X1},hj={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},dj={__name:"vs-dashboard",setup(n){return(e,t)=>(f.openBlock(),f.createElementBlock("div",hj,t[0]||(t[0]=[f.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"mb-4 xl:mb-8"},[f.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),f.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),f.createElementVNode("div",{class:"space-y-5"},[f.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[f.createElementVNode("div",{class:"relative w-full"},[f.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[f.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",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"},[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),f.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),f.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),f.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[f.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[f.createElementVNode("span",{class:"sr-only"},"Close"),f.createElementVNode("svg",{class:"shrink-0 size-4",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"},[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),f.createElementVNode("path",{d:"m15 9-6 6"}),f.createElementVNode("path",{d:"m9 9 6 6"})])])])]),f.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[f.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm 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"},[f.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",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"},[f.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),f.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),f.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),f.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[f.createElementVNode("span",{class:"hidden sm:block"},"Send"),f.createTextVNode("Invite ")])])]),f.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),f.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),f.createElementVNode("div",{class:"hs-tooltip inline-block"},[f.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[f.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),f.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),f.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),f.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[f.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[f.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),f.createElementVNode("div",{class:"flex items-center -space-x-2"})]),f.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),f.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-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"},[f.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[f.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("thead",null,[f.createElementVNode("tr",null,[f.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[f.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),f.createElementVNode("th",{scope:"col",class:"min-w-48"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),f.createElementVNode("th",{scope:"col",class:"min-w-36"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),f.createElementVNode("th",{scope:"col"},[f.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),f.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),f.createTextVNode(" Active ")])])]),f.createElementVNode("tr",null,[f.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[f.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[f.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),f.createElementVNode("div",{class:"grow"},[f.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),f.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[f.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[f.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),f.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},pj={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function fj(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",{onClick:e[0]||(e[0]=(...u)=>a.notify&&a.notify(...u)),class:"py-2 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"}," Custom component ")}const mj=Ue(pj,[["render",fj]]),gj={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(n){this.toggletMap[n]=!this.toggletMap[n],this.$emit("on:toggled",{optionID:n,toggled:this.toggletMap[n]})}}},yj={class:"md:col-span-2"},_j={class:"font-semibold text-gray-800 dark:text-neutral-200"},bj={class:"md:block md:col-span-1 md:text-center"},xj=["onClick"];function vj(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700",`grid-cols-${((u=t.actions)==null?void 0:u.length)+2}`])},[f.createElementVNode("li",yj,[f.createElementVNode("h3",_j,f.toDisplayString(t.item.ua),1)]),(l=t.item.menu)!=null&&l.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(t.actions,g=>(f.openBlock(),f.createElementBlock("li",bj,[f.createElementVNode("button",{onClick:b=>a.toggleHandler(g),type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,xj)]))),256)):f.createCommentVNode("",!0)],2)}const wj=Ue(gj,[["render",vj]]),kj={props:{subitem:{type:Object,required:!0},toggled:{type:Boolean,default:!1},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array,required:!0}},data(){return{checkedActions:[]}},watch:{routes:{handler(){this.initializeCheckedActions()},deep:!0,immediate:!0}},methods:{initializeCheckedActions(){const n=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=n?[...n.actions]:[]},inputHandler(n){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},Sj={class:"md:col-span-2"},Ej={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Cj={class:"text-sm text-gray-500 dark:text-neutral-500"},Tj={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Mj=["value","onChange"];function Aj(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("ul",{class:f.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${t.actions.length+2}`])},[f.createElementVNode("li",Sj,[f.createElementVNode("p",Ej,f.toDisplayString(((u=t.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",Cj,f.toDisplayString(((l=t.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.actions,(g,b)=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",Tj,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",value:g,onChange:w=>a.inputHandler(g),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500","onUpdate:modelValue":e[0]||(e[0]=w=>r.checkedActions=w)},null,40,Mj),[[f.vModelCheckbox,r.checkedActions]])])]))),128))],2)}const Pj=Ue(kj,[["render",Aj]]),Jr=f.ref(null),t_=n=>{const e=[];return n.forEach(t=>{t.menu?e.push(...t_(t.menu)):e.push(t)}),e},Zf=()=>{const n=new CustomEvent("reloadCardPage");window.dispatchEvent(n)},Ij={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:wj,VsGroupSecondLevel:Pj,AdminNodata:e_},data(){return{list:Jr.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,t;const n={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(i=>!(i!=null&&i.menu))};return this.filterMenu([n,...(t=this.list)==null?void 0:t.filter(i=>i==null?void 0:i.menu)],this.searchValue).filter(i=>{var r;return(r=i==null?void 0:i.menu)==null?void 0:r.length})}},methods:{async Save(){var n,e;try{const t=location.href.split("/").pop();await ut.post(`/api/access-group/${t}`,{routes:(n=this.history)==null?void 0:n.filter(i=>{var r;return(r=i==null?void 0:i.actions)==null?void 0:r.length}).map(({path:i,actions:r})=>({path:i,actions:[...new Set(r)]}))}),await this.$notify({type:"success",title:"Успішно!",message:"Данні успішно оновлені"}),await Zf()}catch(t){console.error(((e=t.response)==null?void 0:e.data)||t.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(n=>({...n,actions:[]}))},async getData(){var n,e;try{const t=location.href.split("/").pop(),r=(await ut.get(`/api/access-group/${t}`)).data;this.history=this.getUniqueByPath([...r.routes,...(n=t_(this.list))==null?void 0:n.map(a=>({path:a==null?void 0:a.path,actions:[]}))])}catch(t){console.error(((e=t.response)==null?void 0:e.data)||t.message)}},toggleCheck(n){var t,i;if(!((t=this.history)!=null&&t.length))return;const e=(i=this.history)==null?void 0:i.findIndex(r=>(r==null?void 0:r.path)===(n==null?void 0:n.subitemPath));this.history[e].actions=n==null?void 0:n.checkedActions},toggleAll(n,e){var i,r,a,u,l,g,b;const t=(a=(r=(i=this.getList)==null?void 0:i[e])==null?void 0:r.menu)==null?void 0:a.map(w=>w==null?void 0:w.path);n!=null&&n.toggled?(l=(u=this.history)==null?void 0:u.filter(w=>t==null?void 0:t.includes(w==null?void 0:w.path)))==null||l.forEach(w=>{var E;(E=w==null?void 0:w.actions)==null||E.push(n==null?void 0:n.optionID)}):(b=(g=this.history)==null?void 0:g.filter(w=>t==null?void 0:t.includes(w==null?void 0:w.path)))==null||b.forEach(w=>{var E;w.actions=(E=w==null?void 0:w.actions)==null?void 0:E.filter(C=>C!==(n==null?void 0:n.optionID))})},getUniqueByPath(n){return n.reduce((e,t)=>(e.some(r=>r.path===t.path)||e.push(t),e),[])},filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a}}return(r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e==null?void 0:e.toLowerCase())?t:null}).filter(Boolean)}},async mounted(){await this.getData()}},Dj={class:"flex gap-[6px]"},Oj={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Bj={key:0,class:"space-y-8"},Nj={class:"space-y-5"};function zj(n,e,t,i,r,a){var w;const u=f.resolveComponent("VsText"),l=f.resolveComponent("VsGrouptFirstLevel"),g=f.resolveComponent("VsGroupSecondLevel"),b=f.resolveComponent("AdminNodata");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",Dj,[f.createVNode(u,{placeholder:"Пошук",class:"flex-grow",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E)},null,8,["modelValue"]),f.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100",onClick:e[1]||(e[1]=(...E)=>a.resetAll&&a.resetAll(...E))}," Скинути всі "),f.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...E)=>a.Save&&a.Save(...E))}," Зберегти ")]),f.createElementVNode("div",{class:f.normalizeClass(["grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5",`grid-cols-${t.options.length+2}`])},[e[3]||(e[3]=f.createElementVNode("div",{class:"self-center col-span-2"},[f.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.options,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:C},[f.createElementVNode("h3",Oj,f.toDisplayString(E),1)]))),128))],2),(w=a.getList)!=null&&w.length?(f.openBlock(),f.createElementBlock("div",Bj,[f.createElementVNode("div",Nj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getList,(E,C)=>(f.openBlock(),f.createElementBlock("div",{key:C},[f.createVNode(l,{item:E,"onOn:toggled":P=>a.toggleAll(P,C),actions:t.options},null,8,["item","onOn:toggled","actions"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.menu,P=>(f.openBlock(),f.createBlock(g,{toggled:(E==null?void 0:E.toggled)||!1,optionID:E==null?void 0:E.optionID,key:P==null?void 0:P.path,subitem:P,actions:t.options,"onOn:checked":D=>a.toggleCheck(D,C),routes:r.history},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))]))),128))])])):(f.openBlock(),f.createBlock(b,{key:1}))])}const Rj=Ue(Ij,[["render",zj]]),Lj={__name:"vs-group-interface-page",setup(n){const e=["view","add","edit","del"];return(t,i)=>(f.openBlock(),f.createBlock(f.unref(Rj),{options:e,routes:t.routes},null,8,["routes"]))}},Vj={},Fj={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",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 $j(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Fj,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),f.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const n_=Ue(Vj,[["render",$j]]),jj={components:{IconSearch:n_},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var n,e;return((e=(n=this.data)==null?void 0:n.rows)==null?void 0:e.filter(t=>{var i;return(i=t==null?void 0:t.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:n}=await ut.get("/api/user-cls?type=json");this.data=n}catch{}}}},Uj={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},Hj={class:"relative"},qj={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Wj={class:"w-[99%] overflow-hidden overflow-ellipsis"},Gj={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function Zj(n,e,t,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Uj,[f.createElementVNode("div",Hj,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=b=>r.searchValue=b),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("ul",qj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.rows,b=>{var w,E;return f.openBlock(),f.createElementBlock("li",{key:b==null?void 0:b.id,class:"w-full pr-[10px]"},[f.createVNode(g,{to:r.link+"?name="+((b==null?void 0:b.name)||(b==null?void 0:b.id)),class:f.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(w=n.$route)==null?void 0:w.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Wj,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",Gj,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const Yj=Ue(jj,[["render",Zj]]),Xj={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Kj={class:"w-full"},Jj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Qj={class:"max-w-sm mx-auto mt-6"},e7={class:"font-medium text-gray-800 dark:text-neutral-200"},t7={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function n7(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("div",Kj,[f.createElementVNode("div",Jj,[e[0]||(e[0]=f.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),f.createElementVNode("div",Qj,[f.createElementVNode("p",e7,f.toDisplayString(t.title),1),f.createElementVNode("p",t7,f.toDisplayString(t.text),1)])])])}const $S=Ue(Xj,[["render",n7]]),i7={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(n){this.$emit("update:modelValue",n),this.$refs.popover.togglePopover()}}},r7={class:"flex w-[160px] flex-wrap gap-[4px]"},s7=["onClick"];function o7(n,e,t,i,r,a){const u=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(u,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:f.normalizeStyle({backgroundColor:t.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",r7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.colors,l=>(f.openBlock(),f.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:f.normalizeStyle({backgroundColor:l}),onClick:g=>a.updateColor(l),key:l},null,12,s7))),128))])])]),_:1},512)}const jS=Ue(i7,[["render",o7]]),a7={components:{VsChoceColor:jS},props:{item:Object},data(){var n,e,t;return{color:((n=this.item)==null?void 0:n.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(t=this.item)==null?void 0:t.id}},watch:{color(n){this.$emit("update-item",{...this.item,color:n})},text(n){this.$emit("update-item",{...this.item,text:n})},id(n){this.$emit("update-item",{...this.item},n)}}},l7={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},c7={class:"flex flex-col"},u7={class:"flex gap-[30px]"},h7={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},d7={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},p7={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function f7(n,e,t,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",l7,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",c7,[f.createElementVNode("div",u7,[f.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=b=>r.text=b),onUpdateValue:e[2]||(e[2]=b=>r.text=b)},{default:f.withCtx(()=>[f.createElementVNode("p",h7,f.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),f.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=b=>r.id=b),onUpdateValue:e[4]||(e[4]=b=>r.id=b)},{default:f.withCtx(()=>[f.createElementVNode("p",d7,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",p7,f.toDisplayString((g=t.item)==null?void 0:g.parent),1)])])}const m7={components:{VsReesterUsersItem:Ue(a7,[["render",f7]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(n,e){this.draggedItemIndex=e,n.dataTransfer.effectAllowed="move"},dragOver(n){n.preventDefault()},drop(n,e){n.preventDefault();const t=this.draggedItemIndex;if(t!==e){const i=[...this.list],r=i[t];i.splice(t,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(n,e){var i;const t=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(n==null?void 0:n.id));this.list[t]=n,e&&(this.list[t].id=e),this.$emit("update-list",this.list)}}},g7={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},y7=["onDragstart","onDrop"];function _7(n,e,t,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",g7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.list,(l,g)=>(f.openBlock(),f.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:b=>a.dragStart(b,g),onDragover:e[0]||(e[0]=b=>a.dragOver(b)),onDrop:b=>a.drop(b,g),onDragend:e[1]||(e[1]=(...b)=>a.dragEnd&&a.dragEnd(...b))},[f.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,y7))),128))])}const b7={components:{VsNoData:$S,VsChoceColor:jS,IconCheck:Yx,VsReesterUsersList:Ue(m7,[["render",_7],["__scopeId","data-v-87c0b333"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(n,e){var t,i;((t=n==null?void 0:n.query)==null?void 0:t.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var n;this.data=null;try{const{data:e}=await ut.get(`/api/user-cls/${(n=this.$route.query)==null?void 0:n.name}`);this.data=e}catch{}},async addOneChild(){var n,e,t,i;try{const{form:r}=this.$refs;await r.doValidation(),await ut.post("/api/user-cls",{name:(n=this.$route.query)==null?void 0:n.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(t=this.data)==null?void 0:t.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(n){var e,t;this.data.children=n;try{await ut.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((t=this.data)==null?void 0:t.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},x7={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},v7={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},w7={class:"flex items-end w-full gap-[4px]"};function k7(n,e,t,i,r,a){var E,C,P,D,R;const u=f.resolveComponent("VsForm"),l=f.resolveComponent("VsChoceColor"),g=f.resolveComponent("IconCheck"),b=f.resolveComponent("VsReesterUsersList"),w=f.resolveComponent("VsNoData");return f.openBlock(),f.createElementBlock("div",x7,[(C=(E=n.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",v7,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",w7,[r.formVisible?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=$=>r.formValues=$),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0),f.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=$=>r.color=$)},null,8,["modelValue"]),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...$)=>a.addOneChild&&a.addOneChild(...$)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[f.createVNode(g,{height:"20",width:"20"})])]),(D=(P=r.data)==null?void 0:P.children)!=null&&D.length?(f.openBlock(),f.createBlock(b,{key:0,list:(R=r.data)==null?void 0:R.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(w,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const S7={components:{VsReesterNavList:Yj,VsReesterContent:Ue(b7,[["render",k7]])}},E7={class:"flex items-start gap-0"};function C7(n,e,t,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",E7,[f.createVNode(u),f.createVNode(l)])}const T7=Ue(S7,[["render",C7]]),M7={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},A7={class:"mr-[10px]"},P7={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},I7={class:"flex items-center gap-[6px] ml-auto"},D7={class:"mr-[10px]"},O7={__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(n){var E,C,P,D,R;const{asyncTemplateSlot:e}=(R=(D=(P=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:P.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,t=n,i=CA(),r=TA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${t.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,G,ee,ce;if(!(($=t.slots)!=null&&$.panelLeft))return"div";if((G=t.slots)!=null&&G.panelLeft.includes("<")){const U=e("PanelLeft",(ee=t.slots)==null?void 0:ee.panelLeft,["name"]);u.value=U}else u.value=(ce=t.slots)==null?void 0:ce.panelLeft},w=()=>{var $,G,ee,ce;if(!(($=t.slots)!=null&&$.panelRight))return"div";if((G=t.slots)!=null&&G.panelRight.includes("<")){const U=e("PanelRight",(ee=t.slots)==null?void 0:ee.panelRight,["name"]);a.value=U}else a.value=(ce=t.slots)==null?void 0:ce.panelRight};return b(),w(),($,G)=>{const ee=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",M7,[f.createElementVNode("div",A7,[f.createElementVNode("button",{onClick:l,class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),f.createElementVNode("h2",P7,f.toDisplayString(n.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",I7,[f.createElementVNode("div",D7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),n.isHeaderEditButton?(f.openBlock(),f.createBlock(ee,{key:0,to:g.value,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>G[0]||(G[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])):f.createCommentVNode("",!0)])])}}},B7={__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{const w=e("CustomComponent",i.slot,["data"]);t.value=w})(),(w,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{data:n.objectData},null,8,["data"]))}},N7={},z7={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-chevron-down"};function R7(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",z7,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const i_=Ue(N7,[["render",R7]]),L7={props:["table","id"],components:{AdminCardHeader:O7,AdminCardAsyncComponent:B7,IconChevron:i_},data(){return{objectData:null,showTabs:!1,component:""}},computed:{getRoute(){const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(t=>{var i,r;return(t==null?void 0:t.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R;if((t=(e=(n=this.objectData)==null?void 0:n.rows)==null?void 0:e[0])!=null&&t.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(b=(g=(l=this.objectData)==null?void 0:l.rows)==null?void 0:g[0])==null?void 0:b.name:((P=(C=(E=(w=this.objectData)==null?void 0:w.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:P.slice(0,35))+" ...";{const $=(D=this.flattenMenu(Jr.value))==null?void 0:D.find(G=>{var ee,ce;return(G==null?void 0:G.table)===((ce=(ee=this.$route)==null?void 0:ee.params)==null?void 0:ce.table)});return((R=this.objectData)==null?void 0:R.title)||($==null?void 0:$.ua)}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent(),addEventListener("reloadCardPage",this.getObjectData)},unmounted(){removeEventListener("reloadCardPage",this.getObjectData)},watch:{component(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,tab:n}})}},methods:{async getObjectData(){var t,i;const n=this.table||((t=this.$route)==null?void 0:t.params.table),e=this.id||((i=this.$route)==null?void 0:i.params.id);(!n||!e)&&this.$router.replace("/404");try{const{data:r}=await ut.get(`/api/table-data/${n}/${e}`);this.objectData=r}catch(r){console.error(r)}},getColClass(n){return`col-span-${n||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var n,e,t,i,r,a,u,l,g;if((e=(n=this.$route)==null?void 0:n.query)!=null&&e.tab)this.component=(i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.tab;else{const b=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(w=>(w==null?void 0:w.type)==="tabs"||(w==null?void 0:w.type)==="vertical-tabs");(u=b==null?void 0:b.items)!=null&&u.length&&(this.component=((l=b.items[0])==null?void 0:l.component)||((g=b.items[0])==null?void 0:g.name))}},getProps(n){var t,i,r;const e={};for(const a in n)["name","component","title","token"].includes(a)||(e[a]=((r=(i=(t=this.objectData)==null?void 0:t.rows)==null?void 0:i[0])==null?void 0:r[n[a]])||n[a]);return e},flattenMenu(n){const e=[];return n==null||n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e}}},V7={style:{height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},F7={key:0,class:"bg-white border rounded-xl"},$7={class:"p-[10px] pl-[20px] text-md font-[500]"},j7=["innerHTML"],U7={key:1},H7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},q7={key:2,class:"p-[20px] border-t"},W7=["innerHTML"],G7={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},Z7=["onClick"],Y7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},X7={key:0,class:"p-[20px] border-t"},K7={key:1,class:"p-[20px] border-t"},J7=["innerHTML"],Q7={key:3,class:"flex"},eU=["onClick"],tU={class:"flex-grow w-[80%]"},nU={key:0,class:"w-full h-full overflow-auto bg-white border rounded-xl [&::-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"},iU={key:0,class:"p-[20px]"},rU={key:1,class:"p-[20px]"},sU=["innerHTML"];function oU(n,e,t,i,r,a){var b,w,E,C;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent"),g=f.resolveComponent("IconChevron");return f.openBlock(),f.createElementBlock("div",V7,[r.objectData&&((b=r.objectData)==null?void 0:b.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(w=r.objectData)==null?void 0:w.slots,isHeaderEditButton:(E=r.objectData)==null?void 0:E.isHeaderEditButton},null,8,["title","get-route","slots","isHeaderEditButton"])):f.createCommentVNode("",!0),f.createElementVNode("div",{class:f.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((C=r.objectData)==null?void 0:C.panels,(P,D)=>{var R,$,G,ee,ce;return f.openBlock(),f.createElementBlock("div",{key:D,class:f.normalizeClass(a.getColClass(P.col))},[P!=null&&P.name?(f.openBlock(),f.createElementBlock("div",F7,[f.createElementVNode("h2",$7,f.toDisplayString((P==null?void 0:P.title)||"Панель"),1),(R=r.objectData)!=null&&R.html[P==null?void 0:P.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:($=r.objectData)==null?void 0:$.html[P==null?void 0:P.name]},null,8,j7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(G=r.objectData)==null?void 0:G.vue[P==null?void 0:P.name],data:(ce=(ee=r.objectData)==null?void 0:ee.rows)==null?void 0:ce[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):P.type==="container"?(f.openBlock(),f.createElementBlock("div",U7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn;return f.openBlock(),f.createElementBlock("div",{key:Me,class:f.normalizeClass([{"mb-[20px]":P.items.length>1},"bg-white border rounded-xl"])},[U!=null&&U.title?(f.openBlock(),f.createElementBlock("h2",H7,f.toDisplayString((U==null?void 0:U.title)||"Панель"),1)):f.createCommentVNode("",!0),U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":U==null?void 0:U.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({geometry:(Pe=(ke=r.objectData)==null?void 0:ke.rows[0])==null?void 0:Pe.geom,columns:U==null?void 0:U.columns,token:(Be=(Fe=r.objectData)==null?void 0:Fe.tokens)==null?void 0:Be[U==null?void 0:U.token],zoom:16,ref_for:!0},a.getProps(U),{data:r.objectData,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",q7,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Rt=(Mt=r.objectData)==null?void 0:Mt.html)==null?void 0:Rt[U==null?void 0:U.name]},null,8,W7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(zt=(Ft=r.objectData)==null?void 0:Ft.vue)==null?void 0:zt[U==null?void 0:U.name],data:(yn=(Ht=r.objectData)==null?void 0:Ht.rows)==null?void 0:yn[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(P==null?void 0:P.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",G7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P==null?void 0:P.items,U=>(f.openBlock(),f.createElementBlock("button",{key:(U==null?void 0:U.name)||(U==null?void 0:U.component),onClick:Me=>r.component=(U==null?void 0:U.component)||(U==null?void 0:U.name),class:f.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-[1] after:h-0.5 after:bg-gray-800":r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name),"":r.component!==(U==null?void 0:U.component)&&r.component!==(U==null?void 0:U.name)}])},f.toDisplayString(U==null?void 0:U.title),11,Z7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Me},[r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name)?(f.openBlock(),f.createElementBlock("div",Y7,[U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",X7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({data:r.objectData,token:(Pe=(ke=r.objectData)==null?void 0:ke.tokens)==null?void 0:Pe[U==null?void 0:U.token],columns:U==null?void 0:U.columns,geometry:(Be=(Fe=r.objectData)==null?void 0:Fe.rows[0])==null?void 0:Be.geom,ref_for:!0},a.getProps(U),{zoom:16,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",K7,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Mt=r.objectData)==null?void 0:Mt.html[U==null?void 0:U.name]},null,8,J7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Rt=r.objectData)==null?void 0:Rt.vue[U==null?void 0:U.name],data:(zt=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:zt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(P==null?void 0:P.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",Q7,[f.createElementVNode("div",{class:f.normalizeClass(["p-[5px] bg-white absolute left-0 rounded-lg border rounded-tl-[0] rounded-bl-[0]",[{"left-[260px]":r.showTabs}]]),onClick:e[0]||(e[0]=U=>r.showTabs=!r.showTabs)},[f.createVNode(g,{height:"16",width:"16",class:"-rotate-90"})],2),f.createElementVNode("nav",{class:f.normalizeClass(["lg:relative lg:left-0 flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 items-start pl-[10px] bg-white py-[20px] absolute left-[-100%]",[{"left-0 rounded-tr-[0]":r.showTabs}]])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P==null?void 0:P.items,U=>(f.openBlock(),f.createElementBlock("button",{key:(U==null?void 0:U.name)||(U==null?void 0:U.component),onClick:Me=>r.component=(U==null?void 0:U.component)||(U==null?void 0:U.name),class:f.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm text-left whitespace-pre-wrap border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name),"text-gray-500":r.component!==(U==null?void 0:U.component)&&r.component!==(U==null?void 0:U.name)}])},f.toDisplayString(U==null?void 0:U.title),11,eU))),128))],2),f.createElementVNode("div",tU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(P.items,(U,Me)=>{var ke,Pe,Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Me},[r.component===(U==null?void 0:U.component)||r.component===(U==null?void 0:U.name)?(f.openBlock(),f.createElementBlock("div",nU,[U!=null&&U.component?(f.openBlock(),f.createElementBlock("div",iU,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(U.component),f.mergeProps({token:(Pe=(ke=r.objectData)==null?void 0:ke.tokens)==null?void 0:Pe[U==null?void 0:U.token],data:r.objectData,columns:U==null?void 0:U.columns,geometry:(Be=(Fe=r.objectData)==null?void 0:Fe.rows[0])==null?void 0:Be.geom,ref_for:!0},a.getProps(U),{zoom:16,id:(tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.id}),null,16,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),U!=null&&U.name?(f.openBlock(),f.createElementBlock("div",rU,[(rt=(Nt=r.objectData)==null?void 0:Nt.html)!=null&&rt[U==null?void 0:U.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Mt=r.objectData)==null?void 0:Mt.html[U==null?void 0:U.name]},null,8,sU)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Rt=r.objectData)==null?void 0:Rt.vue[U==null?void 0:U.name],data:(zt=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:zt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const r_=Ue(L7,[["render",oU],["__scopeId","data-v-40ed13d2"]]),aU=Object.freeze(Object.defineProperty({__proto__:null,default:r_},Symbol.toStringTag,{value:"Module"})),s_={...cj,...uj,"vs-dashboard":dj,"vs-custom-button":mj,"vs-group-interface":Lj,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String,geom:null},setup(n){return(e,t)=>(f.openBlock(),f.createElementBlock("div",null,f.toDisplayString(n.dataName)+f.toDisplayString(n.geom),1))}},"vs-card-list":r_,...{"card-page":r_,"user-cls-page":T7}},lU=({token:n,api:e,id:t,form:i,method:r,title:a,init:u})=>new Promise(l=>{var P,D,R,$;const{VsDialog:g,VsForm:b}=(D=(P=window.app)==null?void 0:P._context)==null?void 0:D.components,w=document.querySelector("#modal");if(!w){console.error('Modal root element with id "#modal" not found!');return}const E=document.createElement("div");w.appendChild(E);const C=f.createApp({components:{VsDialog:g,VsForm:b},data(){return{visible:!1,formValues:{},scheme:null}},computed:{title(){return a||"Редагувати"}},methods:{close(G){this.visible=!1,this.$el.remove(),C.unmount(),l(G||"Success")},async getFormScheme(){try{if(n){const ee=await ut.get(`/api/table/${n}`);this.formValues=ee.data}u&&(this.formValues=u);const{data:G}=await ut.get(`/api/template/form/${n||i}`);G!=null&&G.obj&&(this.formValues={...this.formValues,...G.obj}),this.scheme=(G==null?void 0:G.schema)||G}catch(G){console.error("Error fetching form scheme:",G)}finally{this.visible=!0}},async updateData(){var ee;const G=this.$refs.form;try{await G.doValidation();const{data:ce}=await ut({method:r||"PUT",url:`${e||"/api/table/"}${n||t||""}`,data:this.formValues});Zf(),this.visible=!1,this.close(ce),this.$notify({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch(ce){this.$notify({title:"Помилка!",type:"error",message:((ee=ce==null?void 0:ce.response)==null?void 0:ee.data)||"Сталася помилка"})}}},mounted(){this.getFormScheme()},template:`
|
742
742
|
<div style="position: relative; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;">
|
743
743
|
<VsDialog :title="title" v-model:visible="visible">
|
744
744
|
<VsForm ref="form" v-if="scheme" :scheme v-model="formValues" class="p-0"/>
|
@@ -791,4 +791,4 @@ img.ProseMirror-separator {
|
|
791
791
|
</div>
|
792
792
|
`}).mount(u)},{Fancybox:dU}=My,o_={$form:lU,$api:uU,$map:hU,$preview:({media:n})=>{const e=document.querySelector("#app");if(!e){console.error('Modal root element with id "#app" not found!');return}const t=document.createElement("div");e.appendChild(t),f.createApp({data(){return{items:Array.isArray(n)?n:[n]}},mounted(){this.$nextTick(()=>{dU.show(this.items.map(r=>{const a=typeof r=="string"&&r.endsWith(".pdf");return{src:r,type:a?"iframe":"image"}}),{groupAll:!0,Thumbs:{autoStart:!0}})})},template:`
|
793
793
|
<div style="display: none;"></div> <!-- Keeps container hidden -->
|
794
|
-
`}).mount(t)}},pU=async()=>{try{const{data:n}=await ut.get("/api/user-menu");return Jr.value=n,t_(n)}catch(n){return console.error(n),[]}},fU=(n,e)=>{Object.entries(e).forEach(([t,i])=>{n.component(t,i)})},mU={async install(n,{componentsApp:e={},settings:t,routes:i=[]}){ia.value={...ia,...t};try{const a=(await pU()).filter(l=>l==null?void 0:l.component).map(l=>({...l,component:{...s_,...e}[l==null?void 0:l.component]}));fU(n,{...s_,...e}),n.component("admin",QT);const{router:u}=await BA(a.concat(i));window.app={...n,router:u},window.v3plugin={...n.config.globalProperties,...o_},n.config.globalProperties={...n.config.globalProperties,$componentsConfig:{...TB,componentsApp:e},$router:u,$v3plugin:o_,$utils:{reloadCardPage:Zf}},n.use(u)}catch(r){console.error(r)}},components:s_,plugins:o_},gU={data(){return{formValues:{},scheme:null,table:"",token:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const{data:{form:a}}=await ut.get(`/api/template/table/${t}`),{data:u}=await ut.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await ut.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},yU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},_U={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bU={class:"flex items-center gap-[6px]"},xU={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},vU={class:"bg-white w-full rounded-xl border p-[20px] 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"};function wU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",yU,[f.createElementVNode("div",_U,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",bU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$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"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти і повернутися ")])]),f.createElementVNode("div",xU,[f.createElementVNode("div",vU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const kU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(gU,[["render",wU]])},Symbol.toStringTag,{value:"Module"})),SU={data(){return{formValues:{},scheme:null,table:"",token:"",api:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const a=await ut.get(`/api/table-data/${t}`),{data:u}=await ut.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.api=(u==null?void 0:u.api)||"",this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},EU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},CU={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},TU={class:"flex items-center gap-[6px]"},MU={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},AU={class:"bg-white w-full rounded-xl border p-[20px] 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"};function PU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",EU,[f.createElementVNode("div",CU,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$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"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),f.createElementVNode("div",MU,[f.createElementVNode("div",AU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const IU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(SU,[["render",PU]])},Symbol.toStringTag,{value:"Module"})),DU={};function OU(n,e,t,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const US=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(DU,[["render",OU]])},Symbol.toStringTag,{value:"Module"})),BU={},NU={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 zU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",NU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const RU=Ue(BU,[["render",zU]]),LU={},VU={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",VU,e[0]||(e[0]=[f.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 $U=Ue(LU,[["render",FU]]),jU={components:{IconChevronDown:i_},props:{route:Object,searchable:String},mounted(){var n,e,t;(n=this.route)!=null&&n.menu&&(t=(e=this.route)==null?void 0:e.menu)!=null&&t.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},watch:{route(n){n!=null&&n.open&&(this.isOpen=!0)}},data(){return{isOpen:!1}},methods:{highLight(n){if(!this.searchable)return n;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`(${e})(\\s*)`,"gi");return n.replace(t,(i,r,a)=>`<span style="color:#1989fa;">${r}</span>${a}`)}}},UU={key:0,class:""},HU={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},qU={key:1};function WU(n,e,t,i,r,a){var g,b,w,E,C,P,D,R,$,G,ee,ce,U,Me,ke;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=t.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",UU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Pe=>r.isOpen=!r.isOpen),class:f.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",[((w=(b=t.route)==null?void 0:b.menu)==null?void 0:w.some(Pe=>{var Fe,Be;return(Pe==null?void 0:Pe.path)===n.$route.path.replace("/","")||(Pe==null?void 0:Pe.table)===((Be=(Fe=n.$route)==null?void 0:Fe.params)==null?void 0:Be.table)&&(Pe==null?void 0:Pe.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=t.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Pe;return[f.withDirectives(f.createElementVNode("ul",HU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pe=t.route)==null?void 0:Pe.menu,(Fe,Be)=>{var pt,tt;return f.openBlock(),f.createElementBlock("li",{key:Be,class:"w-full"},[f.createVNode(l,{innerHTML:a.highLight(Fe==null?void 0:Fe.ua),to:"/"+(Fe==null?void 0:Fe.path),class:f.normalizeClass([[((Fe==null?void 0:Fe.path)===n.$route.path.replace("/","")||((tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.table)===(Fe==null?void 0:Fe.table)&&(Fe==null?void 0:Fe.table))&&"bg-gray-100"],"block px-3 py-2 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(C=t.route)!=null&&C.hidden?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",qU,[f.createVNode(l,{innerHTML:a.highLight((P=t.route)==null?void 0:P.ua),to:((R=(D=t.route)==null?void 0:D.path)==null?void 0:R[0])==="/"?($=t.route)==null?void 0:$.path:"/"+((G=t.route)==null?void 0:G.path),class:f.normalizeClass([[(((ee=t.route)==null?void 0:ee.path.replace("/",""))===n.$route.path.replace("/","")||((U=(ce=n.$route)==null?void 0:ce.params)==null?void 0:U.table)===((Me=t.route)==null?void 0:Me.table)&&((ke=t.route)==null?void 0:ke.table))&&"bg-gray-100"],"inline-block py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},null,8,["innerHTML","to","class"])]))}const GU={components:{IconLogout:RU,NavbarItem:Ue(jU,[["render",WU]]),IconLogo:$U,IconSearch:n_},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var n;return(n=this.searchValue)!=null&&n.trim()?this.filterMenu(Jr.value,this.searchValue):Jr.value},logo(){var n;return((n=ia.value)==null?void 0:n.logo)||"/assets/logo.svg"}},methods:{filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a,open:!0}}else if((r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e.toLowerCase()))return t;return null}).filter(Boolean)}}},ZU={class:"h-[59px] w-full p-[4px] mb-[10px]"},YU=["src"],XU={class:"relative mx-[16px] pl"},KU={class:"p-[16px] 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"},JU={class:"flex flex-col flex-wrap w-full pb-3"},QU={key:0,class:"flex flex-col gap-[6px]"},e9={key:1,class:"text-gray-800 text-lg mt-[20px]"};function t9(n,e,t,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] shrink-0 absolute transition left-[-100%] z-[11] bg-white",[{"left-0":n.$parent.showMenu}]])},[f.createElementVNode("div",ZU,[f.createElementVNode("img",{src:a.logo,class:"object-contain w-full h-full"},null,8,YU)]),f.createElementVNode("div",XU,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[16px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=w=>r.searchValue=w),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:pl-[40px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",KU,[f.createElementVNode("nav",JU,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",QU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(w,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:w,searchable:r.searchValue},null,8,["route","searchable"])]))),128))])):(f.openBlock(),f.createElementBlock("div",e9,"Не знайдено"))])])],2)}const n9=Ue(GU,[["render",t9]]),i9={},r9={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 s9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const o9={components:{IconQuestion:Ue(i9,[["render",s9]]),IconUser:VS,AdminNotification:FS},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(n){n?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:n}=await ut.get("/user");this.userData=n}catch{}},async logout(){try{await ut.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},a9={class:"h-[60px] border-b flex lg:justify-end justify-between items-center px-[20px]"},l9={class:"flex items-center gap-[6px]"},c9={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"},u9={class:"relative"},h9=["src"],d9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},p9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},f9=["src"],m9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},g9={class:"text-[14px] mr-[10px] text-gray-500"},y9={class:"flex flex-col p-[4px]"};function _9(n,e,t,i,r,a){var w,E,C,P,D,R,$,G,ee,ce;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",a9,[f.createElementVNode("div",{class:"lg:hidden flex",onClick:e[0]||(e[0]=U=>n.$parent.showMenu=!0)},e[4]||(e[4]=[f.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)])),f.createElementVNode("div",l9,[f.createElementVNode("a",c9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[6]||(e[6]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",u9,[f.createElementVNode("div",{onClick:e[1]||(e[1]=U=>r.isVisible=!0),class:"cursor-pointer"},[(E=(w=r.userData)==null?void 0:w.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",p9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,f9)):(f.openBlock(),f.createElementBlock("div",m9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",g9,f.toDisplayString((ce=(ee=r.userData)==null?void 0:ee.user)==null?void 0:ce.username),1)])]),f.createElementVNode("div",y9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[5]||(e[5]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...U)=>a.logout&&a.logout(...U)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const b9={components:{navbar:n9,AdminHeader:Ue(o9,[["render",_9]])},data(){return{showMenu:!1}},computed:{isMenu(){return Jr.value||null},header(){var n;return((n=ia.value)==null?void 0:n.header)||"admin-header"}}},x9={class:"admin-wrapper"},v9={class:"flex flex-col w-full"};function w9(n,e,t,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",x9,[f.createVNode(u),r.showMenu?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=g=>r.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"})):f.createCommentVNode("",!0),f.createElementVNode("div",v9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.header))),f.createVNode(l)],64)):f.createCommentVNode("",!0)])])}const k9=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(b9,[["render",w9],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),S9={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var n,e;return((n=this.data)==null?void 0:n.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var n,e;return(e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(n){n!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(n){switch(n){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(n){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(n);const e=this.$route.query,{sort:t,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(n){return`${this.data.name}-${n}`===this.selectedSortParam}}},E9={scope:"col",class:"text-start px-2 py-1"},C9={class:"flex-shrink-0 size-3.5",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"},T9={key:0,d:"m7 15 5 5 5-5"},M9={key:1,d:"m7 9 5-5 5 5"},A9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal"};function P9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("th",E9,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",C9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",T9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",M9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",A9,f.toDisplayString(a.label),1))])}const I9=Ue(S9,[["render",P9]]),D9={components:{IconMore:J0,IconDelete:zS,IconEdit:RS},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(n=>typeof n=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);await ut.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(n){var e,t;document.querySelector("body").click(),n!=null&&n.form?(await this.$v3plugin.$form({form:n==null?void 0:n.form,id:(e=this.item)==null?void 0:e.id,api:n==null?void 0:n.api,title:n==null?void 0:n.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:n==null?void 0:n.confirm,api:n==null?void 0:n.api,method:n==null?void 0:n.method,id:(t=this.item)==null?void 0:t.id,isId:(n==null?void 0:n.isId)||!1})}}},O9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},B9={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"},N9={class:"flex flex-col items-start"},z9=["onClick"],R9={class:"text-gray-800"},L9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},V9={class:"p-4"},F9={class:"flex justify-end mt-4 gap-x-3"};function $9(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",O9,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",B9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,$;return[f.createElementVNode("div",N9,[(C=t.actions)!=null&&C.includes("edit")&&t.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=n.$route)==null?void 0:P.params)==null?void 0:D.catchAll}&id=${(R=t.item)==null?void 0:R.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:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,ee)=>(f.openBlock(),f.createElementBlock("button",{key:ee,onClick:ce=>a.customButtonAction(G),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"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",R9,f.toDisplayString(G==null?void 0:G.label),1)],8,z9))),128)),t.isForm?(f.openBlock(),f.createElementBlock("div",L9)):f.createCommentVNode("",!0),($=t.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["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"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",V9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",F9,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const j9=Ue(D9,[["render",$9]]),U9={},H9={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 q9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",H9,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const W9=Ue(U9,[["render",q9]]),G9={},Z9={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 Y9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Z9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const X9={components:{IconExport:W9,IconChevronDown:i_,IconSuccess:Ue(G9,[["render",Y9]])},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:"Жодного"}]}},watch:{isOpen(n){n||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var n;if(!((n=this.cols)!=null&&n.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await ut.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},responseType:"blob"}),t=await e.data.text(),i=t!=null&&t.includes(";")?null:JSON==null?void 0:JSON.parse(t),r=new Blob([e.data],{type:"application/octet-stream"}),a=window.URL.createObjectURL(r),u=document.createElement("a");if(u.href=a,u.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(u),typeof i=="string"){this.exportTable();return}u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(a),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(n){this.format=n},choceAll(){var n;this.cols=(n=this.columns)==null?void 0:n.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var n,e;this.cols=(e=(n=this.columns)==null?void 0:n.filter(t=>(t==null?void 0:t.hidden)!==!0))==null?void 0:e.map(t=>t==null?void 0:t.name),this.activeAction="choceVisible"}}},K9={key:0,class:"flex flex-col items-center"},J9={key:1,class:"p-4"},Q9={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},eH={class:"flex items-center"},tH={class:"flex items-center gap-[10px] ml-auto"},nH=["onClick"],iH={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},rH={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},sH={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},oH={class:"mt-2 space-y-2"},aH=["id","onChange"],lH=["for"],cH={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},uH={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hH(n,e,t,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),w=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(w,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",cH,[f.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=>r.isOpen=!1)}," Закрити "),f.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=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",uH,[f.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=>r.isOpen=!1)}," Скасувати "),f.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[5]||(e[5]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",K9,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",J9,[f.createElementVNode("div",Q9,[f.createElementVNode("div",eH,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",tH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.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"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",iH)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,nH))),128))])]),f.createElementVNode("div",rH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",sH,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",oH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.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:P=>a.selectFormat(E)},null,40,aH),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,lH)]))),128))])])]))]),_:1},8,["visible"])],64)}const dH=Ue(X9,[["render",hH]]),pH={},fH={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-columns"};function mH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const gH=Ue(pH,[["render",mH]]),yH={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(n){this.$emit("update-column",{...this.column,hidden:!n})}},mounted(){var n;((n=this.column)==null?void 0:n.hidden)!==!0&&(this.value=!0)}},_H={class:"flex w-full gap-[8px] items-centr"};function bH(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",_H,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=t.column)==null?void 0:u.ua)||((l=t.column)==null?void 0:l.title)),1)])}const xH={components:{IconColumns:gH,AdminTableColumnsHiddenItem:Ue(yH,[["render",bH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(n){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(n==null?void 0:n.name)),t=this.columns;t[e]=n,this.$emit("update-columns",[...t])}}},vH={class:"py-2 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"},wH={class:"py-[10px] px-[10px] w-[260px]"},kH={class:"flex flex-col gap-[3px] max-h-[400px] w-full 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"};function SH(n,e,t,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",vH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",wH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",kH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(b,w)=>(f.openBlock(),f.createElementBlock("li",{key:w},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const EH=Ue(xH,[["render",SH]]),CH={},TH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function MH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",TH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const a_=Ue(CH,[["render",MH]]),AH={props:{row:Object,column:Object,table:String}};function PH(n,e,t,i,r,a){var u,l,g,b,w,E,C,P;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=t.column)==null?void 0:u.format)==="custom"?(l=t.column)==null?void 0:l.component:`table-format-${((b=(g=t.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>n.$emit("update-table")),name:(w=t.column)==null?void 0:w.name,data:t.row,value:(C=t.row)==null?void 0:C[(E=t.column)==null?void 0:E.name],table:t.table,column:t.column,edit:(P=t.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const HS=Ue(AH,[["render",PH]]),IH={},DH={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 OH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",DH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const BH={components:{IconPlus:a_,IconMinus:Ue(IH,[["render",OH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},NH={class:"hs-accordion"},zH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},RH={class:"text-sm font-medium"},LH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function VH(n,e,t,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",NH,[f.createElementVNode("div",zH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",RH,f.toDisplayString(t.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",LH,[f.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const FH={components:{AdminComponentIs:HS,AdminTree:Ue(BH,[["render",VH],["__scopeId","data-v-c6318482"]]),VsNoData:$S,VsWidgetComments:BS,VsWidgetMap:sy,VsWidgetFileList:Kv},props:{table:String,columns:Array,row:Object}},$H={class:"hs-accordion border-gray-100 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 - 310px)"}},jH={class:"border-l",style:{height:"calc(100vh - 360px)"}},UH={class:"flex items-center justify-between py-1 gap-x-4"},HH={class:"col-span-1"},qH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},WH={class:"col-span-2"},GH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},ZH={class:"table-info-card"},YH={class:"table-info-card"};function XH(n,e,t,i,r,a){var C,P,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),w=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",$H,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",jH,[(P=(C=n.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[t.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,R=>(f.openBlock(),f.createElementBlock("dl",UH,[f.createElementVNode("dt",HH,[f.createElementVNode("p",qH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",WH,[f.createElementVNode("p",GH,[f.createVNode(u,{row:t.row,column:R,table:t.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=t.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=t.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=t.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",ZH,[f.createVNode(w,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",YH,[f.createVNode(E,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const KH=Ue(FH,[["render",XH]]),JH={},QH={class:"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 eq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",QH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const tq=Ue(JH,[["render",eq]]),nq={},iq={class:"h21yx vs0hq",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"};function rq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",iq,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const sq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ue(nq,[["render",rq]])},data(){return{isFilters:!1}},methods:{closeFilter({target:n}){this.isFilters&&n.classList.contains("filter-container")&&(this.isFilters=!1)}}},oq={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},aq={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-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 lq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),t.onFilters?(f.openBlock(),f.createElementBlock("span",oq,f.toDisplayString(t.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",aq,[(g=t.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:t.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>n.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const cq=Ue(sq,[["render",lq]]),uq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},hq={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"},dq=["onClick"];function pq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("nav",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>n.$emit("update:filterState",u==null?void 0:u.name),class:f.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":(u==null?void 0:u.name)===t.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,dq))),256))])}const fq=Ue(uq,[["render",pq]]),mq={},gq={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 yq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",gq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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 _q={components:{IconFilter2:Ue(mq,[["render",yq]])},props:{filterCustom:String,customList:Array}},bq={class:"py-2 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"},xq={class:"flex flex-col gap-[4px]"},vq=["onClick"];function wq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",bq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",xq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:w=>{var E;n.$emit("update:filterCustom",g==null?void 0:g.name),(E=n.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":t.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,vq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;n.$emit("update:filterCustom",void 0),(b=n.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const kq=Ue(_q,[["render",wq]]),Sq={class:"flex items-center gap-x-2"},Eq={props:{table:String,title:String},components:{AdminTableControl:j9,AdminTableExport:dH,AdminTableColumnsHidden:EH,AdminTableColumn:I9,AdminNodata:e_,IconPlus:a_,IconSearch:n_,AdminTableCardInfo:KH,IconOpenCard:tq,AdminComponentIs:HS,AdminTableFilters:cq,AdminTableTabs:fq,AdminTableCustomFilters:kq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(n){var l,g,b,w,E;const{asyncTemplateSlot:e}=(E=(w=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:w.globalProperties)==null?void 0:E.utils,t=f.ref(""),i=f.ref(""),r=n,a=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(P=r.slots)==null?void 0:P.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelRight||(t.value="div"),(D=(P=r.slots)==null?void 0:P.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);t.value=G}else t.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,P)=>(f.openBlock(),f.createElementBlock("div",Sq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value)))]))}},AdminCustomButtonAdd:{__name:"admin-custom-button-add",props:{slots:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{var w,E,C,P,D;if((w=i.slots)!=null&&w.addButton||(t.value="div"),(C=(E=i.slots)==null?void 0:E.addButton)!=null&&C.includes("<")){const R=e("addButton",(P=i.slots)==null?void 0:P.addButton,["IconPlus"]);t.value=R}else t.value=(D=i.slots)==null?void 0:D.addButton})(),(w,E)=>t.value?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{key:0,IconPlus:a_})):f.createCommentVNode("",!0)}}},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var n,e;return((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1},columns(){var n,e;return(e=(n=this.tableData)==null?void 0:n.columns)==null?void 0:e.filter(t=>(t==null?void 0:t.hidden)!==!0)},isForm(){var n,e,t;return((n=this.tableData)==null?void 0:n.form)&&((t=(e=this.tableData)==null?void 0:e.actions)==null?void 0:t.includes("add"))},isNoData(){var n,e;return!((n=this.tableData)!=null&&n.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var n,e;return((e=(n=this.tableData)==null?void 0:n.rows)==null?void 0:e.find(t=>{var i,r;return(t==null?void 0:t.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var n;return(n=this.tableData)==null?void 0:n.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((n,e=300)=>{let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}})(async function(n){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:n||void 0}})},500)},$route:{handler(n,e){var t,i;((t=n==null?void 0:n.params)==null?void 0:t.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(n){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:n}})},filterState(n){var e;n&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:n}}),this.getTableData())},filterCustom(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:n}}),this.getTableData()},columns(n){var e,t,i,r;this.visibleColumns=n==null?void 0:n.map(a=>a==null?void 0:a.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,columns:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$;this.page=((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1,this.limit=((i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((w=(b=this.$route)==null?void 0:b.query)==null?void 0:w.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(P=this.$route)==null?void 0:P.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(n){var t,i;const e=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.find(r=>r.name===n);if(e){const r=e==null?void 0:e.width;return typeof r=="number"?`${r}px`:r!=null&&r.includes("px")?r:`${r}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 n,e,t,i,r,a,u,l,g,b,w;try{const{data:E}=await ut.get(`/api/template/table/${this.table}`),C=await ut.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(w=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:w.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var n;try{const{data:e}=await ut.get(`/api/table-filter/${this.table}`);this.filterScheme=(n=e==null?void 0:e.list)==null?void 0:n.map(t=>({...t,label:(t==null?void 0:t.label)||(t==null?void 0:t.ua)}))}catch{}},async handlePageChange(n){const e=this.$route.query;this.page=n,!(!(e!=null&&e.page)&&n===1||e.page===n)&&(await this.$router.replace({query:{...e,page:n}}),await this.getTableData())},async changeLimit(n){this.limit=await n,this.defaultPage=1,await this.getTableData()},async filterChange({url:n,state:e}){var t;this.filters=n!=="no-url"?n:null,this.onFilters=(t=Object.entries(e))==null?void 0:t.length,this.page=1,await this.getTableData()},changeActiveColumn(n){this.activeColumn=n,this.getTableData()},pushToCard(n){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${n}`)},changeActiveCardInfo(n){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:n}})},toggleCardInfo(){var n;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,card:void 0}})}}},Cq={class:"w-[calc(100vw - 320px)] bg-gray-50"},Tq={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Mq={class:"text-xl font-medium"},Aq={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Pq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Iq={class:"flex"},Dq={class:"flex gap-[6px] ml-auto"},Oq={class:"inline-block w-full align-middle"},Bq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Nq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},zq={class:"right-0 border-t border-stone-200"},Rq={key:0,class:"w-[70px] sticky right-0 top-0"},Lq={class:"divide-y divide-gray-200"},Vq={class:"px-4 py-3 text-sm text-gray-600"},Fq=["onClick"],$q=["onClick"],jq={class:"p-[20px] flex justify-start items-center w-full"},Uq={class:"w-[200px] md:inline-flex hidden"},Hq={class:"text-sm text-gray-600 dark:text-neutral-400"},qq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Wq={key:0},Gq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Zq(n,e,t,i,r,a){var Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn,dn,wn,pn,ti,zn,In,Rn,Ee,je,Ye,ot,Lt,Qt,At;const u=f.resolveComponent("AdminCustomButtonAdd"),l=f.resolveComponent("IconPlus"),g=f.resolveComponent("router-link"),b=f.resolveComponent("AdminTableTabs"),w=f.resolveComponent("IconSearch"),E=f.resolveComponent("VsText"),C=f.resolveComponent("AdminTableCustomButtons"),P=f.resolveComponent("AdminTableCustomFilters"),D=f.resolveComponent("AdminTableColumnsHidden"),R=f.resolveComponent("AdminTableExport"),$=f.resolveComponent("AdminTableFilters"),G=f.resolveComponent("IconOpenCard"),ee=f.resolveComponent("AdminTableColumn"),ce=f.resolveComponent("AdminComponentIs"),U=f.resolveComponent("AdminTableControl"),Me=f.resolveComponent("AdminNodata"),ke=f.resolveComponent("VsPagination"),Pe=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",Cq,[f.createElementVNode("div",Tq,[f.createElementVNode("h2",Mq,f.toDisplayString(t.title),1),a.isForm?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(Be=(Fe=r.tableData)==null?void 0:Fe.slots)!=null&&Be.addButton?(f.openBlock(),f.createBlock(u,{key:0,slots:(pt=r.tableData)==null?void 0:pt.slots},null,8,["slots"])):(f.openBlock(),f.createBlock(g,{key:1,to:`/add?table=${(Nt=(tt=n.$route)==null?void 0:tt.params)==null?void 0:Nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>[f.createVNode(l,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):f.createCommentVNode("",!0)]),f.createElementVNode("div",Aq,[f.createElementVNode("div",Pq,[(Mt=(rt=r.tableData)==null?void 0:rt.filterState)!=null&&Mt.length?(f.openBlock(),f.createBlock(b,{key:0,tabsList:(Rt=r.tableData)==null?void 0:Rt.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Re=>r.filterState=Re)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",Iq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(w,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(E,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Re=>r.searchValue=Re),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>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"]),f.createElementVNode("div",Dq,[(Ft=r.tableData)!=null&&Ft.slots?(f.openBlock(),f.createBlock(C,{key:0,slots:(zt=r.tableData)==null?void 0:zt.slots},null,8,["slots"])):f.createCommentVNode("",!0),(yn=(Ht=r.tableData)==null?void 0:Ht.filterCustom)!=null&&yn.length?(f.openBlock(),f.createBlock(P,{key:1,customList:(dn=r.tableData)==null?void 0:dn.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Re=>r.filterCustom=Re)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(D,{columns:(wn=r.tableData)==null?void 0:wn.columns,onUpdateColumns:e[3]||(e[3]=Re=>r.tableData.columns=Re)},null,8,["columns"]),((pn=r.tableData)==null?void 0:pn.export)!==!1?(f.openBlock(),f.createBlock(R,{key:2,table:t.table,columns:(ti=r.tableData)==null?void 0:ti.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):f.createCommentVNode("",!0),(zn=r.filterScheme)!=null&&zn.length?(f.openBlock(),f.createBlock($,{key:3,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...Re)=>a.toggleCardInfo&&a.toggleCardInfo(...Re)),class:"py-2 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"},[f.createVNode(G,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(Rn=(In=r.tableData)==null?void 0:In.filterState)!=null&&Rn.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),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"},[f.createElementVNode("div",Oq,[a.isNoData?(f.openBlock(),f.createBlock(Me,{key:1})):(f.openBlock(),f.createElementBlock("table",Bq,[f.createElementVNode("thead",Nq,[f.createElementVNode("tr",zq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,Re=>(f.openBlock(),f.createBlock(ee,{key:Re.name,style:f.normalizeStyle({width:a.rowWidth(Re==null?void 0:Re.name),textAlign:Re==null?void 0:Re.align,wordBreak:Re==null?void 0:Re.wrap}),data:Re,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(je=(Ee=a.getActions)==null?void 0:Ee.filter(Re=>Re!=="add"&&Re!=="view"))!=null&&je.length?(f.openBlock(),f.createElementBlock("th",Rq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Lq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Ye=r.tableData)==null?void 0:Ye.rows,(Re,sn)=>{var ve,_n,mr,qt,on,vi,wi,si,Wi,oi;return f.openBlock(),f.createElementBlock("tr",{key:sn,class:f.normalizeClass({"bg-gray-50":((_n=(ve=n.$route)==null?void 0:ve.query)==null?void 0:_n.card)===(Re==null?void 0:Re.id)})},[f.createElementVNode("td",Vq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(Re==null?void 0:Re.id),class:f.normalizeClass(["text-sm font-medium",[((mr=r.tableData)==null?void 0:mr.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(ce,{row:Re,column:a.columns[0],table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Fq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((qt=a.columns)==null?void 0:qt.slice(1),Oi=>(f.openBlock(),f.createElementBlock("td",{onClick:Qr=>a.changeActiveCardInfo(Re==null?void 0:Re.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start",{"cursor-pointer":r.isVisibleCardInfo}]),key:Oi.name},[f.createVNode(ce,{row:Re,column:Oi,table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,$q))),128)),(vi=(on=a.getActions)==null?void 0:on.filter(Oi=>Oi!=="add"&&Oi!=="view"))!=null&&vi.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(wi=n.$route)==null?void 0:wi.query)==null?void 0:si.card)===(Re==null?void 0:Re.id),"bg-white":((oi=(Wi=n.$route)==null?void 0:Wi.query)==null?void 0:oi.card)!==(Re==null?void 0:Re.id)}])},[f.createVNode(U,{actions:a.getActions,isForm:a.isForm,item:Re,table:t.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",jq,[f.createElementVNode("div",Uq,[f.createElementVNode("p",Hq,[f.createElementVNode("span",qq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((ot=r.tableData)==null?void 0:ot.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Wq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Gq,f.toDisplayString(" "+((Lt=r.tableData)==null?void 0:Lt.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Qt=r.tableData)==null?void 0:Qt.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(ke,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((At=r.tableData)==null?void 0:At.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var Re;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Pe,{key:0,table:t.table,columns:(Re=r.tableData)==null?void 0:Re.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Yq={components:{AdminTable:Ue(Eq,[["render",Zq],["__scopeId","data-v-c086c7f4"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Jr!=null&&Jr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(n){var e;n&&(document.title=(((e=ia.value)==null?void 0:e.titlePrefix)||"")+n)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async checkPageType(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const t=e==null?void 0:e.table;this.table=t||!1,!t&&this.getInterface()},async getInterface(){var n,e;try{const{data:t}=await ut.get(`/api/template/interface/${((e=(n=this.$route)==null?void 0:n.params)==null?void 0:e.catchAll)||""}`);this.interface=t||""}catch{this.interface=""}}}},Xq=["innerHTML"];function Kq(n,e,t,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,Xq))}const Jq=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(Yq,[["render",Kq]])},Symbol.toStringTag,{value:"Module"}));return mU});
|
794
|
+
`}).mount(t)}};window.addEventListener("click",n=>{var t,i,r;const e=(t=n==null?void 0:n.target)==null?void 0:t.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const a=e==null?void 0:e.getAttribute("_href");(r=(i=window==null?void 0:window.app)==null?void 0:i.router)==null||r.push(a),n==null||n.preventDefault()}});const pU=async()=>{try{const{data:n}=await ut.get("/api/user-menu");return Jr.value=n,t_(n)}catch(n){return console.error(n),[]}},fU=(n,e)=>{Object.entries(e).forEach(([t,i])=>{n.component(t,i)})},mU={async install(n,{componentsApp:e={},settings:t,routes:i=[]}){ia.value={...ia,...t};try{const a=(await pU()).filter(l=>l==null?void 0:l.component).map(l=>({...l,component:{...s_,...e}[l==null?void 0:l.component]}));fU(n,{...s_,...e}),n.component("admin",QT);const{router:u}=await BA(a.concat(i));window.app={...n,router:u},window.v3plugin={...n.config.globalProperties,...o_},n.config.globalProperties={...n.config.globalProperties,$componentsConfig:{...TB,componentsApp:e},$router:u,$v3plugin:o_,$utils:{reloadCardPage:Zf}},n.use(u)}catch(r){console.error(r)}},components:s_,plugins:o_},gU={data(){return{formValues:{},scheme:null,table:"",token:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const{data:{form:a}}=await ut.get(`/api/template/table/${t}`),{data:u}=await ut.get(`/api/table/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.token=(u==null?void 0:u.token)||"",this.formValues=u||{};const{data:l}=await ut.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async onlyEditObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},yU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},_U={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},bU={class:"flex items-center gap-[6px]"},xU={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},vU={class:"bg-white w-full rounded-xl border p-[20px] 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"};function wU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",yU,[f.createElementVNode("div",_U,[e[4]||(e[4]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),f.createElementVNode("div",bU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$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"}," Повернутися "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.onlyEditObject&&a.onlyEditObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти "),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...l)=>a.editObjectAndRedirect&&a.editObjectAndRedirect(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти і повернутися ")])]),f.createElementVNode("div",xU,[f.createElementVNode("div",vU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[3]||(e[3]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const kU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(gU,[["render",wU]])},Symbol.toStringTag,{value:"Module"})),SU={data(){return{formValues:{},scheme:null,table:"",token:"",api:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async getFormScheme(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const t=e==null?void 0:e.table;this.table=t;try{const a=await ut.get(`/api/table-data/${t}`),{data:u}=await ut.get(`/api/template/form/${(i=a==null?void 0:a.data)==null?void 0:i.form}`);this.scheme=(u==null?void 0:u.schema)||u,this.api=(u==null?void 0:u.api)||"",this.token=(r=a==null?void 0:a.data)==null?void 0:r.addToken}catch{}},async createObject(){var e,t,i,r,a,u,l,g,b;const n=this.$refs.form;try{await n.doValidation(),await ut.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(w){const E=((e=w==null?void 0:w.response)==null?void 0:e.data)||"";let C=((a=(r=(i=(t=Object.entries(n==null?void 0:n.formErrors))==null?void 0:t[0])==null?void 0:i[1])==null?void 0:r[0])==null?void 0:a.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(b=(g=(l=(u=Object.entries(n==null?void 0:n.formErrors))==null?void 0:u[0])==null?void 0:l[1])==null?void 0:g[0])==null?void 0:b.message;this.$notify({title:"Помилка!",message:E||C||"Сталася помилка валідаціі",type:"error"})}}}},EU={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},CU={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},TU={class:"flex items-center gap-[6px]"},MU={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},AU={class:"bg-white w-full rounded-xl border p-[20px] 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"};function PU(n,e,t,i,r,a){const u=f.resolveComponent("VsForm");return f.openBlock(),f.createElementBlock("div",EU,[f.createElementVNode("div",CU,[e[3]||(e[3]=f.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),f.createElementVNode("div",TU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=l=>n.$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"}," Скасувати "),f.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),f.createElementVNode("div",MU,[f.createElementVNode("div",AU,[r.scheme?(f.openBlock(),f.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):f.createCommentVNode("",!0)])])])}const IU=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(SU,[["render",PU]])},Symbol.toStringTag,{value:"Module"})),DU={};function OU(n,e,t,i,r,a){const u=f.resolveComponent("router-view");return f.openBlock(),f.createBlock(u)}const US=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(DU,[["render",OU]])},Symbol.toStringTag,{value:"Module"})),BU={},NU={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 zU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",NU,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),f.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const RU=Ue(BU,[["render",zU]]),LU={},VU={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FU(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",VU,e[0]||(e[0]=[f.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 $U=Ue(LU,[["render",FU]]),jU={components:{IconChevronDown:i_},props:{route:Object,searchable:String},mounted(){var n,e,t;(n=this.route)!=null&&n.menu&&(t=(e=this.route)==null?void 0:e.menu)!=null&&t.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},watch:{route(n){n!=null&&n.open&&(this.isOpen=!0)}},data(){return{isOpen:!1}},methods:{highLight(n){if(!this.searchable)return n;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`(${e})(\\s*)`,"gi");return n.replace(t,(i,r,a)=>`<span style="color:#1989fa;">${r}</span>${a}`)}}},UU={key:0,class:""},HU={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},qU={key:1};function WU(n,e,t,i,r,a){var g,b,w,E,C,P,D,R,$,G,ee,ce,U,Me,ke;const u=f.resolveComponent("IconChevronDown"),l=f.resolveComponent("router-link");return(g=t.route)!=null&&g.menu?(f.openBlock(),f.createElementBlock("div",UU,[f.createElementVNode("button",{onClick:e[0]||(e[0]=Pe=>r.isOpen=!r.isOpen),class:f.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",[((w=(b=t.route)==null?void 0:b.menu)==null?void 0:w.some(Pe=>{var Fe,Be;return(Pe==null?void 0:Pe.path)===n.$route.path.replace("/","")||(Pe==null?void 0:Pe.table)===((Be=(Fe=n.$route)==null?void 0:Fe.params)==null?void 0:Be.table)&&(Pe==null?void 0:Pe.table)}))&&"bg-gray-100"]])},[f.createTextVNode(f.toDisplayString((E=t.route)==null?void 0:E.ua)+" ",1),f.createVNode(u,{class:f.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var Pe;return[f.withDirectives(f.createElementVNode("ul",HU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Pe=t.route)==null?void 0:Pe.menu,(Fe,Be)=>{var pt,tt;return f.openBlock(),f.createElementBlock("li",{key:Be,class:"w-full"},[f.createVNode(l,{innerHTML:a.highLight(Fe==null?void 0:Fe.ua),to:"/"+(Fe==null?void 0:Fe.path),class:f.normalizeClass([[((Fe==null?void 0:Fe.path)===n.$route.path.replace("/","")||((tt=(pt=n.$route)==null?void 0:pt.params)==null?void 0:tt.table)===(Fe==null?void 0:Fe.table)&&(Fe==null?void 0:Fe.table))&&"bg-gray-100"],"block px-3 py-2 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],512),[[f.vShow,r.isOpen]])]}),_:1})])):(C=t.route)!=null&&C.hidden?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",qU,[f.createVNode(l,{innerHTML:a.highLight((P=t.route)==null?void 0:P.ua),to:((R=(D=t.route)==null?void 0:D.path)==null?void 0:R[0])==="/"?($=t.route)==null?void 0:$.path:"/"+((G=t.route)==null?void 0:G.path),class:f.normalizeClass([[(((ee=t.route)==null?void 0:ee.path.replace("/",""))===n.$route.path.replace("/","")||((U=(ce=n.$route)==null?void 0:ce.params)==null?void 0:U.table)===((Me=t.route)==null?void 0:Me.table)&&((ke=t.route)==null?void 0:ke.table))&&"bg-gray-100"],"inline-block py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},null,8,["innerHTML","to","class"])]))}const GU={components:{IconLogout:RU,NavbarItem:Ue(jU,[["render",WU]]),IconLogo:$U,IconSearch:n_},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var n;return(n=this.searchValue)!=null&&n.trim()?this.filterMenu(Jr.value,this.searchValue):Jr.value},logo(){var n;return((n=ia.value)==null?void 0:n.logo)||"/assets/logo.svg"}},methods:{filterMenu(n,e){return n.map(t=>{var i,r;if(t.menu){const a=this.filterMenu(t.menu,e);if(a.length>0)return{...t,menu:a,open:!0}}else if((r=(i=t.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e.toLowerCase()))return t;return null}).filter(Boolean)}}},ZU={class:"h-[59px] w-full p-[4px] mb-[10px]"},YU=["src"],XU={class:"relative mx-[16px] pl"},KU={class:"p-[16px] 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"},JU={class:"flex flex-col flex-wrap w-full pb-3"},QU={key:0,class:"flex flex-col gap-[6px]"},e9={key:1,class:"text-gray-800 text-lg mt-[20px]"};function t9(n,e,t,i,r,a){var b;const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("NavbarItem");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] border-r w-[260px] shrink-0 absolute transition left-[-100%] z-[11] bg-white",[{"left-0":n.$parent.showMenu}]])},[f.createElementVNode("div",ZU,[f.createElementVNode("img",{src:a.logo,class:"object-contain w-full h-full"},null,8,YU)]),f.createElementVNode("div",XU,[f.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[16px] text-gray-500 z-[1]"}),f.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=w=>r.searchValue=w),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:pl-[40px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),f.createElementVNode("div",KU,[f.createElementVNode("nav",JU,[(b=a.data)!=null&&b.length?(f.openBlock(),f.createElementBlock("ul",QU,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.data,(w,E)=>(f.openBlock(),f.createElementBlock("li",{key:E,class:"flex flex-col gap-[6px]"},[f.createVNode(g,{route:w,searchable:r.searchValue},null,8,["route","searchable"])]))),128))])):(f.openBlock(),f.createElementBlock("div",e9,"Не знайдено"))])])],2)}const n9=Ue(GU,[["render",t9]]),i9={},r9={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 s9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",r9,e[0]||(e[0]=[f.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),f.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),f.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const o9={components:{IconQuestion:Ue(i9,[["render",s9]]),IconUser:VS,AdminNotification:FS},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(n){n?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:n}=await ut.get("/user");this.userData=n}catch{}},async logout(){try{await ut.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},a9={class:"h-[60px] border-b flex lg:justify-end justify-between items-center px-[20px]"},l9={class:"flex items-center gap-[6px]"},c9={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"},u9={class:"relative"},h9=["src"],d9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},p9={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},f9=["src"],m9={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},g9={class:"text-[14px] mr-[10px] text-gray-500"},y9={class:"flex flex-col p-[4px]"};function _9(n,e,t,i,r,a){var w,E,C,P,D,R,$,G,ee,ce;const u=f.resolveComponent("IconQuestion"),l=f.resolveComponent("AdminNotification"),g=f.resolveComponent("IconUser"),b=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",a9,[f.createElementVNode("div",{class:"lg:hidden flex",onClick:e[0]||(e[0]=U=>n.$parent.showMenu=!0)},e[4]||(e[4]=[f.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)])),f.createElementVNode("div",l9,[f.createElementVNode("a",c9,[f.createVNode(u,{height:"24",width:"24"})]),f.createVNode(l),e[6]||(e[6]=f.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),f.createElementVNode("div",u9,[f.createElementVNode("div",{onClick:e[1]||(e[1]=U=>r.isVisible=!0),class:"cursor-pointer"},[(E=(w=r.userData)==null?void 0:w.user)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(P=(C=r.userData)==null?void 0:C.user)==null?void 0:P.avatar,alt:"Image Description"},null,8,h9)):(f.openBlock(),f.createElementBlock("div",d9,[f.createVNode(g)]))]),r.isVisible?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=f.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[f.createElementVNode("div",p9,[(R=(D=r.userData)==null?void 0:D.user)!=null&&R.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=($=r.userData)==null?void 0:$.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,f9)):(f.openBlock(),f.createElementBlock("div",m9,[f.createVNode(g)])),f.createElementVNode("div",null,[f.createElementVNode("p",g9,f.toDisplayString((ce=(ee=r.userData)==null?void 0:ee.user)==null?void 0:ce.username),1)])]),f.createElementVNode("div",y9,[f.createVNode(b,{to:"profile",disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:f.withCtx(()=>e[5]||(e[5]=[f.createTextVNode("Профіль")])),_:1}),f.createElementVNode("button",{onClick:e[2]||(e[2]=(...U)=>a.logout&&a.logout(...U)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):f.createCommentVNode("",!0)])])])}const b9={components:{navbar:n9,AdminHeader:Ue(o9,[["render",_9]])},data(){return{showMenu:!1}},computed:{isMenu(){return Jr.value||null},header(){var n;return((n=ia.value)==null?void 0:n.header)||"admin-header"}}},x9={class:"admin-wrapper"},v9={class:"flex flex-col w-full"};function w9(n,e,t,i,r,a){const u=f.resolveComponent("navbar"),l=f.resolveComponent("router-view");return f.openBlock(),f.createElementBlock("div",x9,[f.createVNode(u),r.showMenu?(f.openBlock(),f.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=g=>r.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"})):f.createCommentVNode("",!0),f.createElementVNode("div",v9,[a.isMenu?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.header))),f.createVNode(l)],64)):f.createCommentVNode("",!0)])])}const k9=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(b9,[["render",w9],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),S9={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var n,e;return((n=this.data)==null?void 0:n.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var n,e;return(e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(n){n!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(n){switch(n){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(n){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(n);const e=this.$route.query,{sort:t,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(n){return`${this.data.name}-${n}`===this.selectedSortParam}}},E9={scope:"col",class:"text-start px-2 py-1"},C9={class:"flex-shrink-0 size-3.5",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"},T9={key:0,d:"m7 15 5 5 5-5"},M9={key:1,d:"m7 9 5-5 5 5"},A9={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal"};function P9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("th",E9,[a.getVisibleIcon?(f.openBlock(),f.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[f.createTextVNode(f.toDisplayString(a.label)+" ",1),(f.openBlock(),f.createElementBlock("svg",C9,[r.currentSort==="asc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",T9)):f.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(f.openBlock(),f.createElementBlock("path",M9)):f.createCommentVNode("",!0)]))])):(f.openBlock(),f.createElementBlock("p",A9,f.toDisplayString(a.label),1))])}const I9=Ue(S9,[["render",P9]]),D9={components:{IconMore:J0,IconDelete:zS,IconEdit:RS},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(n=>typeof n=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var n;try{const{data:e}=await ut.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);await ut.delete(`/api/table/${e==null?void 0:e.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(n){var e,t;document.querySelector("body").click(),n!=null&&n.form?(await this.$v3plugin.$form({form:n==null?void 0:n.form,id:(e=this.item)==null?void 0:e.id,api:n==null?void 0:n.api,title:n==null?void 0:n.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:n==null?void 0:n.confirm,api:n==null?void 0:n.api,method:n==null?void 0:n.method,id:(t=this.item)==null?void 0:t.id,isId:(n==null?void 0:n.isId)||!1})}}},O9={class:"hs-dropdown [--placement:bottom-right] inline-flex"},B9={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"},N9={class:"flex flex-col items-start"},z9=["onClick"],R9={class:"text-gray-800"},L9={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},V9={class:"p-4"},F9={class:"flex justify-end mt-4 gap-x-3"};function $9(n,e,t,i,r,a){const u=f.resolveComponent("IconMore"),l=f.resolveComponent("IconEdit"),g=f.resolveComponent("router-link"),b=f.resolveComponent("IconDelete"),w=f.resolveComponent("VsPopover"),E=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",O9,[f.createVNode(w,{trigger:"click",placement:"bottom-left"},{reference:f.withCtx(()=>[f.createElementVNode("button",B9,[f.createVNode(u,{height:"16",width:"16"})])]),default:f.withCtx(()=>{var C,P,D,R,$;return[f.createElementVNode("div",N9,[(C=t.actions)!=null&&C.includes("edit")&&t.isForm?(f.openBlock(),f.createBlock(g,{key:0,to:`/edit?table=${(D=(P=n.$route)==null?void 0:P.params)==null?void 0:D.catchAll}&id=${(R=t.item)==null?void 0:R.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:f.withCtx(()=>[f.createVNode(l,{color:"#000"}),e[4]||(e[4]=f.createTextVNode(" Редагувати "))]),_:1},8,["to"])):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.getCustomActions,(G,ee)=>(f.openBlock(),f.createElementBlock("button",{key:ee,onClick:ce=>a.customButtonAction(G),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"},[f.createVNode(b,{class:"opacity-0"}),f.createElementVNode("span",R9,f.toDisplayString(G==null?void 0:G.label),1)],8,z9))),128)),t.isForm?(f.openBlock(),f.createElementBlock("div",L9)):f.createCommentVNode("",!0),($=t.actions)!=null&&$.includes("del")?(f.openBlock(),f.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=f.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["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"},[f.createVNode(b),e[5]||(e[5]=f.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):f.createCommentVNode("",!0)])]}),_:1})]),f.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=C=>r.isDeleteConfirm=C),size:"small",title:"Ви впевнені?"},{default:f.withCtx(()=>[f.createElementVNode("div",V9,[e[6]||(e[6]=f.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),f.createElementVNode("div",F9,[f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 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",onClick:e[1]||(e[1]=C=>r.isDeleteConfirm=!1)}," Скасувати "),f.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...C)=>a.deleteElement&&a.deleteElement(...C))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const j9=Ue(D9,[["render",$9]]),U9={},H9={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 q9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",H9,e[0]||(e[0]=[f.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),f.createElementVNode("path",{d:"M7 20V4"},null,-1),f.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),f.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const W9=Ue(U9,[["render",q9]]),G9={},Z9={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 Y9(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",Z9,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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),f.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const X9={components:{IconExport:W9,IconChevronDown:i_,IconSuccess:Ue(G9,[["render",Y9]])},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:"Жодного"}]}},watch:{isOpen(n){n||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var n;if(!((n=this.cols)!=null&&n.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await ut.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},responseType:"blob"}),t=await e.data.text(),i=t!=null&&t.includes(";")?null:JSON==null?void 0:JSON.parse(t),r=new Blob([e.data],{type:"application/octet-stream"}),a=window.URL.createObjectURL(r),u=document.createElement("a");if(u.href=a,u.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(u),typeof i=="string"){this.exportTable();return}u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(a),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(n){this.format=n},choceAll(){var n;this.cols=(n=this.columns)==null?void 0:n.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var n,e;this.cols=(e=(n=this.columns)==null?void 0:n.filter(t=>(t==null?void 0:t.hidden)!==!0))==null?void 0:e.map(t=>t==null?void 0:t.name),this.activeAction="choceVisible"}}},K9={key:0,class:"flex flex-col items-center"},J9={key:1,class:"p-4"},Q9={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},eH={class:"flex items-center"},tH={class:"flex items-center gap-[10px] ml-auto"},nH=["onClick"],iH={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},rH={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},sH={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},oH={class:"mt-2 space-y-2"},aH=["id","onChange"],lH=["for"],cH={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},uH={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hH(n,e,t,i,r,a){const u=f.resolveComponent("IconExport"),l=f.resolveComponent("IconChevronDown"),g=f.resolveComponent("IconSuccess"),b=f.resolveComponent("VsCheckbox"),w=f.resolveComponent("VsDialog");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=E=>r.isOpen=!0),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[7]||(e[7]=f.createTextVNode(" Експорт ")),f.createVNode(l,{height:"12",width:"16"})]),f.createVNode(w,{visible:r.isOpen,"onUpdate:visible":e[6]||(e[6]=E=>r.isOpen=E),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",cH,[f.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=>r.isOpen=!1)}," Закрити "),f.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=>r.isSuccessTemplate=!1)}," Вигрузити ще ")])):(f.openBlock(),f.createElementBlock("div",uH,[f.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=>r.isOpen=!1)}," Скасувати "),f.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[5]||(e[5]=(...E)=>a.exportTable&&a.exportTable(...E))}," Завантажити таблицю ")]))]),default:f.withCtx(()=>[r.isSuccessTemplate?(f.openBlock(),f.createElementBlock("div",K9,[f.createVNode(g,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=f.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(f.openBlock(),f.createElementBlock("div",J9,[f.createElementVNode("div",Q9,[f.createElementVNode("div",eH,[e[9]||(e[9]=f.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),f.createElementVNode("div",tH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.actions,E=>(f.openBlock(),f.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"},[f.createElementVNode("span",{class:f.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(E==null?void 0:E.name)===r.activeAction}])},[(E==null?void 0:E.name)===r.activeAction?(f.openBlock(),f.createElementBlock("span",iH)):f.createCommentVNode("",!0)],2),f.createTextVNode(" "+f.toDisplayString(E==null?void 0:E.label),1)],8,nH))),128))])]),f.createElementVNode("div",rH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C,style:{width:"calc((100% - 10px) / 2)"}},[f.createVNode(b,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=P=>r.cols=P),value:E==null?void 0:E.name,label:E==null?void 0:E.ua},null,8,["modelValue","value","label"])]))),128))])]),f.createElementVNode("div",sH,[e[10]||(e[10]=f.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),f.createElementVNode("div",oH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(r.tableFormats,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"flex items-center",key:C},[f.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:P=>a.selectFormat(E)},null,40,aH),f.createElementVNode("label",{for:E,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+f.toDisplayString(E),9,lH)]))),128))])])]))]),_:1},8,["visible"])],64)}const dH=Ue(X9,[["render",hH]]),pH={},fH={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-columns"};function mH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",fH,e[0]||(e[0]=[f.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const gH=Ue(pH,[["render",mH]]),yH={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(n){this.$emit("update-column",{...this.column,hidden:!n})}},mounted(){var n;((n=this.column)==null?void 0:n.hidden)!==!0&&(this.value=!0)}},_H={class:"flex w-full gap-[8px] items-centr"};function bH(n,e,t,i,r,a){var u,l;return f.openBlock(),f.createElementBlock("label",_H,[f.withDirectives(f.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=g=>r.value=g),type:"checkbox"},null,512),[[f.vModelCheckbox,r.value]]),f.createTextVNode(" "+f.toDisplayString(((u=t.column)==null?void 0:u.ua)||((l=t.column)==null?void 0:l.title)),1)])}const xH={components:{IconColumns:gH,AdminTableColumnsHiddenItem:Ue(yH,[["render",bH]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(n){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(n==null?void 0:n.name)),t=this.columns;t[e]=n,this.$emit("update-columns",[...t])}}},vH={class:"py-2 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"},wH={class:"py-[10px] px-[10px] w-[260px]"},kH={class:"flex flex-col gap-[3px] max-h-[400px] w-full 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"};function SH(n,e,t,i,r,a){const u=f.resolveComponent("IconColumns"),l=f.resolveComponent("AdminTableColumnsHiddenItem"),g=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(g,{trigger:"click",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",vH,[f.createVNode(u,{height:"20",width:"16"})])]),default:f.withCtx(()=>[f.createElementVNode("div",wH,[e[0]||(e[0]=f.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),f.createElementVNode("ul",kH,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(b,w)=>(f.openBlock(),f.createElementBlock("li",{key:w},[f.createVNode(l,{column:b,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const EH=Ue(xH,[["render",SH]]),CH={},TH={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function MH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",TH,e[0]||(e[0]=[f.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const a_=Ue(CH,[["render",MH]]),AH={props:{row:Object,column:Object,table:String}};function PH(n,e,t,i,r,a){var u,l,g,b,w,E,C,P;return f.openBlock(),f.createBlock(f.resolveDynamicComponent(((u=t.column)==null?void 0:u.format)==="custom"?(l=t.column)==null?void 0:l.component:`table-format-${((b=(g=t.column)==null?void 0:g.format)==null?void 0:b.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>n.$emit("update-table")),name:(w=t.column)==null?void 0:w.name,data:t.row,value:(C=t.row)==null?void 0:C[(E=t.column)==null?void 0:E.name],table:t.table,column:t.column,edit:(P=t.column)==null?void 0:P.edit},null,40,["name","data","value","table","column","edit"])}const HS=Ue(AH,[["render",PH]]),IH={},DH={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 OH(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",DH,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const BH={components:{IconPlus:a_,IconMinus:Ue(IH,[["render",OH]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},NH={class:"hs-accordion"},zH={class:"py-0.5 flex items-center gap-x-0.5 w-full"},RH={class:"text-sm font-medium"},LH={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function VH(n,e,t,i,r,a){const u=f.resolveComponent("IconPlus"),l=f.resolveComponent("IconMinus");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[f.createElementVNode("div",NH,[f.createElementVNode("div",zH,[f.createElementVNode("div",{onClick:e[0]||(e[0]=g=>r.expanded=!r.expanded),class:"rounded-md cursor-pointer grow"},[f.createElementVNode("span",RH,f.toDisplayString(t.title),1)]),f.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=g=>r.expanded=!r.expanded)},[r.expanded?(f.openBlock(),f.createBlock(l,{key:1,width:"14"})):(f.openBlock(),f.createBlock(u,{key:0}))])]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",LH,[f.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[f.vShow,r.expanded]])]),_:3})])])])}const FH={components:{AdminComponentIs:HS,AdminTree:Ue(BH,[["render",VH],["__scopeId","data-v-c6318482"]]),VsNoData:$S,VsWidgetComments:BS,VsWidgetMap:sy,VsWidgetFileList:Kv},props:{table:String,columns:Array,row:Object}},$H={class:"hs-accordion border-gray-100 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 - 310px)"}},jH={class:"border-l",style:{height:"calc(100vh - 360px)"}},UH={class:"flex items-center justify-between py-1 gap-x-4"},HH={class:"col-span-1"},qH={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},WH={class:"col-span-2"},GH={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},ZH={class:"table-info-card"},YH={class:"table-info-card"};function XH(n,e,t,i,r,a){var C,P,D;const u=f.resolveComponent("AdminComponentIs"),l=f.resolveComponent("AdminTree"),g=f.resolveComponent("VsWidgetMap"),b=f.resolveComponent("VsNoData"),w=f.resolveComponent("VsWidgetComments"),E=f.resolveComponent("VsWidgetFileList");return f.openBlock(),f.createElementBlock("div",$H,[e[0]||(e[0]=f.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[f.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),f.createElementVNode("div",jH,[(P=(C=n.$route)==null?void 0:C.query)!=null&&P.card?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[t.row?(f.openBlock(),f.createBlock(l,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,R=>(f.openBlock(),f.createElementBlock("dl",UH,[f.createElementVNode("dt",HH,[f.createElementVNode("p",qH,f.toDisplayString((R==null?void 0:R.ua)||(R==null?void 0:R.title))+": ",1)]),f.createElementVNode("dd",WH,[f.createElementVNode("p",GH,[f.createVNode(u,{row:t.row,column:R,table:t.table},null,8,["row","column","table"])])])]))),256))]),_:1})):f.createCommentVNode("",!0),(D=t.row)!=null&&D.geom?(f.openBlock(),f.createBlock(l,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R,$;return[(R=t.row)!=null&&R.geom?(f.openBlock(),f.createBlock(g,{key:0,geometry:($=t.row)==null?void 0:$.geom,zoom:14},null,8,["geometry"])):(f.openBlock(),f.createBlock(b,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):f.createCommentVNode("",!0),f.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",ZH,[f.createVNode(w,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1}),f.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:f.withCtx(()=>{var R;return[f.createElementVNode("div",YH,[f.createVNode(E,{id:(R=t.row)==null?void 0:R.id},null,8,["id"])])]}),_:1})],64)):(f.openBlock(),f.createBlock(b,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const KH=Ue(FH,[["render",XH]]),JH={},QH={class:"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 eq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",QH,e[0]||(e[0]=[f.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),f.createElementVNode("path",{d:"M15 3v18"},null,-1),f.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const tq=Ue(JH,[["render",eq]]),nq={},iq={class:"h21yx vs0hq",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"};function rq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",iq,e[0]||(e[0]=[f.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const sq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ue(nq,[["render",rq]])},data(){return{isFilters:!1}},methods:{closeFilter({target:n}){this.isFilters&&n.classList.contains("filter-container")&&(this.isFilters=!1)}}},oq={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},aq={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-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 lq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter"),l=f.resolveComponent("VsFilter");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("button",{onClick:e[0]||(e[0]=g=>r.isFilters=!r.isFilters),class:"py-2 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"},[f.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=f.createTextVNode(" Фільтри ")),t.onFilters?(f.openBlock(),f.createElementBlock("span",oq,f.toDisplayString(t.onFilters),1)):f.createCommentVNode("",!0)]),f.createVNode(f.Transition,{name:"fade"},{default:f.withCtx(()=>{var g;return[f.withDirectives(f.createElementVNode("div",{onClick:e[3]||(e[3]=(...b)=>a.closeFilter&&a.closeFilter(...b)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[f.createElementVNode("div",aq,[(g=t.scheme)!=null&&g.length?(f.openBlock(),f.createBlock(l,{key:0,ref:"filter",scheme:t.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=b=>n.$emit("filterChange",b)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=b=>r.isFilters=!1)},null,8,["scheme"])):f.createCommentVNode("",!0)])],512),[[f.vShow,r.isFilters]])]}),_:1})],64)}const cq=Ue(sq,[["render",lq]]),uq={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},hq={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"},dq=["onClick"];function pq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("nav",hq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.tabsList,u=>(f.openBlock(),f.createElementBlock("button",{onClick:l=>n.$emit("update:filterState",u==null?void 0:u.name),class:f.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":(u==null?void 0:u.name)===t.filterState}])},f.toDisplayString(u==null?void 0:u.label),11,dq))),256))])}const fq=Ue(uq,[["render",pq]]),mq={},gq={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 yq(n,e,t,i,r,a){return f.openBlock(),f.createElementBlock("svg",gq,e[0]||(e[0]=[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),f.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 _q={components:{IconFilter2:Ue(mq,[["render",yq]])},props:{filterCustom:String,customList:Array}},bq={class:"py-2 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"},xq={class:"flex flex-col gap-[4px]"},vq=["onClick"];function wq(n,e,t,i,r,a){const u=f.resolveComponent("IconFilter2"),l=f.resolveComponent("VsPopover");return f.openBlock(),f.createBlock(l,{ref:"popover",placement:"bottom"},{reference:f.withCtx(()=>[f.createElementVNode("button",bq,[f.createVNode(u,{height:"20",width:"20"})])]),default:f.withCtx(()=>[f.createElementVNode("div",xq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.customList,(g,b)=>(f.openBlock(),f.createElementBlock("button",{onClick:w=>{var E;n.$emit("update:filterCustom",g==null?void 0:g.name),(E=n.$refs)==null||E.popover.togglePopover()},key:b,class:f.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":t.filterCustom===(g==null?void 0:g.name)}])},f.toDisplayString(g==null?void 0:g.label),11,vq))),128)),f.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=g=>{var b;n.$emit("update:filterCustom",void 0),(b=n.$refs)==null||b.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const kq=Ue(_q,[["render",wq]]),Sq={class:"flex items-center gap-x-2"},Eq={props:{table:String,title:String},components:{AdminTableControl:j9,AdminTableExport:dH,AdminTableColumnsHidden:EH,AdminTableColumn:I9,AdminNodata:e_,IconPlus:a_,IconSearch:n_,AdminTableCardInfo:KH,IconOpenCard:tq,AdminComponentIs:HS,AdminTableFilters:cq,AdminTableTabs:fq,AdminTableCustomFilters:kq,AdminTableCustomButtons:{__name:"admin-table-custom-buttons",props:{slots:Object},setup(n){var l,g,b,w,E;const{asyncTemplateSlot:e}=(E=(w=(b=(g=(l=f.getCurrentInstance())==null?void 0:l.appContext)==null?void 0:g.app)==null?void 0:b.config)==null?void 0:w.globalProperties)==null?void 0:E.utils,t=f.ref(""),i=f.ref(""),r=n,a=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelLeft||(i.value="div"),(D=(P=r.slots)==null?void 0:P.panelLeft)!=null&&D.includes("<")){const G=e("PanelLeft",(R=r.slots)==null?void 0:R.panelLeft,["name"]);i.value=G}else i.value=($=r.slots)==null?void 0:$.panelLeft},u=()=>{var C,P,D,R,$;if((C=r.slots)!=null&&C.panelRight||(t.value="div"),(D=(P=r.slots)==null?void 0:P.panelRight)!=null&&D.includes("<")){const G=e("PanelRight",(R=r.slots)==null?void 0:R.panelRight,["name"]);t.value=G}else t.value=($=r.slots)==null?void 0:$.panelRight};return a(),u(),(C,P)=>(f.openBlock(),f.createElementBlock("div",Sq,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(i.value))),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value)))]))}},AdminCustomButtonAdd:{__name:"admin-custom-button-add",props:{slots:Object},setup(n){var a,u,l,g,b;const{asyncTemplateSlot:e}=(b=(g=(l=(u=(a=f.getCurrentInstance())==null?void 0:a.appContext)==null?void 0:u.app)==null?void 0:l.config)==null?void 0:g.globalProperties)==null?void 0:b.utils,t=f.ref(""),i=n;return(()=>{var w,E,C,P,D;if((w=i.slots)!=null&&w.addButton||(t.value="div"),(C=(E=i.slots)==null?void 0:E.addButton)!=null&&C.includes("<")){const R=e("addButton",(P=i.slots)==null?void 0:P.addButton,["IconPlus"]);t.value=R}else t.value=(D=i.slots)==null?void 0:D.addButton})(),(w,E)=>t.value?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(t.value),{key:0,IconPlus:a_})):f.createCommentVNode("",!0)}}},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var n,e;return((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1},columns(){var n,e;return(e=(n=this.tableData)==null?void 0:n.columns)==null?void 0:e.filter(t=>(t==null?void 0:t.hidden)!==!0)},isForm(){var n,e,t;return((n=this.tableData)==null?void 0:n.form)&&((t=(e=this.tableData)==null?void 0:e.actions)==null?void 0:t.includes("add"))},isNoData(){var n,e;return!((n=this.tableData)!=null&&n.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var n,e;return((e=(n=this.tableData)==null?void 0:n.rows)==null?void 0:e.find(t=>{var i,r;return(t==null?void 0:t.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var n;return(n=this.tableData)==null?void 0:n.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:((n,e=300)=>{let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}})(async function(n){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:n||void 0}})},500)},$route:{handler(n,e){var t,i;((t=n==null?void 0:n.params)==null?void 0:t.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(n){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:n}})},filterState(n){var e;n&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:n}}),this.getTableData())},filterCustom(n){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:n}}),this.getTableData()},columns(n){var e,t,i,r;this.visibleColumns=n==null?void 0:n.map(a=>a==null?void 0:a.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,columns:(i=this.visibleColumns)!=null&&i.length?(r=this.visibleColumns)==null?void 0:r.join(","):void 0}})}},methods:{async checkUrlMounted(){var n,e,t,i,r,a,u,l,g,b,w,E,C,P,D,R,$;this.page=((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.page)||1,this.limit=((i=(t=this.$route)==null?void 0:t.query)==null?void 0:i.limit)||20,this.filters=((u=decodeURI((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filter))==null?void 0:u.replaceAll("+"," "))||null,this.filterState=((g=(l=this.$route)==null?void 0:l.query)==null?void 0:g.filterState)||null,this.filterCustom=((w=(b=this.$route)==null?void 0:b.query)==null?void 0:w.custom)||null,this.searchValue=((C=(E=this.$route)==null?void 0:E.query)==null?void 0:C.search)||"",this.visibleColumns=((R=(D=(P=this.$route)==null?void 0:P.query)==null?void 0:D.columns)==null?void 0:R.split(","))||[],($=this.$route)!=null&&$.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(n){var t,i;const e=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.find(r=>r.name===n);if(e){const r=e==null?void 0:e.width;return typeof r=="number"?`${r}px`:r!=null&&r.includes("px")?r:`${r}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 n,e,t,i,r,a,u,l,g,b,w;try{const{data:E}=await ut.get(`/api/template/table/${this.table}`),C=await ut.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(n=this.$route)==null?void 0:n.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...E,...(C==null?void 0:C.data)||{}},this.initialHiddenColumns=(a=(r=(i=(t=this.tableData)==null?void 0:t.columns)==null?void 0:i.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:r.map(P=>P==null?void 0:P.name))==null?void 0:a.join(","),(u=this.visibleColumns)!=null&&u.length?(l=this.tableData)==null||l.columns.forEach(P=>{var D;(D=this.visibleColumns)!=null&&D.includes(P==null?void 0:P.name)?P.hidden=!1:P.hidden=!0}):this.visibleColumns=(w=(b=(g=this.tableData)==null?void 0:g.columns)==null?void 0:b.filter(P=>(P==null?void 0:P.hidden)!==!0))==null?void 0:w.map(P=>P==null?void 0:P.name)}catch{}},async getFilters(){var n;try{const{data:e}=await ut.get(`/api/table-filter/${this.table}`);this.filterScheme=(n=e==null?void 0:e.list)==null?void 0:n.map(t=>({...t,label:(t==null?void 0:t.label)||(t==null?void 0:t.ua)}))}catch{}},async handlePageChange(n){const e=this.$route.query;this.page=n,!(!(e!=null&&e.page)&&n===1||e.page===n)&&(await this.$router.replace({query:{...e,page:n}}),await this.getTableData())},async changeLimit(n){this.limit=await n,this.defaultPage=1,await this.getTableData()},async filterChange({url:n,state:e}){var t;this.filters=n!=="no-url"?n:null,this.onFilters=(t=Object.entries(e))==null?void 0:t.length,this.page=1,await this.getTableData()},changeActiveColumn(n){this.activeColumn=n,this.getTableData()},pushToCard(n){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${n}`)},changeActiveCardInfo(n){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:n}})},toggleCardInfo(){var n;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,card:void 0}})}}},Cq={class:"w-[calc(100vw - 320px)] bg-gray-50"},Tq={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},Mq={class:"text-xl font-medium"},Aq={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Pq={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Iq={class:"flex"},Dq={class:"flex gap-[6px] ml-auto"},Oq={class:"inline-block w-full align-middle"},Bq={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Nq={class:"sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},zq={class:"right-0 border-t border-stone-200"},Rq={key:0,class:"w-[70px] sticky right-0 top-0"},Lq={class:"divide-y divide-gray-200"},Vq={class:"px-4 py-3 text-sm text-gray-600"},Fq=["onClick"],$q=["onClick"],jq={class:"p-[20px] flex justify-start items-center w-full"},Uq={class:"w-[200px] md:inline-flex hidden"},Hq={class:"text-sm text-gray-600 dark:text-neutral-400"},qq={class:"font-semibold text-gray-800 dark:text-neutral-200"},Wq={key:0},Gq={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function Zq(n,e,t,i,r,a){var Fe,Be,pt,tt,Nt,rt,Mt,Rt,Ft,zt,Ht,yn,dn,wn,pn,ti,zn,In,Rn,Ee,je,Ye,ot,Lt,Qt,At;const u=f.resolveComponent("AdminCustomButtonAdd"),l=f.resolveComponent("IconPlus"),g=f.resolveComponent("router-link"),b=f.resolveComponent("AdminTableTabs"),w=f.resolveComponent("IconSearch"),E=f.resolveComponent("VsText"),C=f.resolveComponent("AdminTableCustomButtons"),P=f.resolveComponent("AdminTableCustomFilters"),D=f.resolveComponent("AdminTableColumnsHidden"),R=f.resolveComponent("AdminTableExport"),$=f.resolveComponent("AdminTableFilters"),G=f.resolveComponent("IconOpenCard"),ee=f.resolveComponent("AdminTableColumn"),ce=f.resolveComponent("AdminComponentIs"),U=f.resolveComponent("AdminTableControl"),Me=f.resolveComponent("AdminNodata"),ke=f.resolveComponent("VsPagination"),Pe=f.resolveComponent("AdminTableCardInfo");return f.openBlock(),f.createElementBlock("div",Cq,[f.createElementVNode("div",Tq,[f.createElementVNode("h2",Mq,f.toDisplayString(t.title),1),a.isForm?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(Be=(Fe=r.tableData)==null?void 0:Fe.slots)!=null&&Be.addButton?(f.openBlock(),f.createBlock(u,{key:0,slots:(pt=r.tableData)==null?void 0:pt.slots},null,8,["slots"])):(f.openBlock(),f.createBlock(g,{key:1,to:`/add?table=${(Nt=(tt=n.$route)==null?void 0:tt.params)==null?void 0:Nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:f.withCtx(()=>[f.createVNode(l,{height:"16",width:"16"}),e[5]||(e[5]=f.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):f.createCommentVNode("",!0)]),f.createElementVNode("div",Aq,[f.createElementVNode("div",Pq,[(Mt=(rt=r.tableData)==null?void 0:rt.filterState)!=null&&Mt.length?(f.openBlock(),f.createBlock(b,{key:0,tabsList:(Rt=r.tableData)==null?void 0:Rt.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Re=>r.filterState=Re)},null,8,["tabsList","filterState"])):f.createCommentVNode("",!0),f.createElementVNode("div",Iq,[f.createElementVNode("div",{class:f.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[f.createElementVNode("div",{class:f.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createVNode(w,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),f.createVNode(E,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Re=>r.searchValue=Re),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>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"]),f.createElementVNode("div",Dq,[(Ft=r.tableData)!=null&&Ft.slots?(f.openBlock(),f.createBlock(C,{key:0,slots:(zt=r.tableData)==null?void 0:zt.slots},null,8,["slots"])):f.createCommentVNode("",!0),(yn=(Ht=r.tableData)==null?void 0:Ht.filterCustom)!=null&&yn.length?(f.openBlock(),f.createBlock(P,{key:1,customList:(dn=r.tableData)==null?void 0:dn.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Re=>r.filterCustom=Re)},null,8,["customList","filterCustom"])):f.createCommentVNode("",!0),f.createVNode(D,{columns:(wn=r.tableData)==null?void 0:wn.columns,onUpdateColumns:e[3]||(e[3]=Re=>r.tableData.columns=Re)},null,8,["columns"]),((pn=r.tableData)==null?void 0:pn.export)!==!1?(f.openBlock(),f.createBlock(R,{key:2,table:t.table,columns:(ti=r.tableData)==null?void 0:ti.columns,page:r.page,"filter-state":r.filterState,"filter-custom":r.filterCustom,filters:r.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):f.createCommentVNode("",!0),(zn=r.filterScheme)!=null&&zn.length?(f.openBlock(),f.createBlock($,{key:3,scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"])):f.createCommentVNode("",!0),f.createElementVNode("button",{onClick:e[4]||(e[4]=(...Re)=>a.toggleCardInfo&&a.toggleCardInfo(...Re)),class:"py-2 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"},[f.createVNode(G,{class:f.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),f.createElementVNode("div",{class:f.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[f.createElementVNode("div",{style:f.normalizeStyle({height:(Rn=(In=r.tableData)==null?void 0:In.filterState)!=null&&Rn.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),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"},[f.createElementVNode("div",Oq,[a.isNoData?(f.openBlock(),f.createBlock(Me,{key:1})):(f.openBlock(),f.createElementBlock("table",Bq,[f.createElementVNode("thead",Nq,[f.createElementVNode("tr",zq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(a.columns,Re=>(f.openBlock(),f.createBlock(ee,{key:Re.name,style:f.normalizeStyle({width:a.rowWidth(Re==null?void 0:Re.name),textAlign:Re==null?void 0:Re.align,wordBreak:Re==null?void 0:Re.wrap}),data:Re,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(je=(Ee=a.getActions)==null?void 0:Ee.filter(Re=>Re!=="add"&&Re!=="view"))!=null&&je.length?(f.openBlock(),f.createElementBlock("th",Rq)):f.createCommentVNode("",!0)])]),f.createElementVNode("tbody",Lq,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((Ye=r.tableData)==null?void 0:Ye.rows,(Re,sn)=>{var ve,_n,mr,qt,on,vi,wi,si,Wi,oi;return f.openBlock(),f.createElementBlock("tr",{key:sn,class:f.normalizeClass({"bg-gray-50":((_n=(ve=n.$route)==null?void 0:ve.query)==null?void 0:_n.card)===(Re==null?void 0:Re.id)})},[f.createElementVNode("td",Vq,[f.createElementVNode("button",{onClick:()=>a.pushToCard(Re==null?void 0:Re.id),class:f.normalizeClass(["text-sm font-medium",[((mr=r.tableData)==null?void 0:mr.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[f.createVNode(ce,{row:Re,column:a.columns[0],table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,Fq)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList((qt=a.columns)==null?void 0:qt.slice(1),Oi=>(f.openBlock(),f.createElementBlock("td",{onClick:Qr=>a.changeActiveCardInfo(Re==null?void 0:Re.id),class:f.normalizeClass(["px-3 py-3 text-sm text-gray-600 text-start",{"cursor-pointer":r.isVisibleCardInfo}]),key:Oi.name},[f.createVNode(ce,{row:Re,column:Oi,table:t.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,$q))),128)),(vi=(on=a.getActions)==null?void 0:on.filter(Oi=>Oi!=="add"&&Oi!=="view"))!=null&&vi.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((si=(wi=n.$route)==null?void 0:wi.query)==null?void 0:si.card)===(Re==null?void 0:Re.id),"bg-white":((oi=(Wi=n.$route)==null?void 0:Wi.query)==null?void 0:oi.card)!==(Re==null?void 0:Re.id)}])},[f.createVNode(U,{actions:a.getActions,isForm:a.isForm,item:Re,table:t.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):f.createCommentVNode("",!0)],2)}),128))])]))])],4)],2),f.createElementVNode("div",jq,[f.createElementVNode("div",Uq,[f.createElementVNode("p",Hq,[f.createElementVNode("span",qq,[f.createTextVNode(f.toDisplayString(r.filters||r.searchValue?"Знайдено":"Об'єктів")+" "+f.toDisplayString(((ot=r.tableData)==null?void 0:ot.count)||"0 ")+" ",1),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Wq," з")):f.createCommentVNode("",!0)]),r.filters||r.searchValue?(f.openBlock(),f.createElementBlock("span",Gq,f.toDisplayString(" "+((Lt=r.tableData)==null?void 0:Lt.filtered)||0),1)):f.createCommentVNode("",!0)])]),Math.ceil(((Qt=r.tableData)==null?void 0:Qt.filtered)/r.limit)>1?(f.openBlock(),f.createBlock(ke,{key:0,goTo:!1,class:"justify-end","default-page":parseInt(a.defaultPage),total:((At=r.tableData)==null?void 0:At.filtered)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit,backgroundColor:"#F3F4F6"},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):f.createCommentVNode("",!0)])],2),f.createVNode(f.Transition,{name:"slide-fade"},{default:f.withCtx(()=>{var Re;return[r.isVisibleCardInfo?(f.openBlock(),f.createBlock(Pe,{key:0,table:t.table,columns:(Re=r.tableData)==null?void 0:Re.columns,row:a.activeCardRow},null,8,["table","columns","row"])):f.createCommentVNode("",!0)]}),_:1})])])])])}const Yq={components:{AdminTable:Ue(Eq,[["render",Zq],["__scopeId","data-v-c086c7f4"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Jr!=null&&Jr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(n){var e;n&&(document.title=(((e=ia.value)==null?void 0:e.titlePrefix)||"")+n)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(n){const e=[];return n.forEach(t=>{t.menu?e.push(...this.flattenMenu(t.menu)):e.push(t)}),e},async checkPageType(){var i,r;const n=this.flattenMenu(Jr.value);n!=null&&n.length||this.$router.replace("/404");const e=n==null?void 0:n.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const t=e==null?void 0:e.table;this.table=t||!1,!t&&this.getInterface()},async getInterface(){var n,e;try{const{data:t}=await ut.get(`/api/template/interface/${((e=(n=this.$route)==null?void 0:n.params)==null?void 0:e.catchAll)||""}`);this.interface=t||""}catch{this.interface=""}}}},Xq=["innerHTML"];function Kq(n,e,t,i,r,a){const u=f.resolveComponent("AdminTable");return r.table?(f.openBlock(),f.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,Xq))}const Jq=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(Yq,[["render",Kq]])},Symbol.toStringTag,{value:"Module"}));return mU});
|