@opengis/admin 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{IconChevronDown-CpKfcYoF.js → IconChevronDown-BCpDxWU9.js} +1 -1
- package/dist/{add-page-BUXbBSgi.js → add-page-CKy5L_78.js} +1 -1
- package/dist/{admin-interface-uzYtYAbe.js → admin-interface-BX613rWQ.js} +2 -2
- package/dist/{admin-view-Dc5G9EIJ.js → admin-view-DJBkad_B.js} +2 -2
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +1 -1
- package/dist/{card-view-D0S2x272.js → card-view-CdCsaogK.js} +1 -1
- package/dist/{edit-page-BxbXeZNO.js → edit-page-C76NxZRq.js} +1 -1
- package/dist/{import-file-DPPjErFi.js → import-file-CknmeGNO.js} +10 -9
- package/package.json +2 -2
- package/server/plugins/hook.js +2 -2
- package/server/routes/access/controllers/access.group.post.js +3 -2
- package/server/routes/templates/controllers/getTemplate.js +4 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { openBlock as e, createElementBlock as t, createElementVNode as n } from "vue";
|
2
|
-
import { _ as r } from "./import-file-
|
2
|
+
import { _ as r } from "./import-file-CknmeGNO.js";
|
3
3
|
const l = {}, s = {
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
5
5
|
viewBox: "0 0 24 24",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as g, u as f, c as u } from "./import-file-
|
1
|
+
import { _ as g, u as f, c as u } from "./import-file-CknmeGNO.js";
|
2
2
|
import { resolveComponent as x, openBlock as d, createElementBlock as w, createElementVNode as n, createBlock as k, createCommentVNode as y } from "vue";
|
3
3
|
const v = {
|
4
4
|
data() {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { _ as v, d as Ve, c as F, V as Ie, e as De, f as Fe, g as je, A as Me, I as qe, u as ye, s as ze } from "./import-file-
|
1
|
+
import { _ as v, d as Ve, c as F, V as Ie, e as De, f as Fe, g as je, A as Me, I as qe, u as ye, s as ze } from "./import-file-CknmeGNO.js";
|
2
2
|
import { openBlock as o, createElementBlock as a, createTextVNode as j, toDisplayString as T, createCommentVNode as w, createStaticVNode as L, Fragment as S, createElementVNode as l, resolveComponent as h, createVNode as x, withCtx as $, createBlock as _, renderList as D, withModifiers as Le, normalizeClass as I, withDirectives as P, vModelCheckbox as Pe, resolveDynamicComponent as z, Transition as B, renderSlot as Be, vShow as ke, getCurrentInstance as Ue, ref as _e, normalizeStyle as ve } from "vue";
|
3
|
-
import { I as Oe } from "./IconChevronDown-
|
3
|
+
import { I as Oe } from "./IconChevronDown-BCpDxWU9.js";
|
4
4
|
const Ee = {
|
5
5
|
data() {
|
6
6
|
return {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { _, I as F, u as D, s as T, a as R, b as q, c as j } from "./import-file-
|
1
|
+
import { _, I as F, u as D, s as T, a as R, b as q, c as j } from "./import-file-CknmeGNO.js";
|
2
2
|
import { openBlock as l, createElementBlock as c, createElementVNode as n, createStaticVNode as G, resolveComponent as p, normalizeClass as I, createTextVNode as B, toDisplayString as U, createVNode as u, Transition as J, withCtx as A, withDirectives as K, Fragment as Z, renderList as Q, vShow as P, createCommentVNode as E, withModifiers as W, createBlock as X, resolveDynamicComponent as Y } from "vue";
|
3
|
-
import { I as e1 } from "./IconChevronDown-
|
3
|
+
import { I as e1 } from "./IconChevronDown-BCpDxWU9.js";
|
4
4
|
const t1 = {}, o1 = {
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
6
6
|
viewBox: "0 0 24 24",
|
package/dist/admin.js
CHANGED
package/dist/admin.umd.cjs
CHANGED
@@ -738,7 +738,7 @@ img.ProseMirror-separator {
|
|
738
738
|
|
739
739
|
`);return!a||!u?!1:t.chain().command(({tr:l})=>(l.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:i}=e,{$from:r,empty:a}=n;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)?t.commands.command(({tr:b})=>(b.setSelection(Xt.near(i.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[O0({find:kF,type:this.type,getAttributes:t=>({language:t[1]})}),O0({find:SF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $i({key:new Ar("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=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(!n||!a)return!1;const{tr:u,schema:l}=t.state,g=l.text(n.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),t.dispatch(u),!0}}})]}}),EF=vo.create({name:"doc",topNode:!0,content:"block+"});function CF(t={}){return new $i({view(e){return new TF(e,t)}})}class TF{constructor(e,n){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=n.width)!==null&&i!==void 0?i:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.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:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.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),n=!e.parent.inlineContent,i;if(n){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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);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 n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=i&&i.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!a){let u=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ow(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 MF=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,n){let i=e.resolve(n.map(this.head));return ri.valid(i)?new ri(i):Xt.near(i)}content(){return pt.empty}eq(e){return e instanceof ri&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ri(e.resolve(n.pos))}getBookmark(){return new J0(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!AF(e)||!IF(e))return!1;let i=n.type.spec.allowGapCursor;if(i!=null)return i;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,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(n>0?e.indexAfter(u)<l.childCount:e.index(u)>0){a=l.child(n>0?e.indexAfter(u):e.index(u)-1);break}else if(u==0)return null;r+=n;let g=e.doc.resolve(r);if(ri.valid(g))return g}for(;;){let u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!zt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;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 J0{constructor(e){this.pos=e}map(e){return new J0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ri.valid(n)?new ri(n):Xt.near(n)}}function AF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),i=t.node(e);if(n==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n-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 IF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),i=t.node(e);if(n==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n);;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 PF(){return new $i({props:{decorations:zF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ri.valid(n)?new ri(n):null},handleClick:OF,handleKeyDown:DF,handleDOMEvents:{beforeinput:BF}}})}const DF=o2({ArrowLeft:Zf("horiz",-1),ArrowRight:Zf("horiz",1),ArrowUp:Zf("vert",-1),ArrowDown:Zf("vert",1)});function Zf(t,e){const n=t=="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(n)||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 OF(t,e,n){if(!t||!t.editable)return!1;let i=t.state.doc.resolve(e);if(!ri.valid(i))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&zt.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ri(i))),!0)}function BF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ri))return!1;let{$from:n}=t.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;let r=Ue.empty;for(let u=i.length-1;u>=0;u--)r=Ue.from(i[u].createAndFill(null,r));let a=t.state.tr.replace(n.pos,n.pos,new pt(r,0,0));return a.setSelection(jt.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function zF(t){if(!(t.selection instanceof ri))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",fi.create(t.doc,[Zr.widget(t.selection.head,e,{key:"gapcursor"})])}const NF=Ii.create({name:"gapCursor",addProseMirrorPlugins(){return[PF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=on(wt(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),RF=vo.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ci(this.options.HTMLAttributes,t)]},renderText(){return`
|
741
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;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()}}}),LF=vo.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>O0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Yf=200,Pi=function(){};Pi.prototype.append=function(e){return e.length?(e=Pi.from(e),!this.length&&e||e.length<Yf&&this.leafAppend(e)||this.length<Yf&&e.leafPrepend(this)||this.appendInner(e)):this},Pi.prototype.prepend=function(e){return e.length?Pi.from(e).append(this):this},Pi.prototype.appendInner=function(e){return new VF(this,e)},Pi.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Pi.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Pi.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Pi.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Pi.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Pi.from=function(e){return e instanceof Pi?e:e&&e.length?new xS(e):Pi.empty};var xS=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={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<=Yf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Yf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Pi);Pi.empty=new xS([]);var VF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.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}(Pi);const FF=500;class Uo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){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;n&&(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 hs(E.map));let I=E.step.map(r.slice(a)),D;I&&u.maybeStep(I).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new hs(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 Uo(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,n,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 hs(e.mapping.maps[w],E,n),I;(I=g&&g.merge(C))&&(C=I,w?a.pop():l=l.slice(0,l.length-1)),a.push(C),n&&(u++,n=void 0),r||(g=C)}let b=u-i.depth;return b>jF&&(l=$F(l,b),u-=b),new Uo(l.append(a),u)}remapping(e,n){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,n),i}addMaps(e){return this.eventCount==0?this:new Uo(this.items.append(e.map(n=>new hs(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=n;this.items.forEach(C=>{let I=a.getMirror(--g);if(I==null)return;u=Math.min(u,I);let D=a.maps[I];if(C.step){let R=e.steps[I].invert(e.docs[I]),$=C.selection&&C.selection.map(a.slice(g+1,I));$&&l++,i.push(new hs(D,R,$))}else i.push(new hs(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new hs(a.maps[C]));let w=this.items.slice(0,r).append(b).append(i),E=new Uo(w,l);return E.emptyItemCount()>FF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.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(n.slice(i)),b=g&&g.getMap();if(i--,b&&n.appendMap(b,i),g){let w=u.selection&&u.selection.map(n.slice(i));w&&a++;let E=new hs(b.invert(),g,w),C,I=r.length-1;(C=r.length&&r[I].merge(E))?r[I]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Uo(Pi.from(r.reverse()),a)}}Uo.empty=new Uo(Pi.empty,0);function $F(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class hs{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new hs(n.getMap().invert(),n,this.selection)}}}class Ma{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const jF=20;function UF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(WF)&&(t=new Ma(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ma(t.done.addTransform(n,void 0,i,Xf(e)),t.undone,vS(n.mapping.maps),t.prevTime,t.prevComposition):new Ma(t.done,t.undone.addTransform(n,void 0,i,Xf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),g=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!HF(n,t.prevRanges)),b=u?Q0(t.prevRanges,n.mapping):vS(n.mapping.maps);return new Ma(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Xf(e)),Uo.empty,b,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ma(t.done.rebased(n,a),t.undone.rebased(n,a),Q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ma(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function HF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function vS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function Q0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function qF(t,e,n){let i=Xf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ma(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:g})}let e_=!1,wS=null;function Xf(t){let e=t.plugins;if(wS!=e){e_=!1,wS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){e_=!0;break}}return e_}const Rl=new Ar("history"),WF=new Ar("closeHistory");function GF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $i({key:Rl,state:{init(){return new Ma(Uo.empty,Uo.empty,null,0,-1)},apply(e,n,i){return UF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?SS:i=="historyRedo"?ES:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function kS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=qF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const SS=kS(!1,!0),ES=kS(!0,!0),ZF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>SS(t,e),redo:()=>({state:t,dispatch:e})=>ES(t,e)}},addProseMirrorPlugins(){return[GF(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()}}}),YF=vo.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):C2(n)?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(zt.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[T4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),XF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,KF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,JF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,e6=as.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wc({find:XF,type:this.type}),Wc({find:JF,type:this.type})]},addPasteRules(){return[Gc({find:KF,type:this.type}),Gc({find:QF,type:this.type})]}}),CS=/^(\d+)\.\s$/,t6=vo.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(K0.name,this.editor.getAttributes(Yh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Lh({find:CS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Lh({find:CS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),n6=vo.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),i6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,r6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,o6=as.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wc({find:i6,type:this.type})]},addPasteRules(){return[Gc({find:r6,type:this.type})]}}),TS=vo.create({name:"text",group:"inline"}),s6=Ii.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,w,E,C,I,D,R,$,W;const te=[];return this.options.bold!==!1&&te.push(_F.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&te.push(pF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&te.push(bF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&te.push(wF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&te.push(bS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&te.push(EF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&te.push(MF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&te.push(NF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&te.push(RF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&te.push(LF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&te.push(ZF.configure((w=this.options)===null||w===void 0?void 0:w.history)),this.options.horizontalRule!==!1&&te.push(YF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&te.push(e6.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&te.push(K0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&te.push(t6.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&te.push(n6.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&te.push(o6.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&te.push(TS.configure((W=this.options)===null||W===void 0?void 0:W.text)),te}}),a6=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function l6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=M4(n),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,I=Array.from(E.matchAll(w)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const D=I.input.slice(Math.max(0,I.index-1),I.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+I.index;let W=$+I[0].length;return i&&g.test(E.slice(W-1,W+1))&&(I[0]+=" ",W+=1),$<u.pos&&W>=u.pos?{range:{from:$,to:W},query:I[0].slice(n.length),text:I[0]}:null}const c6=new Ar("suggestion");function u6({pluginKey:t=c6,editor:e,char:n="@",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=l6}){let I;const D=w==null?void 0:w(),R=new $i({key:t,view(){return{update:async($,W)=>{var te,G,Q,Ie,ve,Se,Ne;const Ae=(te=this.key)===null||te===void 0?void 0:te.getState(W),$e=(G=this.key)===null||G===void 0?void 0:G.getState($.state),Xe=Ae.active&&$e.active&&Ae.range.from!==$e.range.from,Pt=!Ae.active&&$e.active,ot=Ae.active&&!$e.active,Tt=!Pt&&!ot&&Ae.query!==$e.query,Nt=Pt||Xe&&Tt,Vt=Tt||Xe,Ft=ot||Xe&&Tt;if(!Nt&&!Vt&&!Ft)return;const Ht=Ft&&!Nt?Ae:$e,Cn=$.dom.querySelector(`[data-decoration-id="${Ht.decorationId}"]`);I={editor:e,range:Ht.range,query:Ht.query,text:Ht.text,items:[],command:dn=>g({editor:e,range:Ht.range,props:dn}),decorationNode:Cn,clientRect:Cn?()=>{var dn;const{decorationId:vn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${vn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Nt&&((Q=D==null?void 0:D.onBeforeStart)===null||Q===void 0||Q.call(D,I)),Vt&&((Ie=D==null?void 0:D.onBeforeUpdate)===null||Ie===void 0||Ie.call(D,I)),(Vt||Nt)&&(I.items=await b({editor:e,query:Ht.query})),Ft&&((ve=D==null?void 0:D.onExit)===null||ve===void 0||ve.call(D,I)),Vt&&((Se=D==null?void 0:D.onUpdate)===null||Se===void 0||Se.call(D,I)),Nt&&((Ne=D==null?void 0:D.onStart)===null||Ne===void 0||Ne.call(D,I))},destroy:()=>{var $;I&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,W,te,G){const{isEditable:Q}=e,{composing:Ie}=e.view,{selection:ve}=$,{empty:Se,from:Ne}=ve,Ae={...W};if(Ae.composing=Ie,Q&&(Se||e.view.composing)){(Ne<W.range.from||Ne>W.range.to)&&!Ie&&!W.composing&&(Ae.active=!1);const $e=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:ve.$from}),Xe=`id_${Math.floor(Math.random()*4294967295)}`;$e&&E({editor:e,state:G,range:$e.range,isActive:W.active})?(Ae.active=!0,Ae.decorationId=W.decorationId?W.decorationId:Xe,Ae.range=$e.range,Ae.query=$e.query,Ae.text=$e.text):Ae.active=!1}else Ae.active=!1;return Ae.active||(Ae.decorationId=null,Ae.range={from:0,to:0},Ae.query=null,Ae.text=null),Ae}},props:{handleKeyDown($,W){var te;const{active:G,range:Q}=R.getState($.state);return G&&((te=D==null?void 0:D.onKeyDown)===null||te===void 0?void 0:te.call(D,{view:$,event:W,range:Q}))||!1},decorations($){const{active:W,range:te,decorationId:G}=R.getState($);return W?fi.create($.doc,[Zr.inline(te.from,te.to,{nodeName:u,class:l,"data-decoration-id":G})]):null}}});return R}const h6=new Ar("mention"),d6=vo.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:h6,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!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 n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[u6({editor:this.editor,...this.options.suggestion})]}}),p6=as.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),f6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function m6(t,e,n,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 g6=je(f6,[["render",m6]]),y6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function _6(t,e,n,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 b6=je(y6,[["render",_6]]),x6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function v6(t,e,n,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 w6=je(x6,[["render",v6]]),k6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function S6(t,e,n,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 E6=je(k6,[["render",S6]]),C6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function T6(t,e,n,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":n.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 M6=je(C6,[["render",T6]]),A6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function I6(t,e,n,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":n.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 P6=je(A6,[["render",I6]]),D6={},O6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function B6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",O6,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 z6={components:{IconA:je(D6,[["render",B6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},N6={class:"relative flex"},R6={class:"flex w-[160px] flex-wrap gap-[4px]"},L6=["onClick"];function V6(t,e,n,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",N6,[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",R6,[(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,L6))),128))])])]),_:1},512)}const F6=je(z6,[["render",V6]]),$6={},j6={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 U6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",j6,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 MS=je($6,[["render",U6]]),H6={components:{IconMore:MS},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 q6(t,e,n,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":n.editor.isActive("underline")||n.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":n.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":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const W6={bold:M6,italic:P6,text_more:je(H6,[["render",q6]]),color:F6,bullet_list:b6,ordered_list:w6,blockquote:g6,codeblock:E6},G6={components:{EditorContent:hF},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(W6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new uF({content:this.modelValue,extensions:[s6,bS,Yh,a6,p6,TS,d6.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.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",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.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",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},Z6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},Y6={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 X6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",Z6,[r.editor?(f.openBlock(),f.createElementBlock("div",Y6,[(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 AS=je(G6,[["render",X6]]),K6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},J6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return K6(this.name)}}},Q6={class:"mr-2"},e$=["src"],t$={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},n$={key:0},i$={key:1,class:"text-sm"};function r$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Q6,[n.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,e$)):n.name?(f.openBlock(),f.createElementBlock("div",t$,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",n$,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",i$,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const o$={components:{VsWidgetCommentsAvatar:je(J6,[["render",r$]]),VsTextEditor:AS},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 t=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(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 it.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 it.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}}},s$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},a$={class:"flex justify-between items-center mb-2"},l$={class:"flex items-center"},c$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},u$={class:"text-sm text-gray-600 dark:text-gray-400"},h$={class:"flex flex-col items-center gap-[4px]"},d$=["innerHTML"],p$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},f$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function m$(t,e,n,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",s$,[f.createElementVNode("div",a$,[f.createElementVNode("div",l$,[f.createElementVNode("p",c$,[f.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(n.comment.username),1)]),f.createElementVNode("p",u$,[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",h$,[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:n.comment.body},null,8,d$)]),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",f$,[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",p$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=w=>r.textareaValue=w),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const g$={components:{VsWidgetCommentsItem:je(o$,[["render",m$]])},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:t}=await it.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},y$={class:"flex flex-col"},_$={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"},b$={key:1},x$={class:"p-4"},v$={class:"mt-1 text-gray-500 dark:text-neutral-500"},w$={class:"mt-4 flex justify-end gap-x-3"};function k$(t,e,n,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",y$,[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",_$,[(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:n.options,index:E,id:n.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",b$,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",x$,[f.createElementVNode("p",v$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",w$,[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 S$=je(g$,[["render",k$]]),E$={components:{VsTextEditor:AS},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 it.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},C$={class:"flex flex-col items-start w-full widget-comment-form"},T$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},M$={class:"flex"};function A$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",C$,[f.createElementVNode("div",T$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),f.createElementVNode("div",M$,[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 I$={components:{VsWidgetCommentsList:S$,VsWidgetCommentsAddForm:je(E$,[["render",A$]])},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(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await it.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},P$={class:"w-full bg-white-200"};function D$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",P$,[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:n.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const IS=je(I$,[["render",D$]]),PS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),O$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),B$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},z$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return B$(this.username)}}}),N$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function R$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",N$,f.toDisplayString(t.inItials),1)}const L$=je(z$,[["render",R$]]),t_={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{t_.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},V$={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 t_.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await t_.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},F$={id:"map",style:{height:"9rem",width:"24rem"}};function $$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",F$)}const j$=je(V$,[["render",$$]]),U$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:L$,VsWidgetHistoryItemMap:j$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return O$(t.cdate)}}}),H$={class:"relative [&_p]:m-0"},q$={class:"flex items-center gap-3"},W$={class:"w-full flex justify-between"},G$={class:"text-gray-500"},Z$={class:"text-gray-800 font-medium"},Y$={class:"text-gray-500 text-sm"},X$={class:"mt-2 pl-10"},K$={key:0},J$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},Q$={class:"font-medium"},e8={class:"font-medium"};function t8(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",H$,[f.createElementVNode("div",q$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",W$,[f.createElementVNode("p",G$,[f.createElementVNode("span",Z$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",Y$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",X$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",K$,[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",J$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",Q$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",e8,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const n8=je(U$,[["render",t8]]),i8=f.defineComponent({components:{VsWidgetHistoryItem:n8,VsEmptyWidget:Gv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?PS(this.history.data.cdate):""},lastEditDate(){return this.history.data?PS(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:t}=await it.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),r8={class:"bg-white"},o8={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"},s8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function a8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",r8,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=t.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",o8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.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",s8," Історія відсутні "))])}const l8=je(i8,[["render",a8]]),c8={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"},u8={class:"inline-block w-full align-middle"},h8={class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},d8={class:"dark:bg-neutral-700"},p8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},f8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},Kf=10,m8={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String},setup(t){const e=t,n=f.ref([]),i=f.ref(1),r=async()=>{if(e.token)try{const{data:l}=await it.get(`/api/table-data/${e.token}`);n.value=l.rows}catch(l){console.error("Ошибка при загрузке данных таблицы:",l)}},a=l=>{i.value=l},u=f.computed(()=>{const l=(i.value-1)*Kf;return n.value.slice(l,l+Kf)});return f.onMounted(()=>{r()}),(l,g)=>{var w,E,C;const b=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",c8,[f.createElementVNode("div",u8,[f.createElementVNode("table",h8,[(w=t.columns)!=null&&w.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",d8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(I,D)=>(f.openBlock(),f.createElementBlock("th",{key:D,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(I.title),1))),128))])]),f.createElementVNode("tbody",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(I==null?void 0:I[R.name]),1))),128))]))),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",f8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(I,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(R),1))),128))]))),128))]))])]),((E=n.value)==null?void 0:E.length)>Kf?(f.openBlock(),f.createBlock(b,{key:0,goTo:!1,"default-page":1,total:(C=n.value)==null?void 0:C.length,pageSize:Kf,onPageChange:a,backgroundColor:"#F3F4F6"},null,8,["total"])):f.createCommentVNode("",!0)])}}},g8={},y8={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 _8(t,e){return f.openBlock(),f.createElementBlock("svg",y8,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 b8=je(g8,[["render",_8]]),x8={},v8={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 w8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",v8,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 DS=je(x8,[["render",w8]]),k8={},S8={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 E8(t,e){return f.openBlock(),f.createElementBlock("svg",S8,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 C8=je(k8,[["render",E8]]),T8={class:"relative shrink-0"},M8=["src"],A8={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},I8={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},P8={class:"grow"},D8={class:"text-xs text-gray-500 dark:text-neutral-500"},O8={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},B8={class:"text-sm text-gray-500 dark:text-neutral-500"},z8={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"},N8={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await it.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var w,E,C,I,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=t.item)!=null&&w.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",T8,[(E=t.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=t.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,M8)):(f.openBlock(),f.createElementBlock("div",A8,[f.createVNode(DS)])),(I=t.item)!=null&&I.read?(f.openBlock(),f.createElementBlock("span",I8)):f.createCommentVNode("",!0)]),f.createElementVNode("div",P8,[f.createElementVNode("p",D8,[f.createVNode(ly,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",O8,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",B8,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",z8,[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(C8)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},R8={},L8={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 V8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",L8,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 F8=je(R8,[["render",V8]]),$8={},j8={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 U8(t,e){return f.openBlock(),f.createElementBlock("svg",j8,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 H8=je($8,[["render",U8]]),q8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},W8={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},G8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Z8={class:"max-w-sm mx-auto mt-6"},Y8={class:"font-medium text-gray-800 dark:text-neutral-200"},X8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function K8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",W8,[f.createElementVNode("div",null,[f.createElementVNode("div",G8,[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",Z8,[f.createElementVNode("p",Y8,f.toDisplayString(n.title),1),f.createElementVNode("p",X8,f.toDisplayString(n.text),1)])])])])}const n_=je(q8,[["render",K8]]),J8={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},Q8={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"},ej={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},tj={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)]"},nj={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"},ij={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"},rj={key:0},oj={key:1},OS={__name:"admin-notification",setup(t){const e=f.ref(0),n=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 it.get("/api/notification");n.value=(b==null?void 0:b.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await it.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(F8,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",J8,[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",Q8,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",ej,[f.createElementVNode("div",tj,[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",nj,[f.createVNode(H8)])]),f.createElementVNode("div",ij,[(E=n.value)!=null&&E.length?(f.openBlock(),f.createElementBlock("ul",rj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,C=>(f.openBlock(),f.createBlock(N8,{key:C==null?void 0:C.id,item:C,onUpdateNotification:l},null,8,["item"]))),128))])):(f.openBlock(),f.createElementBlock("div",oj,[f.createVNode(n_,{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(b8,{height:"16",width:"16"}),w[3]||(w[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},sj={"vs-widget-map":cy,"vs-widget-gallery":LN,"vs-widget-comments":IS,"vs-widget-file":Yv,"vs-widget-history":l8,"vs-widget-table":m8,"admin-notifications":OS},aj={"table-format-text":yp,"table-format-select":Gx,"table-format-badge":qx,"table-format-swetch":_p,"table-format-check":_p,"table-format-html":yp,"table-format-tags":Zx,"table-format-date":ly,"table-format-number":W1,"table-format-slot":G1},lj={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},cj={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",lj,n[0]||(n[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)])))}},uj={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function hj(t,e,n,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 dj=je(uj,[["render",hj]]),pj={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},fj={class:"md:col-span-2"},mj={class:"font-semibold text-gray-800 dark:text-neutral-200"},gj={class:"md:block md:col-span-1 md:text-center"},yj=["onClick"];function _j(t,e,n,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=n.actions)==null?void 0:u.length)+2}`])},[f.createElementVNode("li",fj,[f.createElementVNode("h3",mj,f.toDisplayString(n.item.ua),1)]),(l=n.item.menu)!=null&&l.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(n.actions,g=>(f.openBlock(),f.createElementBlock("li",gj,[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,yj)]))),256)):f.createCommentVNode("",!0)],2)}const bj=je(pj,[["render",_j]]),xj={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 t=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=t?[...t.actions]:[]},inputHandler(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},vj={class:"md:col-span-2"},wj={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},kj={class:"text-sm text-gray-500 dark:text-neutral-500"},Sj={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Ej=["value","onChange"];function Cj(t,e,n,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-${n.actions.length+2}`])},[f.createElementVNode("li",vj,[f.createElementVNode("p",wj,f.toDisplayString(((u=n.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",kj,f.toDisplayString(((l=n.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.actions,(g,b)=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",Sj,[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,Ej),[[f.vModelCheckbox,r.checkedActions]])])]))),128))],2)}const Tj=je(xj,[["render",Cj]]),Kr=f.ref(null),i_=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...i_(n.menu)):e.push(n)}),e},Jf=()=>{const t=new CustomEvent("reloadCardPage");window.dispatchEvent(t)},Mj={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:bj,VsGroupSecondLevel:Tj,AdminNodata:n_},data(){return{list:Kr.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,n;const t={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(i=>!(i!=null&&i.menu))};return this.filterMenu([t,...(n=this.list)==null?void 0:n.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 t,e;try{const n=location.href.split("/").pop();await it.post(`/api/access-group/${n}`,{routes:(t=this.history)==null?void 0:t.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 Jf()}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(t=>({...t,actions:[]}))},async getData(){var t,e;try{const n=location.href.split("/").pop(),r=(await it.get(`/api/access-group/${n}`)).data;this.history=this.getUniqueByPath([...r.routes,...(t=i_(this.list))==null?void 0:t.map(a=>({path:a==null?void 0:a.path,actions:[]}))])}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message)}},toggleCheck(t){var n,i;if(!((n=this.history)!=null&&n.length))return;const e=(i=this.history)==null?void 0:i.findIndex(r=>(r==null?void 0:r.path)===(t==null?void 0:t.subitemPath));this.history[e].actions=t==null?void 0:t.checkedActions},toggleAll(t,e){var i,r,a,u,l,g,b;const n=(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);t!=null&&t.toggled?(l=(u=this.history)==null?void 0:u.filter(w=>n==null?void 0:n.includes(w==null?void 0:w.path)))==null||l.forEach(w=>{var E;(E=w==null?void 0:w.actions)==null||E.push(t==null?void 0:t.optionID)}):(b=(g=this.history)==null?void 0:g.filter(w=>n==null?void 0:n.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!==(t==null?void 0:t.optionID))})},getUniqueByPath(t){return t.reduce((e,n)=>(e.some(r=>r.path===n.path)||e.push(n),e),[])},filterMenu(t,e){return t.map(n=>{var i,r;if(n.menu){const a=this.filterMenu(n.menu,e);if(a.length>0)return{...n,menu:a}}return(r=(i=n.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e==null?void 0:e.toLowerCase())?n:null}).filter(Boolean)}},async mounted(){await this.getData()}},Aj={class:"flex gap-[6px]"},Ij={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Pj={key:0,class:"space-y-8"},Dj={class:"space-y-5"};function Oj(t,e,n,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",Aj,[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-${n.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(n.options,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:C},[f.createElementVNode("h3",Ij,f.toDisplayString(E),1)]))),128))],2),(w=a.getList)!=null&&w.length?(f.openBlock(),f.createElementBlock("div",Pj,[f.createElementVNode("div",Dj,[(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":I=>a.toggleAll(I,C),actions:n.options},null,8,["item","onOn:toggled","actions"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.menu,I=>(f.openBlock(),f.createBlock(g,{toggled:(E==null?void 0:E.toggled)||!1,optionID:E==null?void 0:E.optionID,key:I==null?void 0:I.path,subitem:I,actions:n.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 Bj=je(Mj,[["render",Oj]]),zj={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","del"];return(n,i)=>(f.openBlock(),f.createBlock(f.unref(Bj),{options:e,routes:n.routes},null,8,["routes"]))}},Nj={},Rj={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 Lj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Rj,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 r_=je(Nj,[["render",Lj]]),Vj={components:{IconSearch:r_},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await it.get("/api/user-cls?type=json");this.data=t}catch{}}}},Fj={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},$j={class:"relative"},jj={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)"}},Uj={class:"w-[99%] overflow-hidden overflow-ellipsis"},Hj={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function qj(t,e,n,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Fj,[f.createElementVNode("div",$j,[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",jj,[(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=t.$route)==null?void 0:w.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Uj,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",Hj,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const Wj=je(Vj,[["render",qj]]),Gj={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Zj={class:"w-full"},Yj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Xj={class:"max-w-sm mx-auto mt-6"},Kj={class:"font-medium text-gray-800 dark:text-neutral-200"},Jj={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function Qj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Zj,[f.createElementVNode("div",Yj,[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",Xj,[f.createElementVNode("p",Kj,f.toDisplayString(n.title),1),f.createElementVNode("p",Jj,f.toDisplayString(n.text),1)])])])}const BS=je(Gj,[["render",Qj]]),e7={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},t7={class:"flex w-[160px] flex-wrap gap-[4px]"},n7=["onClick"];function i7(t,e,n,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:n.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",t7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.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,n7))),128))])])]),_:1},512)}const zS=je(e7,[["render",i7]]),r7={components:{VsChoceColor:zS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},o7={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},s7={class:"flex flex-col"},a7={class:"flex gap-[30px]"},l7={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},c7={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},u7={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function h7(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",o7,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",s7,[f.createElementVNode("div",a7,[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",l7,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",c7,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",u7,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const d7={components:{VsReesterUsersItem:je(r7,[["render",h7]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var i;const n=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},p7={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)"}},f7=["onDragstart","onDrop"];function m7(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",p7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.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,f7))),128))])}const g7={components:{VsNoData:BS,VsChoceColor:zS,IconCheck:Wx,VsReesterUsersList:je(d7,[["render",m7],["__scopeId","data-v-293d7735"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await it.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await it.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.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(t){var e,n;this.data.children=t;try{await it.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},y7={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},_7={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},b7={class:"flex items-end w-full gap-[4px]"};function x7(t,e,n,i,r,a){var E,C,I,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",y7,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",_7,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",b7,[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=(I=r.data)==null?void 0:I.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 v7={components:{VsReesterNavList:Wj,VsReesterContent:je(g7,[["render",x7]])}},w7={class:"flex items-start gap-0"};function k7(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",w7,[f.createVNode(u),f.createVNode(l)])}const S7=je(v7,[["render",k7]]),E7={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},C7={class:"mr-[10px]"},T7={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},M7={class:"flex items-center gap-[6px] ml-auto"},A7={class:"mr-[10px]"},I7={props:["table","id"],components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(t){var E,C,I,D,R;const{asyncTemplateSlot:e}=(R=(D=(I=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:I.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,n=t,i=SA(),r=EA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${n.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,W,te,G;if(!(($=n.slots)!=null&&$.panelLeft))return"div";if((W=n.slots)!=null&&W.panelLeft.includes("<")){const Q=e("PanelLeft",(te=n.slots)==null?void 0:te.panelLeft,["name"]);u.value=Q}else u.value=(G=n.slots)==null?void 0:G.panelLeft},w=()=>{var $,W,te,G;if(!(($=n.slots)!=null&&$.panelRight))return"div";if((W=n.slots)!=null&&W.panelRight.includes("<")){const Q=e("PanelRight",(te=n.slots)==null?void 0:te.panelRight,["name"]);a.value=Q}else a.value=(G=n.slots)==null?void 0:G.panelRight};return b(),w(),($,W)=>{const te=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",E7,[f.createElementVNode("div",C7,[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",T7,f.toDisplayString(t.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",M7,[f.createElementVNode("div",A7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),t.isHeaderEditButton?(f.openBlock(),f.createBlock(te,{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(()=>W[0]||(W[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])):f.createCommentVNode("",!0)])])}}},AdminCardAsyncComponent:{__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){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,n=f.ref(""),i=t;return(()=>{const w=e("CustomComponent",i.slot,["data"]);n.value=w})(),(w,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(Kr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.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 t,e,n,i,r,a,u,l,g,b,w,E,C,I,D,R;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.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:((I=(C=(E=(w=this.objectData)==null?void 0:w.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:I.slice(0,35))+" ...";{const $=(D=this.flattenMenu(Kr.value))==null?void 0:D.find(W=>{var te,G;return(W==null?void 0:W.table)===((G=(te=this.$route)==null?void 0:te.params)==null?void 0:G.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(t){this.$router.replace({...this.$route,query:{tab:t}})}},methods:{async getObjectData(){var n,i;const t=this.table||((n=this.$route)==null?void 0:n.params.table),e=this.id||((i=this.$route)==null?void 0:i.params.id);(!t||!e)&&this.$router.replace("/404");try{const{data:r}=await it.get(`/api/table-data/${t}/${e}`);this.objectData=r}catch(r){console.error(r)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,g;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.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(t){var n,i,r;const e={};for(const a in t)["name","component","title"].includes(a)||(e[a]=((r=(i=(n=this.objectData)==null?void 0:n.rows)==null?void 0:i[0])==null?void 0:r[t[a]])||null);return e},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},P7={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},D7={key:0,class:"bg-white border rounded-xl"},O7={class:"p-[10px] pl-[20px] text-md font-[500]"},B7=["innerHTML"],z7={key:1},N7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},R7={key:2,class:"p-[20px] border-t"},L7=["innerHTML"],V7={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]"},F7=["onClick"],$7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},j7={key:0,class:"p-[20px] border-t"},U7={key:1,class:"p-[20px] border-t"},H7=["innerHTML"],q7={key:3,class:"flex"},W7={class:"flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},G7=["onClick"],Z7={class:"flex-grow w-[80%]"},Y7={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"},X7={key:0,class:"p-[20px]"},K7={key:1,class:"p-[20px]"},J7=["innerHTML"];function Q7(t,e,n,i,r,a){var g,b,w,E;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent");return f.openBlock(),f.createElementBlock("div",P7,[r.objectData&&((g=r.objectData)==null?void 0:g.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(b=r.objectData)==null?void 0:b.slots,isHeaderEditButton:(w=r.objectData)==null?void 0:w.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((E=r.objectData)==null?void 0:E.panels,(C,I)=>{var D,R,$,W,te;return f.openBlock(),f.createElementBlock("div",{key:I,class:f.normalizeClass(a.getColClass(C.col))},[C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",D7,[f.createElementVNode("h2",O7,f.toDisplayString((C==null?void 0:C.title)||"Панель"),1),(D=r.objectData)!=null&&D.html[C==null?void 0:C.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(R=r.objectData)==null?void 0:R.html[C==null?void 0:C.name]},null,8,B7)):(f.openBlock(),f.createBlock(l,{key:1,slot:($=r.objectData)==null?void 0:$.vue[C==null?void 0:C.name],data:(te=(W=r.objectData)==null?void 0:W.rows)==null?void 0:te[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):C.type==="container"?(f.openBlock(),f.createElementBlock("div",z7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt,Ft,Ht;return f.openBlock(),f.createElementBlock("div",{key:Q,class:f.normalizeClass([{"mb-[20px]":C.items.length>1},"bg-white border rounded-xl"])},[G!=null&&G.title?(f.openBlock(),f.createElementBlock("h2",N7,f.toDisplayString((G==null?void 0:G.title)||"Панель"),1)):f.createCommentVNode("",!0),G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":G==null?void 0:G.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),f.mergeProps({geometry:(ve=(Ie=r.objectData)==null?void 0:Ie.rows[0])==null?void 0:ve.geom,columns:G==null?void 0:G.columns,token:(Ne=(Se=r.objectData)==null?void 0:Se.tokens)==null?void 0:Ne[G==null?void 0:G.token],zoom:16,ref_for:!0},a.getProps(G),{data:r.objectData,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id}),null,16,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",R7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Tt=(ot=r.objectData)==null?void 0:ot.html)==null?void 0:Tt[G==null?void 0:G.name]},null,8,L7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Vt=(Nt=r.objectData)==null?void 0:Nt.vue)==null?void 0:Vt[G==null?void 0:G.name],data:(Ht=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:Ht[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(C==null?void 0:C.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",V7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C==null?void 0:C.items,G=>(f.openBlock(),f.createElementBlock("button",{key:(G==null?void 0:G.name)||(G==null?void 0:G.component),onClick:Q=>r.component=(G==null?void 0:G.component)||(G==null?void 0:G.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===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name),"":r.component!==(G==null?void 0:G.component)&&r.component!==(G==null?void 0:G.name)}])},f.toDisplayString(G==null?void 0:G.title),11,F7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Q},[r.component===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name)?(f.openBlock(),f.createElementBlock("div",$7,[G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",j7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),{data:r.objectData,token:(ve=(Ie=r.objectData)==null?void 0:Ie.tokens)==null?void 0:ve[G==null?void 0:G.token],columns:G==null?void 0:G.columns,geometry:(Ne=(Se=r.objectData)==null?void 0:Se.rows[0])==null?void 0:Ne.geom,zoom:16,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id},null,8,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",U7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(ot=r.objectData)==null?void 0:ot.html[G==null?void 0:G.name]},null,8,H7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Tt=r.objectData)==null?void 0:Tt.vue[G==null?void 0:G.name],data:(Vt=(Nt=r.objectData)==null?void 0:Nt.rows)==null?void 0:Vt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(C==null?void 0:C.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",q7,[f.createElementVNode("nav",W7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C==null?void 0:C.items,G=>(f.openBlock(),f.createElementBlock("button",{key:(G==null?void 0:G.name)||(G==null?void 0:G.component),onClick:Q=>r.component=(G==null?void 0:G.component)||(G==null?void 0:G.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===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name),"text-gray-500":r.component!==(G==null?void 0:G.component)&&r.component!==(G==null?void 0:G.name)}])},f.toDisplayString(G==null?void 0:G.title),11,G7))),128))]),f.createElementVNode("div",Z7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Q},[r.component===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name)?(f.openBlock(),f.createElementBlock("div",Y7,[G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",X7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),{token:(ve=(Ie=r.objectData)==null?void 0:Ie.tokens)==null?void 0:ve[G==null?void 0:G.token],data:r.objectData,columns:G==null?void 0:G.columns,geometry:(Ne=(Se=r.objectData)==null?void 0:Se.rows[0])==null?void 0:Ne.geom,zoom:16,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id},null,8,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",K7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(ot=r.objectData)==null?void 0:ot.html[G==null?void 0:G.name]},null,8,J7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Tt=r.objectData)==null?void 0:Tt.vue[G==null?void 0:G.name],data:(Vt=(Nt=r.objectData)==null?void 0:Nt.rows)==null?void 0:Vt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const NS=je(I7,[["render",Q7],["__scopeId","data-v-13a21928"]]),e9=Object.freeze(Object.defineProperty({__proto__:null,default:NS},Symbol.toStringTag,{value:"Module"})),o_={...sj,...aj,"vs-dashboard":cj,"vs-custom-button":dj,"vs-group-interface":zj,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String},setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",null,f.toDisplayString(t.dataName)+f.toDisplayString(t.table),1))}},...{"card-page":NS,"user-cls-page":S7}},t9=({token:t,api:e,id:n,form:i,method:r,title:a,init:u})=>new Promise(l=>{var D,R,$,W;const{VsDialog:g,VsForm:b}=(R=(D=window.app)==null?void 0:D._context)==null?void 0:R.components,{$notify:w}=(W=($=window.app)==null?void 0:$.config)==null?void 0:W.globalProperties,E=document.querySelector("#modal");if(!E){console.error('Modal root element with id "#modal" not found!');return}const C=document.createElement("div");E.appendChild(C);const I=f.createApp({components:{VsDialog:g,VsForm:b},data(){return{visible:!1,formValues:{},scheme:null}},computed:{title(){return a||"Редагувати"}},methods:{close(te){this.visible=!1,this.$el.remove(),I.unmount(),l(te||"Success")},async getFormScheme(){try{if(t){const G=await it.get(`/api/table/${t}`);this.formValues=G.data}u&&(this.formValues=u);const{data:te}=await it.get(`/api/template/form/${t||i}`);this.scheme=(te==null?void 0:te.schema)||te}catch(te){console.error("Error fetching form scheme:",te)}finally{this.visible=!0}},async updateData(){const te=this.$refs.form;try{await te.doValidation();const{data:G}=await it({method:r||"PUT",url:`${e||"/api/table/"}${t||n||""}`,data:this.formValues});Jf(),this.visible=!1,this.close(G),w({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch{w({title:"Помилка!",type:"error",message:"Сталася помилка"})}}},mounted(){this.getFormScheme()},template:`
|
741
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;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()}}}),LF=vo.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>O0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Yf=200,Pi=function(){};Pi.prototype.append=function(e){return e.length?(e=Pi.from(e),!this.length&&e||e.length<Yf&&this.leafAppend(e)||this.length<Yf&&e.leafPrepend(this)||this.appendInner(e)):this},Pi.prototype.prepend=function(e){return e.length?Pi.from(e).append(this):this},Pi.prototype.appendInner=function(e){return new VF(this,e)},Pi.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Pi.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Pi.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Pi.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Pi.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Pi.from=function(e){return e instanceof Pi?e:e&&e.length?new xS(e):Pi.empty};var xS=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={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<=Yf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Yf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Pi);Pi.empty=new xS([]);var VF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.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}(Pi);const FF=500;class Uo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){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;n&&(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 hs(E.map));let I=E.step.map(r.slice(a)),D;I&&u.maybeStep(I).doc&&(D=u.mapping.maps[u.mapping.maps.length-1],b.push(new hs(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 Uo(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,n,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 hs(e.mapping.maps[w],E,n),I;(I=g&&g.merge(C))&&(C=I,w?a.pop():l=l.slice(0,l.length-1)),a.push(C),n&&(u++,n=void 0),r||(g=C)}let b=u-i.depth;return b>jF&&(l=$F(l,b),u-=b),new Uo(l.append(a),u)}remapping(e,n){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,n),i}addMaps(e){return this.eventCount==0?this:new Uo(this.items.append(e.map(n=>new hs(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(C=>{C.selection&&l--},r);let g=n;this.items.forEach(C=>{let I=a.getMirror(--g);if(I==null)return;u=Math.min(u,I);let D=a.maps[I];if(C.step){let R=e.steps[I].invert(e.docs[I]),$=C.selection&&C.selection.map(a.slice(g+1,I));$&&l++,i.push(new hs(D,R,$))}else i.push(new hs(D))},r);let b=[];for(let C=n;C<u;C++)b.push(new hs(a.maps[C]));let w=this.items.slice(0,r).append(b).append(i),E=new Uo(w,l);return E.emptyItemCount()>FF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.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(n.slice(i)),b=g&&g.getMap();if(i--,b&&n.appendMap(b,i),g){let w=u.selection&&u.selection.map(n.slice(i));w&&a++;let E=new hs(b.invert(),g,w),C,I=r.length-1;(C=r.length&&r[I].merge(E))?r[I]=C:r.push(E)}}else u.map&&i--},this.items.length,0),new Uo(Pi.from(r.reverse()),a)}}Uo.empty=new Uo(Pi.empty,0);function $F(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class hs{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new hs(n.getMap().invert(),n,this.selection)}}}class Ma{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const jF=20;function UF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(WF)&&(t=new Ma(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ma(t.done.addTransform(n,void 0,i,Xf(e)),t.undone,vS(n.mapping.maps),t.prevTime,t.prevComposition):new Ma(t.done,t.undone.addTransform(n,void 0,i,Xf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),g=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!HF(n,t.prevRanges)),b=u?Q0(t.prevRanges,n.mapping):vS(n.mapping.maps);return new Ma(t.done.addTransform(n,g?e.selection.getBookmark():void 0,i,Xf(e)),Uo.empty,b,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ma(t.done.rebased(n,a),t.undone.rebased(n,a),Q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ma(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function HF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function vS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function Q0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function qF(t,e,n){let i=Xf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),g=new Ma(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:g})}let e_=!1,wS=null;function Xf(t){let e=t.plugins;if(wS!=e){e_=!1,wS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){e_=!0;break}}return e_}const Rl=new Ar("history"),WF=new Ar("closeHistory");function GF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $i({key:Rl,state:{init(){return new Ma(Uo.empty,Uo.empty,null,0,-1)},apply(e,n,i){return UF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?SS:i=="historyRedo"?ES:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function kS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=qF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const SS=kS(!1,!0),ES=kS(!0,!0),ZF=Ii.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>SS(t,e),redo:()=>({state:t,dispatch:e})=>ES(t,e)}},addProseMirrorPlugins(){return[GF(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()}}}),YF=vo.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):C2(n)?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(zt.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[T4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),XF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,KF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,JF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,e6=as.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wc({find:XF,type:this.type}),Wc({find:JF,type:this.type})]},addPasteRules(){return[Gc({find:KF,type:this.type}),Gc({find:QF,type:this.type})]}}),CS=/^(\d+)\.\s$/,t6=vo.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(K0.name,this.editor.getAttributes(Yh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Lh({find:CS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Lh({find:CS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),n6=vo.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),i6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,r6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,o6=as.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wc({find:i6,type:this.type})]},addPasteRules(){return[Gc({find:r6,type:this.type})]}}),TS=vo.create({name:"text",group:"inline"}),s6=Ii.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,g,b,w,E,C,I,D,R,$,W;const te=[];return this.options.bold!==!1&&te.push(_F.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&te.push(pF.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&te.push(bF.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&te.push(wF.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&te.push(bS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&te.push(EF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&te.push(MF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&te.push(NF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&te.push(RF.configure((g=this.options)===null||g===void 0?void 0:g.hardBreak)),this.options.heading!==!1&&te.push(LF.configure((b=this.options)===null||b===void 0?void 0:b.heading)),this.options.history!==!1&&te.push(ZF.configure((w=this.options)===null||w===void 0?void 0:w.history)),this.options.horizontalRule!==!1&&te.push(YF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&te.push(e6.configure((C=this.options)===null||C===void 0?void 0:C.italic)),this.options.listItem!==!1&&te.push(K0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&te.push(t6.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&te.push(n6.configure((R=this.options)===null||R===void 0?void 0:R.paragraph)),this.options.strike!==!1&&te.push(o6.configure(($=this.options)===null||$===void 0?void 0:$.strike)),this.options.text!==!1&&te.push(TS.configure((W=this.options)===null||W===void 0?void 0:W.text)),te}}),a6=Ii.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function l6(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=M4(n),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,I=Array.from(E.matchAll(w)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const D=I.input.slice(Math.max(0,I.index-1),I.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(D);if(r!==null&&!R)return null;const $=C+I.index;let W=$+I[0].length;return i&&g.test(E.slice(W-1,W+1))&&(I[0]+=" ",W+=1),$<u.pos&&W>=u.pos?{range:{from:$,to:W},query:I[0].slice(n.length),text:I[0]}:null}const c6=new Ar("suggestion");function u6({pluginKey:t=c6,editor:e,char:n="@",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=l6}){let I;const D=w==null?void 0:w(),R=new $i({key:t,view(){return{update:async($,W)=>{var te,G,Q,Ie,ve,Se,Ne;const Ae=(te=this.key)===null||te===void 0?void 0:te.getState(W),$e=(G=this.key)===null||G===void 0?void 0:G.getState($.state),Xe=Ae.active&&$e.active&&Ae.range.from!==$e.range.from,Pt=!Ae.active&&$e.active,ot=Ae.active&&!$e.active,Tt=!Pt&&!ot&&Ae.query!==$e.query,Nt=Pt||Xe&&Tt,Vt=Tt||Xe,Ft=ot||Xe&&Tt;if(!Nt&&!Vt&&!Ft)return;const Ht=Ft&&!Nt?Ae:$e,Cn=$.dom.querySelector(`[data-decoration-id="${Ht.decorationId}"]`);I={editor:e,range:Ht.range,query:Ht.query,text:Ht.text,items:[],command:dn=>g({editor:e,range:Ht.range,props:dn}),decorationNode:Cn,clientRect:Cn?()=>{var dn;const{decorationId:vn}=(dn=this.key)===null||dn===void 0?void 0:dn.getState(e.state),pn=$.dom.querySelector(`[data-decoration-id="${vn}"]`);return(pn==null?void 0:pn.getBoundingClientRect())||null}:null},Nt&&((Q=D==null?void 0:D.onBeforeStart)===null||Q===void 0||Q.call(D,I)),Vt&&((Ie=D==null?void 0:D.onBeforeUpdate)===null||Ie===void 0||Ie.call(D,I)),(Vt||Nt)&&(I.items=await b({editor:e,query:Ht.query})),Ft&&((ve=D==null?void 0:D.onExit)===null||ve===void 0||ve.call(D,I)),Vt&&((Se=D==null?void 0:D.onUpdate)===null||Se===void 0||Se.call(D,I)),Nt&&((Ne=D==null?void 0:D.onStart)===null||Ne===void 0||Ne.call(D,I))},destroy:()=>{var $;I&&(($=D==null?void 0:D.onExit)===null||$===void 0||$.call(D,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply($,W,te,G){const{isEditable:Q}=e,{composing:Ie}=e.view,{selection:ve}=$,{empty:Se,from:Ne}=ve,Ae={...W};if(Ae.composing=Ie,Q&&(Se||e.view.composing)){(Ne<W.range.from||Ne>W.range.to)&&!Ie&&!W.composing&&(Ae.active=!1);const $e=C({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:ve.$from}),Xe=`id_${Math.floor(Math.random()*4294967295)}`;$e&&E({editor:e,state:G,range:$e.range,isActive:W.active})?(Ae.active=!0,Ae.decorationId=W.decorationId?W.decorationId:Xe,Ae.range=$e.range,Ae.query=$e.query,Ae.text=$e.text):Ae.active=!1}else Ae.active=!1;return Ae.active||(Ae.decorationId=null,Ae.range={from:0,to:0},Ae.query=null,Ae.text=null),Ae}},props:{handleKeyDown($,W){var te;const{active:G,range:Q}=R.getState($.state);return G&&((te=D==null?void 0:D.onKeyDown)===null||te===void 0?void 0:te.call(D,{view:$,event:W,range:Q}))||!1},decorations($){const{active:W,range:te,decorationId:G}=R.getState($);return W?fi.create($.doc,[Zr.inline(te.from,te.to,{nodeName:u,class:l,"data-decoration-id":G})]):null}}});return R}const h6=new Ar("mention"),d6=vo.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:h6,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!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 n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[u6({editor:this.editor,...this.options.suggestion})]}}),p6=as.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),f6={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function m6(t,e,n,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 g6=je(f6,[["render",m6]]),y6={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function _6(t,e,n,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 b6=je(y6,[["render",_6]]),x6={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function v6(t,e,n,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 w6=je(x6,[["render",v6]]),k6={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function S6(t,e,n,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 E6=je(k6,[["render",S6]]),C6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function T6(t,e,n,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":n.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 M6=je(C6,[["render",T6]]),A6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function I6(t,e,n,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":n.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 P6=je(A6,[["render",I6]]),D6={},O6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function B6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",O6,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 z6={components:{IconA:je(D6,[["render",B6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},N6={class:"relative flex"},R6={class:"flex w-[160px] flex-wrap gap-[4px]"},L6=["onClick"];function V6(t,e,n,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",N6,[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",R6,[(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,L6))),128))])])]),_:1},512)}const F6=je(z6,[["render",V6]]),$6={},j6={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 U6(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",j6,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 MS=je($6,[["render",U6]]),H6={components:{IconMore:MS},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 q6(t,e,n,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":n.editor.isActive("underline")||n.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":n.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":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const W6={bold:M6,italic:P6,text_more:je(H6,[["render",q6]]),color:F6,bullet_list:b6,ordered_list:w6,blockquote:g6,codeblock:E6},G6={components:{EditorContent:hF},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(W6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new uF({content:this.modelValue,extensions:[s6,bS,Yh,a6,p6,TS,d6.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.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",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.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",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},Z6={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},Y6={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 X6(t,e,n,i,r,a){const u=f.resolveComponent("EditorContent");return f.openBlock(),f.createElementBlock("div",Z6,[r.editor?(f.openBlock(),f.createElementBlock("div",Y6,[(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 AS=je(G6,[["render",X6]]),K6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},J6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return K6(this.name)}}},Q6={class:"mr-2"},e$=["src"],t$={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},n$={key:0},i$={key:1,class:"text-sm"};function r$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Q6,[n.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,e$)):n.name?(f.openBlock(),f.createElementBlock("div",t$,[a.inItials.length?(f.openBlock(),f.createElementBlock("span",n$,f.toDisplayString(a.inItials),1)):(f.openBlock(),f.createElementBlock("span",i$,e[0]||(e[0]=[f.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):f.createCommentVNode("",!0)])}const o$={components:{VsWidgetCommentsAvatar:je(J6,[["render",r$]]),VsTextEditor:AS},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 t=ht(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(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 it.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 it.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}}},s$={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},a$={class:"flex justify-between items-center mb-2"},l$={class:"flex items-center"},c$={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},u$={class:"text-sm text-gray-600 dark:text-gray-400"},h$={class:"flex flex-col items-center gap-[4px]"},d$=["innerHTML"],p$={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},f$={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function m$(t,e,n,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",s$,[f.createElementVNode("div",a$,[f.createElementVNode("div",l$,[f.createElementVNode("p",c$,[f.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),f.createTextVNode(f.toDisplayString(n.comment.username),1)]),f.createElementVNode("p",u$,[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",h$,[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:n.comment.body},null,8,d$)]),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",f$,[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",p$,[e[7]||(e[7]=f.createTextVNode(" Коментар ")),f.createVNode(g,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=w=>r.textareaValue=w),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const g$={components:{VsWidgetCommentsItem:je(o$,[["render",m$]])},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:t}=await it.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},y$={class:"flex flex-col"},_$={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"},b$={key:1},x$={class:"p-4"},v$={class:"mt-1 text-gray-500 dark:text-neutral-500"},w$={class:"mt-4 flex justify-end gap-x-3"};function k$(t,e,n,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",y$,[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",_$,[(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:n.options,index:E,id:n.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",b$,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",x$,[f.createElementVNode("p",v$,f.toDisplayString(r.modal.message),1),f.createElementVNode("div",w$,[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 S$=je(g$,[["render",k$]]),E$={components:{VsTextEditor:AS},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 it.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},C$={class:"flex flex-col items-start w-full widget-comment-form"},T$={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},M$={class:"flex"};function A$(t,e,n,i,r,a){const u=f.resolveComponent("VsTextEditor");return f.openBlock(),f.createElementBlock("div",C$,[f.createElementVNode("div",T$,[f.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),f.createElementVNode("div",M$,[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 I$={components:{VsWidgetCommentsList:S$,VsWidgetCommentsAddForm:je(E$,[["render",A$]])},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(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await it.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},P$={class:"w-full bg-white-200"};function D$(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetCommentsAddForm"),l=f.resolveComponent("VsWidgetCommentsList");return f.openBlock(),f.createElementBlock("div",P$,[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:n.id,onListUpdate:e[0]||(e[0]=g=>a.listUpdate())},null,8,["options","id"]),f.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=g=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const IS=je(I$,[["render",D$]]),PS=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),O$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),B$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},z$=f.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return B$(this.username)}}}),N$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function R$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",N$,f.toDisplayString(t.inItials),1)}const L$=je(z$,[["render",R$]]),t_={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{t_.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},V$={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 t_.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await t_.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},F$={id:"map",style:{height:"9rem",width:"24rem"}};function $$(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",F$)}const j$=je(V$,[["render",$$]]),U$=f.defineComponent({components:{VsWidgetHistoryItemAvatar:L$,VsWidgetHistoryItemMap:j$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return O$(t.cdate)}}}),H$={class:"relative [&_p]:m-0"},q$={class:"flex items-center gap-3"},W$={class:"w-full flex justify-between"},G$={class:"text-gray-500"},Z$={class:"text-gray-800 font-medium"},Y$={class:"text-gray-500 text-sm"},X$={class:"mt-2 pl-10"},K$={key:0},J$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},Q$={class:"font-medium"},e8={class:"font-medium"};function t8(t,e,n,i,r,a){const u=f.resolveComponent("VsWidgetHistoryItemAvatar"),l=f.resolveComponent("VsWidgetHistoryItemMap");return f.openBlock(),f.createElementBlock("div",H$,[f.createElementVNode("div",q$,[f.createVNode(u,{username:t.item.username},null,8,["username"]),f.createElementVNode("div",W$,[f.createElementVNode("p",G$,[f.createElementVNode("span",Z$,f.toDisplayString(t.item.username),1),e[0]||(e[0]=f.createTextVNode(" змінив данні: "))]),f.createElementVNode("p",Y$,f.toDisplayString(t.getDate(t.item)),1)])]),f.createElementVNode("div",X$,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.item.changes,(g,b)=>(f.openBlock(),f.createElementBlock("div",{key:b},[g.attr==="geom"?(f.openBlock(),f.createElementBlock("div",K$,[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",J$,[f.createElementVNode("p",null,f.toDisplayString(`- ${t.getTitle(g)}:`),1),f.createElementVNode("p",Q$,f.toDisplayString(t.getOldValue(g)),1),e[2]||(e[2]=f.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),f.createElementVNode("p",e8,f.toDisplayString(t.getNewValue(g)),1)]))]))),128))])])}const n8=je(U$,[["render",t8]]),i8=f.defineComponent({components:{VsWidgetHistoryItem:n8,VsEmptyWidget:Gv},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?PS(this.history.data.cdate):""},lastEditDate(){return this.history.data?PS(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:t}=await it.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),r8={class:"bg-white"},o8={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"},s8={key:1,class:"w-full h-[330px] flex items-center justify-center"};function a8(t,e,n,i,r,a){var l;const u=f.resolveComponent("VsWidgetHistoryItem");return f.openBlock(),f.createElementBlock("div",r8,[e[0]||(e[0]=f.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(l=t.history.rows)!=null&&l.length?(f.openBlock(),f.createElementBlock("ul",o8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.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",s8," Історія відсутні "))])}const l8=je(i8,[["render",a8]]),c8={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"},u8={class:"inline-block w-full align-middle"},h8={class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},d8={class:"dark:bg-neutral-700"},p8={class:"divide-y divide-gray-200 dark:divide-neutral-700"},f8={key:1,class:"divide-y divide-gray-200 dark:divide-neutral-700"},Kf=10,m8={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String},setup(t){const e=t,n=f.ref([]),i=f.ref(1),r=async()=>{if(e.token)try{const{data:l}=await it.get(`/api/table-data/${e.token}`);n.value=l.rows}catch(l){console.error("Ошибка при загрузке данных таблицы:",l)}},a=l=>{i.value=l},u=f.computed(()=>{const l=(i.value-1)*Kf;return n.value.slice(l,l+Kf)});return f.onMounted(()=>{r()}),(l,g)=>{var w,E,C;const b=f.resolveComponent("VsPagination");return f.openBlock(),f.createElementBlock("div",c8,[f.createElementVNode("div",u8,[f.createElementVNode("table",h8,[(w=t.columns)!=null&&w.length?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createElementVNode("thead",d8,[f.createElementVNode("tr",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(I,D)=>(f.openBlock(),f.createElementBlock("th",{key:D,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(I.title),1))),128))])]),f.createElementVNode("tbody",p8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(t.columns,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(I==null?void 0:I[R.name]),1))),128))]))),128))])],64)):(f.openBlock(),f.createElementBlock("tbody",f8,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(I,D)=>(f.openBlock(),f.createElementBlock("tr",{key:D},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(I,(R,$)=>(f.openBlock(),f.createElementBlock("td",{key:$,class:"px-6 py-4 text-sm font-medium text-gray-800 dark:text-neutral-200"},f.toDisplayString(R),1))),128))]))),128))]))])]),((E=n.value)==null?void 0:E.length)>Kf?(f.openBlock(),f.createBlock(b,{key:0,goTo:!1,"default-page":1,total:(C=n.value)==null?void 0:C.length,pageSize:Kf,onPageChange:a,backgroundColor:"#F3F4F6"},null,8,["total"])):f.createCommentVNode("",!0)])}}},g8={},y8={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 _8(t,e){return f.openBlock(),f.createElementBlock("svg",y8,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 b8=je(g8,[["render",_8]]),x8={},v8={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 w8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",v8,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 DS=je(x8,[["render",w8]]),k8={},S8={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 E8(t,e){return f.openBlock(),f.createElementBlock("svg",S8,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 C8=je(k8,[["render",E8]]),T8={class:"relative shrink-0"},M8=["src"],A8={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},I8={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},P8={class:"grow"},D8={class:"text-xs text-gray-500 dark:text-neutral-500"},O8={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},B8={class:"text-sm text-gray-500 dark:text-neutral-500"},z8={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"},N8={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,i=f.ref(!1),r=()=>i.value=!0,a=()=>i.value=!1,u=async()=>{var l;try{await it.get(`/api/notification-read/${(l=t.item)==null?void 0:l.id}`),await n("update-notification")}catch{}};return(l,g)=>{var w,E,C,I,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=t.item)!=null&&w.read?"bg-gray-100":"bg-white"]]),onMouseenter:r,onMouseleave:a},[f.createElementVNode("div",T8,[(E=t.item)!=null&&E.avatar?(f.openBlock(),f.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(C=t.item)==null?void 0:C.avatar,alt:"Avatar"},null,8,M8)):(f.openBlock(),f.createElementBlock("div",A8,[f.createVNode(DS)])),(I=t.item)!=null&&I.read?(f.openBlock(),f.createElementBlock("span",I8)):f.createCommentVNode("",!0)]),f.createElementVNode("div",P8,[f.createElementVNode("p",D8,[f.createVNode(ly,{name:"cdate",data:t.item},null,8,["data"])]),f.createElementVNode("span",O8,f.toDisplayString((D=t.item)==null?void 0:D.author),1),f.createElementVNode("p",B8,f.toDisplayString((R=t.item)==null?void 0:R.subject),1)]),i.value?(f.openBlock(),f.createElementBlock("div",z8,[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(C8)])]),default:f.withCtx(()=>[g[0]||(g[0]=f.createTextVNode(" Прочитати "))]),_:1})])):f.createCommentVNode("",!0)],34)}}},R8={},L8={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 V8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",L8,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 F8=je(R8,[["render",V8]]),$8={},j8={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 U8(t,e){return f.openBlock(),f.createElementBlock("svg",j8,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 H8=je($8,[["render",U8]]),q8={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},W8={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},G8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Z8={class:"max-w-sm mx-auto mt-6"},Y8={class:"font-medium text-gray-800 dark:text-neutral-200"},X8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function K8(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",W8,[f.createElementVNode("div",null,[f.createElementVNode("div",G8,[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",Z8,[f.createElementVNode("p",Y8,f.toDisplayString(n.title),1),f.createElementVNode("p",X8,f.toDisplayString(n.text),1)])])])])}const n_=je(q8,[["render",K8]]),J8={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},Q8={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"},ej={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},tj={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)]"},nj={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"},ij={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"},rj={key:0},oj={key:1},OS={__name:"admin-notification",setup(t){const e=f.ref(0),n=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 it.get("/api/notification");n.value=(b==null?void 0:b.rows)||[]}catch{a({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};l();const g=async()=>{try{await it.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(F8,{height:"24",width:"24"}),e.value?(f.openBlock(),f.createElementBlock("span",J8,[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",Q8,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",ej,[f.createElementVNode("div",tj,[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",nj,[f.createVNode(H8)])]),f.createElementVNode("div",ij,[(E=n.value)!=null&&E.length?(f.openBlock(),f.createElementBlock("ul",rj,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.value,C=>(f.openBlock(),f.createBlock(N8,{key:C==null?void 0:C.id,item:C,onUpdateNotification:l},null,8,["item"]))),128))])):(f.openBlock(),f.createElementBlock("div",oj,[f.createVNode(n_,{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(b8,{height:"16",width:"16"}),w[3]||(w[3]=f.createTextVNode(" Прочитати усі "))])])):f.createCommentVNode("",!0)]}),_:1})],512))}},sj={"vs-widget-map":cy,"vs-widget-gallery":LN,"vs-widget-comments":IS,"vs-widget-file":Yv,"vs-widget-history":l8,"vs-widget-table":m8,"admin-notifications":OS},aj={"table-format-text":yp,"table-format-select":Gx,"table-format-badge":qx,"table-format-swetch":_p,"table-format-check":_p,"table-format-html":yp,"table-format-tags":Zx,"table-format-date":ly,"table-format-number":W1,"table-format-slot":G1},lj={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},cj={__name:"vs-dashboard",setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",lj,n[0]||(n[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)])))}},uj={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function hj(t,e,n,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 dj=je(uj,[["render",hj]]),pj={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},fj={class:"md:col-span-2"},mj={class:"font-semibold text-gray-800 dark:text-neutral-200"},gj={class:"md:block md:col-span-1 md:text-center"},yj=["onClick"];function _j(t,e,n,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=n.actions)==null?void 0:u.length)+2}`])},[f.createElementVNode("li",fj,[f.createElementVNode("h3",mj,f.toDisplayString(n.item.ua),1)]),(l=n.item.menu)!=null&&l.length?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(n.actions,g=>(f.openBlock(),f.createElementBlock("li",gj,[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,yj)]))),256)):f.createCommentVNode("",!0)],2)}const bj=je(pj,[["render",_j]]),xj={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 t=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=t?[...t.actions]:[]},inputHandler(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},vj={class:"md:col-span-2"},wj={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},kj={class:"text-sm text-gray-500 dark:text-neutral-500"},Sj={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Ej=["value","onChange"];function Cj(t,e,n,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-${n.actions.length+2}`])},[f.createElementVNode("li",vj,[f.createElementVNode("p",wj,f.toDisplayString(((u=n.subitem)==null?void 0:u.ua)||""),1),f.createElementVNode("p",kj,f.toDisplayString(((l=n.subitem)==null?void 0:l.path)||""),1)]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.actions,(g,b)=>(f.openBlock(),f.createElementBlock("li",{class:"col-span-1",key:g},[f.createElementVNode("div",Sj,[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,Ej),[[f.vModelCheckbox,r.checkedActions]])])]))),128))],2)}const Tj=je(xj,[["render",Cj]]),Kr=f.ref(null),i_=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...i_(n.menu)):e.push(n)}),e},Jf=()=>{const t=new CustomEvent("reloadCardPage");window.dispatchEvent(t)},Mj={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:bj,VsGroupSecondLevel:Tj,AdminNodata:n_},data(){return{list:Kr.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,n;const t={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(i=>!(i!=null&&i.menu))};return this.filterMenu([t,...(n=this.list)==null?void 0:n.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 t,e;try{const n=location.href.split("/").pop();await it.post(`/api/access-group/${n}`,{routes:(t=this.history)==null?void 0:t.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 Jf()}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(t=>({...t,actions:[]}))},async getData(){var t,e;try{const n=location.href.split("/").pop(),r=(await it.get(`/api/access-group/${n}`)).data;this.history=this.getUniqueByPath([...r.routes,...(t=i_(this.list))==null?void 0:t.map(a=>({path:a==null?void 0:a.path,actions:[]}))])}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message)}},toggleCheck(t){var n,i;if(!((n=this.history)!=null&&n.length))return;const e=(i=this.history)==null?void 0:i.findIndex(r=>(r==null?void 0:r.path)===(t==null?void 0:t.subitemPath));this.history[e].actions=t==null?void 0:t.checkedActions},toggleAll(t,e){var i,r,a,u,l,g,b;const n=(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);t!=null&&t.toggled?(l=(u=this.history)==null?void 0:u.filter(w=>n==null?void 0:n.includes(w==null?void 0:w.path)))==null||l.forEach(w=>{var E;(E=w==null?void 0:w.actions)==null||E.push(t==null?void 0:t.optionID)}):(b=(g=this.history)==null?void 0:g.filter(w=>n==null?void 0:n.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!==(t==null?void 0:t.optionID))})},getUniqueByPath(t){return t.reduce((e,n)=>(e.some(r=>r.path===n.path)||e.push(n),e),[])},filterMenu(t,e){return t.map(n=>{var i,r;if(n.menu){const a=this.filterMenu(n.menu,e);if(a.length>0)return{...n,menu:a}}return(r=(i=n.ua)==null?void 0:i.toLowerCase())!=null&&r.includes(e==null?void 0:e.toLowerCase())?n:null}).filter(Boolean)}},async mounted(){await this.getData()}},Aj={class:"flex gap-[6px]"},Ij={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Pj={key:0,class:"space-y-8"},Dj={class:"space-y-5"};function Oj(t,e,n,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",Aj,[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-${n.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(n.options,(E,C)=>(f.openBlock(),f.createElementBlock("div",{class:"col-span-1 text-center",key:C},[f.createElementVNode("h3",Ij,f.toDisplayString(E),1)]))),128))],2),(w=a.getList)!=null&&w.length?(f.openBlock(),f.createElementBlock("div",Pj,[f.createElementVNode("div",Dj,[(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":I=>a.toggleAll(I,C),actions:n.options},null,8,["item","onOn:toggled","actions"]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(E.menu,I=>(f.openBlock(),f.createBlock(g,{toggled:(E==null?void 0:E.toggled)||!1,optionID:E==null?void 0:E.optionID,key:I==null?void 0:I.path,subitem:I,actions:n.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 Bj=je(Mj,[["render",Oj]]),zj={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","del"];return(n,i)=>(f.openBlock(),f.createBlock(f.unref(Bj),{options:e,routes:n.routes},null,8,["routes"]))}},Nj={},Rj={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 Lj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("svg",Rj,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 r_=je(Nj,[["render",Lj]]),Vj={components:{IconSearch:r_},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await it.get("/api/user-cls?type=json");this.data=t}catch{}}}},Fj={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},$j={class:"relative"},jj={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)"}},Uj={class:"w-[99%] overflow-hidden overflow-ellipsis"},Hj={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function qj(t,e,n,i,r,a){const u=f.resolveComponent("IconSearch"),l=f.resolveComponent("VsText"),g=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",Fj,[f.createElementVNode("div",$j,[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",jj,[(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=t.$route)==null?void 0:w.query)==null?void 0:E.name)===(b==null?void 0:b.name)}])},{default:f.withCtx(()=>[f.createElementVNode("span",Uj,f.toDisplayString((b==null?void 0:b.name)||(b==null?void 0:b.id)),1),f.createElementVNode("span",Hj,f.toDisplayString((b==null?void 0:b.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const Wj=je(Vj,[["render",qj]]),Gj={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Zj={class:"w-full"},Yj={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Xj={class:"max-w-sm mx-auto mt-6"},Kj={class:"font-medium text-gray-800 dark:text-neutral-200"},Jj={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function Qj(t,e,n,i,r,a){return f.openBlock(),f.createElementBlock("div",Zj,[f.createElementVNode("div",Yj,[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",Xj,[f.createElementVNode("p",Kj,f.toDisplayString(n.title),1),f.createElementVNode("p",Jj,f.toDisplayString(n.text),1)])])])}const BS=je(Gj,[["render",Qj]]),e7={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},t7={class:"flex w-[160px] flex-wrap gap-[4px]"},n7=["onClick"];function i7(t,e,n,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:n.modelValue})},null,4)]),default:f.withCtx(()=>[f.createElementVNode("div",null,[f.createElementVNode("ul",t7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.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,n7))),128))])])]),_:1},512)}const zS=je(e7,[["render",i7]]),r7={components:{VsChoceColor:zS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},o7={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},s7={class:"flex flex-col"},a7={class:"flex gap-[30px]"},l7={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},c7={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},u7={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function h7(t,e,n,i,r,a){var g;const u=f.resolveComponent("VsChoceColor"),l=f.resolveComponent("VsInlineEdit");return f.openBlock(),f.createElementBlock("div",o7,[f.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=b=>r.color=b)},null,8,["modelValue"]),f.createElementVNode("div",s7,[f.createElementVNode("div",a7,[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",l7,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",c7,f.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),f.createElementVNode("p",u7,f.toDisplayString((g=n.item)==null?void 0:g.parent),1)])])}const d7={components:{VsReesterUsersItem:je(r7,[["render",h7]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var i;const n=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},p7={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)"}},f7=["onDragstart","onDrop"];function m7(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterUsersItem");return f.openBlock(),f.createElementBlock("ul",p7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.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,f7))),128))])}const g7={components:{VsNoData:BS,VsChoceColor:zS,IconCheck:Wx,VsReesterUsersList:je(d7,[["render",m7],["__scopeId","data-v-293d7735"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await it.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await it.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.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(t){var e,n;this.data.children=t;try{await it.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},y7={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},_7={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},b7={class:"flex items-end w-full gap-[4px]"};function x7(t,e,n,i,r,a){var E,C,I,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",y7,[(C=(E=t.$route)==null?void 0:E.query)!=null&&C.name?(f.openBlock(),f.createElementBlock("div",_7,[e[3]||(e[3]=f.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),f.createElementVNode("div",b7,[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=(I=r.data)==null?void 0:I.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 v7={components:{VsReesterNavList:Wj,VsReesterContent:je(g7,[["render",x7]])}},w7={class:"flex items-start gap-0"};function k7(t,e,n,i,r,a){const u=f.resolveComponent("VsReesterNavList"),l=f.resolveComponent("VsReesterContent");return f.openBlock(),f.createElementBlock("div",w7,[f.createVNode(u),f.createVNode(l)])}const S7=je(v7,[["render",k7]]),E7={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},C7={class:"mr-[10px]"},T7={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},M7={class:"flex items-center gap-[6px] ml-auto"},A7={class:"mr-[10px]"},I7={props:["table","id"],components:{AdminCardHeader:{__name:"admin-card-header",props:{title:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(t){var E,C,I,D,R;const{asyncTemplateSlot:e}=(R=(D=(I=(C=(E=f.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:C.app)==null?void 0:I.config)==null?void 0:D.globalProperties)==null?void 0:R.utils,n=t,i=SA(),r=EA(),a=f.ref(""),u=f.ref(""),l=()=>{i.back()},g=f.computed(()=>{var $;return`/edit?table=${n.getRoute}&id=${($=r==null?void 0:r.params)==null?void 0:$.id}`}),b=()=>{var $,W,te,G;if(!(($=n.slots)!=null&&$.panelLeft))return"div";if((W=n.slots)!=null&&W.panelLeft.includes("<")){const Q=e("PanelLeft",(te=n.slots)==null?void 0:te.panelLeft,["name"]);u.value=Q}else u.value=(G=n.slots)==null?void 0:G.panelLeft},w=()=>{var $,W,te,G;if(!(($=n.slots)!=null&&$.panelRight))return"div";if((W=n.slots)!=null&&W.panelRight.includes("<")){const Q=e("PanelRight",(te=n.slots)==null?void 0:te.panelRight,["name"]);a.value=Q}else a.value=(G=n.slots)==null?void 0:G.panelRight};return b(),w(),($,W)=>{const te=f.resolveComponent("router-link");return f.openBlock(),f.createElementBlock("div",E7,[f.createElementVNode("div",C7,[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",T7,f.toDisplayString(t.title),1)]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(u.value))),f.createElementVNode("div",M7,[f.createElementVNode("div",A7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(a.value)))]),t.isHeaderEditButton?(f.openBlock(),f.createBlock(te,{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(()=>W[0]||(W[0]=[f.createTextVNode(" Редагувати ")])),_:1},8,["to"])):f.createCommentVNode("",!0)])])}}},AdminCardAsyncComponent:{__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){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,n=f.ref(""),i=t;return(()=>{const w=e("CustomComponent",i.slot,["data"]);n.value=w})(),(w,E)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}}},data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(Kr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.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 t,e,n,i,r,a,u,l,g,b,w,E,C,I,D,R;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.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:((I=(C=(E=(w=this.objectData)==null?void 0:w.rows)==null?void 0:E[0])==null?void 0:C.name)==null?void 0:I.slice(0,35))+" ...";{const $=(D=this.flattenMenu(Kr.value))==null?void 0:D.find(W=>{var te,G;return(W==null?void 0:W.table)===((G=(te=this.$route)==null?void 0:te.params)==null?void 0:G.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(t){this.$router.replace({...this.$route,query:{tab:t}})}},methods:{async getObjectData(){var n,i;const t=this.table||((n=this.$route)==null?void 0:n.params.table),e=this.id||((i=this.$route)==null?void 0:i.params.id);(!t||!e)&&this.$router.replace("/404");try{const{data:r}=await it.get(`/api/table-data/${t}/${e}`);this.objectData=r}catch(r){console.error(r)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,g;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.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(t){var n,i,r;const e={};for(const a in t)["name","component","title"].includes(a)||(e[a]=((r=(i=(n=this.objectData)==null?void 0:n.rows)==null?void 0:i[0])==null?void 0:r[t[a]])||null);return e},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},P7={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},D7={key:0,class:"bg-white border rounded-xl"},O7={class:"p-[10px] pl-[20px] text-md font-[500]"},B7=["innerHTML"],z7={key:1},N7={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},R7={key:2,class:"p-[20px] border-t"},L7=["innerHTML"],V7={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]"},F7=["onClick"],$7={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},j7={key:0,class:"p-[20px] border-t"},U7={key:1,class:"p-[20px] border-t"},H7=["innerHTML"],q7={key:3,class:"flex"},W7={class:"flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 h-auto items-start pl-[10px] bg-white py-[20px]"},G7=["onClick"],Z7={class:"flex-grow w-[80%]"},Y7={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"},X7={key:0,class:"p-[20px]"},K7={key:1,class:"p-[20px]"},J7=["innerHTML"];function Q7(t,e,n,i,r,a){var g,b,w,E;const u=f.resolveComponent("AdminCardHeader"),l=f.resolveComponent("AdminCardAsyncComponent");return f.openBlock(),f.createElementBlock("div",P7,[r.objectData&&((g=r.objectData)==null?void 0:g.isHeader)!==!1?(f.openBlock(),f.createBlock(u,{key:0,title:a.getTitle,"get-route":a.getRoute,slots:(b=r.objectData)==null?void 0:b.slots,isHeaderEditButton:(w=r.objectData)==null?void 0:w.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((E=r.objectData)==null?void 0:E.panels,(C,I)=>{var D,R,$,W,te;return f.openBlock(),f.createElementBlock("div",{key:I,class:f.normalizeClass(a.getColClass(C.col))},[C!=null&&C.name?(f.openBlock(),f.createElementBlock("div",D7,[f.createElementVNode("h2",O7,f.toDisplayString((C==null?void 0:C.title)||"Панель"),1),(D=r.objectData)!=null&&D.html[C==null?void 0:C.name]?(f.openBlock(),f.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(R=r.objectData)==null?void 0:R.html[C==null?void 0:C.name]},null,8,B7)):(f.openBlock(),f.createBlock(l,{key:1,slot:($=r.objectData)==null?void 0:$.vue[C==null?void 0:C.name],data:(te=(W=r.objectData)==null?void 0:W.rows)==null?void 0:te[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):C.type==="container"?(f.openBlock(),f.createElementBlock("div",z7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt,Ft,Ht;return f.openBlock(),f.createElementBlock("div",{key:Q,class:f.normalizeClass([{"mb-[20px]":C.items.length>1},"bg-white border rounded-xl"])},[G!=null&&G.title?(f.openBlock(),f.createElementBlock("h2",N7,f.toDisplayString((G==null?void 0:G.title)||"Панель"),1)):f.createCommentVNode("",!0),G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["p-[20px]",{"border-t":G==null?void 0:G.title}])},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),f.mergeProps({geometry:(ve=(Ie=r.objectData)==null?void 0:Ie.rows[0])==null?void 0:ve.geom,columns:G==null?void 0:G.columns,token:(Ne=(Se=r.objectData)==null?void 0:Se.tokens)==null?void 0:Ne[G==null?void 0:G.token],zoom:16,ref_for:!0},a.getProps(G),{data:r.objectData,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id}),null,16,["geometry","columns","token","data","id"]))],2)):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",R7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(Tt=(ot=r.objectData)==null?void 0:ot.html)==null?void 0:Tt[G==null?void 0:G.name]},null,8,L7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Vt=(Nt=r.objectData)==null?void 0:Nt.vue)==null?void 0:Vt[G==null?void 0:G.name],data:(Ht=(Ft=r.objectData)==null?void 0:Ft.rows)==null?void 0:Ht[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)],2)}),128))])):f.createCommentVNode("",!0),(C==null?void 0:C.type)==="tabs"?(f.openBlock(),f.createElementBlock(f.Fragment,{key:2},[f.createElementVNode("nav",V7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C==null?void 0:C.items,G=>(f.openBlock(),f.createElementBlock("button",{key:(G==null?void 0:G.name)||(G==null?void 0:G.component),onClick:Q=>r.component=(G==null?void 0:G.component)||(G==null?void 0:G.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===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name),"":r.component!==(G==null?void 0:G.component)&&r.component!==(G==null?void 0:G.name)}])},f.toDisplayString(G==null?void 0:G.title),11,F7))),128))]),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Q},[r.component===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name)?(f.openBlock(),f.createElementBlock("div",$7,[G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",j7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),{data:r.objectData,token:(ve=(Ie=r.objectData)==null?void 0:Ie.tokens)==null?void 0:ve[G==null?void 0:G.token],columns:G==null?void 0:G.columns,geometry:(Ne=(Se=r.objectData)==null?void 0:Se.rows[0])==null?void 0:Ne.geom,zoom:16,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id},null,8,["data","token","columns","geometry","id"]))])):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",U7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(ot=r.objectData)==null?void 0:ot.html[G==null?void 0:G.name]},null,8,H7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Tt=r.objectData)==null?void 0:Tt.vue[G==null?void 0:G.name],data:(Vt=(Nt=r.objectData)==null?void 0:Nt.rows)==null?void 0:Vt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))],64)):f.createCommentVNode("",!0),(C==null?void 0:C.type)==="vertical-tabs"?(f.openBlock(),f.createElementBlock("div",q7,[f.createElementVNode("nav",W7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C==null?void 0:C.items,G=>(f.openBlock(),f.createElementBlock("button",{key:(G==null?void 0:G.name)||(G==null?void 0:G.component),onClick:Q=>r.component=(G==null?void 0:G.component)||(G==null?void 0:G.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===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name),"text-gray-500":r.component!==(G==null?void 0:G.component)&&r.component!==(G==null?void 0:G.name)}])},f.toDisplayString(G==null?void 0:G.title),11,G7))),128))]),f.createElementVNode("div",Z7,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.items,(G,Q)=>{var Ie,ve,Se,Ne,Ae,$e,Xe,Pt,ot,Tt,Nt,Vt;return f.openBlock(),f.createElementBlock(f.Fragment,{key:Q},[r.component===(G==null?void 0:G.component)||r.component===(G==null?void 0:G.name)?(f.openBlock(),f.createElementBlock("div",Y7,[G!=null&&G.component?(f.openBlock(),f.createElementBlock("div",X7,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(G.component),{token:(ve=(Ie=r.objectData)==null?void 0:Ie.tokens)==null?void 0:ve[G==null?void 0:G.token],data:r.objectData,columns:G==null?void 0:G.columns,geometry:(Ne=(Se=r.objectData)==null?void 0:Se.rows[0])==null?void 0:Ne.geom,zoom:16,id:($e=(Ae=t.$route)==null?void 0:Ae.params)==null?void 0:$e.id},null,8,["token","data","columns","geometry","id"]))])):f.createCommentVNode("",!0),G!=null&&G.name?(f.openBlock(),f.createElementBlock("div",K7,[(Pt=(Xe=r.objectData)==null?void 0:Xe.html)!=null&&Pt[G==null?void 0:G.name]?(f.openBlock(),f.createElementBlock("div",{key:0,innerHTML:(ot=r.objectData)==null?void 0:ot.html[G==null?void 0:G.name]},null,8,J7)):(f.openBlock(),f.createBlock(l,{key:1,slot:(Tt=r.objectData)==null?void 0:Tt.vue[G==null?void 0:G.name],data:(Vt=(Nt=r.objectData)==null?void 0:Nt.rows)==null?void 0:Vt[0],objectData:r.objectData},null,8,["slot","data","objectData"]))])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)],64)}),128))])])):f.createCommentVNode("",!0)],2)}),128))],2)])}const NS=je(I7,[["render",Q7],["__scopeId","data-v-13a21928"]]),e9=Object.freeze(Object.defineProperty({__proto__:null,default:NS},Symbol.toStringTag,{value:"Module"})),o_={...sj,...aj,"vs-dashboard":cj,"vs-custom-button":dj,"vs-group-interface":zj,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String,geom:null},setup(t){return(e,n)=>(f.openBlock(),f.createElementBlock("div",null,f.toDisplayString(t.dataName)+f.toDisplayString(t.geom),1))}},...{"card-page":NS,"user-cls-page":S7}},t9=({token:t,api:e,id:n,form:i,method:r,title:a,init:u})=>new Promise(l=>{var D,R,$,W;const{VsDialog:g,VsForm:b}=(R=(D=window.app)==null?void 0:D._context)==null?void 0:R.components,{$notify:w}=(W=($=window.app)==null?void 0:$.config)==null?void 0:W.globalProperties,E=document.querySelector("#modal");if(!E){console.error('Modal root element with id "#modal" not found!');return}const C=document.createElement("div");E.appendChild(C);const I=f.createApp({components:{VsDialog:g,VsForm:b},data(){return{visible:!1,formValues:{},scheme:null}},computed:{title(){return a||"Редагувати"}},methods:{close(te){this.visible=!1,this.$el.remove(),I.unmount(),l(te||"Success")},async getFormScheme(){try{if(t){const G=await it.get(`/api/table/${t}`);this.formValues=G.data}u&&(this.formValues=u);const{data:te}=await it.get(`/api/template/form/${t||i}`);te!=null&&te.obj&&(this.formValues={...this.formValues,...te.obj}),this.scheme=(te==null?void 0:te.schema)||te}catch(te){console.error("Error fetching form scheme:",te)}finally{this.visible=!0}},async updateData(){const te=this.$refs.form;try{await te.doValidation();const{data:G}=await it({method:r||"PUT",url:`${e||"/api/table/"}${t||n||""}`,data:this.formValues});Jf(),this.visible=!1,this.close(G),w({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch{w({title:"Помилка!",type:"error",message:"Сталася помилка"})}}},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"/>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as d, u as m, c as n } from "./import-file-
|
1
|
+
import { _ as d, u as m, c as n } from "./import-file-CknmeGNO.js";
|
2
2
|
import { resolveComponent as b, openBlock as u, createElementBlock as h, createElementVNode as a, createBlock as f, createCommentVNode as p } from "vue";
|
3
3
|
const g = {
|
4
4
|
data() {
|
@@ -3588,16 +3588,16 @@ function tD(t) {
|
|
3588
3588
|
}
|
3589
3589
|
const nD = [
|
3590
3590
|
// { name: 'profile', path: '/profile', component: () => import('../components/profile/vs-profile.vue') },
|
3591
|
-
{ name: "edit", path: "/edit", component: () => import("./edit-page-
|
3592
|
-
{ name: "add", path: "/add", component: () => import("./add-page-
|
3591
|
+
{ name: "edit", path: "/edit", component: () => import("./edit-page-C76NxZRq.js") },
|
3592
|
+
{ name: "add", path: "/add", component: () => import("./add-page-CKy5L_78.js") },
|
3593
3593
|
{
|
3594
3594
|
name: "card-view",
|
3595
3595
|
path: "/card",
|
3596
|
-
component: () => import("./card-view-
|
3596
|
+
component: () => import("./card-view-CdCsaogK.js"),
|
3597
3597
|
children: [{
|
3598
3598
|
name: "table",
|
3599
3599
|
path: ":table",
|
3600
|
-
component: () => import("./card-view-
|
3600
|
+
component: () => import("./card-view-CdCsaogK.js"),
|
3601
3601
|
children: [{ name: "card", path: ":id", component: () => Promise.resolve().then(() => r7) }]
|
3602
3602
|
}]
|
3603
3603
|
}
|
@@ -3651,14 +3651,14 @@ const aD = /* @__PURE__ */ Tt(iD, [["render", oD]]), lD = (t) => {
|
|
3651
3651
|
{
|
3652
3652
|
path: "/",
|
3653
3653
|
name: "home",
|
3654
|
-
component: () => import("./admin-view-
|
3654
|
+
component: () => import("./admin-view-DJBkad_B.js"),
|
3655
3655
|
children: [
|
3656
3656
|
...e,
|
3657
3657
|
...t,
|
3658
3658
|
// { path: '/', redirect: '/home' },
|
3659
3659
|
{
|
3660
3660
|
path: "/:catchAll(.*)",
|
3661
|
-
component: () => import("./admin-interface-
|
3661
|
+
component: () => import("./admin-interface-BX613rWQ.js")
|
3662
3662
|
}
|
3663
3663
|
]
|
3664
3664
|
}
|
@@ -48497,10 +48497,11 @@ const YM = /* @__PURE__ */ Tt(zW, [["render", i7], ["__scopeId", "data-v-13a2192
|
|
48497
48497
|
props: {
|
48498
48498
|
data: Object,
|
48499
48499
|
dataName: String,
|
48500
|
-
table: String
|
48500
|
+
table: String,
|
48501
|
+
geom: null
|
48501
48502
|
},
|
48502
48503
|
setup(t) {
|
48503
|
-
return (e, n) => (ue(), ye("div", null, pt(t.dataName) + pt(t.
|
48504
|
+
return (e, n) => (ue(), ye("div", null, pt(t.dataName) + pt(t.geom), 1));
|
48504
48505
|
}
|
48505
48506
|
}, N0 = {
|
48506
48507
|
...iq,
|
@@ -48548,7 +48549,7 @@ const YM = /* @__PURE__ */ Tt(zW, [["render", i7], ["__scopeId", "data-v-13a2192
|
|
48548
48549
|
const { data: te } = await kt.get(
|
48549
48550
|
`/api/template/form/${t || i}`
|
48550
48551
|
);
|
48551
|
-
this.scheme = (te == null ? void 0 : te.schema) || te;
|
48552
|
+
te != null && te.obj && (this.formValues = { ...this.formValues, ...te.obj }), this.scheme = (te == null ? void 0 : te.schema) || te;
|
48552
48553
|
} catch (te) {
|
48553
48554
|
console.error("Error fetching form scheme:", te);
|
48554
48555
|
} finally {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opengis/admin",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.6",
|
4
4
|
"description": "This project Softpro Admin",
|
5
5
|
"main": "dist/admin.js",
|
6
6
|
"type": "module",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"@opengis/fastify-auth": "^1.0.51",
|
38
38
|
"@opengis/fastify-file": "^1.0.30",
|
39
39
|
"@opengis/fastify-table": "^1.1.86",
|
40
|
-
"@opengis/v3-core": "^0.2.
|
40
|
+
"@opengis/v3-core": "^0.2.52",
|
41
41
|
"@opengis/v3-filter": "^0.0.41",
|
42
42
|
"@tiptap/core": "^2.8.0",
|
43
43
|
"@tiptap/extension-color": "^2.8.0",
|
package/server/plugins/hook.js
CHANGED
@@ -17,7 +17,7 @@ export default async function plugin(fastify) {
|
|
17
17
|
const json = await getMenu({ user: { uid: 1 } });
|
18
18
|
// insert interface list to db (user access management)
|
19
19
|
if (client?.pk?.['admin.routes'] && json?.length) {
|
20
|
-
const menuList = json.filter((el) => (el?.table || el?.menu?.length) && el?.ua || el?.en || el?.name);
|
20
|
+
const menuList = json.filter((el) => (el?.table || el?.component || el?.menu?.length) && el?.ua || el?.en || el?.name);
|
21
21
|
|
22
22
|
// skip dupes
|
23
23
|
const q = `insert into admin.menu(name, ord) values${menuList.filter((el, idx, arr) => arr.map((el) => el?.ua || el?.en || el?.name).indexOf(el?.ua || el?.en || el?.name) === idx).map((el, i) => `('${(el?.ua || el?.en || el?.name).replace(/'/g, '’')}', ${i}) `).join(',')
|
@@ -26,7 +26,7 @@ export default async function plugin(fastify) {
|
|
26
26
|
const { rows = [] } = menuList?.length ? await client.query(q) : {};
|
27
27
|
const menus = rows.reduce((acc, curr) => Object.assign(acc, { [curr.menu_id]: menuList.find((item) => (item?.ua || item?.en || item?.name) === curr.name) }), {});
|
28
28
|
const values = Object.entries(menus).reduce((acc, curr) => {
|
29
|
-
if (curr[1]?.table) { acc.push({ ...curr[1], menuId: curr[0] }); }
|
29
|
+
if (curr[1]?.table || curr[1]?.component) { acc.push({ ...curr[1], menuId: curr[0] }); }
|
30
30
|
curr[1]?.menu?.forEach((el) => acc.push({ ...el, menuId: curr[0] }));
|
31
31
|
return acc;
|
32
32
|
}, []);
|
@@ -21,12 +21,13 @@ export default async function accessGroupPost({
|
|
21
21
|
}
|
22
22
|
|
23
23
|
if (routes?.length) {
|
24
|
-
|
24
|
+
const { routesDB = [] } = await pg.query('select array_agg(route_id) as "routesDB" from admin.routes where enabled')
|
25
|
+
.then((res1) => res1.rows?.[0] || {});
|
25
26
|
await pg.query(`delete from admin.role_access where role_id=$1;`, [id]);
|
26
27
|
|
27
28
|
|
28
29
|
const q = `insert into admin.role_access(role_id,route_id,actions) values ($1,$2,$3)`;
|
29
|
-
await Promise.all(routes.filter(el => el.actions).map(el => pg.query(q, [id, el.path, el.actions])))
|
30
|
+
await Promise.all(routes.filter(el => routesDB.includes(el.path) && el.actions).map(el => pg.query(q, [id, el.path, el.actions])))
|
30
31
|
|
31
32
|
const { rows } = await pg.query(`select a.route_id as path, b.actions as actions from admin.routes a
|
32
33
|
left join admin.role_access b on a.route_id=b.route_id
|
@@ -23,5 +23,9 @@ export default async function getTemplateApi(req) {
|
|
23
23
|
return `access restricted ${name}`;
|
24
24
|
}
|
25
25
|
await applyHook('afterTemplate', { name, type, data, user });
|
26
|
+
if (tokenData.obj) {
|
27
|
+
const obj = tokenData.obj.split('#').reduce((p, el) => ({ ...p, [el.split('=')[0]]: el.split('=')[1] }), {})
|
28
|
+
Object.assign(data, { obj });
|
29
|
+
}
|
26
30
|
return data?.html || data || `template not found "${name}"`;
|
27
31
|
}
|