voiptime-components 1.23.9 → 1.23.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/audio/types.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/audio/types.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAG9C,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,EAAE,CAAC;IACT,KAAK,EAAE,EAAE,CAAC;IACV,KAAK,EAAE,EAAE,CAAC;IACV,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAGlD,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAEhC,eAAe,IAAI,gBAAgB,CAAC;CACrC;AAED,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -101,4 +101,4 @@
|
|
|
101
101
|
16.5982 14.3027 16.9805 13.3872C17.3628 12.4717 17.5596 11.4895 17.5596 10.4974
|
|
102
102
|
C17.5596 9.50531 17.3628 8.52309 16.9805 7.60761C16.5982 6.69212 16.0382 5.86158
|
|
103
103
|
15.3327 5.16406" stroke="#F2F2F2" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
104
|
-
</svg>`,S),d=new WeakMap,{t:a}=f1(),h=o,m=l,p=e.computed(()=>!!(h.userA||h.userB)),C=e.ref(!1),Z=e.computed(()=>h.disabled||C.value),b=e.ref(!1),I=e.ref(1),w=e.ref(`ws-${Math.random().toString(36).slice(2,9)}`),y=e.ref(null),f=e.ref(null),Y=e.ref(null),u=e.ref(null),g=e.ref(null),x=e.computed(()=>h.type==="channel-routed"),K=(R,S)=>{var O;const N=S.canvas,{width:v,height:Q}=N,q=(O=y.value)==null?void 0:O.decodedData,r1=N.getBoundingClientRect(),C1=r1.width>0?v/r1.width:1,a1=r1.height>0?Q/r1.height:1;if(!R.length&&!q){S.fillStyle=me.WAVE_DEFAULT,S.fillRect(0,Q/2,v,2);return}const c1=p.value&&q&&q.numberOfChannels>=2?[q.getChannelData(0),q.getChannelData(1)]:[R[0]||new Float32Array(v).fill(0)];S.clearRect(0,0,v,Q);const M1=20*a1,W1=20*C1,L1=[];if(c1.forEach((A,n1)=>{const V1=Q/c1.length,x1=V1-(p.value?M1:0),g1=n1*V1+(p.value?M1:0)+x1/2,F1=A.length/v;let R1=0;for(let U=0;U<A.length;U+=100){const e1=Math.abs(A[U]??0);e1>R1&&(R1=e1)}R1===0&&(R1=1),S.fillStyle=me.WAVE_DEFAULT;for(let U=0;U<v;U+=2){const e1=Math.floor(U*F1),m1=Math.min(Math.floor((U+2)*F1),A.length-1);let w1=0;for(let t1=e1;t1<=m1;t1++){const d1=Math.abs(A[t1]??0);d1>w1&&(w1=d1)}const J1=w1/R1,U1=Math.max(J1*x1*.85,2);S.fillRect(U,g1-U1/2,1.5,U1)}if(p.value){S.fillStyle="#999999",S.font=`${12*C1}px Inter, sans-serif`,S.textAlign="right";const U=(n1===0?h.userA:h.userB)??"";S.fillText(U,v-10*C1,n1*V1+M1-5*a1);const e1=n1,m1=5*C1,w1=n1*V1+1*a1;((e1===0?T.value:W.value)===0?r:n)(e1===0?me.CHANNEL_A:me.CHANNEL_B,U1=>S.drawImage(U1,m1,w1,W1,W1)),L1.push({x:m1,y:w1,width:W1,height:W1,channelIdx:e1})}}),p.value){const A=d.get(N);A&&N.removeEventListener("click",A);const n1=V1=>{if(Z.value)return;const x1=N.getBoundingClientRect(),g1=x1.width>0?N.width/x1.width:1,F1=x1.height>0?N.height/x1.height:1,R1=(V1.clientX-x1.left)*g1,U=(V1.clientY-x1.top)*F1;for(const e1 of L1)if(R1>=e1.x&&R1<=e1.x+e1.width&&U>=e1.y&&U<=e1.y+e1.height){V1.stopPropagation(),V1.preventDefault(),X(e1.channelIdx);const m1=(e1.channelIdx===0?T.value:W.value)===0;S.save(),S.clearRect(e1.x,e1.y,e1.width,e1.height),(m1?r:n)(e1.channelIdx===0?me.CHANNEL_A:me.CHANNEL_B,w1=>S.drawImage(w1,e1.x,e1.y,e1.width,e1.height)),S.restore();break}};N.addEventListener("click",n1),d.set(N,n1)}},k=e.computed(()=>{if(h.height){const R=parseInt(h.height,10);if(!isNaN(R))return R}return x.value?36:p.value?100:50}),M=()=>{var Q;const R=(Q=y.value)==null?void 0:Q.getMediaElement();if(!R)return;Y.value=new(window.AudioContext||window.webkitAudioContext);const S=Y.value.createMediaElementSource(R),N=Y.value.createChannelSplitter(2),v=Y.value.createChannelMerger(2);u.value=Y.value.createGain(),g.value=Y.value.createGain(),u.value.gain.value=T.value,g.value.gain.value=W.value,S.connect(N),N.connect(u.value,0),N.connect(g.value,1),p.value?(u.value.connect(v,0,0),g.value.connect(v,0,1)):(u.value.connect(v,0,0),u.value.connect(v,0,1),g.value.connect(v,0,0),g.value.connect(v,0,1)),v.connect(Y.value.destination)},L=()=>{var R;(R=Y.value)==null||R.close(),Y.value=null,u.value=null,g.value=null},V=()=>{if(!h.recordUrl)return;C.value=!1;const R=Te.create({container:`#waveform-${w.value}`,waveColor:me.WAVE_DEFAULT,progressColor:me.PROGRESS,barWidth:2,height:k.value,plugins:x.value?[]:[ut.create({container:f.value,style:{fontSize:"10px",color:"#999"}})],renderFunction:(S,N)=>K(S,N)});y.value=R,y.value.on("play",()=>{b.value=!0,m("play")}),y.value.on("pause",()=>{b.value=!1,m("pause")}),y.value.on("timeupdate",S=>m("timeUpdate",S)),y.value.on("finish",()=>{b.value=!1,m("ended")}),y.value.on("error",()=>{C.value=!0,m("error")}),(p.value||x.value)&&y.value.on("ready",()=>{M()}),y.value.load(h.recordUrl)},T=e.ref(1),W=e.ref(1),X=R=>{const S=R===0?u.value:g.value,N=R===0?T:W;N.value=N.value?0:1,S&&(S.gain.value=N.value)},G=async()=>{if(!(!y.value||Z.value)){if(x.value){const R=y.value.getMediaElement();if(!R||!Y.value)return;Y.value.state==="suspended"&&await Y.value.resume(),R.paused?await R.play():R.pause();return}b.value?y.value.pause():y.value.play()}},F=R=>{var S;I.value=R,(S=y.value)==null||S.setPlaybackRate(I.value)},B=(R,S)=>{if(R.startsWith("data:")){const v=document.createElement("a");v.href=R,v.download=S,document.body.appendChild(v),v.click(),document.body.removeChild(v)}else fetch(R).then(v=>v.blob()).then(v=>{const Q=document.createElement("a");Q.href=URL.createObjectURL(v),Q.download=S,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q)}).catch(console.error)},l1=()=>{if(h.disabled||!h.recordUrl)return;const R=h.recordUrl.indexOf("?"),S=h.recordUrl.substring(h.recordUrl.lastIndexOf("/")+1,R===-1?void 0:R);B(h.recordUrl,S)};return e.onMounted(()=>e.nextTick(V)),e.onBeforeUnmount(()=>{var R;(R=y.value)==null||R.destroy(),L()}),e.watch(()=>h.recordUrl,()=>{var R;(R=y.value)==null||R.destroy(),L(),e.nextTick(V)}),t({play:()=>{var R;return(R=y.value)==null?void 0:R.play()},pause:()=>{var R;return(R=y.value)==null?void 0:R.pause()},getCurrentTime:()=>{var R;return((R=y.value)==null?void 0:R.getCurrentTime())||0}}),(R,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"is-disabled":Z.value,"is-channel-routed":x.value},"vt-audio"])},[o.recordUrl?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([{"is-single-channel":!p.value,"is-channel-routed":x.value},"vt-audio__container"])},[o.playPosition==="left"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:G},[b.value?e.renderSlot(R.$slots,"icon-pause",{key:0},()=>[e.createVNode(p1,{height:"24",name:"pause",width:"24"})]):e.renderSlot(R.$slots,"icon-play",{key:1},()=>[e.createVNode(p1,{height:"24",name:"start",width:"24"})])],8,ID)):e.createCommentVNode("",!0),e.createElementVNode("div",ZD,[e.createElementVNode("div",{id:`waveform-${w.value}`,class:"vt-audio__waveform"},null,8,kD),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"timelineContainer",ref:f,class:"vt-audio__timeline"},null,512))]),e.createElementVNode("div",bD,[h.download?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn",onClick:l1},[e.createVNode(p1,{height:"20",name:"import",width:"20"})],8,VD)):e.createCommentVNode("",!0),o.playPosition==="right"?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:G},[b.value?e.renderSlot(R.$slots,"icon-pause",{key:0},()=>[e.createVNode(p1,{height:"24",name:"pause",width:"24"})]):e.renderSlot(R.$slots,"icon-play",{key:1},()=>[e.createVNode(p1,{height:"24",name:"start",width:"24"})])],8,wD)):e.createCommentVNode("",!0),e.createVNode(Ze,{disabled:Z.value,placement:"top",trigger:"click",onCommand:F},{dropdown:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList([.5,1,1.5,2],N=>e.createVNode(ke,{key:N,class:e.normalizeClass({"is-active":I.value===N}),command:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N)+"x ",1)]),_:2},1032,["class","command"])),64))]),default:e.withCtx(()=>[e.createElementVNode("button",{disabled:Z.value,class:"vt-audio__speed-val"},e.toDisplayString(I.value)+"x",9,LD)]),_:1},8,["disabled"])])],2)):(e.openBlock(),e.createElementBlock("div",pD,[e.renderSlot(R.$slots,"empty",{},()=>[x.value?(e.openBlock(),e.createElementBlock("span",CD,e.toDisplayString(e.unref(a)(e.unref(s).AUDIO_EMPTY)),1)):(e.openBlock(),e.createBlock(Oe,{key:0,text:e.unref(a)(e.unref(s).AUDIO_EMPTY),icon:"noSound"},null,8,["text"]))])]))],2))}}),yD=new Set(["p","div","br","hr","h1","h2","h3","h4","h5","h6","blockquote","pre","code","ul","ol","li","b","strong","i","em","u","s","strike","del","sub","sup","font","span","a","img","table","thead","tbody","tfoot","tr","th","td","caption"]),MD=new Set(["style","class","href","target","rel","src","alt","width","height","face","size","color","colspan","rowspan"]),SD=new Set(["behavior","-moz-binding","filter"]),YD=/expression\s*\(|javascript\s*:|vbscript\s*:/i;function ND(o){const t=document.createElement("span");t.setAttribute("style",o);const l=t.style,i=[];for(let n=0;n<l.length;n++){const r=l[n],d=l.getPropertyValue(r);SD.has(r)||YD.test(d)||/url\s*\(/i.test(d)&&!/url\s*\(\s*['"]?data:image\//i.test(d)||i.push(`${r}:${d}`)}return i.join(";")}const WD=new Set(["https:","http:","ftp:","mailto:","tel:"]);function gD(o){const t=o.trim();if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const l=new URL(t);return WD.has(l.protocol)}catch{return!/^[a-z][a-z0-9+\-.]*:/i.test(t)}}function g2(o){var r,d,a;if(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.PROCESSING_INSTRUCTION_NODE){(r=o.parentNode)==null||r.removeChild(o);return}if(o.nodeType!==Node.ELEMENT_NODE)return;const t=o,l=t.tagName.toLowerCase();if(!yD.has(l)){for(;t.firstChild;)(d=t.parentNode)==null||d.insertBefore(t.firstChild,t);(a=t.parentNode)==null||a.removeChild(t);return}const i=Array.from(t.attributes);for(const h of i){const m=h.name.toLowerCase();if(m.startsWith("on")){t.removeAttribute(h.name);continue}if(!MD.has(m)){t.removeAttribute(h.name);continue}if((m==="href"||m==="src")&&!gD(h.value)){t.removeAttribute(h.name);continue}if(m==="style"){const p=ND(h.value);p?t.setAttribute("style",p):t.removeAttribute("style");continue}}l==="a"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer");const n=Array.from(t.childNodes);for(let h=n.length-1;h>=0;h--)g2(n[h])}function we(o){if(!o)return"";const t=new DOMParser().parseFromString(o,"text/html");t.head.innerHTML="";const l=Array.from(t.body.childNodes);for(let i=l.length-1;i>=0;i--)g2(l[i]);return t.body.innerHTML}function xt(o){const t=document.createElement("div");return t.innerHTML=o,t.textContent??t.innerText??""}function fD(o,t){function l(m,p){o.value&&(o.value.focus(),document.execCommand(m,!1,p??""),t())}function i(m){try{return document.queryCommandState(m)}catch{return!1}}function n(m){o.value&&(o.value.focus(),document.execCommand("formatBlock",!1,m),t())}function r(m){o.value&&(o.value.focus(),document.execCommand("fontName",!1,m),t())}function d(m){o.value&&(o.value.focus(),document.execCommand("foreColor",!1,m),t())}function a(m){o.value&&(o.value.focus(),document.execCommand("hiliteColor",!1,m),t())}function h(m){const p=window.getSelection();if(!p||p.rangeCount===0)return;let C=p.anchorNode;C.nodeType===Node.TEXT_NODE&&(C=C.parentElement);const Z=C.closest(".vt-editor__content > *");if(!Z)return;const b=parseInt(Z.style.marginLeft||"0",10),I=20,w=m==="indent"?b+I:Math.max(0,b-I);Z.style.marginLeft=w?`${w}px`:"",t()}return{exec:l,isActive:i,applyBlock:n,applyFont:r,applyForeColor:d,applyBackColor:a,handleIndent:h}}function xD(){let o=null;function t(){const r=window.getSelection();r&&r.rangeCount>0&&(o=r.getRangeAt(0).cloneRange())}function l(){if(!o)return;const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}function i(){o=null}function n(){return o}return{saveSelection:t,restoreSelection:l,clearSavedRange:i,getSavedRange:n}}function TD(o,t){const{saveSelection:l,restoreSelection:i,clearSavedRange:n,getSavedRange:r}=xD(),d=e.ref({visible:!1,url:"",text:"",openInNewTab:!1});function a(){var f,Y;l();const I=window.getSelection(),w=(I==null?void 0:I.toString())??"",y=(Y=(f=I==null?void 0:I.anchorNode)==null?void 0:f.parentElement)==null?void 0:Y.closest("a");d.value={visible:!0,url:(y==null?void 0:y.getAttribute("href"))??"",text:w,openInNewTab:(y==null?void 0:y.getAttribute("target"))==="_blank"}}function h(){i();const{url:I,text:w,openInNewTab:y}=d.value;if(!I){m();return}const f=document.createElement("a");f.href=I,f.textContent=w||I,y&&f.setAttribute("target","_blank"),f.setAttribute("rel","noopener noreferrer");const Y=r(),u=window.getSelection();u&&u.rangeCount>0&&Y?(Y.deleteContents(),Y.insertNode(f)):o(f.outerHTML),m(),t()}function m(){d.value={visible:!1,url:"",text:"",openInNewTab:!1},n()}const p=e.ref({visible:!1,url:"",alt:""});function C(){l(),p.value={visible:!0,url:"",alt:""}}function Z(){i();const{url:I,alt:w}=p.value;if(!I){b();return}o(`<img src="${I}" alt="${w}" style="max-width:100%;" />`),b()}function b(){p.value={visible:!1,url:"",alt:""},n()}return{linkState:d,openLinkDialog:a,confirmLink:h,cancelLink:m,imageState:p,openImageDialog:C,confirmImage:Z,cancelImage:b}}const _1={undo:"undo",redo:"redo",bold:"textBold",italic:"textItalic",underline:"textUnderline",strikethrough:"textStrikethrough",subscript:"subscript",superscript:"superscript",orderedList:"orderedList",unorderedList:"unorderedList",indent:"indent",outdent:"outdent",alignLeft:"alignLeft",alignCenter:"alignCenter",alignRight:"alignRight",alignJustify:"alignJustify",link:"link",image:"image",blockquote:"blockquote",clearFormat:"clearFormat",html:"html"},vD=[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],XD=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"}];function GD(o,t){const{t:l}=f1(),i=e.ref(0);function n(){i.value++}function r(h){var m;return i.value,((m=h.activeCheck)==null?void 0:m.call(h))??!1}function d(h){const m=[];return h.forEach((p,C)=>{switch(C>0&&m.push({type:"separator"}),p){case"history":m.push({type:"button",id:"undo",tooltip:l(s.EDITOR_UNDO),iconName:_1.undo,action:()=>t.exec("undo")},{type:"button",id:"redo",tooltip:l(s.EDITOR_REDO),iconName:_1.redo,action:()=>t.exec("redo")});break;case"format":m.push({type:"button",id:"bold",tooltip:l(s.EDITOR_BOLD),iconName:_1.bold,action:()=>t.exec("bold"),activeCheck:()=>t.isActive("bold")},{type:"button",id:"italic",tooltip:l(s.EDITOR_ITALIC),iconName:_1.italic,action:()=>t.exec("italic"),activeCheck:()=>t.isActive("italic")},{type:"button",id:"underline",tooltip:l(s.EDITOR_UNDERLINE),iconName:_1.underline,action:()=>t.exec("underline"),activeCheck:()=>t.isActive("underline")},{type:"button",id:"strikethrough",tooltip:l(s.EDITOR_STRIKETHROUGH),iconName:_1.strikethrough,action:()=>t.exec("strikethrough"),activeCheck:()=>t.isActive("strikeThrough")});break;case"script":m.push({type:"button",id:"subscript",tooltip:l(s.EDITOR_SUBSCRIPT),iconName:_1.subscript,action:()=>t.exec("subscript"),activeCheck:()=>t.isActive("subscript")},{type:"button",id:"superscript",tooltip:l(s.EDITOR_SUPERSCRIPT),iconName:_1.superscript,action:()=>t.exec("superscript"),activeCheck:()=>t.isActive("superscript")});break;case"heading":m.push({type:"select",id:"heading"});break;case"fontName":m.push({type:"select",id:"fontName"});break;case"foreColor":m.push({type:"select",id:"foreColor"});break;case"align":m.push({type:"button",id:"alignLeft",tooltip:l(s.EDITOR_ALIGN_LEFT),iconName:_1.alignLeft,action:()=>t.exec("justifyLeft"),activeCheck:()=>t.isActive("justifyLeft")},{type:"button",id:"alignCenter",tooltip:l(s.EDITOR_ALIGN_CENTER),iconName:_1.alignCenter,action:()=>t.exec("justifyCenter"),activeCheck:()=>t.isActive("justifyCenter")},{type:"button",id:"alignRight",tooltip:l(s.EDITOR_ALIGN_RIGHT),iconName:_1.alignRight,action:()=>t.exec("justifyRight"),activeCheck:()=>t.isActive("justifyRight")},{type:"button",id:"alignJustify",tooltip:l(s.EDITOR_ALIGN_JUSTIFY),iconName:_1.alignJustify,action:()=>t.exec("justifyFull"),activeCheck:()=>t.isActive("justifyFull")});break;case"list":m.push({type:"button",id:"orderedList",tooltip:l(s.EDITOR_ORDERED_LIST),iconName:_1.orderedList,action:()=>t.exec("insertOrderedList"),activeCheck:()=>t.isActive("insertOrderedList")},{type:"button",id:"unorderedList",tooltip:l(s.EDITOR_UNORDERED_LIST),iconName:_1.unorderedList,action:()=>t.exec("insertUnorderedList"),activeCheck:()=>t.isActive("insertUnorderedList")});break;case"indent":m.push({type:"button",id:"indent",tooltip:l(s.EDITOR_INDENT),iconName:_1.indent,action:()=>t.handleIndent("indent")},{type:"button",id:"outdent",tooltip:l(s.EDITOR_OUTDENT),iconName:_1.outdent,action:()=>t.handleIndent("outdent")});break;case"link":m.push({type:"button",id:"link",tooltip:l(s.EDITOR_INSERT_LINK),iconName:_1.link,action:t.openLinkDialog});break;case"image":m.push({type:"button",id:"image",tooltip:l(s.EDITOR_INSERT_IMAGE),iconName:_1.image,action:t.openImageDialog});break;case"blockquote":m.push({type:"button",id:"blockquote",tooltip:l(s.EDITOR_BLOCKQUOTE),iconName:_1.blockquote,action:()=>t.applyBlock("blockquote")});break;case"clear":m.push({type:"button",id:"clear",tooltip:l(s.EDITOR_CLEAR_FORMAT),iconName:_1.clearFormat,action:()=>t.exec("removeFormat")});break;case"html":m.push({type:"button",id:"html",tooltip:l(s.EDITOR_HTML_SOURCE),iconName:_1.html,action:t.toggleHtmlMode,activeCheck:t.isHtmlMode});break}}),m}return{toolbarItems:e.computed(()=>d(o())),selectionTick:i,onSelectionChange:n,getItemActive:r,HEADING_GROUPS:vD,FONT_GROUPS:XD}}const ED={key:0,class:"vt-editor__toolbar-wrapper"},_D={key:0,class:"vt-editor__toolbar-sep"},jD=["value"],JD=["value"],KD=["onClick"],FD={class:"vt-editor__body"},RD=["contenteditable","data-placeholder"],UD={key:1,class:"vt-editor__error"},zD={class:"vt-editor__dialog-fields"},OD={class:"vt-editor__dialog-label"},DD={class:"vt-editor__dialog-label"},BD={class:"vt-editor__dialog-checkbox"},PD={class:"vt-modal__footer"},HD={class:"vt-editor__dialog-fields"},QD={class:"vt-editor__dialog-label"},AD={class:"vt-editor__dialog-label"},$D={class:"vt-modal__footer"},f2=e.defineComponent({__name:"VEditor",props:{modelValue:{},placeholder:{},toolbar:{default:()=>["history","format","heading","fontName","foreColor","align","list","indent","link","image","blockquote","clear","html"]},disabled:{type:Boolean,default:!1},required:{type:Boolean},errorMessage:{}},emits:["update:modelValue","input","change","focus","blur","validation"],setup(o,{expose:t,emit:l}){const{t:i}=f1(),n=o,r=l,d=e.ref(null),a=e.ref(null),h=e.ref(null),m=e.ref(!1),p=e.ref(!1),C=e.ref(""),Z=e.ref([]),b=e.ref(!0),I=e.ref(!1),w=e.ref(!1),y=e.ref("#000000"),f=e.ref("#ffffff");function Y(H){var s1;const D=H??((s1=d.value)==null?void 0:s1.innerHTML)??"",y1=we(D);r("update:modelValue",y1),r("input",y1)}const{exec:u,isActive:g,applyBlock:x,applyFont:K,applyForeColor:k,applyBackColor:M,handleIndent:L}=fD(d,Y);function V(){if(d.value)if(!p.value)C.value=d.value.innerHTML,p.value=!0,e.nextTick(()=>{var H;return(H=h.value)==null?void 0:H.focus()});else{const H=we(C.value);p.value=!1,e.nextTick(()=>{d.value&&(d.value.innerHTML=H,Y(H),d.value.focus())})}}function T(){const H=we(C.value);r("update:modelValue",H),r("input",H)}const{linkState:W,openLinkDialog:X,confirmLink:G,cancelLink:F,imageState:B,openImageDialog:l1,confirmImage:R,cancelImage:S}=TD(H=>u("insertHTML",H),Y),{toolbarItems:N,onSelectionChange:v,getItemActive:Q,HEADING_GROUPS:q,FONT_GROUPS:r1}=GD(()=>n.toolbar,{exec:u,isActive:g,applyBlock:x,applyFont:K,handleIndent:L,openLinkDialog:X,openImageDialog:l1,toggleHtmlMode:V,isHtmlMode:()=>p.value});function C1(H){const D=H.target.value;y.value=D,k(D)}function a1(H){const D=H.target.value;f.value=D,M(D)}function c1(){const H=a.value;H&&(I.value=H.scrollLeft>2,w.value=H.scrollLeft+H.clientWidth<H.scrollWidth-2)}function M1(H){const D=a.value;D&&(D.scrollBy({left:H==="left"?-160:160,behavior:"smooth"}),setTimeout(c1,250))}function S1(H){const D=[];n.required&&!xt(H).trim()&&D.push(i(s.VALIDATION_REQUIRED)),Z.value=D,b.value=D.length===0,r("validation",{isValid:b.value,errors:D})}const W1=e.computed(()=>n.errorMessage||Z.value[0]||""),L1=e.computed(()=>!!W1.value),O=e.computed(()=>["vt-editor",{"vt-editor--focused":m.value,"vt-editor--error":L1.value,"vt-editor--disabled":n.disabled}]);function A(){Y(),S1(n.modelValue??"")}function n1(H){m.value=!0,r("focus",H)}function V1(H){m.value=!1,r("blur",H),S1(n.modelValue??"")}function x1(H){H.key==="Tab"&&(H.preventDefault(),u("insertHTML"," "))}e.watch(()=>n.modelValue,H=>{!d.value||m.value||p.value||d.value.innerHTML!==H&&(d.value.innerHTML=H??"")}),e.onMounted(()=>{d.value&&n.modelValue&&(d.value.innerHTML=we(n.modelValue)),document.addEventListener("selectionchange",v),e.nextTick(()=>{c1();const H=new ResizeObserver(c1);a.value&&H.observe(a.value)}),window.addEventListener("resize",c1)}),e.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",v),window.removeEventListener("resize",c1)});function g1(){var H;(H=d.value)==null||H.focus()}function F1(){var H;(H=d.value)==null||H.blur()}function R1(){d.value&&(d.value.innerHTML=""),Y(""),Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function U(){var H;return((H=d.value)==null?void 0:H.innerHTML)??""}function e1(){var H;return xt(((H=d.value)==null?void 0:H.innerHTML)??"")}function m1(H){const D=we(H);d.value&&(d.value.innerHTML=D),Y(D)}function w1(H){var D;(D=d.value)==null||D.focus(),u("insertHTML",we(H))}function J1(){return S1(n.modelValue??""),b.value}function U1(){Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function t1(){return{isValid:b.value,errors:[...Z.value]}}function d1(){return d.value}return t({focus:g1,blur:F1,clear:R1,getHTML:U,getText:e1,setHTML:m1,insertHTML:w1,validate:J1,clearValidation:U1,getValidationState:t1,getEditorElement:d1}),(H,D)=>{const y1=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(O.value)},[!o.disabled&&e.unref(N).length?(e.openBlock(),e.createElementBlock("div",ED,[I.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--left",type:"button",onClick:D[0]||(D[0]=s1=>M1("left")),onMousedown:D[1]||(D[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(p1,{name:"arrowLeft"})],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"toolbarRef",ref:a,class:"vt-editor__toolbar",onScroll:c1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(s1,ee)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ee},[(s1==null?void 0:s1.type)==="separator"?(e.openBlock(),e.createElementBlock("span",_D)):(s1==null?void 0:s1.type)==="select"&&s1.id==="heading"?(e.openBlock(),e.createBlock(Ze,{key:1,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:D[3]||(D[3]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),I1=>(e.openBlock(),e.createBlock(ke,{key:I1.value,onClick:v1=>e.unref(x)(I1.value),onMousedown:D[2]||(D[2]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I1.label),1)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(p1,{name:"tagType"},null,512),[[y1,e.unref(i)(e.unref(s).EDITOR_HEADING)]])]),_:1})):(s1==null?void 0:s1.type)==="select"&&s1.id==="fontName"?(e.openBlock(),e.createBlock(Ze,{key:2,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:D[5]||(D[5]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r1),I1=>(e.openBlock(),e.createBlock(ke,{key:I1.value,onClick:v1=>e.unref(K)(I1.value),onMousedown:D[4]||(D[4]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",{style:e.normalizeStyle({fontFamily:I1.value})},e.toDisplayString(I1.label),5)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(p1,{name:"fontName"},null,512),[[y1,e.unref(i)(e.unref(s).EDITOR_FONT)]])]),_:1})):(s1==null?void 0:s1.type)==="select"&&s1.id==="foreColor"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.withDirectives(e.createElementVNode("input",{value:y.value,class:"vt-editor__color-picker",type:"color",onInput:C1,onMousedown:D[6]||(D[6]=e.withModifiers(()=>{},["stop"]))},null,40,jD),[[y1,e.unref(i)(e.unref(s).EDITOR_FORE_COLOR)]]),e.withDirectives(e.createElementVNode("input",{value:f.value,class:"vt-editor__color-picker vt-editor__color-picker--bg",type:"color",onInput:a1,onMousedown:D[7]||(D[7]=e.withModifiers(()=>{},["stop"]))},null,40,JD),[[y1,e.unref(i)(e.unref(s).EDITOR_BACK_COLOR)]])],64)):(s1==null?void 0:s1.type)==="button"?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass([{"vt-editor__toolbar-btn--active":e.unref(Q)(s1)},"vt-editor__toolbar-btn"]),type:"button",onClick:I1=>{var v1;return(v1=s1==null?void 0:s1.action)==null?void 0:v1.call(s1)},onMousedown:D[8]||(D[8]=e.withModifiers(()=>{},["prevent"]))},[s1!=null&&s1.iconName?(e.openBlock(),e.createBlock(p1,{key:0,name:s1.iconName},null,8,["name"])):e.createCommentVNode("",!0)],42,KD)),[[y1,s1==null?void 0:s1.tooltip]]):e.createCommentVNode("",!0)],64))),128))],544),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--right",type:"button",onClick:D[9]||(D[9]=s1=>M1("right")),onMousedown:D[10]||(D[10]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(p1,{name:"arrowRight"})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",FD,[e.withDirectives(e.createElementVNode("div",{ref_key:"editorRef",ref:d,contenteditable:!o.disabled,"data-placeholder":o.placeholder,class:"vt-editor__content",onBlur:V1,onFocus:n1,onInput:A,onKeydown:x1},null,40,RD),[[e.vShow,!p.value]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,ref_key:"htmlSourceRef",ref:h,"onUpdate:modelValue":D[11]||(D[11]=s1=>C.value=s1),class:"vt-editor__html-source",onInput:T},null,544)),[[e.vModelText,C.value]]):e.createCommentVNode("",!0)]),W1.value?(e.openBlock(),e.createElementBlock("div",UD,e.toDisplayString(W1.value),1)):e.createCommentVNode("",!0),e.createVNode(xe,{modelValue:e.unref(W).visible,"onUpdate:modelValue":D[19]||(D[19]=s1=>e.unref(W).visible=s1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_LINK_TITLE),size:"small",onClose:e.unref(F)},{default:e.withCtx(()=>[e.createElementVNode("div",zD,[e.createElementVNode("label",OD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[12]||(D[12]=s1=>e.unref(W).url=s1),class:"vt-editor__dialog-input",placeholder:"https://example.com",type:"url",onKeydown:[D[13]||(D[13]=e.withKeys((...s1)=>e.unref(G)&&e.unref(G)(...s1),["enter"])),D[14]||(D[14]=e.withKeys((...s1)=>e.unref(F)&&e.unref(F)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).url]]),e.createElementVNode("label",DD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_TEXT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[15]||(D[15]=s1=>e.unref(W).text=s1),class:"vt-editor__dialog-input",placeholder:"Link text",type:"text",onKeydown:[D[16]||(D[16]=e.withKeys((...s1)=>e.unref(G)&&e.unref(G)(...s1),["enter"])),D[17]||(D[17]=e.withKeys((...s1)=>e.unref(F)&&e.unref(F)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).text]]),e.createElementVNode("label",BD,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[18]||(D[18]=s1=>e.unref(W).openInNewTab=s1),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(W).openInNewTab]]),e.createTextVNode(" "+e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_NEW_TAB)),1)])]),e.createElementVNode("div",PD,[e.createVNode(E1,{onClick:e.unref(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(E1,{type:"primary",onClick:e.unref(G)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"]),e.createVNode(xe,{modelValue:e.unref(B).visible,"onUpdate:modelValue":D[26]||(D[26]=s1=>e.unref(B).visible=s1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_IMAGE_TITLE),size:"small",onClose:e.unref(S)},{default:e.withCtx(()=>[e.createElementVNode("div",HD,[e.createElementVNode("label",QD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[20]||(D[20]=s1=>e.unref(B).url=s1),class:"vt-editor__dialog-input",placeholder:"https://example.com/image.png",type:"url",onKeydown:[D[21]||(D[21]=e.withKeys((...s1)=>e.unref(R)&&e.unref(R)(...s1),["enter"])),D[22]||(D[22]=e.withKeys((...s1)=>e.unref(S)&&e.unref(S)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(B).url]]),e.createElementVNode("label",AD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_ALT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[23]||(D[23]=s1=>e.unref(B).alt=s1),class:"vt-editor__dialog-input",placeholder:"Image description",type:"text",onKeydown:[D[24]||(D[24]=e.withKeys((...s1)=>e.unref(R)&&e.unref(R)(...s1),["enter"])),D[25]||(D[25]=e.withKeys((...s1)=>e.unref(S)&&e.unref(S)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(B).alt]])]),e.createElementVNode("div",$D,[e.createVNode(E1,{onClick:e.unref(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(E1,{type:"primary",onClick:e.unref(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])],2)}}}),qD={class:"vt-badge"},mt=e.defineComponent({__name:"VBadge",props:{content:{default:void 0},max:{default:99},dot:{type:Boolean,default:!1},color:{default:"danger"},position:{default:"top-end"},offsetX:{default:0},offsetY:{default:0},bordered:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(o){const t=o,l=e.computed(()=>t.dot?!0:t.content===void 0||t.content===null||t.content===""?!1:typeof t.content=="number"?t.content>0:!0),i=e.computed(()=>l.value&&!t.hidden),n=e.computed(()=>typeof t.content=="number"?t.content>t.max?`${t.max}+`:String(t.content):t.content),r=e.computed(()=>{if(!t.offsetX&&!t.offsetY)return{};const d=t.position.startsWith("top"),a=t.position.endsWith("end"),h={};return t.offsetX&&(h[a?"right":"left"]=`${-t.offsetX}px`),t.offsetY&&(h[d?"top":"bottom"]=`${-t.offsetY}px`),h});return(d,a)=>(e.openBlock(),e.createElementBlock("span",qD,[e.renderSlot(d.$slots,"default"),e.createVNode(e.Transition,{name:"vt-badge__fade"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-badge__content",[`vt-badge__content--${o.position}`,`vt-badge__content--${o.color}`,{"vt-badge__content--dot":o.dot,"vt-badge__content--bordered":o.bordered}]]),style:e.normalizeStyle(r.value)},[o.dot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(n.value),1)],64))],6)):e.createCommentVNode("",!0)]),_:1})]))}}),eB={class:"vt-app-bar__logo"},tB={key:0,class:"vt-app-bar__center"},oB={key:1,class:"vt-app-bar__actions"},x2=e.defineComponent({__name:"VAppBar",props:{sticky:{type:Boolean,default:!1}},setup(o){return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-app-bar",{"vt-app-bar--sticky":o.sticky}])},[e.createElementVNode("div",eB,[e.renderSlot(t.$slots,"logo")]),t.$slots.center?(e.openBlock(),e.createElementBlock("div",tB,[e.renderSlot(t.$slots,"center")])):e.createCommentVNode("",!0),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",oB,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)],2))}}),lB={class:"vt-nav-rail"},nB={class:"vt-nav-rail__list"},iB=["data-placement","onClick"],rB={key:0,class:"vt-nav-rail__divider"},sB={key:0,class:"vt-nav-rail__footer"},T2=e.defineComponent({__name:"VNavRail",props:{items:{},modelValue:{default:null},placement:{default:"left"}},emits:["update:modelValue","select"],setup(o,{emit:t}){const l=t,i=n=>{n.disabled||(l("update:modelValue",n.key),l("select",n))};return(n,r)=>{const d=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("aside",lB,[e.createElementVNode("div",nB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,(a,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-nav-rail__item",{"vt-nav-rail__item--selected":o.modelValue===a.key,"vt-nav-rail__item--disabled":a.disabled}]),"data-placement":o.placement,onClick:m=>i(a)},[a.badge?(e.openBlock(),e.createBlock(mt,{key:0,content:a.badge.content,position:a.badge.position},{default:e.withCtx(()=>[e.createVNode(p1,{name:a.icon,width:24,height:24},null,8,["name"])]),_:2},1032,["content","position"])):(e.openBlock(),e.createBlock(p1,{key:1,name:a.icon,width:24,height:24},null,8,["name"]))],10,iB)),[[d,a.label]]),h<o.items.length-1?(e.openBlock(),e.createElementBlock("span",rB)):e.createCommentVNode("",!0)],64))),128))]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",sB,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)])}}}),cB=(o,t)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${t}`,l.innerText=o,Object.assign(l.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"});const i=document.createElement("div");switch(i.className="vt-tooltip__arrow",Object.assign(i.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),t){case"top":Object.assign(i.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(i.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(i.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(i.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(i),l},v2=(o,t,l)=>{const i=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,d=window.innerWidth,a=window.innerHeight,h=8,m=Math.min(300,d-h*2);o.style.maxWidth=`${m}px`;const p=o.getBoundingClientRect();let C=0,Z=0;switch(l){case"top":C=i.top+r-p.height-8,Z=i.left+n+(i.width-p.width)/2;break;case"bottom":C=i.bottom+r+8,Z=i.left+n+(i.width-p.width)/2;break;case"left":C=i.top+r+(i.height-p.height)/2,Z=i.left+n-p.width-8;break;case"right":C=i.top+r+(i.height-p.height)/2,Z=i.right+n+8;break}Z<h?Z=h:Z+p.width>d-h&&(Z=d-p.width-h),C<r+h?l==="top"?C=i.bottom+r+8:C=r+h:C+p.height>r+a-h&&(l==="bottom"?C=i.top+r-p.height-8:C=r+a-p.height-h),o.style.top=`${C}px`,o.style.left=`${Z}px`},dB=(o,t,l)=>{o.parentElement||document.body.appendChild(o),o.style.visibility="visible",v2(o,t,l),requestAnimationFrame(()=>{o.style.opacity="1"})},aB=o=>{o.style.opacity="0",o.style.visibility="hidden"},uB=o=>o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight,mB=o=>!!o.closest(".vt-table, table"),Tt=o=>o.dataset.placement||"top",vt=o=>{var t;return((t=o.value)==null?void 0:t.trim())??""},Xt=o=>{var t;(t=o.__tooltipEl)==null||t.remove(),delete o.__tooltipEl},X2={mounted(o,t){o.__tooltipText=vt(t);const l=()=>{const r=o.__tooltipText;if(!r||mB(o)&&!uB(o))return;const d=Tt(o);o.__tooltipEl||(o.__tooltipEl=cB(r,d)),dB(o.__tooltipEl,o,d)},i=()=>{o.__tooltipEl&&aB(o.__tooltipEl)},n=()=>{var r;((r=o.__tooltipEl)==null?void 0:r.style.opacity)==="1"&&v2(o.__tooltipEl,o,Tt(o))};o.__mouseenterHandler=l,o.__mouseleaveHandler=i,o.__scrollHandler=n,o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",i),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n)},updated(o,t){const l=vt(t);l!==o.__tooltipText&&(o.__tooltipText=l,l?o.__tooltipEl&&(o.__tooltipEl.firstChild.textContent=l):Xt(o))},beforeUnmount(o){Xt(o),delete o.__tooltipText,o.__mouseenterHandler&&(o.removeEventListener("mouseenter",o.__mouseenterHandler),delete o.__mouseenterHandler),o.__mouseleaveHandler&&(o.removeEventListener("mouseleave",o.__mouseleaveHandler),delete o.__mouseleaveHandler),o.__scrollHandler&&(window.removeEventListener("scroll",o.__scrollHandler,!0),window.removeEventListener("resize",o.__scrollHandler),delete o.__scrollHandler)}},G2={mounted(o,t){e.unref(t.value)&&Gt(o)},updated(o,t){const l=e.unref(t.value),i=e.unref(t.oldValue);l!==i&&(l?Gt(o):Et(o))},unmounted(o){Et(o)}};function Gt(o){if(o._loaderEl)return;const t=document.createElement("div");t.className="vt-loader-base__overlay",t.innerHTML='<span class="vt-loader-base"></span>';const l=getComputedStyle(o).position;(l==="static"||!l)&&(o.style.position="relative"),o.appendChild(t),o._loaderEl=t}function Et(o){const t=o._loaderEl;t&&(t.remove(),delete o._loaderEl)}const hB={class:"vt-message-container"},pB={class:"vt-message-icon"},CB={class:"vt-message-content"},IB={key:0,class:"vt-message-title"},ZB=["innerHTML"],kB={key:1,class:"vt-message-text"},bB=["onClick"],VB=e.defineComponent({__name:"VMessage",setup(o,{expose:t}){const l=e.ref([]);let i=0;const n=a=>({success:"checkCircle",danger:"alertCircle",warning:"alertTriangle",primary:"infoCircle"})[a]||"infoCircle",r=a=>{const h=++i,m={id:h,message:a.message||"",title:a.title||"",type:a.type||"primary",showClose:a.showClose||!1,duration:a.duration!==void 0?a.duration:3e3,dangerouslyUseHTMLString:a.dangerouslyUseHTMLString||!1};return l.value.push(m),m.duration&&m.duration>0&&setTimeout(()=>{d(h)},m.duration),h},d=a=>{const h=l.value.findIndex(m=>m.id===a);h>-1&&l.value.splice(h,1)};return t({addMessage:r,removeMessage:d}),(a,h)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",hB,[e.createVNode(e.TransitionGroup,{name:"vt-message",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id,class:e.normalizeClass(["vt-message-item",`vt-message-item--${m.type}`,{"vt-message-item--closable":m.showClose}])},[e.createElementVNode("div",pB,[e.createVNode(p1,{color:m.type==="primary"?"#00475A":"",name:n(m.type)},null,8,["color","name"])]),e.createElementVNode("div",CB,[m.title?(e.openBlock(),e.createElementBlock("div",IB,e.toDisplayString(m.title),1)):e.createCommentVNode("",!0),m.message?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[m.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-message-text",innerHTML:m.message},null,8,ZB)):(e.openBlock(),e.createElementBlock("div",kB,e.toDisplayString(m.message),1))],64)):e.createCommentVNode("",!0)]),m.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-message-close",type:"button",onClick:p=>d(m.id)},[e.createVNode(p1,{name:"close"})],8,bB)):e.createCommentVNode("",!0)],2))),128))]),_:1})])]))}});class wB{constructor(){this.messageInstance=null,this.app=null,this.container=null}call(t={}){return this.ensureInstance().addMessage({message:t.message||"",title:t.title||"",type:t.type||"primary",showClose:t.showClose||!1,duration:t.duration!==void 0?t.duration:3e3,dangerouslyUseHTMLString:t.dangerouslyUseHTMLString||!1})}success(t,l={}){return this.call({...l,message:t,type:"success"})}danger(t,l={}){return this.call({...l,message:t,type:"danger"})}warning(t,l={}){return this.call({...l,message:t,type:"warning"})}primary(t,l={}){return this.call({...l,message:t,type:"primary"})}close(t){this.messageInstance&&this.messageInstance.removeMessage(t)}closeAll(){this.messageInstance&&(this.messageInstance.messages=[]),this.container&&this.container.parentNode&&document.body.removeChild(this.container),this.app&&this.app.unmount(),this.messageInstance=null,this.app=null,this.container=null}getOpenMessagesCount(){return this.messageInstance?this.messageInstance.messages.length:0}ensureInstance(){return this.messageInstance?this.messageInstance:(this.container=document.createElement("div"),this.container.setAttribute("data-vt-message-container",""),document.body.appendChild(this.container),this.app=e.createApp(VB),this.messageInstance=this.app.mount(this.container),this.messageInstance)}}const ie=new wB,it=Object.assign((o={})=>ie.call(o),{success:(o,t={})=>ie.success(o,t),danger:(o,t={})=>ie.danger(o,t),warning:(o,t={})=>ie.warning(o,t),primary:(o,t={})=>ie.primary(o,t),close:o=>{ie.close(o)},closeAll:()=>{ie.closeAll()}}),E2={install(o){o.config.globalProperties.$message=it,o.provide("$message",it),o.config.globalProperties.$messageStack={closeAll:()=>ie.closeAll(),getCount:()=>ie.getOpenMessagesCount(),closeById:t=>ie.close(t)}}},LB={sortable:!0,actionColumn:!1,showOverflowTooltip:!0,visible:!0,pinnedLeft:!1,pinnedRight:!1,manage:!1};function yB(o){_t(o)}const _2={install(o,t={}){const{prefix:l="V",modal:i=!0,message:n=!0,locale:r=ce.uk}=t;o.component(`${l}Button`,E1),o.component(`${l}Icon`,p1),o.component(`${l}Loader`,fe),o.component(`${l}Modal`,xe),o.component(`${l}Pagination`,Kt),o.component(`${l}Checkbox`,se),o.component(`${l}Radiobox`,Ft),o.component(`${l}Table`,Ut),o.component(`${l}TableColumn`,zt),o.component(`${l}Dropdown`,Ze),o.component(`${l}DropdownItem`,ke),o.component(`${l}Input`,Me),o.component(`${l}Select`,Ue),o.component(`${l}Option`,ze),o.component(`${l}DatePicker`,At),o.component(`${l}TimePicker`,We),o.component(`${l}Collapse`,$t),o.component(`${l}CollapseItem`,qt),o.component(`${l}Tabs`,e2),o.component(`${l}TabItem`,t2),o.component(`${l}Upload`,l2),o.component(`${l}Sidebar`,n2),o.component(`${l}Login`,u2),o.component(`${l}LoginLogo`,m2),o.component(`${l}LocaleSelect`,Ot),o.component(`${l}DynamicFilter`,h2),o.component(`${l}Slider`,p2),o.component(`${l}SliderMarkRange`,C2),o.component(`${l}Chart`,I2),o.component(`${l}InfoBox`,Z2),o.component(`${l}TransferList`,k2),o.component(`${l}Avatar`,b2),o.component(`${l}AvatarUpload`,V2),o.component(`${l}ImageFullscreen`,w2),o.component(`${l}Breadcrumb`,L2),o.component(`${l}BreadcrumbItem`,y2),o.component(`${l}Audio`,W2),o.component(`${l}Empty`,Oe),o.component(`${l}Editor`,f2),o.component(`${l}Badge`,mt),o.component(`${l}AppBar`,x2),o.component(`${l}NavRail`,T2),o.directive("tooltip",X2),o.directive("loader",G2),i&&o.use(Rt),n&&o.use(E2),o.use(lj,{locale:r})}},MB=_2.install;exports.DEFAULT_COLUMN_CONFIG=LB;exports.DEFAULT_FORMATS=Dt;exports.DEFAULT_TIME_FORMATS=Ne;exports.DropdownContextKey=ct;exports.FORMAT_TOKENS=sK;exports.FileParser=ge;exports.FileValidator=Ce;exports.LANGUAGES=ce;exports.VAppBar=x2;exports.VAudio=W2;exports.VAvatar=b2;exports.VAvatarUpload=V2;exports.VBadge=mt;exports.VBreadcrumb=L2;exports.VBreadcrumbItem=y2;exports.VButton=E1;exports.VChart=I2;exports.VCheckbox=se;exports.VCollapse=$t;exports.VCollapseItem=qt;exports.VColorPicker=BO;exports.VDatePicker=At;exports.VDropdown=Ze;exports.VDropdownItem=ke;exports.VDynamicFilter=h2;exports.VEditor=f2;exports.VEmpty=Oe;exports.VIcon=p1;exports.VImageFullscreen=w2;exports.VInfoBox=Z2;exports.VInput=Me;exports.VLoader=fe;exports.VLocaleSelect=Ot;exports.VLogin=u2;exports.VLoginLogo=m2;exports.VMessage=it;exports.VMessagePlugin=E2;exports.VModal=xe;exports.VModalPlugin=Rt;exports.VNavRail=T2;exports.VOption=ze;exports.VPagination=Kt;exports.VRadiobox=Ft;exports.VSelect=Ue;exports.VSidebar=n2;exports.VSlider=p2;exports.VSliderMarkRange=C2;exports.VTabItem=t2;exports.VTable=Ut;exports.VTableColumn=zt;exports.VTabs=e2;exports.VTimePicker=We;exports.VTimerDuration=QO;exports.VTransferList=k2;exports.VUpload=l2;exports.VtSelectContextKey=rt;exports.containUpperCaseLetter=d2;exports.default=_2;exports.email=i2;exports.formatTime=Ht;exports.generateTimeOptions=je;exports.iconGroups=K_;exports.install=MB;exports.isValidDate=et;exports.isValidTimeString=Je;exports.loaderDirective=G2;exports.maxLength=lU;exports.maxNumber=iU;exports.messageManager=ie;exports.minLength=tt;exports.minNumber=nU;exports.mk=oU;exports.modalManager=de;exports.noSpaces=at;exports.numeric=s2;exports.parseTimeString=Qt;exports.pattern=sU;exports.phoneNumber=c2;exports.required=Ke;exports.sameAs=rU;exports.setLocale=yB;exports.tooltipDirective=X2;exports.uniqueAsync=cU;exports.url=r2;exports.useValidate=a2;exports.validateDateValue=Bt;exports.validateTimeValue=Pt;exports.withAsync=tU;exports.withMessage=eU;exports.withName=pe;exports.withParams=qR;
|
|
104
|
+
</svg>`,S),d=new WeakMap,{t:a}=f1(),h=o,m=l,p=e.computed(()=>!!(h.userA||h.userB)),C=e.ref(!1),Z=e.computed(()=>h.disabled||C.value),b=e.ref(!1),I=e.ref(1),w=e.ref(`ws-${Math.random().toString(36).slice(2,9)}`),y=e.ref(null),f=e.ref(null),Y=e.ref(null),u=e.ref(null),g=e.ref(null),x=e.computed(()=>h.type==="channel-routed"),K=(R,S)=>{var O;const N=S.canvas,{width:v,height:Q}=N,q=(O=y.value)==null?void 0:O.decodedData,r1=N.getBoundingClientRect(),C1=r1.width>0?v/r1.width:1,a1=r1.height>0?Q/r1.height:1;if(!R.length&&!q){S.fillStyle=me.WAVE_DEFAULT,S.fillRect(0,Q/2,v,2);return}const c1=p.value&&q&&q.numberOfChannels>=2?[q.getChannelData(0),q.getChannelData(1)]:[R[0]||new Float32Array(v).fill(0)];S.clearRect(0,0,v,Q);const M1=20*a1,W1=20*C1,L1=[];if(c1.forEach((A,n1)=>{const V1=Q/c1.length,x1=V1-(p.value?M1:0),g1=n1*V1+(p.value?M1:0)+x1/2,F1=A.length/v;let R1=0;for(let U=0;U<A.length;U+=100){const e1=Math.abs(A[U]??0);e1>R1&&(R1=e1)}R1===0&&(R1=1),S.fillStyle=me.WAVE_DEFAULT;for(let U=0;U<v;U+=2){const e1=Math.floor(U*F1),m1=Math.min(Math.floor((U+2)*F1),A.length-1);let w1=0;for(let t1=e1;t1<=m1;t1++){const d1=Math.abs(A[t1]??0);d1>w1&&(w1=d1)}const J1=w1/R1,U1=Math.max(J1*x1*.85,2);S.fillRect(U,g1-U1/2,1.5,U1)}if(p.value){S.fillStyle="#999999",S.font=`${12*C1}px Inter, sans-serif`,S.textAlign="right";const U=(n1===0?h.userA:h.userB)??"";S.fillText(U,v-10*C1,n1*V1+M1-5*a1);const e1=n1,m1=5*C1,w1=n1*V1+1*a1;((e1===0?T.value:W.value)===0?r:n)(e1===0?me.CHANNEL_A:me.CHANNEL_B,U1=>S.drawImage(U1,m1,w1,W1,W1)),L1.push({x:m1,y:w1,width:W1,height:W1,channelIdx:e1})}}),p.value){const A=d.get(N);A&&N.removeEventListener("click",A);const n1=V1=>{if(Z.value)return;const x1=N.getBoundingClientRect(),g1=x1.width>0?N.width/x1.width:1,F1=x1.height>0?N.height/x1.height:1,R1=(V1.clientX-x1.left)*g1,U=(V1.clientY-x1.top)*F1;for(const e1 of L1)if(R1>=e1.x&&R1<=e1.x+e1.width&&U>=e1.y&&U<=e1.y+e1.height){V1.stopPropagation(),V1.preventDefault(),X(e1.channelIdx);const m1=(e1.channelIdx===0?T.value:W.value)===0;S.save(),S.clearRect(e1.x,e1.y,e1.width,e1.height),(m1?r:n)(e1.channelIdx===0?me.CHANNEL_A:me.CHANNEL_B,w1=>S.drawImage(w1,e1.x,e1.y,e1.width,e1.height)),S.restore();break}};N.addEventListener("click",n1),d.set(N,n1)}},k=e.computed(()=>{if(h.height){const R=parseInt(h.height,10);if(!isNaN(R))return R}return x.value?36:p.value?100:50}),M=()=>{var Q;const R=(Q=y.value)==null?void 0:Q.getMediaElement();if(!R)return;Y.value=new(window.AudioContext||window.webkitAudioContext);const S=Y.value.createMediaElementSource(R),N=Y.value.createChannelSplitter(2),v=Y.value.createChannelMerger(2);u.value=Y.value.createGain(),g.value=Y.value.createGain(),u.value.gain.value=T.value,g.value.gain.value=W.value,S.connect(N),N.connect(u.value,0),N.connect(g.value,1),p.value?(u.value.connect(v,0,0),g.value.connect(v,0,1)):(u.value.connect(v,0,0),u.value.connect(v,0,1),g.value.connect(v,0,0),g.value.connect(v,0,1)),v.connect(Y.value.destination)},L=()=>{var R;(R=Y.value)==null||R.close(),Y.value=null,u.value=null,g.value=null},V=()=>{if(!h.recordUrl)return;C.value=!1;const R=Te.create({container:`#waveform-${w.value}`,waveColor:me.WAVE_DEFAULT,progressColor:me.PROGRESS,barWidth:2,height:k.value,plugins:x.value?[]:[ut.create({container:f.value,style:{fontSize:"10px",color:"#999"}})],renderFunction:(S,N)=>K(S,N)});y.value=R,y.value.on("play",()=>{b.value=!0,m("play")}),y.value.on("pause",()=>{b.value=!1,m("pause")}),y.value.on("timeupdate",S=>m("timeUpdate",S)),y.value.on("finish",()=>{b.value=!1,m("ended")}),y.value.on("error",()=>{C.value=!0,m("error")}),(p.value||x.value)&&y.value.on("ready",()=>{M()}),y.value.load(h.recordUrl)},T=e.ref(1),W=e.ref(1),X=R=>{const S=R===0?u.value:g.value,N=R===0?T:W;N.value=N.value?0:1,S&&(S.gain.value=N.value)},G=async()=>{if(!(!y.value||Z.value)){if(x.value){const R=y.value.getMediaElement();if(!R||!Y.value)return;Y.value.state==="suspended"&&await Y.value.resume(),R.paused?await R.play():R.pause();return}b.value?y.value.pause():y.value.play()}},F=R=>{var S;I.value=R,(S=y.value)==null||S.setPlaybackRate(I.value)},B=(R,S)=>{if(R.startsWith("data:")){const v=document.createElement("a");v.href=R,v.download=S,document.body.appendChild(v),v.click(),document.body.removeChild(v)}else fetch(R).then(v=>v.blob()).then(v=>{const Q=document.createElement("a");Q.href=URL.createObjectURL(v),Q.download=S,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q)}).catch(console.error)},l1=()=>{if(h.disabled||!h.recordUrl)return;const R=h.recordUrl.indexOf("?"),S=h.recordUrl.substring(h.recordUrl.lastIndexOf("/")+1,R===-1?void 0:R);B(h.recordUrl,S)};return e.onMounted(()=>e.nextTick(V)),e.onBeforeUnmount(()=>{var R;(R=y.value)==null||R.destroy(),L()}),e.watch(()=>h.recordUrl,()=>{var R;(R=y.value)==null||R.destroy(),L(),e.nextTick(V)}),t({play:()=>{var R;return(R=y.value)==null?void 0:R.play()},pause:()=>{var R;return(R=y.value)==null?void 0:R.pause()},getCurrentTime:()=>{var R;return((R=y.value)==null?void 0:R.getCurrentTime())||0}}),(R,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"is-disabled":Z.value,"is-channel-routed":x.value},"vt-audio"])},[o.recordUrl?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([{"is-single-channel":!p.value,"is-channel-routed":x.value},"vt-audio__container"])},[o.playPosition==="left"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:G},[b.value?e.renderSlot(R.$slots,"icon-pause",{key:0},()=>[e.createVNode(p1,{height:"20",name:"pause",width:"20"})]):e.renderSlot(R.$slots,"icon-play",{key:1},()=>[e.createVNode(p1,{height:"20",name:"start",width:"20"})])],8,ID)):e.createCommentVNode("",!0),e.createElementVNode("div",ZD,[e.createElementVNode("div",{id:`waveform-${w.value}`,class:"vt-audio__waveform"},null,8,kD),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"timelineContainer",ref:f,class:"vt-audio__timeline"},null,512))]),e.createElementVNode("div",bD,[h.download?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn",onClick:l1},[e.createVNode(p1,{height:"20",name:"import",width:"20"})],8,VD)):e.createCommentVNode("",!0),o.playPosition==="right"?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:G},[b.value?e.renderSlot(R.$slots,"icon-pause",{key:0},()=>[e.createVNode(p1,{height:"20",name:"pause",width:"20"})]):e.renderSlot(R.$slots,"icon-play",{key:1},()=>[e.createVNode(p1,{height:"20",name:"start",width:"20"})])],8,wD)):e.createCommentVNode("",!0),e.createVNode(Ze,{disabled:Z.value,placement:"top",trigger:"click",onCommand:F},{dropdown:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList([.5,1,1.5,2],N=>e.createVNode(ke,{key:N,class:e.normalizeClass({"is-active":I.value===N}),command:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N)+"x ",1)]),_:2},1032,["class","command"])),64))]),default:e.withCtx(()=>[e.createElementVNode("button",{disabled:Z.value,class:"vt-audio__speed-val"},e.toDisplayString(I.value)+"x",9,LD)]),_:1},8,["disabled"])])],2)):(e.openBlock(),e.createElementBlock("div",pD,[e.renderSlot(R.$slots,"empty",{},()=>[x.value?(e.openBlock(),e.createElementBlock("span",CD,e.toDisplayString(e.unref(a)(e.unref(s).AUDIO_EMPTY)),1)):(e.openBlock(),e.createBlock(Oe,{key:0,text:e.unref(a)(e.unref(s).AUDIO_EMPTY),icon:"noSound"},null,8,["text"]))])]))],2))}}),yD=new Set(["p","div","br","hr","h1","h2","h3","h4","h5","h6","blockquote","pre","code","ul","ol","li","b","strong","i","em","u","s","strike","del","sub","sup","font","span","a","img","table","thead","tbody","tfoot","tr","th","td","caption"]),MD=new Set(["style","class","href","target","rel","src","alt","width","height","face","size","color","colspan","rowspan"]),SD=new Set(["behavior","-moz-binding","filter"]),YD=/expression\s*\(|javascript\s*:|vbscript\s*:/i;function ND(o){const t=document.createElement("span");t.setAttribute("style",o);const l=t.style,i=[];for(let n=0;n<l.length;n++){const r=l[n],d=l.getPropertyValue(r);SD.has(r)||YD.test(d)||/url\s*\(/i.test(d)&&!/url\s*\(\s*['"]?data:image\//i.test(d)||i.push(`${r}:${d}`)}return i.join(";")}const WD=new Set(["https:","http:","ftp:","mailto:","tel:"]);function gD(o){const t=o.trim();if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const l=new URL(t);return WD.has(l.protocol)}catch{return!/^[a-z][a-z0-9+\-.]*:/i.test(t)}}function g2(o){var r,d,a;if(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.PROCESSING_INSTRUCTION_NODE){(r=o.parentNode)==null||r.removeChild(o);return}if(o.nodeType!==Node.ELEMENT_NODE)return;const t=o,l=t.tagName.toLowerCase();if(!yD.has(l)){for(;t.firstChild;)(d=t.parentNode)==null||d.insertBefore(t.firstChild,t);(a=t.parentNode)==null||a.removeChild(t);return}const i=Array.from(t.attributes);for(const h of i){const m=h.name.toLowerCase();if(m.startsWith("on")){t.removeAttribute(h.name);continue}if(!MD.has(m)){t.removeAttribute(h.name);continue}if((m==="href"||m==="src")&&!gD(h.value)){t.removeAttribute(h.name);continue}if(m==="style"){const p=ND(h.value);p?t.setAttribute("style",p):t.removeAttribute("style");continue}}l==="a"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer");const n=Array.from(t.childNodes);for(let h=n.length-1;h>=0;h--)g2(n[h])}function we(o){if(!o)return"";const t=new DOMParser().parseFromString(o,"text/html");t.head.innerHTML="";const l=Array.from(t.body.childNodes);for(let i=l.length-1;i>=0;i--)g2(l[i]);return t.body.innerHTML}function xt(o){const t=document.createElement("div");return t.innerHTML=o,t.textContent??t.innerText??""}function fD(o,t){function l(m,p){o.value&&(o.value.focus(),document.execCommand(m,!1,p??""),t())}function i(m){try{return document.queryCommandState(m)}catch{return!1}}function n(m){o.value&&(o.value.focus(),document.execCommand("formatBlock",!1,m),t())}function r(m){o.value&&(o.value.focus(),document.execCommand("fontName",!1,m),t())}function d(m){o.value&&(o.value.focus(),document.execCommand("foreColor",!1,m),t())}function a(m){o.value&&(o.value.focus(),document.execCommand("hiliteColor",!1,m),t())}function h(m){const p=window.getSelection();if(!p||p.rangeCount===0)return;let C=p.anchorNode;C.nodeType===Node.TEXT_NODE&&(C=C.parentElement);const Z=C.closest(".vt-editor__content > *");if(!Z)return;const b=parseInt(Z.style.marginLeft||"0",10),I=20,w=m==="indent"?b+I:Math.max(0,b-I);Z.style.marginLeft=w?`${w}px`:"",t()}return{exec:l,isActive:i,applyBlock:n,applyFont:r,applyForeColor:d,applyBackColor:a,handleIndent:h}}function xD(){let o=null;function t(){const r=window.getSelection();r&&r.rangeCount>0&&(o=r.getRangeAt(0).cloneRange())}function l(){if(!o)return;const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}function i(){o=null}function n(){return o}return{saveSelection:t,restoreSelection:l,clearSavedRange:i,getSavedRange:n}}function TD(o,t){const{saveSelection:l,restoreSelection:i,clearSavedRange:n,getSavedRange:r}=xD(),d=e.ref({visible:!1,url:"",text:"",openInNewTab:!1});function a(){var f,Y;l();const I=window.getSelection(),w=(I==null?void 0:I.toString())??"",y=(Y=(f=I==null?void 0:I.anchorNode)==null?void 0:f.parentElement)==null?void 0:Y.closest("a");d.value={visible:!0,url:(y==null?void 0:y.getAttribute("href"))??"",text:w,openInNewTab:(y==null?void 0:y.getAttribute("target"))==="_blank"}}function h(){i();const{url:I,text:w,openInNewTab:y}=d.value;if(!I){m();return}const f=document.createElement("a");f.href=I,f.textContent=w||I,y&&f.setAttribute("target","_blank"),f.setAttribute("rel","noopener noreferrer");const Y=r(),u=window.getSelection();u&&u.rangeCount>0&&Y?(Y.deleteContents(),Y.insertNode(f)):o(f.outerHTML),m(),t()}function m(){d.value={visible:!1,url:"",text:"",openInNewTab:!1},n()}const p=e.ref({visible:!1,url:"",alt:""});function C(){l(),p.value={visible:!0,url:"",alt:""}}function Z(){i();const{url:I,alt:w}=p.value;if(!I){b();return}o(`<img src="${I}" alt="${w}" style="max-width:100%;" />`),b()}function b(){p.value={visible:!1,url:"",alt:""},n()}return{linkState:d,openLinkDialog:a,confirmLink:h,cancelLink:m,imageState:p,openImageDialog:C,confirmImage:Z,cancelImage:b}}const _1={undo:"undo",redo:"redo",bold:"textBold",italic:"textItalic",underline:"textUnderline",strikethrough:"textStrikethrough",subscript:"subscript",superscript:"superscript",orderedList:"orderedList",unorderedList:"unorderedList",indent:"indent",outdent:"outdent",alignLeft:"alignLeft",alignCenter:"alignCenter",alignRight:"alignRight",alignJustify:"alignJustify",link:"link",image:"image",blockquote:"blockquote",clearFormat:"clearFormat",html:"html"},vD=[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],XD=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"}];function GD(o,t){const{t:l}=f1(),i=e.ref(0);function n(){i.value++}function r(h){var m;return i.value,((m=h.activeCheck)==null?void 0:m.call(h))??!1}function d(h){const m=[];return h.forEach((p,C)=>{switch(C>0&&m.push({type:"separator"}),p){case"history":m.push({type:"button",id:"undo",tooltip:l(s.EDITOR_UNDO),iconName:_1.undo,action:()=>t.exec("undo")},{type:"button",id:"redo",tooltip:l(s.EDITOR_REDO),iconName:_1.redo,action:()=>t.exec("redo")});break;case"format":m.push({type:"button",id:"bold",tooltip:l(s.EDITOR_BOLD),iconName:_1.bold,action:()=>t.exec("bold"),activeCheck:()=>t.isActive("bold")},{type:"button",id:"italic",tooltip:l(s.EDITOR_ITALIC),iconName:_1.italic,action:()=>t.exec("italic"),activeCheck:()=>t.isActive("italic")},{type:"button",id:"underline",tooltip:l(s.EDITOR_UNDERLINE),iconName:_1.underline,action:()=>t.exec("underline"),activeCheck:()=>t.isActive("underline")},{type:"button",id:"strikethrough",tooltip:l(s.EDITOR_STRIKETHROUGH),iconName:_1.strikethrough,action:()=>t.exec("strikethrough"),activeCheck:()=>t.isActive("strikeThrough")});break;case"script":m.push({type:"button",id:"subscript",tooltip:l(s.EDITOR_SUBSCRIPT),iconName:_1.subscript,action:()=>t.exec("subscript"),activeCheck:()=>t.isActive("subscript")},{type:"button",id:"superscript",tooltip:l(s.EDITOR_SUPERSCRIPT),iconName:_1.superscript,action:()=>t.exec("superscript"),activeCheck:()=>t.isActive("superscript")});break;case"heading":m.push({type:"select",id:"heading"});break;case"fontName":m.push({type:"select",id:"fontName"});break;case"foreColor":m.push({type:"select",id:"foreColor"});break;case"align":m.push({type:"button",id:"alignLeft",tooltip:l(s.EDITOR_ALIGN_LEFT),iconName:_1.alignLeft,action:()=>t.exec("justifyLeft"),activeCheck:()=>t.isActive("justifyLeft")},{type:"button",id:"alignCenter",tooltip:l(s.EDITOR_ALIGN_CENTER),iconName:_1.alignCenter,action:()=>t.exec("justifyCenter"),activeCheck:()=>t.isActive("justifyCenter")},{type:"button",id:"alignRight",tooltip:l(s.EDITOR_ALIGN_RIGHT),iconName:_1.alignRight,action:()=>t.exec("justifyRight"),activeCheck:()=>t.isActive("justifyRight")},{type:"button",id:"alignJustify",tooltip:l(s.EDITOR_ALIGN_JUSTIFY),iconName:_1.alignJustify,action:()=>t.exec("justifyFull"),activeCheck:()=>t.isActive("justifyFull")});break;case"list":m.push({type:"button",id:"orderedList",tooltip:l(s.EDITOR_ORDERED_LIST),iconName:_1.orderedList,action:()=>t.exec("insertOrderedList"),activeCheck:()=>t.isActive("insertOrderedList")},{type:"button",id:"unorderedList",tooltip:l(s.EDITOR_UNORDERED_LIST),iconName:_1.unorderedList,action:()=>t.exec("insertUnorderedList"),activeCheck:()=>t.isActive("insertUnorderedList")});break;case"indent":m.push({type:"button",id:"indent",tooltip:l(s.EDITOR_INDENT),iconName:_1.indent,action:()=>t.handleIndent("indent")},{type:"button",id:"outdent",tooltip:l(s.EDITOR_OUTDENT),iconName:_1.outdent,action:()=>t.handleIndent("outdent")});break;case"link":m.push({type:"button",id:"link",tooltip:l(s.EDITOR_INSERT_LINK),iconName:_1.link,action:t.openLinkDialog});break;case"image":m.push({type:"button",id:"image",tooltip:l(s.EDITOR_INSERT_IMAGE),iconName:_1.image,action:t.openImageDialog});break;case"blockquote":m.push({type:"button",id:"blockquote",tooltip:l(s.EDITOR_BLOCKQUOTE),iconName:_1.blockquote,action:()=>t.applyBlock("blockquote")});break;case"clear":m.push({type:"button",id:"clear",tooltip:l(s.EDITOR_CLEAR_FORMAT),iconName:_1.clearFormat,action:()=>t.exec("removeFormat")});break;case"html":m.push({type:"button",id:"html",tooltip:l(s.EDITOR_HTML_SOURCE),iconName:_1.html,action:t.toggleHtmlMode,activeCheck:t.isHtmlMode});break}}),m}return{toolbarItems:e.computed(()=>d(o())),selectionTick:i,onSelectionChange:n,getItemActive:r,HEADING_GROUPS:vD,FONT_GROUPS:XD}}const ED={key:0,class:"vt-editor__toolbar-wrapper"},_D={key:0,class:"vt-editor__toolbar-sep"},jD=["value"],JD=["value"],KD=["onClick"],FD={class:"vt-editor__body"},RD=["contenteditable","data-placeholder"],UD={key:1,class:"vt-editor__error"},zD={class:"vt-editor__dialog-fields"},OD={class:"vt-editor__dialog-label"},DD={class:"vt-editor__dialog-label"},BD={class:"vt-editor__dialog-checkbox"},PD={class:"vt-modal__footer"},HD={class:"vt-editor__dialog-fields"},QD={class:"vt-editor__dialog-label"},AD={class:"vt-editor__dialog-label"},$D={class:"vt-modal__footer"},f2=e.defineComponent({__name:"VEditor",props:{modelValue:{},placeholder:{},toolbar:{default:()=>["history","format","heading","fontName","foreColor","align","list","indent","link","image","blockquote","clear","html"]},disabled:{type:Boolean,default:!1},required:{type:Boolean},errorMessage:{}},emits:["update:modelValue","input","change","focus","blur","validation"],setup(o,{expose:t,emit:l}){const{t:i}=f1(),n=o,r=l,d=e.ref(null),a=e.ref(null),h=e.ref(null),m=e.ref(!1),p=e.ref(!1),C=e.ref(""),Z=e.ref([]),b=e.ref(!0),I=e.ref(!1),w=e.ref(!1),y=e.ref("#000000"),f=e.ref("#ffffff");function Y(H){var s1;const D=H??((s1=d.value)==null?void 0:s1.innerHTML)??"",y1=we(D);r("update:modelValue",y1),r("input",y1)}const{exec:u,isActive:g,applyBlock:x,applyFont:K,applyForeColor:k,applyBackColor:M,handleIndent:L}=fD(d,Y);function V(){if(d.value)if(!p.value)C.value=d.value.innerHTML,p.value=!0,e.nextTick(()=>{var H;return(H=h.value)==null?void 0:H.focus()});else{const H=we(C.value);p.value=!1,e.nextTick(()=>{d.value&&(d.value.innerHTML=H,Y(H),d.value.focus())})}}function T(){const H=we(C.value);r("update:modelValue",H),r("input",H)}const{linkState:W,openLinkDialog:X,confirmLink:G,cancelLink:F,imageState:B,openImageDialog:l1,confirmImage:R,cancelImage:S}=TD(H=>u("insertHTML",H),Y),{toolbarItems:N,onSelectionChange:v,getItemActive:Q,HEADING_GROUPS:q,FONT_GROUPS:r1}=GD(()=>n.toolbar,{exec:u,isActive:g,applyBlock:x,applyFont:K,handleIndent:L,openLinkDialog:X,openImageDialog:l1,toggleHtmlMode:V,isHtmlMode:()=>p.value});function C1(H){const D=H.target.value;y.value=D,k(D)}function a1(H){const D=H.target.value;f.value=D,M(D)}function c1(){const H=a.value;H&&(I.value=H.scrollLeft>2,w.value=H.scrollLeft+H.clientWidth<H.scrollWidth-2)}function M1(H){const D=a.value;D&&(D.scrollBy({left:H==="left"?-160:160,behavior:"smooth"}),setTimeout(c1,250))}function S1(H){const D=[];n.required&&!xt(H).trim()&&D.push(i(s.VALIDATION_REQUIRED)),Z.value=D,b.value=D.length===0,r("validation",{isValid:b.value,errors:D})}const W1=e.computed(()=>n.errorMessage||Z.value[0]||""),L1=e.computed(()=>!!W1.value),O=e.computed(()=>["vt-editor",{"vt-editor--focused":m.value,"vt-editor--error":L1.value,"vt-editor--disabled":n.disabled}]);function A(){Y(),S1(n.modelValue??"")}function n1(H){m.value=!0,r("focus",H)}function V1(H){m.value=!1,r("blur",H),S1(n.modelValue??"")}function x1(H){H.key==="Tab"&&(H.preventDefault(),u("insertHTML"," "))}e.watch(()=>n.modelValue,H=>{!d.value||m.value||p.value||d.value.innerHTML!==H&&(d.value.innerHTML=H??"")}),e.onMounted(()=>{d.value&&n.modelValue&&(d.value.innerHTML=we(n.modelValue)),document.addEventListener("selectionchange",v),e.nextTick(()=>{c1();const H=new ResizeObserver(c1);a.value&&H.observe(a.value)}),window.addEventListener("resize",c1)}),e.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",v),window.removeEventListener("resize",c1)});function g1(){var H;(H=d.value)==null||H.focus()}function F1(){var H;(H=d.value)==null||H.blur()}function R1(){d.value&&(d.value.innerHTML=""),Y(""),Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function U(){var H;return((H=d.value)==null?void 0:H.innerHTML)??""}function e1(){var H;return xt(((H=d.value)==null?void 0:H.innerHTML)??"")}function m1(H){const D=we(H);d.value&&(d.value.innerHTML=D),Y(D)}function w1(H){var D;(D=d.value)==null||D.focus(),u("insertHTML",we(H))}function J1(){return S1(n.modelValue??""),b.value}function U1(){Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function t1(){return{isValid:b.value,errors:[...Z.value]}}function d1(){return d.value}return t({focus:g1,blur:F1,clear:R1,getHTML:U,getText:e1,setHTML:m1,insertHTML:w1,validate:J1,clearValidation:U1,getValidationState:t1,getEditorElement:d1}),(H,D)=>{const y1=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(O.value)},[!o.disabled&&e.unref(N).length?(e.openBlock(),e.createElementBlock("div",ED,[I.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--left",type:"button",onClick:D[0]||(D[0]=s1=>M1("left")),onMousedown:D[1]||(D[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(p1,{name:"arrowLeft"})],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"toolbarRef",ref:a,class:"vt-editor__toolbar",onScroll:c1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(s1,ee)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ee},[(s1==null?void 0:s1.type)==="separator"?(e.openBlock(),e.createElementBlock("span",_D)):(s1==null?void 0:s1.type)==="select"&&s1.id==="heading"?(e.openBlock(),e.createBlock(Ze,{key:1,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:D[3]||(D[3]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),I1=>(e.openBlock(),e.createBlock(ke,{key:I1.value,onClick:v1=>e.unref(x)(I1.value),onMousedown:D[2]||(D[2]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I1.label),1)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(p1,{name:"tagType"},null,512),[[y1,e.unref(i)(e.unref(s).EDITOR_HEADING)]])]),_:1})):(s1==null?void 0:s1.type)==="select"&&s1.id==="fontName"?(e.openBlock(),e.createBlock(Ze,{key:2,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:D[5]||(D[5]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r1),I1=>(e.openBlock(),e.createBlock(ke,{key:I1.value,onClick:v1=>e.unref(K)(I1.value),onMousedown:D[4]||(D[4]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",{style:e.normalizeStyle({fontFamily:I1.value})},e.toDisplayString(I1.label),5)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(p1,{name:"fontName"},null,512),[[y1,e.unref(i)(e.unref(s).EDITOR_FONT)]])]),_:1})):(s1==null?void 0:s1.type)==="select"&&s1.id==="foreColor"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.withDirectives(e.createElementVNode("input",{value:y.value,class:"vt-editor__color-picker",type:"color",onInput:C1,onMousedown:D[6]||(D[6]=e.withModifiers(()=>{},["stop"]))},null,40,jD),[[y1,e.unref(i)(e.unref(s).EDITOR_FORE_COLOR)]]),e.withDirectives(e.createElementVNode("input",{value:f.value,class:"vt-editor__color-picker vt-editor__color-picker--bg",type:"color",onInput:a1,onMousedown:D[7]||(D[7]=e.withModifiers(()=>{},["stop"]))},null,40,JD),[[y1,e.unref(i)(e.unref(s).EDITOR_BACK_COLOR)]])],64)):(s1==null?void 0:s1.type)==="button"?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass([{"vt-editor__toolbar-btn--active":e.unref(Q)(s1)},"vt-editor__toolbar-btn"]),type:"button",onClick:I1=>{var v1;return(v1=s1==null?void 0:s1.action)==null?void 0:v1.call(s1)},onMousedown:D[8]||(D[8]=e.withModifiers(()=>{},["prevent"]))},[s1!=null&&s1.iconName?(e.openBlock(),e.createBlock(p1,{key:0,name:s1.iconName},null,8,["name"])):e.createCommentVNode("",!0)],42,KD)),[[y1,s1==null?void 0:s1.tooltip]]):e.createCommentVNode("",!0)],64))),128))],544),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--right",type:"button",onClick:D[9]||(D[9]=s1=>M1("right")),onMousedown:D[10]||(D[10]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(p1,{name:"arrowRight"})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",FD,[e.withDirectives(e.createElementVNode("div",{ref_key:"editorRef",ref:d,contenteditable:!o.disabled,"data-placeholder":o.placeholder,class:"vt-editor__content",onBlur:V1,onFocus:n1,onInput:A,onKeydown:x1},null,40,RD),[[e.vShow,!p.value]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,ref_key:"htmlSourceRef",ref:h,"onUpdate:modelValue":D[11]||(D[11]=s1=>C.value=s1),class:"vt-editor__html-source",onInput:T},null,544)),[[e.vModelText,C.value]]):e.createCommentVNode("",!0)]),W1.value?(e.openBlock(),e.createElementBlock("div",UD,e.toDisplayString(W1.value),1)):e.createCommentVNode("",!0),e.createVNode(xe,{modelValue:e.unref(W).visible,"onUpdate:modelValue":D[19]||(D[19]=s1=>e.unref(W).visible=s1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_LINK_TITLE),size:"small",onClose:e.unref(F)},{default:e.withCtx(()=>[e.createElementVNode("div",zD,[e.createElementVNode("label",OD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[12]||(D[12]=s1=>e.unref(W).url=s1),class:"vt-editor__dialog-input",placeholder:"https://example.com",type:"url",onKeydown:[D[13]||(D[13]=e.withKeys((...s1)=>e.unref(G)&&e.unref(G)(...s1),["enter"])),D[14]||(D[14]=e.withKeys((...s1)=>e.unref(F)&&e.unref(F)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).url]]),e.createElementVNode("label",DD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_TEXT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[15]||(D[15]=s1=>e.unref(W).text=s1),class:"vt-editor__dialog-input",placeholder:"Link text",type:"text",onKeydown:[D[16]||(D[16]=e.withKeys((...s1)=>e.unref(G)&&e.unref(G)(...s1),["enter"])),D[17]||(D[17]=e.withKeys((...s1)=>e.unref(F)&&e.unref(F)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).text]]),e.createElementVNode("label",BD,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[18]||(D[18]=s1=>e.unref(W).openInNewTab=s1),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(W).openInNewTab]]),e.createTextVNode(" "+e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_NEW_TAB)),1)])]),e.createElementVNode("div",PD,[e.createVNode(E1,{onClick:e.unref(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(E1,{type:"primary",onClick:e.unref(G)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"]),e.createVNode(xe,{modelValue:e.unref(B).visible,"onUpdate:modelValue":D[26]||(D[26]=s1=>e.unref(B).visible=s1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_IMAGE_TITLE),size:"small",onClose:e.unref(S)},{default:e.withCtx(()=>[e.createElementVNode("div",HD,[e.createElementVNode("label",QD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[20]||(D[20]=s1=>e.unref(B).url=s1),class:"vt-editor__dialog-input",placeholder:"https://example.com/image.png",type:"url",onKeydown:[D[21]||(D[21]=e.withKeys((...s1)=>e.unref(R)&&e.unref(R)(...s1),["enter"])),D[22]||(D[22]=e.withKeys((...s1)=>e.unref(S)&&e.unref(S)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(B).url]]),e.createElementVNode("label",AD,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_ALT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":D[23]||(D[23]=s1=>e.unref(B).alt=s1),class:"vt-editor__dialog-input",placeholder:"Image description",type:"text",onKeydown:[D[24]||(D[24]=e.withKeys((...s1)=>e.unref(R)&&e.unref(R)(...s1),["enter"])),D[25]||(D[25]=e.withKeys((...s1)=>e.unref(S)&&e.unref(S)(...s1),["esc"]))]},null,544),[[e.vModelText,e.unref(B).alt]])]),e.createElementVNode("div",$D,[e.createVNode(E1,{onClick:e.unref(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(E1,{type:"primary",onClick:e.unref(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])],2)}}}),qD={class:"vt-badge"},mt=e.defineComponent({__name:"VBadge",props:{content:{default:void 0},max:{default:99},dot:{type:Boolean,default:!1},color:{default:"danger"},position:{default:"top-end"},offsetX:{default:0},offsetY:{default:0},bordered:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(o){const t=o,l=e.computed(()=>t.dot?!0:t.content===void 0||t.content===null||t.content===""?!1:typeof t.content=="number"?t.content>0:!0),i=e.computed(()=>l.value&&!t.hidden),n=e.computed(()=>typeof t.content=="number"?t.content>t.max?`${t.max}+`:String(t.content):t.content),r=e.computed(()=>{if(!t.offsetX&&!t.offsetY)return{};const d=t.position.startsWith("top"),a=t.position.endsWith("end"),h={};return t.offsetX&&(h[a?"right":"left"]=`${-t.offsetX}px`),t.offsetY&&(h[d?"top":"bottom"]=`${-t.offsetY}px`),h});return(d,a)=>(e.openBlock(),e.createElementBlock("span",qD,[e.renderSlot(d.$slots,"default"),e.createVNode(e.Transition,{name:"vt-badge__fade"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-badge__content",[`vt-badge__content--${o.position}`,`vt-badge__content--${o.color}`,{"vt-badge__content--dot":o.dot,"vt-badge__content--bordered":o.bordered}]]),style:e.normalizeStyle(r.value)},[o.dot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(n.value),1)],64))],6)):e.createCommentVNode("",!0)]),_:1})]))}}),eB={class:"vt-app-bar__logo"},tB={key:0,class:"vt-app-bar__center"},oB={key:1,class:"vt-app-bar__actions"},x2=e.defineComponent({__name:"VAppBar",props:{sticky:{type:Boolean,default:!1}},setup(o){return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-app-bar",{"vt-app-bar--sticky":o.sticky}])},[e.createElementVNode("div",eB,[e.renderSlot(t.$slots,"logo")]),t.$slots.center?(e.openBlock(),e.createElementBlock("div",tB,[e.renderSlot(t.$slots,"center")])):e.createCommentVNode("",!0),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",oB,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)],2))}}),lB={class:"vt-nav-rail"},nB={class:"vt-nav-rail__list"},iB=["data-placement","onClick"],rB={key:0,class:"vt-nav-rail__divider"},sB={key:0,class:"vt-nav-rail__footer"},T2=e.defineComponent({__name:"VNavRail",props:{items:{},modelValue:{default:null},placement:{default:"left"}},emits:["update:modelValue","select"],setup(o,{emit:t}){const l=t,i=n=>{n.disabled||(l("update:modelValue",n.key),l("select",n))};return(n,r)=>{const d=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("aside",lB,[e.createElementVNode("div",nB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,(a,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-nav-rail__item",{"vt-nav-rail__item--selected":o.modelValue===a.key,"vt-nav-rail__item--disabled":a.disabled}]),"data-placement":o.placement,onClick:m=>i(a)},[a.badge?(e.openBlock(),e.createBlock(mt,{key:0,content:a.badge.content,position:a.badge.position},{default:e.withCtx(()=>[e.createVNode(p1,{name:a.icon,width:24,height:24},null,8,["name"])]),_:2},1032,["content","position"])):(e.openBlock(),e.createBlock(p1,{key:1,name:a.icon,width:24,height:24},null,8,["name"]))],10,iB)),[[d,a.label]]),h<o.items.length-1?(e.openBlock(),e.createElementBlock("span",rB)):e.createCommentVNode("",!0)],64))),128))]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",sB,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)])}}}),cB=(o,t)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${t}`,l.innerText=o,Object.assign(l.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"});const i=document.createElement("div");switch(i.className="vt-tooltip__arrow",Object.assign(i.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),t){case"top":Object.assign(i.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(i.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(i.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(i.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(i),l},v2=(o,t,l)=>{const i=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,d=window.innerWidth,a=window.innerHeight,h=8,m=Math.min(300,d-h*2);o.style.maxWidth=`${m}px`;const p=o.getBoundingClientRect();let C=0,Z=0;switch(l){case"top":C=i.top+r-p.height-8,Z=i.left+n+(i.width-p.width)/2;break;case"bottom":C=i.bottom+r+8,Z=i.left+n+(i.width-p.width)/2;break;case"left":C=i.top+r+(i.height-p.height)/2,Z=i.left+n-p.width-8;break;case"right":C=i.top+r+(i.height-p.height)/2,Z=i.right+n+8;break}Z<h?Z=h:Z+p.width>d-h&&(Z=d-p.width-h),C<r+h?l==="top"?C=i.bottom+r+8:C=r+h:C+p.height>r+a-h&&(l==="bottom"?C=i.top+r-p.height-8:C=r+a-p.height-h),o.style.top=`${C}px`,o.style.left=`${Z}px`},dB=(o,t,l)=>{o.parentElement||document.body.appendChild(o),o.style.visibility="visible",v2(o,t,l),requestAnimationFrame(()=>{o.style.opacity="1"})},aB=o=>{o.style.opacity="0",o.style.visibility="hidden"},uB=o=>o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight,mB=o=>!!o.closest(".vt-table, table"),Tt=o=>o.dataset.placement||"top",vt=o=>{var t;return((t=o.value)==null?void 0:t.trim())??""},Xt=o=>{var t;(t=o.__tooltipEl)==null||t.remove(),delete o.__tooltipEl},X2={mounted(o,t){o.__tooltipText=vt(t);const l=()=>{const r=o.__tooltipText;if(!r||mB(o)&&!uB(o))return;const d=Tt(o);o.__tooltipEl||(o.__tooltipEl=cB(r,d)),dB(o.__tooltipEl,o,d)},i=()=>{o.__tooltipEl&&aB(o.__tooltipEl)},n=()=>{var r;((r=o.__tooltipEl)==null?void 0:r.style.opacity)==="1"&&v2(o.__tooltipEl,o,Tt(o))};o.__mouseenterHandler=l,o.__mouseleaveHandler=i,o.__scrollHandler=n,o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",i),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n)},updated(o,t){const l=vt(t);l!==o.__tooltipText&&(o.__tooltipText=l,l?o.__tooltipEl&&(o.__tooltipEl.firstChild.textContent=l):Xt(o))},beforeUnmount(o){Xt(o),delete o.__tooltipText,o.__mouseenterHandler&&(o.removeEventListener("mouseenter",o.__mouseenterHandler),delete o.__mouseenterHandler),o.__mouseleaveHandler&&(o.removeEventListener("mouseleave",o.__mouseleaveHandler),delete o.__mouseleaveHandler),o.__scrollHandler&&(window.removeEventListener("scroll",o.__scrollHandler,!0),window.removeEventListener("resize",o.__scrollHandler),delete o.__scrollHandler)}},G2={mounted(o,t){e.unref(t.value)&&Gt(o)},updated(o,t){const l=e.unref(t.value),i=e.unref(t.oldValue);l!==i&&(l?Gt(o):Et(o))},unmounted(o){Et(o)}};function Gt(o){if(o._loaderEl)return;const t=document.createElement("div");t.className="vt-loader-base__overlay",t.innerHTML='<span class="vt-loader-base"></span>';const l=getComputedStyle(o).position;(l==="static"||!l)&&(o.style.position="relative"),o.appendChild(t),o._loaderEl=t}function Et(o){const t=o._loaderEl;t&&(t.remove(),delete o._loaderEl)}const hB={class:"vt-message-container"},pB={class:"vt-message-icon"},CB={class:"vt-message-content"},IB={key:0,class:"vt-message-title"},ZB=["innerHTML"],kB={key:1,class:"vt-message-text"},bB=["onClick"],VB=e.defineComponent({__name:"VMessage",setup(o,{expose:t}){const l=e.ref([]);let i=0;const n=a=>({success:"checkCircle",danger:"alertCircle",warning:"alertTriangle",primary:"infoCircle"})[a]||"infoCircle",r=a=>{const h=++i,m={id:h,message:a.message||"",title:a.title||"",type:a.type||"primary",showClose:a.showClose||!1,duration:a.duration!==void 0?a.duration:3e3,dangerouslyUseHTMLString:a.dangerouslyUseHTMLString||!1};return l.value.push(m),m.duration&&m.duration>0&&setTimeout(()=>{d(h)},m.duration),h},d=a=>{const h=l.value.findIndex(m=>m.id===a);h>-1&&l.value.splice(h,1)};return t({addMessage:r,removeMessage:d}),(a,h)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",hB,[e.createVNode(e.TransitionGroup,{name:"vt-message",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id,class:e.normalizeClass(["vt-message-item",`vt-message-item--${m.type}`,{"vt-message-item--closable":m.showClose}])},[e.createElementVNode("div",pB,[e.createVNode(p1,{color:m.type==="primary"?"#00475A":"",name:n(m.type)},null,8,["color","name"])]),e.createElementVNode("div",CB,[m.title?(e.openBlock(),e.createElementBlock("div",IB,e.toDisplayString(m.title),1)):e.createCommentVNode("",!0),m.message?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[m.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-message-text",innerHTML:m.message},null,8,ZB)):(e.openBlock(),e.createElementBlock("div",kB,e.toDisplayString(m.message),1))],64)):e.createCommentVNode("",!0)]),m.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-message-close",type:"button",onClick:p=>d(m.id)},[e.createVNode(p1,{name:"close"})],8,bB)):e.createCommentVNode("",!0)],2))),128))]),_:1})])]))}});class wB{constructor(){this.messageInstance=null,this.app=null,this.container=null}call(t={}){return this.ensureInstance().addMessage({message:t.message||"",title:t.title||"",type:t.type||"primary",showClose:t.showClose||!1,duration:t.duration!==void 0?t.duration:3e3,dangerouslyUseHTMLString:t.dangerouslyUseHTMLString||!1})}success(t,l={}){return this.call({...l,message:t,type:"success"})}danger(t,l={}){return this.call({...l,message:t,type:"danger"})}warning(t,l={}){return this.call({...l,message:t,type:"warning"})}primary(t,l={}){return this.call({...l,message:t,type:"primary"})}close(t){this.messageInstance&&this.messageInstance.removeMessage(t)}closeAll(){this.messageInstance&&(this.messageInstance.messages=[]),this.container&&this.container.parentNode&&document.body.removeChild(this.container),this.app&&this.app.unmount(),this.messageInstance=null,this.app=null,this.container=null}getOpenMessagesCount(){return this.messageInstance?this.messageInstance.messages.length:0}ensureInstance(){return this.messageInstance?this.messageInstance:(this.container=document.createElement("div"),this.container.setAttribute("data-vt-message-container",""),document.body.appendChild(this.container),this.app=e.createApp(VB),this.messageInstance=this.app.mount(this.container),this.messageInstance)}}const ie=new wB,it=Object.assign((o={})=>ie.call(o),{success:(o,t={})=>ie.success(o,t),danger:(o,t={})=>ie.danger(o,t),warning:(o,t={})=>ie.warning(o,t),primary:(o,t={})=>ie.primary(o,t),close:o=>{ie.close(o)},closeAll:()=>{ie.closeAll()}}),E2={install(o){o.config.globalProperties.$message=it,o.provide("$message",it),o.config.globalProperties.$messageStack={closeAll:()=>ie.closeAll(),getCount:()=>ie.getOpenMessagesCount(),closeById:t=>ie.close(t)}}},LB={sortable:!0,actionColumn:!1,showOverflowTooltip:!0,visible:!0,pinnedLeft:!1,pinnedRight:!1,manage:!1};function yB(o){_t(o)}const _2={install(o,t={}){const{prefix:l="V",modal:i=!0,message:n=!0,locale:r=ce.uk}=t;o.component(`${l}Button`,E1),o.component(`${l}Icon`,p1),o.component(`${l}Loader`,fe),o.component(`${l}Modal`,xe),o.component(`${l}Pagination`,Kt),o.component(`${l}Checkbox`,se),o.component(`${l}Radiobox`,Ft),o.component(`${l}Table`,Ut),o.component(`${l}TableColumn`,zt),o.component(`${l}Dropdown`,Ze),o.component(`${l}DropdownItem`,ke),o.component(`${l}Input`,Me),o.component(`${l}Select`,Ue),o.component(`${l}Option`,ze),o.component(`${l}DatePicker`,At),o.component(`${l}TimePicker`,We),o.component(`${l}Collapse`,$t),o.component(`${l}CollapseItem`,qt),o.component(`${l}Tabs`,e2),o.component(`${l}TabItem`,t2),o.component(`${l}Upload`,l2),o.component(`${l}Sidebar`,n2),o.component(`${l}Login`,u2),o.component(`${l}LoginLogo`,m2),o.component(`${l}LocaleSelect`,Ot),o.component(`${l}DynamicFilter`,h2),o.component(`${l}Slider`,p2),o.component(`${l}SliderMarkRange`,C2),o.component(`${l}Chart`,I2),o.component(`${l}InfoBox`,Z2),o.component(`${l}TransferList`,k2),o.component(`${l}Avatar`,b2),o.component(`${l}AvatarUpload`,V2),o.component(`${l}ImageFullscreen`,w2),o.component(`${l}Breadcrumb`,L2),o.component(`${l}BreadcrumbItem`,y2),o.component(`${l}Audio`,W2),o.component(`${l}Empty`,Oe),o.component(`${l}Editor`,f2),o.component(`${l}Badge`,mt),o.component(`${l}AppBar`,x2),o.component(`${l}NavRail`,T2),o.directive("tooltip",X2),o.directive("loader",G2),i&&o.use(Rt),n&&o.use(E2),o.use(lj,{locale:r})}},MB=_2.install;exports.DEFAULT_COLUMN_CONFIG=LB;exports.DEFAULT_FORMATS=Dt;exports.DEFAULT_TIME_FORMATS=Ne;exports.DropdownContextKey=ct;exports.FORMAT_TOKENS=sK;exports.FileParser=ge;exports.FileValidator=Ce;exports.LANGUAGES=ce;exports.VAppBar=x2;exports.VAudio=W2;exports.VAvatar=b2;exports.VAvatarUpload=V2;exports.VBadge=mt;exports.VBreadcrumb=L2;exports.VBreadcrumbItem=y2;exports.VButton=E1;exports.VChart=I2;exports.VCheckbox=se;exports.VCollapse=$t;exports.VCollapseItem=qt;exports.VColorPicker=BO;exports.VDatePicker=At;exports.VDropdown=Ze;exports.VDropdownItem=ke;exports.VDynamicFilter=h2;exports.VEditor=f2;exports.VEmpty=Oe;exports.VIcon=p1;exports.VImageFullscreen=w2;exports.VInfoBox=Z2;exports.VInput=Me;exports.VLoader=fe;exports.VLocaleSelect=Ot;exports.VLogin=u2;exports.VLoginLogo=m2;exports.VMessage=it;exports.VMessagePlugin=E2;exports.VModal=xe;exports.VModalPlugin=Rt;exports.VNavRail=T2;exports.VOption=ze;exports.VPagination=Kt;exports.VRadiobox=Ft;exports.VSelect=Ue;exports.VSidebar=n2;exports.VSlider=p2;exports.VSliderMarkRange=C2;exports.VTabItem=t2;exports.VTable=Ut;exports.VTableColumn=zt;exports.VTabs=e2;exports.VTimePicker=We;exports.VTimerDuration=QO;exports.VTransferList=k2;exports.VUpload=l2;exports.VtSelectContextKey=rt;exports.containUpperCaseLetter=d2;exports.default=_2;exports.email=i2;exports.formatTime=Ht;exports.generateTimeOptions=je;exports.iconGroups=K_;exports.install=MB;exports.isValidDate=et;exports.isValidTimeString=Je;exports.loaderDirective=G2;exports.maxLength=lU;exports.maxNumber=iU;exports.messageManager=ie;exports.minLength=tt;exports.minNumber=nU;exports.mk=oU;exports.modalManager=de;exports.noSpaces=at;exports.numeric=s2;exports.parseTimeString=Qt;exports.pattern=sU;exports.phoneNumber=c2;exports.required=Ke;exports.sameAs=rU;exports.setLocale=yB;exports.tooltipDirective=X2;exports.uniqueAsync=cU;exports.url=r2;exports.useValidate=a2;exports.validateDateValue=Bt;exports.validateTimeValue=Pt;exports.withAsync=tU;exports.withMessage=eU;exports.withName=pe;exports.withParams=qR;
|
package/dist/index.es.js
CHANGED
|
@@ -25140,15 +25140,15 @@ const F2 = {
|
|
|
25140
25140
|
}, [
|
|
25141
25141
|
y.value ? J1(B.$slots, "icon-pause", { key: 0 }, () => [
|
|
25142
25142
|
u1(V1, {
|
|
25143
|
-
height: "
|
|
25143
|
+
height: "20",
|
|
25144
25144
|
name: "pause",
|
|
25145
|
-
width: "
|
|
25145
|
+
width: "20"
|
|
25146
25146
|
})
|
|
25147
25147
|
]) : J1(B.$slots, "icon-play", { key: 1 }, () => [
|
|
25148
25148
|
u1(V1, {
|
|
25149
|
-
height: "
|
|
25149
|
+
height: "20",
|
|
25150
25150
|
name: "start",
|
|
25151
|
-
width: "
|
|
25151
|
+
width: "20"
|
|
25152
25152
|
})
|
|
25153
25153
|
])
|
|
25154
25154
|
], 8, zE)) : F("", !0),
|
|
@@ -25185,15 +25185,15 @@ const F2 = {
|
|
|
25185
25185
|
}, [
|
|
25186
25186
|
y.value ? J1(B.$slots, "icon-pause", { key: 0 }, () => [
|
|
25187
25187
|
u1(V1, {
|
|
25188
|
-
height: "
|
|
25188
|
+
height: "20",
|
|
25189
25189
|
name: "pause",
|
|
25190
|
-
width: "
|
|
25190
|
+
width: "20"
|
|
25191
25191
|
})
|
|
25192
25192
|
]) : J1(B.$slots, "icon-play", { key: 1 }, () => [
|
|
25193
25193
|
u1(V1, {
|
|
25194
|
-
height: "
|
|
25194
|
+
height: "20",
|
|
25195
25195
|
name: "start",
|
|
25196
|
-
width: "
|
|
25196
|
+
width: "20"
|
|
25197
25197
|
})
|
|
25198
25198
|
])
|
|
25199
25199
|
], 8, BE)) : F("", !0),
|
package/dist/index.umd.js
CHANGED
|
@@ -101,4 +101,4 @@
|
|
|
101
101
|
16.5982 14.3027 16.9805 13.3872C17.3628 12.4717 17.5596 11.4895 17.5596 10.4974
|
|
102
102
|
C17.5596 9.50531 17.3628 8.52309 16.9805 7.60761C16.5982 6.69212 16.0382 5.86158
|
|
103
103
|
15.3327 5.16406" stroke="#F2F2F2" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
104
|
-
</svg>`,S),d=new WeakMap,{t:a}=f1(),p=o,h=l,C=e.computed(()=>!!(p.userA||p.userB)),u=e.ref(!1),Z=e.computed(()=>p.disabled||u.value),b=e.ref(!1),I=e.ref(1),w=e.ref(`ws-${Math.random().toString(36).slice(2,9)}`),y=e.ref(null),f=e.ref(null),Y=e.ref(null),m=e.ref(null),g=e.ref(null),T=e.computed(()=>p.type==="channel-routed"),F=(U,S)=>{var D;const N=S.canvas,{width:X,height:Q}=N,q=(D=y.value)==null?void 0:D.decodedData,s1=N.getBoundingClientRect(),I1=s1.width>0?X/s1.width:1,m1=s1.height>0?Q/s1.height:1;if(!U.length&&!q){S.fillStyle=Ce.WAVE_DEFAULT,S.fillRect(0,Q/2,X,2);return}const d1=C.value&&q&&q.numberOfChannels>=2?[q.getChannelData(0),q.getChannelData(1)]:[U[0]||new Float32Array(X).fill(0)];S.clearRect(0,0,X,Q);const S1=20*m1,g1=20*I1,y1=[];if(d1.forEach((A,i1)=>{const w1=Q/d1.length,x1=w1-(C.value?S1:0),T1=i1*w1+(C.value?S1:0)+x1/2,U1=A.length/X;let z1=0;for(let z=0;z<A.length;z+=100){const e1=Math.abs(A[z]??0);e1>z1&&(z1=e1)}z1===0&&(z1=1),S.fillStyle=Ce.WAVE_DEFAULT;for(let z=0;z<X;z+=2){const e1=Math.floor(z*U1),p1=Math.min(Math.floor((z+2)*U1),A.length-1);let L1=0;for(let t1=e1;t1<=p1;t1++){const a1=Math.abs(A[t1]??0);a1>L1&&(L1=a1)}const F1=L1/z1,O1=Math.max(F1*x1*.85,2);S.fillRect(z,T1-O1/2,1.5,O1)}if(C.value){S.fillStyle="#999999",S.font=`${12*I1}px Inter, sans-serif`,S.textAlign="right";const z=(i1===0?p.userA:p.userB)??"";S.fillText(z,X-10*I1,i1*w1+S1-5*m1);const e1=i1,p1=5*I1,L1=i1*w1+1*m1;((e1===0?x.value:W.value)===0?r:n)(e1===0?Ce.CHANNEL_A:Ce.CHANNEL_B,O1=>S.drawImage(O1,p1,L1,g1,g1)),y1.push({x:p1,y:L1,width:g1,height:g1,channelIdx:e1})}}),C.value){const A=d.get(N);A&&N.removeEventListener("click",A);const i1=w1=>{if(Z.value)return;const x1=N.getBoundingClientRect(),T1=x1.width>0?N.width/x1.width:1,U1=x1.height>0?N.height/x1.height:1,z1=(w1.clientX-x1.left)*T1,z=(w1.clientY-x1.top)*U1;for(const e1 of y1)if(z1>=e1.x&&z1<=e1.x+e1.width&&z>=e1.y&&z<=e1.y+e1.height){w1.stopPropagation(),w1.preventDefault(),G(e1.channelIdx);const p1=(e1.channelIdx===0?x.value:W.value)===0;S.save(),S.clearRect(e1.x,e1.y,e1.width,e1.height),(p1?r:n)(e1.channelIdx===0?Ce.CHANNEL_A:Ce.CHANNEL_B,L1=>S.drawImage(L1,e1.x,e1.y,e1.width,e1.height)),S.restore();break}};N.addEventListener("click",i1),d.set(N,i1)}},k=e.computed(()=>{if(p.height){const U=parseInt(p.height,10);if(!isNaN(U))return U}return T.value?36:C.value?100:50}),M=()=>{var Q;const U=(Q=y.value)==null?void 0:Q.getMediaElement();if(!U)return;Y.value=new(window.AudioContext||window.webkitAudioContext);const S=Y.value.createMediaElementSource(U),N=Y.value.createChannelSplitter(2),X=Y.value.createChannelMerger(2);m.value=Y.value.createGain(),g.value=Y.value.createGain(),m.value.gain.value=x.value,g.value.gain.value=W.value,S.connect(N),N.connect(m.value,0),N.connect(g.value,1),C.value?(m.value.connect(X,0,0),g.value.connect(X,0,1)):(m.value.connect(X,0,0),m.value.connect(X,0,1),g.value.connect(X,0,0),g.value.connect(X,0,1)),X.connect(Y.value.destination)},L=()=>{var U;(U=Y.value)==null||U.close(),Y.value=null,m.value=null,g.value=null},V=()=>{if(!p.recordUrl)return;u.value=!1;const U=Ge.create({container:`#waveform-${w.value}`,waveColor:Ce.WAVE_DEFAULT,progressColor:Ce.PROGRESS,barWidth:2,height:k.value,plugins:T.value?[]:[mt.create({container:f.value,style:{fontSize:"10px",color:"#999"}})],renderFunction:(S,N)=>F(S,N)});y.value=U,y.value.on("play",()=>{b.value=!0,h("play")}),y.value.on("pause",()=>{b.value=!1,h("pause")}),y.value.on("timeupdate",S=>h("timeUpdate",S)),y.value.on("finish",()=>{b.value=!1,h("ended")}),y.value.on("error",()=>{u.value=!0,h("error")}),(C.value||T.value)&&y.value.on("ready",()=>{M()}),y.value.load(p.recordUrl)},x=e.ref(1),W=e.ref(1),G=U=>{const S=U===0?m.value:g.value,N=U===0?x:W;N.value=N.value?0:1,S&&(S.gain.value=N.value)},E=async()=>{if(!(!y.value||Z.value)){if(T.value){const U=y.value.getMediaElement();if(!U||!Y.value)return;Y.value.state==="suspended"&&await Y.value.resume(),U.paused?await U.play():U.pause();return}b.value?y.value.pause():y.value.play()}},R=U=>{var S;I.value=U,(S=y.value)==null||S.setPlaybackRate(I.value)},P=(U,S)=>{if(U.startsWith("data:")){const X=document.createElement("a");X.href=U,X.download=S,document.body.appendChild(X),X.click(),document.body.removeChild(X)}else fetch(U).then(X=>X.blob()).then(X=>{const Q=document.createElement("a");Q.href=URL.createObjectURL(X),Q.download=S,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q)}).catch(console.error)},n1=()=>{if(p.disabled||!p.recordUrl)return;const U=p.recordUrl.indexOf("?"),S=p.recordUrl.substring(p.recordUrl.lastIndexOf("/")+1,U===-1?void 0:U);P(p.recordUrl,S)};return e.onMounted(()=>e.nextTick(V)),e.onBeforeUnmount(()=>{var U;(U=y.value)==null||U.destroy(),L()}),e.watch(()=>p.recordUrl,()=>{var U;(U=y.value)==null||U.destroy(),L(),e.nextTick(V)}),t({play:()=>{var U;return(U=y.value)==null?void 0:U.play()},pause:()=>{var U;return(U=y.value)==null?void 0:U.pause()},getCurrentTime:()=>{var U;return((U=y.value)==null?void 0:U.getCurrentTime())||0}}),(U,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"is-disabled":Z.value,"is-channel-routed":T.value},"vt-audio"])},[o.recordUrl?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([{"is-single-channel":!C.value,"is-channel-routed":T.value},"vt-audio__container"])},[o.playPosition==="left"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:E},[b.value?e.renderSlot(U.$slots,"icon-pause",{key:0},()=>[e.createVNode(u1,{height:"24",name:"pause",width:"24"})]):e.renderSlot(U.$slots,"icon-play",{key:1},()=>[e.createVNode(u1,{height:"24",name:"start",width:"24"})])],8,hB)):e.createCommentVNode("",!0),e.createElementVNode("div",pB,[e.createElementVNode("div",{id:`waveform-${w.value}`,class:"vt-audio__waveform"},null,8,CB),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"timelineContainer",ref:f,class:"vt-audio__timeline"},null,512))]),e.createElementVNode("div",uB,[p.download?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn",onClick:n1},[e.createVNode(u1,{height:"20",name:"import",width:"20"})],8,IB)):e.createCommentVNode("",!0),o.playPosition==="right"?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:E},[b.value?e.renderSlot(U.$slots,"icon-pause",{key:0},()=>[e.createVNode(u1,{height:"24",name:"pause",width:"24"})]):e.renderSlot(U.$slots,"icon-play",{key:1},()=>[e.createVNode(u1,{height:"24",name:"start",width:"24"})])],8,ZB)):e.createCommentVNode("",!0),e.createVNode(Ie,{disabled:Z.value,placement:"top",trigger:"click",onCommand:R},{dropdown:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList([.5,1,1.5,2],N=>e.createVNode(Ze,{key:N,class:e.normalizeClass({"is-active":I.value===N}),command:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N)+"x ",1)]),_:2},1032,["class","command"])),64))]),default:e.withCtx(()=>[e.createElementVNode("button",{disabled:Z.value,class:"vt-audio__speed-val"},e.toDisplayString(I.value)+"x",9,kB)]),_:1},8,["disabled"])])],2)):(e.openBlock(),e.createElementBlock("div",aB,[e.renderSlot(U.$slots,"empty",{},()=>[T.value?(e.openBlock(),e.createElementBlock("span",mB,e.toDisplayString(e.unref(a)(e.unref(s).AUDIO_EMPTY)),1)):(e.openBlock(),e.createBlock(Ke,{key:0,text:e.unref(a)(e.unref(s).AUDIO_EMPTY),icon:"noSound"},null,8,["text"]))])]))],2))}}),bB=new Set(["p","div","br","hr","h1","h2","h3","h4","h5","h6","blockquote","pre","code","ul","ol","li","b","strong","i","em","u","s","strike","del","sub","sup","font","span","a","img","table","thead","tbody","tfoot","tr","th","td","caption"]),VB=new Set(["style","class","href","target","rel","src","alt","width","height","face","size","color","colspan","rowspan"]),wB=new Set(["behavior","-moz-binding","filter"]),LB=/expression\s*\(|javascript\s*:|vbscript\s*:/i;function yB(o){const t=document.createElement("span");t.setAttribute("style",o);const l=t.style,i=[];for(let n=0;n<l.length;n++){const r=l[n],d=l.getPropertyValue(r);wB.has(r)||LB.test(d)||/url\s*\(/i.test(d)&&!/url\s*\(\s*['"]?data:image\//i.test(d)||i.push(`${r}:${d}`)}return i.join(";")}const MB=new Set(["https:","http:","ftp:","mailto:","tel:"]);function SB(o){const t=o.trim();if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const l=new URL(t);return MB.has(l.protocol)}catch{return!/^[a-z][a-z0-9+\-.]*:/i.test(t)}}function L2(o){var r,d,a;if(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.PROCESSING_INSTRUCTION_NODE){(r=o.parentNode)==null||r.removeChild(o);return}if(o.nodeType!==Node.ELEMENT_NODE)return;const t=o,l=t.tagName.toLowerCase();if(!bB.has(l)){for(;t.firstChild;)(d=t.parentNode)==null||d.insertBefore(t.firstChild,t);(a=t.parentNode)==null||a.removeChild(t);return}const i=Array.from(t.attributes);for(const p of i){const h=p.name.toLowerCase();if(h.startsWith("on")){t.removeAttribute(p.name);continue}if(!VB.has(h)){t.removeAttribute(p.name);continue}if((h==="href"||h==="src")&&!SB(p.value)){t.removeAttribute(p.name);continue}if(h==="style"){const C=yB(p.value);C?t.setAttribute("style",C):t.removeAttribute("style");continue}}l==="a"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer");const n=Array.from(t.childNodes);for(let p=n.length-1;p>=0;p--)L2(n[p])}function ye(o){if(!o)return"";const t=new DOMParser().parseFromString(o,"text/html");t.head.innerHTML="";const l=Array.from(t.body.childNodes);for(let i=l.length-1;i>=0;i--)L2(l[i]);return t.body.innerHTML}function y2(o){const t=document.createElement("div");return t.innerHTML=o,t.textContent??t.innerText??""}function YB(o,t){function l(h,C){o.value&&(o.value.focus(),document.execCommand(h,!1,C??""),t())}function i(h){try{return document.queryCommandState(h)}catch{return!1}}function n(h){o.value&&(o.value.focus(),document.execCommand("formatBlock",!1,h),t())}function r(h){o.value&&(o.value.focus(),document.execCommand("fontName",!1,h),t())}function d(h){o.value&&(o.value.focus(),document.execCommand("foreColor",!1,h),t())}function a(h){o.value&&(o.value.focus(),document.execCommand("hiliteColor",!1,h),t())}function p(h){const C=window.getSelection();if(!C||C.rangeCount===0)return;let u=C.anchorNode;u.nodeType===Node.TEXT_NODE&&(u=u.parentElement);const Z=u.closest(".vt-editor__content > *");if(!Z)return;const b=parseInt(Z.style.marginLeft||"0",10),I=20,w=h==="indent"?b+I:Math.max(0,b-I);Z.style.marginLeft=w?`${w}px`:"",t()}return{exec:l,isActive:i,applyBlock:n,applyFont:r,applyForeColor:d,applyBackColor:a,handleIndent:p}}function NB(){let o=null;function t(){const r=window.getSelection();r&&r.rangeCount>0&&(o=r.getRangeAt(0).cloneRange())}function l(){if(!o)return;const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}function i(){o=null}function n(){return o}return{saveSelection:t,restoreSelection:l,clearSavedRange:i,getSavedRange:n}}function WB(o,t){const{saveSelection:l,restoreSelection:i,clearSavedRange:n,getSavedRange:r}=NB(),d=e.ref({visible:!1,url:"",text:"",openInNewTab:!1});function a(){var f,Y;l();const I=window.getSelection(),w=(I==null?void 0:I.toString())??"",y=(Y=(f=I==null?void 0:I.anchorNode)==null?void 0:f.parentElement)==null?void 0:Y.closest("a");d.value={visible:!0,url:(y==null?void 0:y.getAttribute("href"))??"",text:w,openInNewTab:(y==null?void 0:y.getAttribute("target"))==="_blank"}}function p(){i();const{url:I,text:w,openInNewTab:y}=d.value;if(!I){h();return}const f=document.createElement("a");f.href=I,f.textContent=w||I,y&&f.setAttribute("target","_blank"),f.setAttribute("rel","noopener noreferrer");const Y=r(),m=window.getSelection();m&&m.rangeCount>0&&Y?(Y.deleteContents(),Y.insertNode(f)):o(f.outerHTML),h(),t()}function h(){d.value={visible:!1,url:"",text:"",openInNewTab:!1},n()}const C=e.ref({visible:!1,url:"",alt:""});function u(){l(),C.value={visible:!0,url:"",alt:""}}function Z(){i();const{url:I,alt:w}=C.value;if(!I){b();return}o(`<img src="${I}" alt="${w}" style="max-width:100%;" />`),b()}function b(){C.value={visible:!1,url:"",alt:""},n()}return{linkState:d,openLinkDialog:a,confirmLink:p,cancelLink:h,imageState:C,openImageDialog:u,confirmImage:Z,cancelImage:b}}const K1={undo:"undo",redo:"redo",bold:"textBold",italic:"textItalic",underline:"textUnderline",strikethrough:"textStrikethrough",subscript:"subscript",superscript:"superscript",orderedList:"orderedList",unorderedList:"unorderedList",indent:"indent",outdent:"outdent",alignLeft:"alignLeft",alignCenter:"alignCenter",alignRight:"alignRight",alignJustify:"alignJustify",link:"link",image:"image",blockquote:"blockquote",clearFormat:"clearFormat",html:"html"},gB=[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],fB=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"}];function TB(o,t){const{t:l}=f1(),i=e.ref(0);function n(){i.value++}function r(p){var h;return i.value,((h=p.activeCheck)==null?void 0:h.call(p))??!1}function d(p){const h=[];return p.forEach((C,u)=>{switch(u>0&&h.push({type:"separator"}),C){case"history":h.push({type:"button",id:"undo",tooltip:l(s.EDITOR_UNDO),iconName:K1.undo,action:()=>t.exec("undo")},{type:"button",id:"redo",tooltip:l(s.EDITOR_REDO),iconName:K1.redo,action:()=>t.exec("redo")});break;case"format":h.push({type:"button",id:"bold",tooltip:l(s.EDITOR_BOLD),iconName:K1.bold,action:()=>t.exec("bold"),activeCheck:()=>t.isActive("bold")},{type:"button",id:"italic",tooltip:l(s.EDITOR_ITALIC),iconName:K1.italic,action:()=>t.exec("italic"),activeCheck:()=>t.isActive("italic")},{type:"button",id:"underline",tooltip:l(s.EDITOR_UNDERLINE),iconName:K1.underline,action:()=>t.exec("underline"),activeCheck:()=>t.isActive("underline")},{type:"button",id:"strikethrough",tooltip:l(s.EDITOR_STRIKETHROUGH),iconName:K1.strikethrough,action:()=>t.exec("strikethrough"),activeCheck:()=>t.isActive("strikeThrough")});break;case"script":h.push({type:"button",id:"subscript",tooltip:l(s.EDITOR_SUBSCRIPT),iconName:K1.subscript,action:()=>t.exec("subscript"),activeCheck:()=>t.isActive("subscript")},{type:"button",id:"superscript",tooltip:l(s.EDITOR_SUPERSCRIPT),iconName:K1.superscript,action:()=>t.exec("superscript"),activeCheck:()=>t.isActive("superscript")});break;case"heading":h.push({type:"select",id:"heading"});break;case"fontName":h.push({type:"select",id:"fontName"});break;case"foreColor":h.push({type:"select",id:"foreColor"});break;case"align":h.push({type:"button",id:"alignLeft",tooltip:l(s.EDITOR_ALIGN_LEFT),iconName:K1.alignLeft,action:()=>t.exec("justifyLeft"),activeCheck:()=>t.isActive("justifyLeft")},{type:"button",id:"alignCenter",tooltip:l(s.EDITOR_ALIGN_CENTER),iconName:K1.alignCenter,action:()=>t.exec("justifyCenter"),activeCheck:()=>t.isActive("justifyCenter")},{type:"button",id:"alignRight",tooltip:l(s.EDITOR_ALIGN_RIGHT),iconName:K1.alignRight,action:()=>t.exec("justifyRight"),activeCheck:()=>t.isActive("justifyRight")},{type:"button",id:"alignJustify",tooltip:l(s.EDITOR_ALIGN_JUSTIFY),iconName:K1.alignJustify,action:()=>t.exec("justifyFull"),activeCheck:()=>t.isActive("justifyFull")});break;case"list":h.push({type:"button",id:"orderedList",tooltip:l(s.EDITOR_ORDERED_LIST),iconName:K1.orderedList,action:()=>t.exec("insertOrderedList"),activeCheck:()=>t.isActive("insertOrderedList")},{type:"button",id:"unorderedList",tooltip:l(s.EDITOR_UNORDERED_LIST),iconName:K1.unorderedList,action:()=>t.exec("insertUnorderedList"),activeCheck:()=>t.isActive("insertUnorderedList")});break;case"indent":h.push({type:"button",id:"indent",tooltip:l(s.EDITOR_INDENT),iconName:K1.indent,action:()=>t.handleIndent("indent")},{type:"button",id:"outdent",tooltip:l(s.EDITOR_OUTDENT),iconName:K1.outdent,action:()=>t.handleIndent("outdent")});break;case"link":h.push({type:"button",id:"link",tooltip:l(s.EDITOR_INSERT_LINK),iconName:K1.link,action:t.openLinkDialog});break;case"image":h.push({type:"button",id:"image",tooltip:l(s.EDITOR_INSERT_IMAGE),iconName:K1.image,action:t.openImageDialog});break;case"blockquote":h.push({type:"button",id:"blockquote",tooltip:l(s.EDITOR_BLOCKQUOTE),iconName:K1.blockquote,action:()=>t.applyBlock("blockquote")});break;case"clear":h.push({type:"button",id:"clear",tooltip:l(s.EDITOR_CLEAR_FORMAT),iconName:K1.clearFormat,action:()=>t.exec("removeFormat")});break;case"html":h.push({type:"button",id:"html",tooltip:l(s.EDITOR_HTML_SOURCE),iconName:K1.html,action:t.toggleHtmlMode,activeCheck:t.isHtmlMode});break}}),h}return{toolbarItems:e.computed(()=>d(o())),selectionTick:i,onSelectionChange:n,getItemActive:r,HEADING_GROUPS:gB,FONT_GROUPS:fB}}const xB={key:0,class:"vt-editor__toolbar-wrapper"},XB={key:0,class:"vt-editor__toolbar-sep"},GB=["value"],EB=["value"],_B=["onClick"],jB={class:"vt-editor__body"},JB=["contenteditable","data-placeholder"],KB={key:1,class:"vt-editor__error"},FB={class:"vt-editor__dialog-fields"},RB={class:"vt-editor__dialog-label"},UB={class:"vt-editor__dialog-label"},zB={class:"vt-editor__dialog-checkbox"},OB={class:"vt-modal__footer"},DB={class:"vt-editor__dialog-fields"},BB={class:"vt-editor__dialog-label"},PB={class:"vt-editor__dialog-label"},HB={class:"vt-modal__footer"},M2=e.defineComponent({__name:"VEditor",props:{modelValue:{},placeholder:{},toolbar:{default:()=>["history","format","heading","fontName","foreColor","align","list","indent","link","image","blockquote","clear","html"]},disabled:{type:Boolean,default:!1},required:{type:Boolean},errorMessage:{}},emits:["update:modelValue","input","change","focus","blur","validation"],setup(o,{expose:t,emit:l}){const{t:i}=f1(),n=o,r=l,d=e.ref(null),a=e.ref(null),p=e.ref(null),h=e.ref(!1),C=e.ref(!1),u=e.ref(""),Z=e.ref([]),b=e.ref(!0),I=e.ref(!1),w=e.ref(!1),y=e.ref("#000000"),f=e.ref("#ffffff");function Y(v){var c1;const B=v??((c1=d.value)==null?void 0:c1.innerHTML)??"",M1=ye(B);r("update:modelValue",M1),r("input",M1)}const{exec:m,isActive:g,applyBlock:T,applyFont:F,applyForeColor:k,applyBackColor:M,handleIndent:L}=YB(d,Y);function V(){if(d.value)if(!C.value)u.value=d.value.innerHTML,C.value=!0,e.nextTick(()=>{var v;return(v=p.value)==null?void 0:v.focus()});else{const v=ye(u.value);C.value=!1,e.nextTick(()=>{d.value&&(d.value.innerHTML=v,Y(v),d.value.focus())})}}function x(){const v=ye(u.value);r("update:modelValue",v),r("input",v)}const{linkState:W,openLinkDialog:G,confirmLink:E,cancelLink:R,imageState:P,openImageDialog:n1,confirmImage:U,cancelImage:S}=WB(v=>m("insertHTML",v),Y),{toolbarItems:N,onSelectionChange:X,getItemActive:Q,HEADING_GROUPS:q,FONT_GROUPS:s1}=TB(()=>n.toolbar,{exec:m,isActive:g,applyBlock:T,applyFont:F,handleIndent:L,openLinkDialog:G,openImageDialog:n1,toggleHtmlMode:V,isHtmlMode:()=>C.value});function I1(v){const B=v.target.value;y.value=B,k(B)}function m1(v){const B=v.target.value;f.value=B,M(B)}function d1(){const v=a.value;v&&(I.value=v.scrollLeft>2,w.value=v.scrollLeft+v.clientWidth<v.scrollWidth-2)}function S1(v){const B=a.value;B&&(B.scrollBy({left:v==="left"?-160:160,behavior:"smooth"}),setTimeout(d1,250))}function Y1(v){const B=[];n.required&&!y2(v).trim()&&B.push(i(s.VALIDATION_REQUIRED)),Z.value=B,b.value=B.length===0,r("validation",{isValid:b.value,errors:B})}const g1=e.computed(()=>n.errorMessage||Z.value[0]||""),y1=e.computed(()=>!!g1.value),D=e.computed(()=>["vt-editor",{"vt-editor--focused":h.value,"vt-editor--error":y1.value,"vt-editor--disabled":n.disabled}]);function A(){Y(),Y1(n.modelValue??"")}function i1(v){h.value=!0,r("focus",v)}function w1(v){h.value=!1,r("blur",v),Y1(n.modelValue??"")}function x1(v){v.key==="Tab"&&(v.preventDefault(),m("insertHTML"," "))}e.watch(()=>n.modelValue,v=>{!d.value||h.value||C.value||d.value.innerHTML!==v&&(d.value.innerHTML=v??"")}),e.onMounted(()=>{d.value&&n.modelValue&&(d.value.innerHTML=ye(n.modelValue)),document.addEventListener("selectionchange",X),e.nextTick(()=>{d1();const v=new ResizeObserver(d1);a.value&&v.observe(a.value)}),window.addEventListener("resize",d1)}),e.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",X),window.removeEventListener("resize",d1)});function T1(){var v;(v=d.value)==null||v.focus()}function U1(){var v;(v=d.value)==null||v.blur()}function z1(){d.value&&(d.value.innerHTML=""),Y(""),Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function z(){var v;return((v=d.value)==null?void 0:v.innerHTML)??""}function e1(){var v;return y2(((v=d.value)==null?void 0:v.innerHTML)??"")}function p1(v){const B=ye(v);d.value&&(d.value.innerHTML=B),Y(B)}function L1(v){var B;(B=d.value)==null||B.focus(),m("insertHTML",ye(v))}function F1(){return Y1(n.modelValue??""),b.value}function O1(){Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function t1(){return{isValid:b.value,errors:[...Z.value]}}function a1(){return d.value}return t({focus:T1,blur:U1,clear:z1,getHTML:z,getText:e1,setHTML:p1,insertHTML:L1,validate:F1,clearValidation:O1,getValidationState:t1,getEditorElement:a1}),(v,B)=>{const M1=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(D.value)},[!o.disabled&&e.unref(N).length?(e.openBlock(),e.createElementBlock("div",xB,[I.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--left",type:"button",onClick:B[0]||(B[0]=c1=>S1("left")),onMousedown:B[1]||(B[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(u1,{name:"arrowLeft"})],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"toolbarRef",ref:a,class:"vt-editor__toolbar",onScroll:d1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(c1,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe},[(c1==null?void 0:c1.type)==="separator"?(e.openBlock(),e.createElementBlock("span",XB)):(c1==null?void 0:c1.type)==="select"&&c1.id==="heading"?(e.openBlock(),e.createBlock(Ie,{key:1,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:B[3]||(B[3]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),Z1=>(e.openBlock(),e.createBlock(Ze,{key:Z1.value,onClick:G1=>e.unref(T)(Z1.value),onMousedown:B[2]||(B[2]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Z1.label),1)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(u1,{name:"tagType"},null,512),[[M1,e.unref(i)(e.unref(s).EDITOR_HEADING)]])]),_:1})):(c1==null?void 0:c1.type)==="select"&&c1.id==="fontName"?(e.openBlock(),e.createBlock(Ie,{key:2,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:B[5]||(B[5]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s1),Z1=>(e.openBlock(),e.createBlock(Ze,{key:Z1.value,onClick:G1=>e.unref(F)(Z1.value),onMousedown:B[4]||(B[4]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",{style:e.normalizeStyle({fontFamily:Z1.value})},e.toDisplayString(Z1.label),5)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(u1,{name:"fontName"},null,512),[[M1,e.unref(i)(e.unref(s).EDITOR_FONT)]])]),_:1})):(c1==null?void 0:c1.type)==="select"&&c1.id==="foreColor"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.withDirectives(e.createElementVNode("input",{value:y.value,class:"vt-editor__color-picker",type:"color",onInput:I1,onMousedown:B[6]||(B[6]=e.withModifiers(()=>{},["stop"]))},null,40,GB),[[M1,e.unref(i)(e.unref(s).EDITOR_FORE_COLOR)]]),e.withDirectives(e.createElementVNode("input",{value:f.value,class:"vt-editor__color-picker vt-editor__color-picker--bg",type:"color",onInput:m1,onMousedown:B[7]||(B[7]=e.withModifiers(()=>{},["stop"]))},null,40,EB),[[M1,e.unref(i)(e.unref(s).EDITOR_BACK_COLOR)]])],64)):(c1==null?void 0:c1.type)==="button"?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass([{"vt-editor__toolbar-btn--active":e.unref(Q)(c1)},"vt-editor__toolbar-btn"]),type:"button",onClick:Z1=>{var G1;return(G1=c1==null?void 0:c1.action)==null?void 0:G1.call(c1)},onMousedown:B[8]||(B[8]=e.withModifiers(()=>{},["prevent"]))},[c1!=null&&c1.iconName?(e.openBlock(),e.createBlock(u1,{key:0,name:c1.iconName},null,8,["name"])):e.createCommentVNode("",!0)],42,_B)),[[M1,c1==null?void 0:c1.tooltip]]):e.createCommentVNode("",!0)],64))),128))],544),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--right",type:"button",onClick:B[9]||(B[9]=c1=>S1("right")),onMousedown:B[10]||(B[10]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(u1,{name:"arrowRight"})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jB,[e.withDirectives(e.createElementVNode("div",{ref_key:"editorRef",ref:d,contenteditable:!o.disabled,"data-placeholder":o.placeholder,class:"vt-editor__content",onBlur:w1,onFocus:i1,onInput:A,onKeydown:x1},null,40,JB),[[e.vShow,!C.value]]),C.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,ref_key:"htmlSourceRef",ref:p,"onUpdate:modelValue":B[11]||(B[11]=c1=>u.value=c1),class:"vt-editor__html-source",onInput:x},null,544)),[[e.vModelText,u.value]]):e.createCommentVNode("",!0)]),g1.value?(e.openBlock(),e.createElementBlock("div",KB,e.toDisplayString(g1.value),1)):e.createCommentVNode("",!0),e.createVNode(Ne,{modelValue:e.unref(W).visible,"onUpdate:modelValue":B[19]||(B[19]=c1=>e.unref(W).visible=c1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_LINK_TITLE),size:"small",onClose:e.unref(R)},{default:e.withCtx(()=>[e.createElementVNode("div",FB,[e.createElementVNode("label",RB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[12]||(B[12]=c1=>e.unref(W).url=c1),class:"vt-editor__dialog-input",placeholder:"https://example.com",type:"url",onKeydown:[B[13]||(B[13]=e.withKeys((...c1)=>e.unref(E)&&e.unref(E)(...c1),["enter"])),B[14]||(B[14]=e.withKeys((...c1)=>e.unref(R)&&e.unref(R)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).url]]),e.createElementVNode("label",UB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_TEXT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[15]||(B[15]=c1=>e.unref(W).text=c1),class:"vt-editor__dialog-input",placeholder:"Link text",type:"text",onKeydown:[B[16]||(B[16]=e.withKeys((...c1)=>e.unref(E)&&e.unref(E)(...c1),["enter"])),B[17]||(B[17]=e.withKeys((...c1)=>e.unref(R)&&e.unref(R)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).text]]),e.createElementVNode("label",zB,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[18]||(B[18]=c1=>e.unref(W).openInNewTab=c1),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(W).openInNewTab]]),e.createTextVNode(" "+e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_NEW_TAB)),1)])]),e.createElementVNode("div",OB,[e.createVNode(j1,{onClick:e.unref(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(j1,{type:"primary",onClick:e.unref(E)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"]),e.createVNode(Ne,{modelValue:e.unref(P).visible,"onUpdate:modelValue":B[26]||(B[26]=c1=>e.unref(P).visible=c1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_IMAGE_TITLE),size:"small",onClose:e.unref(S)},{default:e.withCtx(()=>[e.createElementVNode("div",DB,[e.createElementVNode("label",BB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[20]||(B[20]=c1=>e.unref(P).url=c1),class:"vt-editor__dialog-input",placeholder:"https://example.com/image.png",type:"url",onKeydown:[B[21]||(B[21]=e.withKeys((...c1)=>e.unref(U)&&e.unref(U)(...c1),["enter"])),B[22]||(B[22]=e.withKeys((...c1)=>e.unref(S)&&e.unref(S)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(P).url]]),e.createElementVNode("label",PB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_ALT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[23]||(B[23]=c1=>e.unref(P).alt=c1),class:"vt-editor__dialog-input",placeholder:"Image description",type:"text",onKeydown:[B[24]||(B[24]=e.withKeys((...c1)=>e.unref(U)&&e.unref(U)(...c1),["enter"])),B[25]||(B[25]=e.withKeys((...c1)=>e.unref(S)&&e.unref(S)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(P).alt]])]),e.createElementVNode("div",HB,[e.createVNode(j1,{onClick:e.unref(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(j1,{type:"primary",onClick:e.unref(U)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])],2)}}}),vB={class:"vt-badge"},ht=e.defineComponent({__name:"VBadge",props:{content:{default:void 0},max:{default:99},dot:{type:Boolean,default:!1},color:{default:"danger"},position:{default:"top-end"},offsetX:{default:0},offsetY:{default:0},bordered:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(o){const t=o,l=e.computed(()=>t.dot?!0:t.content===void 0||t.content===null||t.content===""?!1:typeof t.content=="number"?t.content>0:!0),i=e.computed(()=>l.value&&!t.hidden),n=e.computed(()=>typeof t.content=="number"?t.content>t.max?`${t.max}+`:String(t.content):t.content),r=e.computed(()=>{if(!t.offsetX&&!t.offsetY)return{};const d=t.position.startsWith("top"),a=t.position.endsWith("end"),p={};return t.offsetX&&(p[a?"right":"left"]=`${-t.offsetX}px`),t.offsetY&&(p[d?"top":"bottom"]=`${-t.offsetY}px`),p});return(d,a)=>(e.openBlock(),e.createElementBlock("span",vB,[e.renderSlot(d.$slots,"default"),e.createVNode(e.Transition,{name:"vt-badge__fade"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-badge__content",[`vt-badge__content--${o.position}`,`vt-badge__content--${o.color}`,{"vt-badge__content--dot":o.dot,"vt-badge__content--bordered":o.bordered}]]),style:e.normalizeStyle(r.value)},[o.dot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(n.value),1)],64))],6)):e.createCommentVNode("",!0)]),_:1})]))}}),QB={class:"vt-app-bar__logo"},AB={key:0,class:"vt-app-bar__center"},$B={key:1,class:"vt-app-bar__actions"},S2=e.defineComponent({__name:"VAppBar",props:{sticky:{type:Boolean,default:!1}},setup(o){return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-app-bar",{"vt-app-bar--sticky":o.sticky}])},[e.createElementVNode("div",QB,[e.renderSlot(t.$slots,"logo")]),t.$slots.center?(e.openBlock(),e.createElementBlock("div",AB,[e.renderSlot(t.$slots,"center")])):e.createCommentVNode("",!0),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",$B,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)],2))}}),qB={class:"vt-nav-rail"},eP={class:"vt-nav-rail__list"},tP=["data-placement","onClick"],oP={key:0,class:"vt-nav-rail__divider"},lP={key:0,class:"vt-nav-rail__footer"},Y2=e.defineComponent({__name:"VNavRail",props:{items:{},modelValue:{default:null},placement:{default:"left"}},emits:["update:modelValue","select"],setup(o,{emit:t}){const l=t,i=n=>{n.disabled||(l("update:modelValue",n.key),l("select",n))};return(n,r)=>{const d=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("aside",qB,[e.createElementVNode("div",eP,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-nav-rail__item",{"vt-nav-rail__item--selected":o.modelValue===a.key,"vt-nav-rail__item--disabled":a.disabled}]),"data-placement":o.placement,onClick:h=>i(a)},[a.badge?(e.openBlock(),e.createBlock(ht,{key:0,content:a.badge.content,position:a.badge.position},{default:e.withCtx(()=>[e.createVNode(u1,{name:a.icon,width:24,height:24},null,8,["name"])]),_:2},1032,["content","position"])):(e.openBlock(),e.createBlock(u1,{key:1,name:a.icon,width:24,height:24},null,8,["name"]))],10,tP)),[[d,a.label]]),p<o.items.length-1?(e.openBlock(),e.createElementBlock("span",oP)):e.createCommentVNode("",!0)],64))),128))]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",lP,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)])}}}),nP=(o,t)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${t}`,l.innerText=o,Object.assign(l.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"});const i=document.createElement("div");switch(i.className="vt-tooltip__arrow",Object.assign(i.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),t){case"top":Object.assign(i.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(i.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(i.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(i.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(i),l},N2=(o,t,l)=>{const i=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,d=window.innerWidth,a=window.innerHeight,p=8,h=Math.min(300,d-p*2);o.style.maxWidth=`${h}px`;const C=o.getBoundingClientRect();let u=0,Z=0;switch(l){case"top":u=i.top+r-C.height-8,Z=i.left+n+(i.width-C.width)/2;break;case"bottom":u=i.bottom+r+8,Z=i.left+n+(i.width-C.width)/2;break;case"left":u=i.top+r+(i.height-C.height)/2,Z=i.left+n-C.width-8;break;case"right":u=i.top+r+(i.height-C.height)/2,Z=i.right+n+8;break}Z<p?Z=p:Z+C.width>d-p&&(Z=d-C.width-p),u<r+p?l==="top"?u=i.bottom+r+8:u=r+p:u+C.height>r+a-p&&(l==="bottom"?u=i.top+r-C.height-8:u=r+a-C.height-p),o.style.top=`${u}px`,o.style.left=`${Z}px`},iP=(o,t,l)=>{o.parentElement||document.body.appendChild(o),o.style.visibility="visible",N2(o,t,l),requestAnimationFrame(()=>{o.style.opacity="1"})},rP=o=>{o.style.opacity="0",o.style.visibility="hidden"},sP=o=>o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight,cP=o=>!!o.closest(".vt-table, table"),W2=o=>o.dataset.placement||"top",g2=o=>{var t;return((t=o.value)==null?void 0:t.trim())??""},f2=o=>{var t;(t=o.__tooltipEl)==null||t.remove(),delete o.__tooltipEl},T2={mounted(o,t){o.__tooltipText=g2(t);const l=()=>{const r=o.__tooltipText;if(!r||cP(o)&&!sP(o))return;const d=W2(o);o.__tooltipEl||(o.__tooltipEl=nP(r,d)),iP(o.__tooltipEl,o,d)},i=()=>{o.__tooltipEl&&rP(o.__tooltipEl)},n=()=>{var r;((r=o.__tooltipEl)==null?void 0:r.style.opacity)==="1"&&N2(o.__tooltipEl,o,W2(o))};o.__mouseenterHandler=l,o.__mouseleaveHandler=i,o.__scrollHandler=n,o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",i),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n)},updated(o,t){const l=g2(t);l!==o.__tooltipText&&(o.__tooltipText=l,l?o.__tooltipEl&&(o.__tooltipEl.firstChild.textContent=l):f2(o))},beforeUnmount(o){f2(o),delete o.__tooltipText,o.__mouseenterHandler&&(o.removeEventListener("mouseenter",o.__mouseenterHandler),delete o.__mouseenterHandler),o.__mouseleaveHandler&&(o.removeEventListener("mouseleave",o.__mouseleaveHandler),delete o.__mouseleaveHandler),o.__scrollHandler&&(window.removeEventListener("scroll",o.__scrollHandler,!0),window.removeEventListener("resize",o.__scrollHandler),delete o.__scrollHandler)}},x2={mounted(o,t){e.unref(t.value)&&X2(o)},updated(o,t){const l=e.unref(t.value),i=e.unref(t.oldValue);l!==i&&(l?X2(o):G2(o))},unmounted(o){G2(o)}};function X2(o){if(o._loaderEl)return;const t=document.createElement("div");t.className="vt-loader-base__overlay",t.innerHTML='<span class="vt-loader-base"></span>';const l=getComputedStyle(o).position;(l==="static"||!l)&&(o.style.position="relative"),o.appendChild(t),o._loaderEl=t}function G2(o){const t=o._loaderEl;t&&(t.remove(),delete o._loaderEl)}const dP={class:"vt-message-container"},aP={class:"vt-message-icon"},mP={class:"vt-message-content"},hP={key:0,class:"vt-message-title"},pP=["innerHTML"],CP={key:1,class:"vt-message-text"},uP=["onClick"],IP=e.defineComponent({__name:"VMessage",setup(o,{expose:t}){const l=e.ref([]);let i=0;const n=a=>({success:"checkCircle",danger:"alertCircle",warning:"alertTriangle",primary:"infoCircle"})[a]||"infoCircle",r=a=>{const p=++i,h={id:p,message:a.message||"",title:a.title||"",type:a.type||"primary",showClose:a.showClose||!1,duration:a.duration!==void 0?a.duration:3e3,dangerouslyUseHTMLString:a.dangerouslyUseHTMLString||!1};return l.value.push(h),h.duration&&h.duration>0&&setTimeout(()=>{d(p)},h.duration),p},d=a=>{const p=l.value.findIndex(h=>h.id===a);p>-1&&l.value.splice(p,1)};return t({addMessage:r,removeMessage:d}),(a,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",dP,[e.createVNode(e.TransitionGroup,{name:"vt-message",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["vt-message-item",`vt-message-item--${h.type}`,{"vt-message-item--closable":h.showClose}])},[e.createElementVNode("div",aP,[e.createVNode(u1,{color:h.type==="primary"?"#00475A":"",name:n(h.type)},null,8,["color","name"])]),e.createElementVNode("div",mP,[h.title?(e.openBlock(),e.createElementBlock("div",hP,e.toDisplayString(h.title),1)):e.createCommentVNode("",!0),h.message?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-message-text",innerHTML:h.message},null,8,pP)):(e.openBlock(),e.createElementBlock("div",CP,e.toDisplayString(h.message),1))],64)):e.createCommentVNode("",!0)]),h.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-message-close",type:"button",onClick:C=>d(h.id)},[e.createVNode(u1,{name:"close"})],8,uP)):e.createCommentVNode("",!0)],2))),128))]),_:1})])]))}});class ZP{constructor(){this.messageInstance=null,this.app=null,this.container=null}call(t={}){return this.ensureInstance().addMessage({message:t.message||"",title:t.title||"",type:t.type||"primary",showClose:t.showClose||!1,duration:t.duration!==void 0?t.duration:3e3,dangerouslyUseHTMLString:t.dangerouslyUseHTMLString||!1})}success(t,l={}){return this.call({...l,message:t,type:"success"})}danger(t,l={}){return this.call({...l,message:t,type:"danger"})}warning(t,l={}){return this.call({...l,message:t,type:"warning"})}primary(t,l={}){return this.call({...l,message:t,type:"primary"})}close(t){this.messageInstance&&this.messageInstance.removeMessage(t)}closeAll(){this.messageInstance&&(this.messageInstance.messages=[]),this.container&&this.container.parentNode&&document.body.removeChild(this.container),this.app&&this.app.unmount(),this.messageInstance=null,this.app=null,this.container=null}getOpenMessagesCount(){return this.messageInstance?this.messageInstance.messages.length:0}ensureInstance(){return this.messageInstance?this.messageInstance:(this.container=document.createElement("div"),this.container.setAttribute("data-vt-message-container",""),document.body.appendChild(this.container),this.app=e.createApp(IP),this.messageInstance=this.app.mount(this.container),this.messageInstance)}}const se=new ZP,pt=Object.assign((o={})=>se.call(o),{success:(o,t={})=>se.success(o,t),danger:(o,t={})=>se.danger(o,t),warning:(o,t={})=>se.warning(o,t),primary:(o,t={})=>se.primary(o,t),close:o=>{se.close(o)},closeAll:()=>{se.closeAll()}}),E2={install(o){o.config.globalProperties.$message=pt,o.provide("$message",pt),o.config.globalProperties.$messageStack={closeAll:()=>se.closeAll(),getCount:()=>se.getOpenMessagesCount(),closeById:t=>se.close(t)}}},kP={sortable:!0,actionColumn:!1,showOverflowTooltip:!0,visible:!0,pinnedLeft:!1,pinnedRight:!1,manage:!1};function bP(o){ut(o)}const _2={install(o,t={}){const{prefix:l="V",modal:i=!0,message:n=!0,locale:r=ie.uk}=t;o.component(`${l}Button`,j1),o.component(`${l}Icon`,u1),o.component(`${l}Loader`,Ye),o.component(`${l}Modal`,Ne),o.component(`${l}Pagination`,wt),o.component(`${l}Checkbox`,ne),o.component(`${l}Radiobox`,Lt),o.component(`${l}Table`,Yt),o.component(`${l}TableColumn`,Nt),o.component(`${l}Dropdown`,Ie),o.component(`${l}DropdownItem`,Ze),o.component(`${l}Input`,we),o.component(`${l}Select`,_e),o.component(`${l}Option`,je),o.component(`${l}DatePicker`,_t),o.component(`${l}TimePicker`,fe),o.component(`${l}Collapse`,jt),o.component(`${l}CollapseItem`,Jt),o.component(`${l}Tabs`,Kt),o.component(`${l}TabItem`,Ft),o.component(`${l}Upload`,zt),o.component(`${l}Sidebar`,Ot),o.component(`${l}Login`,At),o.component(`${l}LoginLogo`,$t),o.component(`${l}LocaleSelect`,Wt),o.component(`${l}DynamicFilter`,qt),o.component(`${l}Slider`,e2),o.component(`${l}SliderMarkRange`,t2),o.component(`${l}Chart`,l2),o.component(`${l}InfoBox`,n2),o.component(`${l}TransferList`,i2),o.component(`${l}Avatar`,r2),o.component(`${l}AvatarUpload`,c2),o.component(`${l}ImageFullscreen`,a2),o.component(`${l}Breadcrumb`,m2),o.component(`${l}BreadcrumbItem`,h2),o.component(`${l}Audio`,w2),o.component(`${l}Empty`,Ke),o.component(`${l}Editor`,M2),o.component(`${l}Badge`,ht),o.component(`${l}AppBar`,S2),o.component(`${l}NavRail`,Y2),o.directive("tooltip",T2),o.directive("loader",x2),i&&o.use(St),n&&o.use(E2),o.use(tJ,{locale:r})}},VP=_2.install;o1.DEFAULT_COLUMN_CONFIG=kP,o1.DEFAULT_FORMATS=gt,o1.DEFAULT_TIME_FORMATS=ge,o1.DropdownContextKey=Ae,o1.FORMAT_TOKENS=nF,o1.FileParser=Te,o1.FileValidator=ke,o1.LANGUAGES=ie,o1.VAppBar=S2,o1.VAudio=w2,o1.VAvatar=r2,o1.VAvatarUpload=c2,o1.VBadge=ht,o1.VBreadcrumb=m2,o1.VBreadcrumbItem=h2,o1.VButton=j1,o1.VChart=l2,o1.VCheckbox=ne,o1.VCollapse=jt,o1.VCollapseItem=Jt,o1.VColorPicker=zD,o1.VDatePicker=_t,o1.VDropdown=Ie,o1.VDropdownItem=Ze,o1.VDynamicFilter=qt,o1.VEditor=M2,o1.VEmpty=Ke,o1.VIcon=u1,o1.VImageFullscreen=a2,o1.VInfoBox=n2,o1.VInput=we,o1.VLoader=Ye,o1.VLocaleSelect=Wt,o1.VLogin=At,o1.VLoginLogo=$t,o1.VMessage=pt,o1.VMessagePlugin=E2,o1.VModal=Ne,o1.VModalPlugin=St,o1.VNavRail=Y2,o1.VOption=je,o1.VPagination=wt,o1.VRadiobox=Lt,o1.VSelect=_e,o1.VSidebar=Ot,o1.VSlider=e2,o1.VSliderMarkRange=t2,o1.VTabItem=Ft,o1.VTable=Yt,o1.VTableColumn=Nt,o1.VTabs=Kt,o1.VTimePicker=fe,o1.VTimerDuration=BD,o1.VTransferList=i2,o1.VUpload=zt,o1.VtSelectContextKey=Pe,o1.containUpperCaseLetter=vt,o1.default=_2,o1.email=Dt,o1.formatTime=Gt,o1.generateTimeOptions=Ue,o1.iconGroups=Jj,o1.install=VP,o1.isValidDate=et,o1.isValidTimeString=Re,o1.loaderDirective=x2,o1.maxLength=ez,o1.maxNumber=oz,o1.messageManager=se,o1.minLength=tt,o1.minNumber=tz,o1.mk=qU,o1.modalManager=ae,o1.noSpaces=ot,o1.numeric=Pt,o1.parseTimeString=Et,o1.pattern=nz,o1.phoneNumber=Ht,o1.required=ze,o1.sameAs=lz,o1.setLocale=bP,o1.tooltipDirective=T2,o1.uniqueAsync=iz,o1.url=Bt,o1.useValidate=Qt,o1.validateDateValue=ft,o1.validateTimeValue=xt,o1.withAsync=$U,o1.withMessage=AU,o1.withName=he,o1.withParams=QU,Object.defineProperties(o1,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
104
|
+
</svg>`,S),d=new WeakMap,{t:a}=f1(),p=o,h=l,C=e.computed(()=>!!(p.userA||p.userB)),u=e.ref(!1),Z=e.computed(()=>p.disabled||u.value),b=e.ref(!1),I=e.ref(1),w=e.ref(`ws-${Math.random().toString(36).slice(2,9)}`),y=e.ref(null),f=e.ref(null),Y=e.ref(null),m=e.ref(null),g=e.ref(null),T=e.computed(()=>p.type==="channel-routed"),F=(U,S)=>{var D;const N=S.canvas,{width:X,height:Q}=N,q=(D=y.value)==null?void 0:D.decodedData,s1=N.getBoundingClientRect(),I1=s1.width>0?X/s1.width:1,m1=s1.height>0?Q/s1.height:1;if(!U.length&&!q){S.fillStyle=Ce.WAVE_DEFAULT,S.fillRect(0,Q/2,X,2);return}const d1=C.value&&q&&q.numberOfChannels>=2?[q.getChannelData(0),q.getChannelData(1)]:[U[0]||new Float32Array(X).fill(0)];S.clearRect(0,0,X,Q);const S1=20*m1,g1=20*I1,y1=[];if(d1.forEach((A,i1)=>{const w1=Q/d1.length,x1=w1-(C.value?S1:0),T1=i1*w1+(C.value?S1:0)+x1/2,U1=A.length/X;let z1=0;for(let z=0;z<A.length;z+=100){const e1=Math.abs(A[z]??0);e1>z1&&(z1=e1)}z1===0&&(z1=1),S.fillStyle=Ce.WAVE_DEFAULT;for(let z=0;z<X;z+=2){const e1=Math.floor(z*U1),p1=Math.min(Math.floor((z+2)*U1),A.length-1);let L1=0;for(let t1=e1;t1<=p1;t1++){const a1=Math.abs(A[t1]??0);a1>L1&&(L1=a1)}const F1=L1/z1,O1=Math.max(F1*x1*.85,2);S.fillRect(z,T1-O1/2,1.5,O1)}if(C.value){S.fillStyle="#999999",S.font=`${12*I1}px Inter, sans-serif`,S.textAlign="right";const z=(i1===0?p.userA:p.userB)??"";S.fillText(z,X-10*I1,i1*w1+S1-5*m1);const e1=i1,p1=5*I1,L1=i1*w1+1*m1;((e1===0?x.value:W.value)===0?r:n)(e1===0?Ce.CHANNEL_A:Ce.CHANNEL_B,O1=>S.drawImage(O1,p1,L1,g1,g1)),y1.push({x:p1,y:L1,width:g1,height:g1,channelIdx:e1})}}),C.value){const A=d.get(N);A&&N.removeEventListener("click",A);const i1=w1=>{if(Z.value)return;const x1=N.getBoundingClientRect(),T1=x1.width>0?N.width/x1.width:1,U1=x1.height>0?N.height/x1.height:1,z1=(w1.clientX-x1.left)*T1,z=(w1.clientY-x1.top)*U1;for(const e1 of y1)if(z1>=e1.x&&z1<=e1.x+e1.width&&z>=e1.y&&z<=e1.y+e1.height){w1.stopPropagation(),w1.preventDefault(),G(e1.channelIdx);const p1=(e1.channelIdx===0?x.value:W.value)===0;S.save(),S.clearRect(e1.x,e1.y,e1.width,e1.height),(p1?r:n)(e1.channelIdx===0?Ce.CHANNEL_A:Ce.CHANNEL_B,L1=>S.drawImage(L1,e1.x,e1.y,e1.width,e1.height)),S.restore();break}};N.addEventListener("click",i1),d.set(N,i1)}},k=e.computed(()=>{if(p.height){const U=parseInt(p.height,10);if(!isNaN(U))return U}return T.value?36:C.value?100:50}),M=()=>{var Q;const U=(Q=y.value)==null?void 0:Q.getMediaElement();if(!U)return;Y.value=new(window.AudioContext||window.webkitAudioContext);const S=Y.value.createMediaElementSource(U),N=Y.value.createChannelSplitter(2),X=Y.value.createChannelMerger(2);m.value=Y.value.createGain(),g.value=Y.value.createGain(),m.value.gain.value=x.value,g.value.gain.value=W.value,S.connect(N),N.connect(m.value,0),N.connect(g.value,1),C.value?(m.value.connect(X,0,0),g.value.connect(X,0,1)):(m.value.connect(X,0,0),m.value.connect(X,0,1),g.value.connect(X,0,0),g.value.connect(X,0,1)),X.connect(Y.value.destination)},L=()=>{var U;(U=Y.value)==null||U.close(),Y.value=null,m.value=null,g.value=null},V=()=>{if(!p.recordUrl)return;u.value=!1;const U=Ge.create({container:`#waveform-${w.value}`,waveColor:Ce.WAVE_DEFAULT,progressColor:Ce.PROGRESS,barWidth:2,height:k.value,plugins:T.value?[]:[mt.create({container:f.value,style:{fontSize:"10px",color:"#999"}})],renderFunction:(S,N)=>F(S,N)});y.value=U,y.value.on("play",()=>{b.value=!0,h("play")}),y.value.on("pause",()=>{b.value=!1,h("pause")}),y.value.on("timeupdate",S=>h("timeUpdate",S)),y.value.on("finish",()=>{b.value=!1,h("ended")}),y.value.on("error",()=>{u.value=!0,h("error")}),(C.value||T.value)&&y.value.on("ready",()=>{M()}),y.value.load(p.recordUrl)},x=e.ref(1),W=e.ref(1),G=U=>{const S=U===0?m.value:g.value,N=U===0?x:W;N.value=N.value?0:1,S&&(S.gain.value=N.value)},E=async()=>{if(!(!y.value||Z.value)){if(T.value){const U=y.value.getMediaElement();if(!U||!Y.value)return;Y.value.state==="suspended"&&await Y.value.resume(),U.paused?await U.play():U.pause();return}b.value?y.value.pause():y.value.play()}},R=U=>{var S;I.value=U,(S=y.value)==null||S.setPlaybackRate(I.value)},P=(U,S)=>{if(U.startsWith("data:")){const X=document.createElement("a");X.href=U,X.download=S,document.body.appendChild(X),X.click(),document.body.removeChild(X)}else fetch(U).then(X=>X.blob()).then(X=>{const Q=document.createElement("a");Q.href=URL.createObjectURL(X),Q.download=S,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q)}).catch(console.error)},n1=()=>{if(p.disabled||!p.recordUrl)return;const U=p.recordUrl.indexOf("?"),S=p.recordUrl.substring(p.recordUrl.lastIndexOf("/")+1,U===-1?void 0:U);P(p.recordUrl,S)};return e.onMounted(()=>e.nextTick(V)),e.onBeforeUnmount(()=>{var U;(U=y.value)==null||U.destroy(),L()}),e.watch(()=>p.recordUrl,()=>{var U;(U=y.value)==null||U.destroy(),L(),e.nextTick(V)}),t({play:()=>{var U;return(U=y.value)==null?void 0:U.play()},pause:()=>{var U;return(U=y.value)==null?void 0:U.pause()},getCurrentTime:()=>{var U;return((U=y.value)==null?void 0:U.getCurrentTime())||0}}),(U,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"is-disabled":Z.value,"is-channel-routed":T.value},"vt-audio"])},[o.recordUrl?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([{"is-single-channel":!C.value,"is-channel-routed":T.value},"vt-audio__container"])},[o.playPosition==="left"?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:E},[b.value?e.renderSlot(U.$slots,"icon-pause",{key:0},()=>[e.createVNode(u1,{height:"20",name:"pause",width:"20"})]):e.renderSlot(U.$slots,"icon-play",{key:1},()=>[e.createVNode(u1,{height:"20",name:"start",width:"20"})])],8,hB)):e.createCommentVNode("",!0),e.createElementVNode("div",pB,[e.createElementVNode("div",{id:`waveform-${w.value}`,class:"vt-audio__waveform"},null,8,CB),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"timelineContainer",ref:f,class:"vt-audio__timeline"},null,512))]),e.createElementVNode("div",uB,[p.download?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:Z.value,class:"vt-audio__btn",onClick:n1},[e.createVNode(u1,{height:"20",name:"import",width:"20"})],8,IB)):e.createCommentVNode("",!0),o.playPosition==="right"?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:Z.value,class:"vt-audio__btn vt-audio__btn--main",onClick:E},[b.value?e.renderSlot(U.$slots,"icon-pause",{key:0},()=>[e.createVNode(u1,{height:"20",name:"pause",width:"20"})]):e.renderSlot(U.$slots,"icon-play",{key:1},()=>[e.createVNode(u1,{height:"20",name:"start",width:"20"})])],8,ZB)):e.createCommentVNode("",!0),e.createVNode(Ie,{disabled:Z.value,placement:"top",trigger:"click",onCommand:R},{dropdown:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList([.5,1,1.5,2],N=>e.createVNode(Ze,{key:N,class:e.normalizeClass({"is-active":I.value===N}),command:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N)+"x ",1)]),_:2},1032,["class","command"])),64))]),default:e.withCtx(()=>[e.createElementVNode("button",{disabled:Z.value,class:"vt-audio__speed-val"},e.toDisplayString(I.value)+"x",9,kB)]),_:1},8,["disabled"])])],2)):(e.openBlock(),e.createElementBlock("div",aB,[e.renderSlot(U.$slots,"empty",{},()=>[T.value?(e.openBlock(),e.createElementBlock("span",mB,e.toDisplayString(e.unref(a)(e.unref(s).AUDIO_EMPTY)),1)):(e.openBlock(),e.createBlock(Ke,{key:0,text:e.unref(a)(e.unref(s).AUDIO_EMPTY),icon:"noSound"},null,8,["text"]))])]))],2))}}),bB=new Set(["p","div","br","hr","h1","h2","h3","h4","h5","h6","blockquote","pre","code","ul","ol","li","b","strong","i","em","u","s","strike","del","sub","sup","font","span","a","img","table","thead","tbody","tfoot","tr","th","td","caption"]),VB=new Set(["style","class","href","target","rel","src","alt","width","height","face","size","color","colspan","rowspan"]),wB=new Set(["behavior","-moz-binding","filter"]),LB=/expression\s*\(|javascript\s*:|vbscript\s*:/i;function yB(o){const t=document.createElement("span");t.setAttribute("style",o);const l=t.style,i=[];for(let n=0;n<l.length;n++){const r=l[n],d=l.getPropertyValue(r);wB.has(r)||LB.test(d)||/url\s*\(/i.test(d)&&!/url\s*\(\s*['"]?data:image\//i.test(d)||i.push(`${r}:${d}`)}return i.join(";")}const MB=new Set(["https:","http:","ftp:","mailto:","tel:"]);function SB(o){const t=o.trim();if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const l=new URL(t);return MB.has(l.protocol)}catch{return!/^[a-z][a-z0-9+\-.]*:/i.test(t)}}function L2(o){var r,d,a;if(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.PROCESSING_INSTRUCTION_NODE){(r=o.parentNode)==null||r.removeChild(o);return}if(o.nodeType!==Node.ELEMENT_NODE)return;const t=o,l=t.tagName.toLowerCase();if(!bB.has(l)){for(;t.firstChild;)(d=t.parentNode)==null||d.insertBefore(t.firstChild,t);(a=t.parentNode)==null||a.removeChild(t);return}const i=Array.from(t.attributes);for(const p of i){const h=p.name.toLowerCase();if(h.startsWith("on")){t.removeAttribute(p.name);continue}if(!VB.has(h)){t.removeAttribute(p.name);continue}if((h==="href"||h==="src")&&!SB(p.value)){t.removeAttribute(p.name);continue}if(h==="style"){const C=yB(p.value);C?t.setAttribute("style",C):t.removeAttribute("style");continue}}l==="a"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer");const n=Array.from(t.childNodes);for(let p=n.length-1;p>=0;p--)L2(n[p])}function ye(o){if(!o)return"";const t=new DOMParser().parseFromString(o,"text/html");t.head.innerHTML="";const l=Array.from(t.body.childNodes);for(let i=l.length-1;i>=0;i--)L2(l[i]);return t.body.innerHTML}function y2(o){const t=document.createElement("div");return t.innerHTML=o,t.textContent??t.innerText??""}function YB(o,t){function l(h,C){o.value&&(o.value.focus(),document.execCommand(h,!1,C??""),t())}function i(h){try{return document.queryCommandState(h)}catch{return!1}}function n(h){o.value&&(o.value.focus(),document.execCommand("formatBlock",!1,h),t())}function r(h){o.value&&(o.value.focus(),document.execCommand("fontName",!1,h),t())}function d(h){o.value&&(o.value.focus(),document.execCommand("foreColor",!1,h),t())}function a(h){o.value&&(o.value.focus(),document.execCommand("hiliteColor",!1,h),t())}function p(h){const C=window.getSelection();if(!C||C.rangeCount===0)return;let u=C.anchorNode;u.nodeType===Node.TEXT_NODE&&(u=u.parentElement);const Z=u.closest(".vt-editor__content > *");if(!Z)return;const b=parseInt(Z.style.marginLeft||"0",10),I=20,w=h==="indent"?b+I:Math.max(0,b-I);Z.style.marginLeft=w?`${w}px`:"",t()}return{exec:l,isActive:i,applyBlock:n,applyFont:r,applyForeColor:d,applyBackColor:a,handleIndent:p}}function NB(){let o=null;function t(){const r=window.getSelection();r&&r.rangeCount>0&&(o=r.getRangeAt(0).cloneRange())}function l(){if(!o)return;const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}function i(){o=null}function n(){return o}return{saveSelection:t,restoreSelection:l,clearSavedRange:i,getSavedRange:n}}function WB(o,t){const{saveSelection:l,restoreSelection:i,clearSavedRange:n,getSavedRange:r}=NB(),d=e.ref({visible:!1,url:"",text:"",openInNewTab:!1});function a(){var f,Y;l();const I=window.getSelection(),w=(I==null?void 0:I.toString())??"",y=(Y=(f=I==null?void 0:I.anchorNode)==null?void 0:f.parentElement)==null?void 0:Y.closest("a");d.value={visible:!0,url:(y==null?void 0:y.getAttribute("href"))??"",text:w,openInNewTab:(y==null?void 0:y.getAttribute("target"))==="_blank"}}function p(){i();const{url:I,text:w,openInNewTab:y}=d.value;if(!I){h();return}const f=document.createElement("a");f.href=I,f.textContent=w||I,y&&f.setAttribute("target","_blank"),f.setAttribute("rel","noopener noreferrer");const Y=r(),m=window.getSelection();m&&m.rangeCount>0&&Y?(Y.deleteContents(),Y.insertNode(f)):o(f.outerHTML),h(),t()}function h(){d.value={visible:!1,url:"",text:"",openInNewTab:!1},n()}const C=e.ref({visible:!1,url:"",alt:""});function u(){l(),C.value={visible:!0,url:"",alt:""}}function Z(){i();const{url:I,alt:w}=C.value;if(!I){b();return}o(`<img src="${I}" alt="${w}" style="max-width:100%;" />`),b()}function b(){C.value={visible:!1,url:"",alt:""},n()}return{linkState:d,openLinkDialog:a,confirmLink:p,cancelLink:h,imageState:C,openImageDialog:u,confirmImage:Z,cancelImage:b}}const K1={undo:"undo",redo:"redo",bold:"textBold",italic:"textItalic",underline:"textUnderline",strikethrough:"textStrikethrough",subscript:"subscript",superscript:"superscript",orderedList:"orderedList",unorderedList:"unorderedList",indent:"indent",outdent:"outdent",alignLeft:"alignLeft",alignCenter:"alignCenter",alignRight:"alignRight",alignJustify:"alignJustify",link:"link",image:"image",blockquote:"blockquote",clearFormat:"clearFormat",html:"html"},gB=[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],fB=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"}];function TB(o,t){const{t:l}=f1(),i=e.ref(0);function n(){i.value++}function r(p){var h;return i.value,((h=p.activeCheck)==null?void 0:h.call(p))??!1}function d(p){const h=[];return p.forEach((C,u)=>{switch(u>0&&h.push({type:"separator"}),C){case"history":h.push({type:"button",id:"undo",tooltip:l(s.EDITOR_UNDO),iconName:K1.undo,action:()=>t.exec("undo")},{type:"button",id:"redo",tooltip:l(s.EDITOR_REDO),iconName:K1.redo,action:()=>t.exec("redo")});break;case"format":h.push({type:"button",id:"bold",tooltip:l(s.EDITOR_BOLD),iconName:K1.bold,action:()=>t.exec("bold"),activeCheck:()=>t.isActive("bold")},{type:"button",id:"italic",tooltip:l(s.EDITOR_ITALIC),iconName:K1.italic,action:()=>t.exec("italic"),activeCheck:()=>t.isActive("italic")},{type:"button",id:"underline",tooltip:l(s.EDITOR_UNDERLINE),iconName:K1.underline,action:()=>t.exec("underline"),activeCheck:()=>t.isActive("underline")},{type:"button",id:"strikethrough",tooltip:l(s.EDITOR_STRIKETHROUGH),iconName:K1.strikethrough,action:()=>t.exec("strikethrough"),activeCheck:()=>t.isActive("strikeThrough")});break;case"script":h.push({type:"button",id:"subscript",tooltip:l(s.EDITOR_SUBSCRIPT),iconName:K1.subscript,action:()=>t.exec("subscript"),activeCheck:()=>t.isActive("subscript")},{type:"button",id:"superscript",tooltip:l(s.EDITOR_SUPERSCRIPT),iconName:K1.superscript,action:()=>t.exec("superscript"),activeCheck:()=>t.isActive("superscript")});break;case"heading":h.push({type:"select",id:"heading"});break;case"fontName":h.push({type:"select",id:"fontName"});break;case"foreColor":h.push({type:"select",id:"foreColor"});break;case"align":h.push({type:"button",id:"alignLeft",tooltip:l(s.EDITOR_ALIGN_LEFT),iconName:K1.alignLeft,action:()=>t.exec("justifyLeft"),activeCheck:()=>t.isActive("justifyLeft")},{type:"button",id:"alignCenter",tooltip:l(s.EDITOR_ALIGN_CENTER),iconName:K1.alignCenter,action:()=>t.exec("justifyCenter"),activeCheck:()=>t.isActive("justifyCenter")},{type:"button",id:"alignRight",tooltip:l(s.EDITOR_ALIGN_RIGHT),iconName:K1.alignRight,action:()=>t.exec("justifyRight"),activeCheck:()=>t.isActive("justifyRight")},{type:"button",id:"alignJustify",tooltip:l(s.EDITOR_ALIGN_JUSTIFY),iconName:K1.alignJustify,action:()=>t.exec("justifyFull"),activeCheck:()=>t.isActive("justifyFull")});break;case"list":h.push({type:"button",id:"orderedList",tooltip:l(s.EDITOR_ORDERED_LIST),iconName:K1.orderedList,action:()=>t.exec("insertOrderedList"),activeCheck:()=>t.isActive("insertOrderedList")},{type:"button",id:"unorderedList",tooltip:l(s.EDITOR_UNORDERED_LIST),iconName:K1.unorderedList,action:()=>t.exec("insertUnorderedList"),activeCheck:()=>t.isActive("insertUnorderedList")});break;case"indent":h.push({type:"button",id:"indent",tooltip:l(s.EDITOR_INDENT),iconName:K1.indent,action:()=>t.handleIndent("indent")},{type:"button",id:"outdent",tooltip:l(s.EDITOR_OUTDENT),iconName:K1.outdent,action:()=>t.handleIndent("outdent")});break;case"link":h.push({type:"button",id:"link",tooltip:l(s.EDITOR_INSERT_LINK),iconName:K1.link,action:t.openLinkDialog});break;case"image":h.push({type:"button",id:"image",tooltip:l(s.EDITOR_INSERT_IMAGE),iconName:K1.image,action:t.openImageDialog});break;case"blockquote":h.push({type:"button",id:"blockquote",tooltip:l(s.EDITOR_BLOCKQUOTE),iconName:K1.blockquote,action:()=>t.applyBlock("blockquote")});break;case"clear":h.push({type:"button",id:"clear",tooltip:l(s.EDITOR_CLEAR_FORMAT),iconName:K1.clearFormat,action:()=>t.exec("removeFormat")});break;case"html":h.push({type:"button",id:"html",tooltip:l(s.EDITOR_HTML_SOURCE),iconName:K1.html,action:t.toggleHtmlMode,activeCheck:t.isHtmlMode});break}}),h}return{toolbarItems:e.computed(()=>d(o())),selectionTick:i,onSelectionChange:n,getItemActive:r,HEADING_GROUPS:gB,FONT_GROUPS:fB}}const xB={key:0,class:"vt-editor__toolbar-wrapper"},XB={key:0,class:"vt-editor__toolbar-sep"},GB=["value"],EB=["value"],_B=["onClick"],jB={class:"vt-editor__body"},JB=["contenteditable","data-placeholder"],KB={key:1,class:"vt-editor__error"},FB={class:"vt-editor__dialog-fields"},RB={class:"vt-editor__dialog-label"},UB={class:"vt-editor__dialog-label"},zB={class:"vt-editor__dialog-checkbox"},OB={class:"vt-modal__footer"},DB={class:"vt-editor__dialog-fields"},BB={class:"vt-editor__dialog-label"},PB={class:"vt-editor__dialog-label"},HB={class:"vt-modal__footer"},M2=e.defineComponent({__name:"VEditor",props:{modelValue:{},placeholder:{},toolbar:{default:()=>["history","format","heading","fontName","foreColor","align","list","indent","link","image","blockquote","clear","html"]},disabled:{type:Boolean,default:!1},required:{type:Boolean},errorMessage:{}},emits:["update:modelValue","input","change","focus","blur","validation"],setup(o,{expose:t,emit:l}){const{t:i}=f1(),n=o,r=l,d=e.ref(null),a=e.ref(null),p=e.ref(null),h=e.ref(!1),C=e.ref(!1),u=e.ref(""),Z=e.ref([]),b=e.ref(!0),I=e.ref(!1),w=e.ref(!1),y=e.ref("#000000"),f=e.ref("#ffffff");function Y(v){var c1;const B=v??((c1=d.value)==null?void 0:c1.innerHTML)??"",M1=ye(B);r("update:modelValue",M1),r("input",M1)}const{exec:m,isActive:g,applyBlock:T,applyFont:F,applyForeColor:k,applyBackColor:M,handleIndent:L}=YB(d,Y);function V(){if(d.value)if(!C.value)u.value=d.value.innerHTML,C.value=!0,e.nextTick(()=>{var v;return(v=p.value)==null?void 0:v.focus()});else{const v=ye(u.value);C.value=!1,e.nextTick(()=>{d.value&&(d.value.innerHTML=v,Y(v),d.value.focus())})}}function x(){const v=ye(u.value);r("update:modelValue",v),r("input",v)}const{linkState:W,openLinkDialog:G,confirmLink:E,cancelLink:R,imageState:P,openImageDialog:n1,confirmImage:U,cancelImage:S}=WB(v=>m("insertHTML",v),Y),{toolbarItems:N,onSelectionChange:X,getItemActive:Q,HEADING_GROUPS:q,FONT_GROUPS:s1}=TB(()=>n.toolbar,{exec:m,isActive:g,applyBlock:T,applyFont:F,handleIndent:L,openLinkDialog:G,openImageDialog:n1,toggleHtmlMode:V,isHtmlMode:()=>C.value});function I1(v){const B=v.target.value;y.value=B,k(B)}function m1(v){const B=v.target.value;f.value=B,M(B)}function d1(){const v=a.value;v&&(I.value=v.scrollLeft>2,w.value=v.scrollLeft+v.clientWidth<v.scrollWidth-2)}function S1(v){const B=a.value;B&&(B.scrollBy({left:v==="left"?-160:160,behavior:"smooth"}),setTimeout(d1,250))}function Y1(v){const B=[];n.required&&!y2(v).trim()&&B.push(i(s.VALIDATION_REQUIRED)),Z.value=B,b.value=B.length===0,r("validation",{isValid:b.value,errors:B})}const g1=e.computed(()=>n.errorMessage||Z.value[0]||""),y1=e.computed(()=>!!g1.value),D=e.computed(()=>["vt-editor",{"vt-editor--focused":h.value,"vt-editor--error":y1.value,"vt-editor--disabled":n.disabled}]);function A(){Y(),Y1(n.modelValue??"")}function i1(v){h.value=!0,r("focus",v)}function w1(v){h.value=!1,r("blur",v),Y1(n.modelValue??"")}function x1(v){v.key==="Tab"&&(v.preventDefault(),m("insertHTML"," "))}e.watch(()=>n.modelValue,v=>{!d.value||h.value||C.value||d.value.innerHTML!==v&&(d.value.innerHTML=v??"")}),e.onMounted(()=>{d.value&&n.modelValue&&(d.value.innerHTML=ye(n.modelValue)),document.addEventListener("selectionchange",X),e.nextTick(()=>{d1();const v=new ResizeObserver(d1);a.value&&v.observe(a.value)}),window.addEventListener("resize",d1)}),e.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",X),window.removeEventListener("resize",d1)});function T1(){var v;(v=d.value)==null||v.focus()}function U1(){var v;(v=d.value)==null||v.blur()}function z1(){d.value&&(d.value.innerHTML=""),Y(""),Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function z(){var v;return((v=d.value)==null?void 0:v.innerHTML)??""}function e1(){var v;return y2(((v=d.value)==null?void 0:v.innerHTML)??"")}function p1(v){const B=ye(v);d.value&&(d.value.innerHTML=B),Y(B)}function L1(v){var B;(B=d.value)==null||B.focus(),m("insertHTML",ye(v))}function F1(){return Y1(n.modelValue??""),b.value}function O1(){Z.value=[],b.value=!0,r("validation",{isValid:!0,errors:[]})}function t1(){return{isValid:b.value,errors:[...Z.value]}}function a1(){return d.value}return t({focus:T1,blur:U1,clear:z1,getHTML:z,getText:e1,setHTML:p1,insertHTML:L1,validate:F1,clearValidation:O1,getValidationState:t1,getEditorElement:a1}),(v,B)=>{const M1=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(D.value)},[!o.disabled&&e.unref(N).length?(e.openBlock(),e.createElementBlock("div",xB,[I.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--left",type:"button",onClick:B[0]||(B[0]=c1=>S1("left")),onMousedown:B[1]||(B[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(u1,{name:"arrowLeft"})],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"toolbarRef",ref:a,class:"vt-editor__toolbar",onScroll:d1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(c1,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe},[(c1==null?void 0:c1.type)==="separator"?(e.openBlock(),e.createElementBlock("span",XB)):(c1==null?void 0:c1.type)==="select"&&c1.id==="heading"?(e.openBlock(),e.createBlock(Ie,{key:1,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:B[3]||(B[3]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),Z1=>(e.openBlock(),e.createBlock(Ze,{key:Z1.value,onClick:G1=>e.unref(T)(Z1.value),onMousedown:B[2]||(B[2]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Z1.label),1)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(u1,{name:"tagType"},null,512),[[M1,e.unref(i)(e.unref(s).EDITOR_HEADING)]])]),_:1})):(c1==null?void 0:c1.type)==="select"&&c1.id==="fontName"?(e.openBlock(),e.createBlock(Ie,{key:2,"max-height":220,class:"vt-editor__toolbar-btn",placement:"bottom-start",trigger:"hover",onMousedown:B[5]||(B[5]=e.withModifiers(()=>{},["prevent"]))},{dropdown:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s1),Z1=>(e.openBlock(),e.createBlock(Ze,{key:Z1.value,onClick:G1=>e.unref(F)(Z1.value),onMousedown:B[4]||(B[4]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",{style:e.normalizeStyle({fontFamily:Z1.value})},e.toDisplayString(Z1.label),5)]),_:2},1032,["onClick"]))),128))]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(u1,{name:"fontName"},null,512),[[M1,e.unref(i)(e.unref(s).EDITOR_FONT)]])]),_:1})):(c1==null?void 0:c1.type)==="select"&&c1.id==="foreColor"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.withDirectives(e.createElementVNode("input",{value:y.value,class:"vt-editor__color-picker",type:"color",onInput:I1,onMousedown:B[6]||(B[6]=e.withModifiers(()=>{},["stop"]))},null,40,GB),[[M1,e.unref(i)(e.unref(s).EDITOR_FORE_COLOR)]]),e.withDirectives(e.createElementVNode("input",{value:f.value,class:"vt-editor__color-picker vt-editor__color-picker--bg",type:"color",onInput:m1,onMousedown:B[7]||(B[7]=e.withModifiers(()=>{},["stop"]))},null,40,EB),[[M1,e.unref(i)(e.unref(s).EDITOR_BACK_COLOR)]])],64)):(c1==null?void 0:c1.type)==="button"?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass([{"vt-editor__toolbar-btn--active":e.unref(Q)(c1)},"vt-editor__toolbar-btn"]),type:"button",onClick:Z1=>{var G1;return(G1=c1==null?void 0:c1.action)==null?void 0:G1.call(c1)},onMousedown:B[8]||(B[8]=e.withModifiers(()=>{},["prevent"]))},[c1!=null&&c1.iconName?(e.openBlock(),e.createBlock(u1,{key:0,name:c1.iconName},null,8,["name"])):e.createCommentVNode("",!0)],42,_B)),[[M1,c1==null?void 0:c1.tooltip]]):e.createCommentVNode("",!0)],64))),128))],544),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"vt-editor__toolbar-scroll-btn vt-editor__toolbar-scroll-btn--right",type:"button",onClick:B[9]||(B[9]=c1=>S1("right")),onMousedown:B[10]||(B[10]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(u1,{name:"arrowRight"})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jB,[e.withDirectives(e.createElementVNode("div",{ref_key:"editorRef",ref:d,contenteditable:!o.disabled,"data-placeholder":o.placeholder,class:"vt-editor__content",onBlur:w1,onFocus:i1,onInput:A,onKeydown:x1},null,40,JB),[[e.vShow,!C.value]]),C.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,ref_key:"htmlSourceRef",ref:p,"onUpdate:modelValue":B[11]||(B[11]=c1=>u.value=c1),class:"vt-editor__html-source",onInput:x},null,544)),[[e.vModelText,u.value]]):e.createCommentVNode("",!0)]),g1.value?(e.openBlock(),e.createElementBlock("div",KB,e.toDisplayString(g1.value),1)):e.createCommentVNode("",!0),e.createVNode(Ne,{modelValue:e.unref(W).visible,"onUpdate:modelValue":B[19]||(B[19]=c1=>e.unref(W).visible=c1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_LINK_TITLE),size:"small",onClose:e.unref(R)},{default:e.withCtx(()=>[e.createElementVNode("div",FB,[e.createElementVNode("label",RB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[12]||(B[12]=c1=>e.unref(W).url=c1),class:"vt-editor__dialog-input",placeholder:"https://example.com",type:"url",onKeydown:[B[13]||(B[13]=e.withKeys((...c1)=>e.unref(E)&&e.unref(E)(...c1),["enter"])),B[14]||(B[14]=e.withKeys((...c1)=>e.unref(R)&&e.unref(R)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).url]]),e.createElementVNode("label",UB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_TEXT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[15]||(B[15]=c1=>e.unref(W).text=c1),class:"vt-editor__dialog-input",placeholder:"Link text",type:"text",onKeydown:[B[16]||(B[16]=e.withKeys((...c1)=>e.unref(E)&&e.unref(E)(...c1),["enter"])),B[17]||(B[17]=e.withKeys((...c1)=>e.unref(R)&&e.unref(R)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(W).text]]),e.createElementVNode("label",zB,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[18]||(B[18]=c1=>e.unref(W).openInNewTab=c1),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(W).openInNewTab]]),e.createTextVNode(" "+e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_LINK_NEW_TAB)),1)])]),e.createElementVNode("div",OB,[e.createVNode(j1,{onClick:e.unref(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(j1,{type:"primary",onClick:e.unref(E)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"]),e.createVNode(Ne,{modelValue:e.unref(P).visible,"onUpdate:modelValue":B[26]||(B[26]=c1=>e.unref(P).visible=c1),"close-on-backdrop-click":!1,title:e.unref(i)(e.unref(s).EDITOR_IMAGE_TITLE),size:"small",onClose:e.unref(S)},{default:e.withCtx(()=>[e.createElementVNode("div",DB,[e.createElementVNode("label",BB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_URL)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[20]||(B[20]=c1=>e.unref(P).url=c1),class:"vt-editor__dialog-input",placeholder:"https://example.com/image.png",type:"url",onKeydown:[B[21]||(B[21]=e.withKeys((...c1)=>e.unref(U)&&e.unref(U)(...c1),["enter"])),B[22]||(B[22]=e.withKeys((...c1)=>e.unref(S)&&e.unref(S)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(P).url]]),e.createElementVNode("label",PB,e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_IMAGE_ALT)),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[23]||(B[23]=c1=>e.unref(P).alt=c1),class:"vt-editor__dialog-input",placeholder:"Image description",type:"text",onKeydown:[B[24]||(B[24]=e.withKeys((...c1)=>e.unref(U)&&e.unref(U)(...c1),["enter"])),B[25]||(B[25]=e.withKeys((...c1)=>e.unref(S)&&e.unref(S)(...c1),["esc"]))]},null,544),[[e.vModelText,e.unref(P).alt]])]),e.createElementVNode("div",HB,[e.createVNode(j1,{onClick:e.unref(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).BUTTON_CANCEL)),1)]),_:1},8,["onClick"]),e.createVNode(j1,{type:"primary",onClick:e.unref(U)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(e.unref(s).EDITOR_INSERT)),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])],2)}}}),vB={class:"vt-badge"},ht=e.defineComponent({__name:"VBadge",props:{content:{default:void 0},max:{default:99},dot:{type:Boolean,default:!1},color:{default:"danger"},position:{default:"top-end"},offsetX:{default:0},offsetY:{default:0},bordered:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(o){const t=o,l=e.computed(()=>t.dot?!0:t.content===void 0||t.content===null||t.content===""?!1:typeof t.content=="number"?t.content>0:!0),i=e.computed(()=>l.value&&!t.hidden),n=e.computed(()=>typeof t.content=="number"?t.content>t.max?`${t.max}+`:String(t.content):t.content),r=e.computed(()=>{if(!t.offsetX&&!t.offsetY)return{};const d=t.position.startsWith("top"),a=t.position.endsWith("end"),p={};return t.offsetX&&(p[a?"right":"left"]=`${-t.offsetX}px`),t.offsetY&&(p[d?"top":"bottom"]=`${-t.offsetY}px`),p});return(d,a)=>(e.openBlock(),e.createElementBlock("span",vB,[e.renderSlot(d.$slots,"default"),e.createVNode(e.Transition,{name:"vt-badge__fade"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vt-badge__content",[`vt-badge__content--${o.position}`,`vt-badge__content--${o.color}`,{"vt-badge__content--dot":o.dot,"vt-badge__content--bordered":o.bordered}]]),style:e.normalizeStyle(r.value)},[o.dot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(n.value),1)],64))],6)):e.createCommentVNode("",!0)]),_:1})]))}}),QB={class:"vt-app-bar__logo"},AB={key:0,class:"vt-app-bar__center"},$B={key:1,class:"vt-app-bar__actions"},S2=e.defineComponent({__name:"VAppBar",props:{sticky:{type:Boolean,default:!1}},setup(o){return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-app-bar",{"vt-app-bar--sticky":o.sticky}])},[e.createElementVNode("div",QB,[e.renderSlot(t.$slots,"logo")]),t.$slots.center?(e.openBlock(),e.createElementBlock("div",AB,[e.renderSlot(t.$slots,"center")])):e.createCommentVNode("",!0),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",$B,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)],2))}}),qB={class:"vt-nav-rail"},eP={class:"vt-nav-rail__list"},tP=["data-placement","onClick"],oP={key:0,class:"vt-nav-rail__divider"},lP={key:0,class:"vt-nav-rail__footer"},Y2=e.defineComponent({__name:"VNavRail",props:{items:{},modelValue:{default:null},placement:{default:"left"}},emits:["update:modelValue","select"],setup(o,{emit:t}){const l=t,i=n=>{n.disabled||(l("update:modelValue",n.key),l("select",n))};return(n,r)=>{const d=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("aside",qB,[e.createElementVNode("div",eP,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.key},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vt-nav-rail__item",{"vt-nav-rail__item--selected":o.modelValue===a.key,"vt-nav-rail__item--disabled":a.disabled}]),"data-placement":o.placement,onClick:h=>i(a)},[a.badge?(e.openBlock(),e.createBlock(ht,{key:0,content:a.badge.content,position:a.badge.position},{default:e.withCtx(()=>[e.createVNode(u1,{name:a.icon,width:24,height:24},null,8,["name"])]),_:2},1032,["content","position"])):(e.openBlock(),e.createBlock(u1,{key:1,name:a.icon,width:24,height:24},null,8,["name"]))],10,tP)),[[d,a.label]]),p<o.items.length-1?(e.openBlock(),e.createElementBlock("span",oP)):e.createCommentVNode("",!0)],64))),128))]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",lP,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)])}}}),nP=(o,t)=>{const l=document.createElement("div");l.className=`vt-tooltip vt-tooltip--${t}`,l.innerText=o,Object.assign(l.style,{position:"absolute",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"4px",fontSize:"12px",lineHeight:"1.4",zIndex:"9999",pointerEvents:"none",visibility:"hidden",opacity:"0",transition:"opacity 0.2s ease, visibility 0.2s ease",maxWidth:"300px",wordWrap:"break-word",whiteSpace:"normal",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"});const i=document.createElement("div");switch(i.className="vt-tooltip__arrow",Object.assign(i.style,{position:"absolute",width:"0",height:"0",borderStyle:"solid"}),t){case"top":Object.assign(i.style,{top:"100%",left:"50%",marginLeft:"-5px",borderWidth:"5px 5px 0 5px",borderColor:"rgba(0, 0, 0, 0.8) transparent transparent transparent"});break;case"bottom":Object.assign(i.style,{bottom:"100%",left:"50%",marginLeft:"-5px",borderWidth:"0 5px 5px 5px",borderColor:"transparent transparent rgba(0, 0, 0, 0.8) transparent"});break;case"left":Object.assign(i.style,{top:"50%",left:"100%",marginTop:"-5px",borderWidth:"5px 0 5px 5px",borderColor:"transparent transparent transparent rgba(0, 0, 0, 0.8)"});break;case"right":Object.assign(i.style,{top:"50%",right:"100%",marginTop:"-5px",borderWidth:"5px 5px 5px 0",borderColor:"transparent rgba(0, 0, 0, 0.8) transparent transparent"});break}return l.appendChild(i),l},N2=(o,t,l)=>{const i=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,d=window.innerWidth,a=window.innerHeight,p=8,h=Math.min(300,d-p*2);o.style.maxWidth=`${h}px`;const C=o.getBoundingClientRect();let u=0,Z=0;switch(l){case"top":u=i.top+r-C.height-8,Z=i.left+n+(i.width-C.width)/2;break;case"bottom":u=i.bottom+r+8,Z=i.left+n+(i.width-C.width)/2;break;case"left":u=i.top+r+(i.height-C.height)/2,Z=i.left+n-C.width-8;break;case"right":u=i.top+r+(i.height-C.height)/2,Z=i.right+n+8;break}Z<p?Z=p:Z+C.width>d-p&&(Z=d-C.width-p),u<r+p?l==="top"?u=i.bottom+r+8:u=r+p:u+C.height>r+a-p&&(l==="bottom"?u=i.top+r-C.height-8:u=r+a-C.height-p),o.style.top=`${u}px`,o.style.left=`${Z}px`},iP=(o,t,l)=>{o.parentElement||document.body.appendChild(o),o.style.visibility="visible",N2(o,t,l),requestAnimationFrame(()=>{o.style.opacity="1"})},rP=o=>{o.style.opacity="0",o.style.visibility="hidden"},sP=o=>o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight,cP=o=>!!o.closest(".vt-table, table"),W2=o=>o.dataset.placement||"top",g2=o=>{var t;return((t=o.value)==null?void 0:t.trim())??""},f2=o=>{var t;(t=o.__tooltipEl)==null||t.remove(),delete o.__tooltipEl},T2={mounted(o,t){o.__tooltipText=g2(t);const l=()=>{const r=o.__tooltipText;if(!r||cP(o)&&!sP(o))return;const d=W2(o);o.__tooltipEl||(o.__tooltipEl=nP(r,d)),iP(o.__tooltipEl,o,d)},i=()=>{o.__tooltipEl&&rP(o.__tooltipEl)},n=()=>{var r;((r=o.__tooltipEl)==null?void 0:r.style.opacity)==="1"&&N2(o.__tooltipEl,o,W2(o))};o.__mouseenterHandler=l,o.__mouseleaveHandler=i,o.__scrollHandler=n,o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",i),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n)},updated(o,t){const l=g2(t);l!==o.__tooltipText&&(o.__tooltipText=l,l?o.__tooltipEl&&(o.__tooltipEl.firstChild.textContent=l):f2(o))},beforeUnmount(o){f2(o),delete o.__tooltipText,o.__mouseenterHandler&&(o.removeEventListener("mouseenter",o.__mouseenterHandler),delete o.__mouseenterHandler),o.__mouseleaveHandler&&(o.removeEventListener("mouseleave",o.__mouseleaveHandler),delete o.__mouseleaveHandler),o.__scrollHandler&&(window.removeEventListener("scroll",o.__scrollHandler,!0),window.removeEventListener("resize",o.__scrollHandler),delete o.__scrollHandler)}},x2={mounted(o,t){e.unref(t.value)&&X2(o)},updated(o,t){const l=e.unref(t.value),i=e.unref(t.oldValue);l!==i&&(l?X2(o):G2(o))},unmounted(o){G2(o)}};function X2(o){if(o._loaderEl)return;const t=document.createElement("div");t.className="vt-loader-base__overlay",t.innerHTML='<span class="vt-loader-base"></span>';const l=getComputedStyle(o).position;(l==="static"||!l)&&(o.style.position="relative"),o.appendChild(t),o._loaderEl=t}function G2(o){const t=o._loaderEl;t&&(t.remove(),delete o._loaderEl)}const dP={class:"vt-message-container"},aP={class:"vt-message-icon"},mP={class:"vt-message-content"},hP={key:0,class:"vt-message-title"},pP=["innerHTML"],CP={key:1,class:"vt-message-text"},uP=["onClick"],IP=e.defineComponent({__name:"VMessage",setup(o,{expose:t}){const l=e.ref([]);let i=0;const n=a=>({success:"checkCircle",danger:"alertCircle",warning:"alertTriangle",primary:"infoCircle"})[a]||"infoCircle",r=a=>{const p=++i,h={id:p,message:a.message||"",title:a.title||"",type:a.type||"primary",showClose:a.showClose||!1,duration:a.duration!==void 0?a.duration:3e3,dangerouslyUseHTMLString:a.dangerouslyUseHTMLString||!1};return l.value.push(h),h.duration&&h.duration>0&&setTimeout(()=>{d(p)},h.duration),p},d=a=>{const p=l.value.findIndex(h=>h.id===a);p>-1&&l.value.splice(p,1)};return t({addMessage:r,removeMessage:d}),(a,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",dP,[e.createVNode(e.TransitionGroup,{name:"vt-message",tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["vt-message-item",`vt-message-item--${h.type}`,{"vt-message-item--closable":h.showClose}])},[e.createElementVNode("div",aP,[e.createVNode(u1,{color:h.type==="primary"?"#00475A":"",name:n(h.type)},null,8,["color","name"])]),e.createElementVNode("div",mP,[h.title?(e.openBlock(),e.createElementBlock("div",hP,e.toDisplayString(h.title),1)):e.createCommentVNode("",!0),h.message?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vt-message-text",innerHTML:h.message},null,8,pP)):(e.openBlock(),e.createElementBlock("div",CP,e.toDisplayString(h.message),1))],64)):e.createCommentVNode("",!0)]),h.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vt-message-close",type:"button",onClick:C=>d(h.id)},[e.createVNode(u1,{name:"close"})],8,uP)):e.createCommentVNode("",!0)],2))),128))]),_:1})])]))}});class ZP{constructor(){this.messageInstance=null,this.app=null,this.container=null}call(t={}){return this.ensureInstance().addMessage({message:t.message||"",title:t.title||"",type:t.type||"primary",showClose:t.showClose||!1,duration:t.duration!==void 0?t.duration:3e3,dangerouslyUseHTMLString:t.dangerouslyUseHTMLString||!1})}success(t,l={}){return this.call({...l,message:t,type:"success"})}danger(t,l={}){return this.call({...l,message:t,type:"danger"})}warning(t,l={}){return this.call({...l,message:t,type:"warning"})}primary(t,l={}){return this.call({...l,message:t,type:"primary"})}close(t){this.messageInstance&&this.messageInstance.removeMessage(t)}closeAll(){this.messageInstance&&(this.messageInstance.messages=[]),this.container&&this.container.parentNode&&document.body.removeChild(this.container),this.app&&this.app.unmount(),this.messageInstance=null,this.app=null,this.container=null}getOpenMessagesCount(){return this.messageInstance?this.messageInstance.messages.length:0}ensureInstance(){return this.messageInstance?this.messageInstance:(this.container=document.createElement("div"),this.container.setAttribute("data-vt-message-container",""),document.body.appendChild(this.container),this.app=e.createApp(IP),this.messageInstance=this.app.mount(this.container),this.messageInstance)}}const se=new ZP,pt=Object.assign((o={})=>se.call(o),{success:(o,t={})=>se.success(o,t),danger:(o,t={})=>se.danger(o,t),warning:(o,t={})=>se.warning(o,t),primary:(o,t={})=>se.primary(o,t),close:o=>{se.close(o)},closeAll:()=>{se.closeAll()}}),E2={install(o){o.config.globalProperties.$message=pt,o.provide("$message",pt),o.config.globalProperties.$messageStack={closeAll:()=>se.closeAll(),getCount:()=>se.getOpenMessagesCount(),closeById:t=>se.close(t)}}},kP={sortable:!0,actionColumn:!1,showOverflowTooltip:!0,visible:!0,pinnedLeft:!1,pinnedRight:!1,manage:!1};function bP(o){ut(o)}const _2={install(o,t={}){const{prefix:l="V",modal:i=!0,message:n=!0,locale:r=ie.uk}=t;o.component(`${l}Button`,j1),o.component(`${l}Icon`,u1),o.component(`${l}Loader`,Ye),o.component(`${l}Modal`,Ne),o.component(`${l}Pagination`,wt),o.component(`${l}Checkbox`,ne),o.component(`${l}Radiobox`,Lt),o.component(`${l}Table`,Yt),o.component(`${l}TableColumn`,Nt),o.component(`${l}Dropdown`,Ie),o.component(`${l}DropdownItem`,Ze),o.component(`${l}Input`,we),o.component(`${l}Select`,_e),o.component(`${l}Option`,je),o.component(`${l}DatePicker`,_t),o.component(`${l}TimePicker`,fe),o.component(`${l}Collapse`,jt),o.component(`${l}CollapseItem`,Jt),o.component(`${l}Tabs`,Kt),o.component(`${l}TabItem`,Ft),o.component(`${l}Upload`,zt),o.component(`${l}Sidebar`,Ot),o.component(`${l}Login`,At),o.component(`${l}LoginLogo`,$t),o.component(`${l}LocaleSelect`,Wt),o.component(`${l}DynamicFilter`,qt),o.component(`${l}Slider`,e2),o.component(`${l}SliderMarkRange`,t2),o.component(`${l}Chart`,l2),o.component(`${l}InfoBox`,n2),o.component(`${l}TransferList`,i2),o.component(`${l}Avatar`,r2),o.component(`${l}AvatarUpload`,c2),o.component(`${l}ImageFullscreen`,a2),o.component(`${l}Breadcrumb`,m2),o.component(`${l}BreadcrumbItem`,h2),o.component(`${l}Audio`,w2),o.component(`${l}Empty`,Ke),o.component(`${l}Editor`,M2),o.component(`${l}Badge`,ht),o.component(`${l}AppBar`,S2),o.component(`${l}NavRail`,Y2),o.directive("tooltip",T2),o.directive("loader",x2),i&&o.use(St),n&&o.use(E2),o.use(tJ,{locale:r})}},VP=_2.install;o1.DEFAULT_COLUMN_CONFIG=kP,o1.DEFAULT_FORMATS=gt,o1.DEFAULT_TIME_FORMATS=ge,o1.DropdownContextKey=Ae,o1.FORMAT_TOKENS=nF,o1.FileParser=Te,o1.FileValidator=ke,o1.LANGUAGES=ie,o1.VAppBar=S2,o1.VAudio=w2,o1.VAvatar=r2,o1.VAvatarUpload=c2,o1.VBadge=ht,o1.VBreadcrumb=m2,o1.VBreadcrumbItem=h2,o1.VButton=j1,o1.VChart=l2,o1.VCheckbox=ne,o1.VCollapse=jt,o1.VCollapseItem=Jt,o1.VColorPicker=zD,o1.VDatePicker=_t,o1.VDropdown=Ie,o1.VDropdownItem=Ze,o1.VDynamicFilter=qt,o1.VEditor=M2,o1.VEmpty=Ke,o1.VIcon=u1,o1.VImageFullscreen=a2,o1.VInfoBox=n2,o1.VInput=we,o1.VLoader=Ye,o1.VLocaleSelect=Wt,o1.VLogin=At,o1.VLoginLogo=$t,o1.VMessage=pt,o1.VMessagePlugin=E2,o1.VModal=Ne,o1.VModalPlugin=St,o1.VNavRail=Y2,o1.VOption=je,o1.VPagination=wt,o1.VRadiobox=Lt,o1.VSelect=_e,o1.VSidebar=Ot,o1.VSlider=e2,o1.VSliderMarkRange=t2,o1.VTabItem=Ft,o1.VTable=Yt,o1.VTableColumn=Nt,o1.VTabs=Kt,o1.VTimePicker=fe,o1.VTimerDuration=BD,o1.VTransferList=i2,o1.VUpload=zt,o1.VtSelectContextKey=Pe,o1.containUpperCaseLetter=vt,o1.default=_2,o1.email=Dt,o1.formatTime=Gt,o1.generateTimeOptions=Ue,o1.iconGroups=Jj,o1.install=VP,o1.isValidDate=et,o1.isValidTimeString=Re,o1.loaderDirective=x2,o1.maxLength=ez,o1.maxNumber=oz,o1.messageManager=se,o1.minLength=tt,o1.minNumber=tz,o1.mk=qU,o1.modalManager=ae,o1.noSpaces=ot,o1.numeric=Pt,o1.parseTimeString=Et,o1.pattern=nz,o1.phoneNumber=Ht,o1.required=ze,o1.sameAs=lz,o1.setLocale=bP,o1.tooltipDirective=T2,o1.uniqueAsync=iz,o1.url=Bt,o1.useValidate=Qt,o1.validateDateValue=ft,o1.validateTimeValue=xt,o1.withAsync=$U,o1.withMessage=AU,o1.withName=he,o1.withParams=QU,Object.defineProperties(o1,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|