dsp-semactic 0.6.53 → 0.6.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +28 -28
- package/dist/index.es.js +4432 -4376
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gl=require("vue-i18n"),Sa={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Va=["value"],Na=["placeholder","value","disabled"],Ba=["placeholder","value"],Ma={key:0,class:"dss-datepicker__double-wrap"},_a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},$a=["onClick"],La={class:"dss-datepicker__double-calendars"},Ta={class:"dss-datepicker__double-calendar"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__double-calendar"},Wa={class:"dss-datepicker__calendar-header"},qa=["aria-label"],Za={class:"dss-datepicker__month-year-row"},Ua=["aria-label"],Xa={class:"dss-datepicker__weekdays"},Ya={class:"dss-datepicker__grid"},ja=["disabled","onClick","onMouseenter"],Ka={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ga={class:"dss-datepicker__calendar-header"},Qa=["aria-label"],Ja={class:"dss-datepicker__month-year-row"},es=["aria-label"],ts={class:"dss-datepicker__weekdays"},ns={class:"dss-datepicker__grid"},ls=["disabled","onClick","onMouseenter"],os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},as={class:"dss-datepicker__calendar-header"},ss={class:"dss-datepicker__month-year-row"},rs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},is={class:"dss-datepicker__months-grid"},cs=["onClick"],us={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ds={class:"dss-datepicker__month-year"},ms={class:"dss-datepicker__years-grid"},ps=["data-year","onClick"],ra=27,ea={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:T=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(T)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(T,{emit:ne}){const _=T,L=ne,{t:ue,locale:I}=Gl.useI18n(),A=e.ref(!1),X=e.ref("days"),Ge=new Date,ge=e.computed(()=>_.minDate instanceof Date?_.minDate:Ge),f=e.ref(ge.value.getMonth()),Ce=e.ref(ge.value.getFullYear()),he=e.ref(ge.value.getMonth()),le=e.ref(ge.value.getFullYear()),oe=e.ref(ge.value.getMonth()),me=e.ref(ge.value.getFullYear()),H=e.ref("start"),be=e.ref(null),Ae=e.ref(null);function Pe(){const P=ge.value,Z=P.getMonth(),z=P.getFullYear(),re=Z===11?0:Z+1,Ie=Z===11?z+1:z;return{left:{month:Z,year:z},right:{month:re,year:Ie}}}const ut=e.ref(null),U=e.ref(null),Ue=e.ref(null),Qe=e.ref(null),Ve=e.ref(null),Le=e.ref(null),Xe=new Date().getFullYear(),G=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),Fe=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),xe=e.computed(()=>{if(_.mode!=="single"&&_.mode!=="singleFromAvailable")return null;const P=_.modelValue;return P instanceof Date?P:null}),ht=e.computed(()=>{if(!Fe.value)return{start:null,end:null};const P=_.modelValue;return!P||typeof P!="object"?{start:null,end:null}:{start:P.start instanceof Date?P.start:null,end:P.end instanceof Date?P.end:null}});function ct(P){if(!P||!(P instanceof Date))return"";const Z=P.getDate(),z=P.getMonth()+1,re=P.getFullYear(),Ie=mt=>String(mt).padStart(2,"0");return`${Ie(Z)}/${Ie(z)}/${re}`}const St=e.computed(()=>ct(xe.value)),At=e.computed(()=>{const{start:P,end:Z}=ht.value;if(!P&&!Z)return"";const z=!Z||P&&P<=Z?P:Z,re=!P||Z&&Z>=P?Z:P;return W(z,re)?ct(z):`${ct(z)} - ${ct(re)}`}),qt=e.computed(()=>{if(_.mode!=="readonly")return"—";const P=_.modelValue;if(P instanceof Date)return ct(P)||"—";if(P&&typeof P=="object"&&("start"in P||"end"in P)){const Z=P.start instanceof Date?P.start:null,z=P.end instanceof Date?P.end:null;if(!Z&&!z)return"—";const re=!z||Z&&Z<=z?Z:z,Ie=!Z||z&&z>=Z?z:Z;return W(re,Ie)?ct(re):`${ct(re)} - ${ct(Ie)}`}return"—"});e.computed(()=>{const P=new Date(Ce.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(P)});const It=e.computed(()=>Ae.value==="left"?he.value:Ae.value==="right"?oe.value:f.value),Q=e.computed(()=>Ae.value==="left"?le.value:Ae.value==="right"?me.value:Ce.value),pe=e.computed(()=>{const P=new Date(Ce.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(P)}),He=e.computed(()=>{const P=new Date(Q.value,It.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(P)}),Ye=e.computed(()=>{const P=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(Z,z)=>P.format(new Date(2024,z,1)))}),Zt=e.computed(()=>{const Z=(Ae.value?Q.value:Ce.value)-Math.floor(ra/2);return Array.from({length:ra},(z,re)=>Z+re)}),kt=e.computed(()=>{const P=Zt.value;return P.length?`${P[0]} – ${P[P.length-1]}`:""}),Ot=e.computed(()=>{const P=new Intl.DateTimeFormat(I.value,{weekday:"short"}),Z=new Date(2024,0,1),z=[];for(let re=0;re<7;re++){const Ie=new Date(Z);Ie.setDate(Z.getDate()+re),z.push(P.format(Ie).slice(0,2))}return z});function xt(P,Z){const z=new Date(P,Z,1),re=new Date(P,Z+1,0),Ie=z.getDay(),mt=re.getDate(),ft=[];for(let nt=0;nt<Ie;nt++)ft.push(null);for(let nt=1;nt<=mt;nt++)ft.push(new Date(P,Z,nt));return ft}const zt=e.computed(()=>xt(Ce.value,f.value)),J=e.computed(()=>xt(le.value,he.value)),ye=e.computed(()=>xt(me.value,oe.value));e.computed(()=>{const P=new Date(le.value,he.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(P)}),e.computed(()=>{const P=new Date(me.value,oe.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(P)});const Be=e.computed(()=>{const P=new Date(le.value,he.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(P)}),We=e.computed(()=>{const P=new Date(me.value,oe.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(P)}),lt=e.computed(()=>_.availableDates&&_.availableDates.length>0),Vt=e.computed(()=>lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),je=e.ref({top:0,left:0});function Nt(){if(!Qe.value||!A.value)return;const P=Qe.value.getBoundingClientRect(),Z=window.innerWidth||document.documentElement.clientWidth,z=window.innerHeight||document.documentElement.clientHeight;let re=P.left,Ie=P.bottom+4;const mt=Ve.value;if(mt){const ft=mt.offsetWidth,nt=mt.offsetHeight;if(re+ft>Z-8&&(re=P.right-ft,re<8&&(re=8)),Ie+nt>z-8){const Et=P.top-4-nt;Et>=8?Ie=Et:Ie=Math.max(8,z-nt-8)}}je.value={top:Ie,left:re}}const Ke=e.computed(()=>!Qe.value||!A.value?{}:{position:"fixed",left:`${je.value.left}px`,top:`${je.value.top}px`,zIndex:1002});function W(P,Z){return!P||!Z?!1:P.getFullYear()===Z.getFullYear()&&P.getMonth()===Z.getMonth()&&P.getDate()===Z.getDate()}function q(P){return new Date(P.getFullYear(),P.getMonth(),P.getDate()).getTime()}function K(P){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(Z=>Z instanceof Date&&W(Z,P))}function ve(P){const Z=q(P);return!(_.minDate instanceof Date&&Z<q(_.minDate)||_.maxDate instanceof Date&&Z>q(_.maxDate))}function qe(P){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(Z=>Z instanceof Date&&W(Z,P))}function Je(P){return qe(P)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?K(P):ve(P)}function Bt(P){const Z=xe.value,z=ht.value,re=q(P),Ie=Fe.value&&z.start&&z.end&&re>q(z.start)&&re<q(z.end),mt=Fe.value&&z.start&&W(P,z.start),ft=Fe.value&&z.end&&W(P,z.end),nt=mt&&ft,Et=G.value&&Z&&W(P,Z)||mt||ft;let Pt=!1;if(Fe.value&&z.start&&!z.end&&be.value){const Tn=q(z.start),An=q(be.value),Dn=Math.min(Tn,An),cl=Math.max(Tn,An);Pt=re>Dn&&re<cl}return{"dss-datepicker__day--selected":Et&&!nt,"dss-datepicker__day--range-start":mt&&!nt,"dss-datepicker__day--range-end":ft&&!nt,"dss-datepicker__day--range-single":nt,"dss-datepicker__day--in-range":Ie&&!mt&&!ft,"dss-datepicker__day--in-range-preview":Pt&&!mt&&!ft&&!Ie,"dss-datepicker__day--disabled":!Je(P)}}function tt(P){if(!Fe.value)return;const Z=ht.value;if(!Z.start||Z.end){be.value=null;return}if(!Je(P)){be.value=null;return}be.value=new Date(P.getFullYear(),P.getMonth(),P.getDate())}function st(){be.value=null}function Xt(){if(!_.doubleCalendar||!Fe.value)return;const P=ht.value,{start:Z,end:z}=P;if(Z&&z){const mt=Z<=z?Z:z,ft=Z<=z?z:Z,nt=mt.getMonth(),Et=mt.getFullYear(),Pt=ft.getMonth(),Tn=ft.getFullYear();if(nt!==Pt||Et!==Tn){const An=he.value===nt&&le.value===Et,Dn=oe.value===Pt&&me.value===Tn;if(An&&Dn)return;he.value=nt,le.value=Et,oe.value=Pt,me.value=Tn}else{const An=nt===0?11:nt-1,Dn=nt===0?Et-1:Et;he.value===An&&le.value===Dn&&oe.value===nt&&me.value===Et||(he.value=nt,le.value=Et,nt===11?(oe.value=0,me.value=Et+1):(oe.value=nt+1,me.value=Et))}return}const re=Z||z;if(re){const mt=re.getMonth(),ft=re.getFullYear(),nt=he.value===mt&&le.value===ft,Et=oe.value===mt&&me.value===ft;if(nt||Et)return;he.value=mt,le.value=ft,mt===11?(oe.value=0,me.value=ft+1):(oe.value=mt+1,me.value=ft);return}const Ie=Pe();he.value=Ie.left.month,le.value=Ie.left.year,oe.value=Ie.right.month,me.value=Ie.right.year}function ln(P="start"){if(_.mode==="readonly")return;H.value=P;const Z=xe.value,z=ht.value;if(G.value&&Z)f.value=Z.getMonth(),Ce.value=Z.getFullYear();else if(Fe.value)if(_.doubleCalendar)Xt();else{const re=P==="start"&&z.start?z.start:z.end||z.start;re&&(f.value=re.getMonth(),Ce.value=re.getFullYear())}Qe.value=G.value?ut.value?.closest(".dss-datepicker__input-wrap"):U.value,X.value="days",Ae.value=null,A.value=!0,e.nextTick(()=>{Nt()})}function Lt(){X.value="days",Ae.value=null,be.value=null,A.value=!1}function Qt(P,Z){Ae.value=P,X.value=Z}function V(){X.value="days",Ae.value=null}function w(P){const Z=new Date,z=Z.getFullYear(),re=Z.getMonth(),Ie=Z.getDate();let mt,ft;if(lt.value){const nt=[..._.availableDates].filter(Et=>Et instanceof Date).map(Et=>new Date(Et.getFullYear(),Et.getMonth(),Et.getDate()));if(nt.sort((Et,Pt)=>Et.getTime()-Pt.getTime()),nt.length===0)return;if(P==="all")mt=nt[0],ft=nt[nt.length-1];else{const Et=parseInt(P.replace("last",""),10);if(Et<2||Et>5)return;const Pt=nt.slice(-Et);mt=Pt[0],ft=Pt[Pt.length-1]}}else{const nt=new Date(z,re,Ie);switch(P){case"today":mt=nt,ft=nt;break;case"lastWeek":mt=new Date(z,re,Ie-6),ft=nt;break;case"last15Days":mt=new Date(z,re,Ie-14),ft=nt;break;case"last30Days":mt=new Date(z,re,Ie-29),ft=nt;break;case"thisMonth":mt=new Date(z,re,1),ft=nt;break;case"last3Months":mt=new Date(z,re-3,1),ft=new Date(z,re,0);break;case"last6Months":mt=new Date(z,re-6,1),ft=new Date(z,re,0);break;case"last12Months":mt=new Date(z,re-12,1),ft=new Date(z,re,0);break;case"lastYear":mt=new Date(z-1,0,1),ft=new Date(z-1,11,31);break;default:return}}L("update:modelValue",{start:mt,end:ft}),Xt()}function S(P){Ae.value==="left"?he.value=P:Ae.value==="right"?oe.value=P:f.value=P,V()}function Y(P){Ae.value==="left"?le.value=P:Ae.value==="right"?me.value=P:Ce.value=P,V()}function ee(){f.value===0?(f.value=11,Ce.value--):f.value--}function Oe(){f.value===11?(f.value=0,Ce.value++):f.value++}function vt(){he.value===0?(he.value=11,le.value--):he.value--}function ot(){he.value===11?(he.value=0,le.value++):he.value++}function we(){oe.value===0?(oe.value=11,me.value--):oe.value--}function Mt(){oe.value===11?(oe.value=0,me.value++):oe.value++}function Dt(P){if(!Je(P))return;const Z=new Date(P.getFullYear(),P.getMonth(),P.getDate());if(G.value){L("update:modelValue",Z),Lt();return}const z=ht.value;if(!z.start&&!z.end){L("update:modelValue",{start:Z,end:null}),H.value="end";return}if(z.start&&z.end){L("update:modelValue",{start:Z,end:null}),H.value="end";return}if(H.value==="start"){let re=Z,Ie=z.end;re&&Ie&&re>Ie&&([re,Ie]=[Ie,re]),L("update:modelValue",{start:re||Ie,end:Ie||re}),H.value="end"}else{let re=z.start,Ie=Z;re&&Ie&&Ie<re&&([re,Ie]=[Ie,re]),L("update:modelValue",{start:re||Ie,end:Ie||re}),H.value="start"}}e.watch(ht,()=>{_.doubleCalendar&&Fe.value&&A.value&&Xt()},{deep:!0});let Ct=null,at=null,pt=null;function qn(){Ct&&(document.removeEventListener("keydown",Ct),Ct=null),at&&(window.removeEventListener("resize",at),at=null),pt&&(window.removeEventListener("scroll",pt,!0),pt=null)}return e.watch(X,P=>{P==="years"&&e.nextTick(()=>{Le.value?.querySelector(`[data-year="${Q.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,P=>{qn(),P&&(Ct=Z=>{Z.key==="Escape"&&(X.value==="years"||X.value==="months"?V():Lt())},at=()=>{Nt()},pt=()=>{Nt()},document.addEventListener("keydown",Ct),window.addEventListener("resize",at),window.addEventListener("scroll",pt,!0))}),e.onBeforeUnmount(()=>{qn()}),(P,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":T.mode==="readonly"}])},[T.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Sa,[Z[10]||(Z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:qt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):G.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:Z[0]||(Z[0]=z=>ln("start"))},[Z[11]||(Z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:ut,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ue)("datepicker.selectDate"),value:St.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):Fe.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:U,onClick:Z[1]||(Z[1]=z=>ln("start"))},[Z[12]||(Z[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ue,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ue)("datepicker.selectRange"),value:At.value,readonly:""},null,8,Ba)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Lt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ve,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&&Fe.value&&X.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&&Fe.value&&X.value==="days"&&T.quickSelect}]),onClick:Z[9]||(Z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ke.value)},[X.value==="days"&&T.doubleCalendar&&Fe.value?(e.openBlock(),e.createElementBlock("div",Ma,[T.quickSelect?(e.openBlock(),e.createElementBlock("nav",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:re=>w(z.id)},e.toDisplayString(e.unref(ue)(z.labelKey)),9,$a))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",La,[e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:vt}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[2]||(Z[2]=z=>Qt("left","months"))},e.toDisplayString(Be.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[3]||(Z[3]=z=>Qt("left","years"))},e.toDisplayString(le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:ot}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Bt(z)]),disabled:!Je(z),onClick:Ie=>Dt(z),onMouseenter:Ie=>tt(z),onMouseleave:st},e.toDisplayString(z.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])]),e.createElementVNode("div",Oa,[e.createElementVNode("div",Wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:we}," ‹ ",8,qa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[4]||(Z[4]=z=>Qt("right","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[5]||(Z[5]=z=>Qt("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Mt}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Bt(z)]),disabled:!Je(z),onClick:Ie=>Dt(z),onMouseenter:Ie=>tt(z),onMouseleave:st},e.toDisplayString(z.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:ee}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[6]||(Z[6]=z=>X.value="months")},e.toDisplayString(pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[7]||(Z[7]=z=>X.value="years")},e.toDisplayString(Ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Oe}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Bt(z)]),disabled:!Je(z),onClick:Ie=>Dt(z),onMouseenter:Ie=>tt(z),onMouseleave:st},e.toDisplayString(z.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(He.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[8]||(Z[8]=z=>X.value="years")},e.toDisplayString(Q.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(z,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":re===It.value}]),onClick:Ie=>S(re)},e.toDisplayString(z),11,cs))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",us,[e.createElementVNode("span",ds,e.toDisplayString(kt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Le},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":z===Q.value,"dss-datepicker__year-cell--current":z===e.unref(Xe)}]),"data-year":z,onClick:re=>Y(z)},e.toDisplayString(z),11,ps))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},fs=["data-chart-type"],vs={class:"dss-chart-header-titles"},gs={key:0,class:"dss-chart-title"},hs={key:1,class:"dss-chart-subtitle"},ys=["onClick","onMouseenter"],ks={class:"dss-legend-text"},Cs=["onClick","onMouseenter"],bs={class:"dss-legend-text"},ws=["title"],xs=["src"],Es={class:"dss-chart-area-wrapper"},Ss={key:0,class:"dss-chart-z-axis-label"},Vs=["width","height","data-smooth","data-animated"],Ns=["id"],Bs=["y","width","height"],Ms=["id"],_s=["d"],$s=["id"],Ls=["d"],Ts={key:0},As=["clip-path"],Ds=["x1","x2","y1","y2"],Hs={class:"dss-axes"},Rs=["x1","x2","y1","y2"],Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs={class:"dss-axis-labels"},Ps=["x","y"],Os=["x","y"],Ws=["x","y"],qs=["x","y"],Zs=["y","transform"],Us=["x","y","transform"],Xs={key:1,class:"dss-flag-markers"},Ys=["clip-path"],js=["x1","x2","y1","y2","onMouseover"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["cx","cy","onMouseover"],Js=["cx","cy","fill","onMouseover"],er=["x","y"],tr=["clip-path"],nr={key:0},lr=["d","onMouseover"],or=["x","y","width","height","fill","onMouseover"],ar={class:"dss-line-chart"},sr=["d","stroke","stroke-width","stroke-dasharray"],rr=["d","stroke","stroke-width","opacity"],ir=["cx","cy","r","fill","onMouseover"],cr={key:1},ur=["d","stroke","stroke-width","stroke-dasharray"],dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","opacity"],pr=["cx","cy","r","fill","onMouseover"],fr={key:2},vr=["id"],gr=["x","y","width","height"],hr=["d","fill","fill-opacity","mask"],yr=["d","stroke","stroke-width"],kr=["d","fill","onMouseover"],Cr=["x","y","width","height","onMouseover"],br=["clip-path"],wr=["x1","x2","y1","y2","stroke"],xr=["cx","cy","r","fill"],Er={key:1,class:"dss-bubble-chart"},Sr={key:0,class:"dss-bubble-group"},Vr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Nr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Br=["transform"],Mr=["cx","cy","r"],_r=["data-chart-type","clip-path"],$r=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Lr={key:1,class:"dss-radial-segment-data-labels"},Tr=["x","y"],Ar=["x","y","font-size","fill"],Dr=["x1","y1","x2","y2","stroke"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x","y","text-anchor","font-size"],Fr=["transform"],Ir={key:0,class:"dss-spider-grid"},zr=["cx","cy","r"],Pr={class:"dss-spider-grid-labels"},Or=["x","y"],Wr=["x","y"],qr=["x1","x2","y1","y2"],Zr={class:"dss-spider-labels"},Ur=["x","y","text-anchor","dominant-baseline"],Xr=["points","fill","fill-opacity","stroke","stroke-width"],Yr=["cx","cy","r","fill","onMouseover"],jr={class:"dss-chart-logos"},Kr=["cx","cy","r","fill"],Gr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Qr=["onClick","onMouseenter"],Jr=["src"],ei={class:"dss-marker-tooltip-category"},ti={key:0,class:"dss-marker-tooltip-description"},ni={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},li={class:"dss-tooltip-title dss-spider-tooltip-area-title"},oi={class:"dss-tooltip-series-name"},ai={class:"dss-tooltip-series-value"},si={key:1,class:"dss-tooltip-section"},ri={key:0,class:"dss-tooltip-title"},ii={class:"dss-bubble-tooltip-data"},ci={key:2,class:"dss-tooltip-section"},ui={class:"dss-tooltip-title"},di={class:"dss-tooltip-value"},mi={key:0,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-group-header"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-text"},hi={key:1,class:"dss-tooltip-section"},yi={class:"dss-tooltip-section-title"},ki={class:"dss-tooltip-item-content"},Ci={class:"dss-tooltip-item-title"},bi={key:0,class:"dss-tooltip-item-description"},wi={class:"dss-tooltip-section"},xi={class:"dss-tooltip-title"},Ei={key:0,class:"dss-bubble-tooltip-data"},Si={class:"dss-tooltip-series-name"},Vi={class:"dss-tooltip-series-value"},Ni={key:0,class:"dss-tooltip-section"},Bi={class:"dss-tooltip-section-title"},Mi={class:"dss-tooltip-group-header"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-text"},Li={key:1,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Ai={class:"dss-tooltip-item-content"},Di={class:"dss-tooltip-item-title"},Hi={key:0,class:"dss-tooltip-item-description"},Ri=["onClick","onMouseenter"],Fi={class:"dss-legend-text"},Ii={key:1,class:"dss-context-menu-separator"},zi={key:0,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi=["onClick"],Wi=["innerHTML"],qi={key:0,class:"dss-context-menu-icon"},Zi={class:"dss-marker-modal-header"},Ui={class:"dss-marker-modal-body"},Xi={class:"dss-form-group"},Yi={class:"dss-form-group"},ji={for:"dss-marker-description"},Ki={key:0,class:"dss-form-text-display"},Gi=["placeholder"],Qi={class:"dss-marker-modal-footer"},Ji={class:"modal-footer-left"},ec={class:"dss-modal-footer-right"},tc=["disabled"],nc={name:"DSSChart"},lc=Object.assign(nc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:ne}){const{t:_,locale:L}=Gl.useI18n(),ue=ne,I=e.ref(null),A=e.ref(null),X=e.ref(null),Ge=e.ref(0),ge=e.ref(0);let f=null,Ce=null;const he=20,le=e.computed(()=>{if(ge.value,Ge.value,!I.value||!A.value)return 0;try{const t=I.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),oe=e.computed(()=>`chart-clip-${H.chartId}`),me=e.computed(()=>`url(#${oe.value})`),H=T,be={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Ae(t,a){const n=Object.assign({},t);return ut(t)&&ut(a)&&Object.keys(a).forEach(i=>{ut(a[i])?i in t?n[i]=Ae(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const Pe=()=>{let t=20,a=0,n=0;if(ct.value&&(t+=30),St.value&&(t+=25),J.value&&H.series.length>0){const i=H.series.filter((p,g)=>!rt.value.has(g)).length;if(ye.value==="top"||ye.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(Ve.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function ut(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>Ae(be,H.options)),Ue=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),Qe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),Ve=e.computed(()=>{const t=U.value;return Ue.value?Ge.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(he),Xe=e.computed(()=>{if(Qe.value){const t=Xe.value;return t??Math.max(0,(ge.value||400)-Le.value*5)}}),G=e.computed(()=>{const t=U.value;if(xe.value==="mini-radial")return Ve.value;if(Qe.value){const a=Xe.value;return a??Math.max(0,(ge.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Fe=e.computed(()=>{if(Qe.value&&xe.value==="semi-radial"&&Xe.value!=null)return Le.value+G.value+"px";if(Qe.value)return"100%";if(vn.value)return Le.value+G.value+"px";if(J.value&&ye.value==="bottom"){const t=Pe();return G.value+(t.legendHeight||35)+"px"}return G.value+(J.value?20:0)+"px"}),xe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),ht=e.computed(()=>{const t=H.series.map(a=>a.type||xe.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),St=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),At=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),qt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Q=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),pe=e.computed(()=>{const t=Q.value;return t&&t.title&&t.title.text?t.title.text:""}),He=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return wn;const a=t.yAxis.min;return typeof a=="number"||a===wn?a:wn}),Ye=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return wn;const a=t.yAxis.max;return typeof a=="number"||a===wn?a:wn}),Zt=e.computed(()=>{const t=Q.value;if(!t)return wn;const a=t.min;return typeof a=="number"||a===wn?a:wn}),kt=e.computed(()=>{const t=Q.value;if(!t)return wn;const a=t.max;return typeof a=="number"||a===wn?a:wn}),Ot=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),xt=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),zt=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),J=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),ye=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),We=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),lt=e.computed(()=>{const t=U.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Vt=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),je=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Nt=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ke=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),W=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),q=e.computed(()=>{if(!vn.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),K=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ve=e.computed(()=>{const{maxX:t}=Ut.value;return t===0}),qe=(t,a)=>ve.value&&a===0?5:a,Je=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},Bt=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),tt=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),st=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Xt=e.computed(()=>{const t=U.value;return tt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ln=e.computed(()=>{const t=U.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Lt=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),Qt=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),w=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),S=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ee=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Oe=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),vt=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ot=e.computed(()=>U.value?.spider?.gridSteps||5),we=e.computed(()=>{const t=[],a=ot.value;for(let n=1;n<=a;n++)t.push(dt.value/a*n);return t}),Mt=t=>{const a=Dt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=we.value[t];return Math.round(n/dt.value*100)+"%"},Dt=e.computed(()=>U.value?.spider?.gridLabels||null),Ct=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),at=e.computed(()=>{const t=U.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),pt=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),qn=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Nl.value}),P=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Z=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),z=e.computed(()=>{const a=U.value?.valueFormat?.extension;return typeof a=="string"?a:""}),re=t=>{const a=z.value;if(t==null)return"";const n=String(t);return a?n+a:n},Ie=e.computed(()=>!se.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(bn.value||jt.value)){const a=Kt(t.categoryIndex),n=le.value+R.value.bottom-Z.value/2;return{...t,x:a,y:n}}return t}));function mt(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,b]=t.split("-"),F=Number(b?.length===2?`20${b}`:b);n=new Date(F,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[b,F,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(F)-1,Number(b)),te=Math.abs(B-n);te<p&&(p=te,i=C)}),i}const ft=e.computed(()=>{const t=H.markers.map(n=>{const i=mt(n.marker_date,H.categories),p=Kt(i),g=le.value+R.value.bottom-Z.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=Tt.value.map(n=>{if(n.categoryIndex!==void 0&&(bn.value||jt.value)){const i=Kt(n.categoryIndex),p=le.value+R.value.bottom-Z.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),nt=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),Et=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Pt=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Tn=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),An=e.computed(()=>{const t={left:R.value.left,top:R.value.top,width:R.value.width,height:R.value.height};let a,n;const i=String(Pt.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Dn=e.computed(()=>{const{width:t,height:a}=An.value,n=Tn.value;let i,p;const g=R.value.left,C=R.value.right,b=R.value.top,F=R.value.bottom,N=R.value.width,$=R.value.height;switch(n){case"center":i=g+(N-t)/2,p=b+($-a)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=C-t-15,p=b+5;break;case"bottom-left":i=g+15,p=F-a-5;break;case"bottom-right":default:i=C-t-15,p=F-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),cl=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),Hn=t=>{const a=cl(t),n=Tl(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Nl=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gl=require("vue-i18n"),Sa={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Va=["value"],Na=["placeholder","value","disabled"],Ba=["placeholder","value"],Ma={key:0,class:"dss-datepicker__double-wrap"},_a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},$a=["disabled","onClick"],La={class:"dss-datepicker__double-calendars"},Ta={class:"dss-datepicker__double-calendar"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__double-calendar"},Wa={class:"dss-datepicker__calendar-header"},qa=["aria-label"],Za={class:"dss-datepicker__month-year-row"},Ua=["aria-label"],Xa={class:"dss-datepicker__weekdays"},Ya={class:"dss-datepicker__grid"},ja=["disabled","onClick","onMouseenter"],Ka={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ga={class:"dss-datepicker__calendar-header"},Qa=["aria-label"],Ja={class:"dss-datepicker__month-year-row"},es=["aria-label"],ts={class:"dss-datepicker__weekdays"},ns={class:"dss-datepicker__grid"},ls=["disabled","onClick","onMouseenter"],os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},as={class:"dss-datepicker__calendar-header"},ss={class:"dss-datepicker__month-year-row"},rs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},is={class:"dss-datepicker__months-grid"},cs=["onClick"],us={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ds={class:"dss-datepicker__month-year"},ms={class:"dss-datepicker__years-grid"},ps=["data-year","onClick"],ra=27,ea={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:T=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(T)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(T,{emit:oe}){const M=T,L=oe,{t:fe,locale:P}=Gl.useI18n(),A=e.ref(!1),pe=e.ref("days"),ft=new Date,ee=e.computed(()=>M.minDate instanceof Date?M.minDate:ft),f=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),Ce=e.ref(ee.value.getMonth()),Q=e.ref(ee.value.getFullYear()),X=e.ref(ee.value.getMonth()),de=e.ref(ee.value.getFullYear()),H=e.ref("start"),Ee=e.ref(null),Ie=e.ref(null);function ot(){const R=ee.value,W=R.getMonth(),I=R.getFullYear(),ne=W===11?0:W+1,Ae=W===11?I+1:I;return{left:{month:W,year:I},right:{month:ne,year:Ae}}}const vt=e.ref(null),q=e.ref(null),Ye=e.ref(null),qe=e.ref(null),Se=e.ref(null),$e=e.ref(null),Ge=new Date().getFullYear(),K=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),We=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),we=e.computed(()=>{if(M.mode!=="single"&&M.mode!=="singleFromAvailable")return null;const R=M.modelValue;return R instanceof Date?R:null}),ct=e.computed(()=>{if(!We.value)return{start:null,end:null};const R=M.modelValue;return!R||typeof R!="object"?{start:null,end:null}:{start:R.start instanceof Date?R.start:null,end:R.end instanceof Date?R.end:null}});function rt(R){if(!R||!(R instanceof Date))return"";const W=R.getDate(),I=R.getMonth()+1,ne=R.getFullYear(),Ae=dt=>String(dt).padStart(2,"0");return`${Ae(W)}/${Ae(I)}/${ne}`}const Et=e.computed(()=>rt(we.value)),Rt=e.computed(()=>{const{start:R,end:W}=ct.value;if(!R&&!W)return"";const I=!W||R&&R<=W?R:W,ne=!R||W&&W>=R?W:R;return Be(I,ne)?rt(I):`${rt(I)} - ${rt(ne)}`}),Qt=e.computed(()=>{if(M.mode!=="readonly")return"—";const R=M.modelValue;if(R instanceof Date)return rt(R)||"—";if(R&&typeof R=="object"&&("start"in R||"end"in R)){const W=R.start instanceof Date?R.start:null,I=R.end instanceof Date?R.end:null;if(!W&&!I)return"—";const ne=!I||W&&W<=I?W:I,Ae=!W||I&&I>=W?I:W;return Be(ne,Ae)?rt(ne):`${rt(ne)} - ${rt(Ae)}`}return"—"});e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)});const It=e.computed(()=>Ie.value==="left"?Ce.value:Ie.value==="right"?X.value:f.value),ae=e.computed(()=>Ie.value==="left"?Q.value:Ie.value==="right"?de.value:be.value),me=e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Pe=e.computed(()=>{const R=new Date(ae.value,It.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Re=e.computed(()=>{const R=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(W,I)=>R.format(new Date(2024,I,1)))}),Wt=e.computed(()=>{const W=(Ie.value?ae.value:be.value)-Math.floor(ra/2);return Array.from({length:ra},(I,ne)=>W+ne)}),kt=e.computed(()=>{const R=Wt.value;return R.length?`${R[0]} – ${R[R.length-1]}`:""}),qt=e.computed(()=>{const R=new Intl.DateTimeFormat(P.value,{weekday:"short"}),W=new Date(2024,0,1),I=[];for(let ne=0;ne<7;ne++){const Ae=new Date(W);Ae.setDate(W.getDate()+ne),I.push(R.format(Ae).slice(0,2))}return I});function Bt(R,W){const I=new Date(R,W,1),ne=new Date(R,W+1,0),Ae=I.getDay(),dt=ne.getDate(),mt=[];for(let at=0;at<Ae;at++)mt.push(null);for(let at=1;at<=dt;at++)mt.push(new Date(R,W,at));return mt}const Pt=e.computed(()=>Bt(be.value,f.value)),G=e.computed(()=>Bt(Q.value,Ce.value)),he=e.computed(()=>Bt(de.value,X.value));e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)}),e.computed(()=>{const R=new Date(de.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)});const _e=e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),je=e.computed(()=>{const R=new Date(de.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Qe=e.computed(()=>M.availableDates&&M.availableDates.length>0),Lt=e.computed(()=>Qe.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),tt=e.ref({top:0,left:0});function Tt(){if(!qe.value||!A.value)return;const R=qe.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,I=window.innerHeight||document.documentElement.clientHeight;let ne=R.left,Ae=R.bottom+4;const dt=Se.value;if(dt){const mt=dt.offsetWidth,at=dt.offsetHeight;if(ne+mt>W-8&&(ne=R.right-mt,ne<8&&(ne=8)),Ae+at>I-8){const pt=R.top-4-at;pt>=8?Ae=pt:Ae=Math.max(8,I-at-8)}}tt.value={top:Ae,left:ne}}const Xe=e.computed(()=>!qe.value||!A.value?{}:{position:"fixed",left:`${tt.value.left}px`,top:`${tt.value.top}px`,zIndex:1002});function Be(R,W){return!R||!W?!1:R.getFullYear()===W.getFullYear()&&R.getMonth()===W.getMonth()&&R.getDate()===W.getDate()}function Je(R){return new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime()}function St(R){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(W=>W instanceof Date&&Be(W,R))}function le(R){const W=Je(R);return!(M.minDate instanceof Date&&W<Je(M.minDate)||M.maxDate instanceof Date&&W>Je(M.maxDate))}function U(R){const W=new Date(R);return new Date(W.getFullYear(),W.getMonth(),W.getDate())}function Y(R){return R.filter(W=>le(W))}function ge(R,W){if(!(R instanceof Date)||!(W instanceof Date))return null;let I=Je(R),ne=Je(W);if(I>ne&&([I,ne]=[ne,I]),M.minDate instanceof Date){const Ae=Je(M.minDate);I=Math.max(I,Ae),ne=Math.max(ne,Ae)}if(M.maxDate instanceof Date){const Ae=Je(M.maxDate);I=Math.min(I,Ae),ne=Math.min(ne,Ae)}return I>ne?null:{start:U(I),end:U(ne)}}function ke(R){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(W=>W instanceof Date&&Be(W,R))}function Le(R){return ke(R)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?St(R):le(R)}function xt(R){const W=we.value,I=ct.value,ne=Je(R),Ae=We.value&&I.start&&I.end&&ne>Je(I.start)&&ne<Je(I.end),dt=We.value&&I.start&&Be(R,I.start),mt=We.value&&I.end&&Be(R,I.end),at=dt&&mt,pt=K.value&&W&&Be(R,W)||dt||mt;let dn=!1;if(We.value&&I.start&&!I.end&&Ee.value){const Vn=Je(I.start),Dn=Je(Ee.value),zn=Math.min(Vn,Dn),pl=Math.max(Vn,Dn);dn=ne>zn&&ne<pl}return{"dss-datepicker__day--selected":pt&&!at,"dss-datepicker__day--range-start":dt&&!at,"dss-datepicker__day--range-end":mt&&!at,"dss-datepicker__day--range-single":at,"dss-datepicker__day--in-range":Ae&&!dt&&!mt,"dss-datepicker__day--in-range-preview":dn&&!dt&&!mt&&!Ae,"dss-datepicker__day--disabled":!Le(R)}}function Jt(R){if(!We.value)return;const W=ct.value;if(!W.start||W.end){Ee.value=null;return}if(!Le(R)){Ee.value=null;return}Ee.value=new Date(R.getFullYear(),R.getMonth(),R.getDate())}function Vt(){Ee.value=null}function Ut(){if(!M.doubleCalendar||!We.value)return;const R=ct.value,{start:W,end:I}=R;if(W&&I){const dt=W<=I?W:I,mt=W<=I?I:W,at=dt.getMonth(),pt=dt.getFullYear(),dn=mt.getMonth(),Vn=mt.getFullYear();if(at!==dn||pt!==Vn){const Dn=Ce.value===at&&Q.value===pt,zn=X.value===dn&&de.value===Vn;if(Dn&&zn)return;Ce.value=at,Q.value=pt,X.value=dn,de.value=Vn}else{const Dn=at===0?11:at-1,zn=at===0?pt-1:pt;Ce.value===Dn&&Q.value===zn&&X.value===at&&de.value===pt||(Ce.value=at,Q.value=pt,at===11?(X.value=0,de.value=pt+1):(X.value=at+1,de.value=pt))}return}const ne=W||I;if(ne){const dt=ne.getMonth(),mt=ne.getFullYear(),at=Ce.value===dt&&Q.value===mt,pt=X.value===dt&&de.value===mt;if(at||pt)return;Ce.value=dt,Q.value=mt,dt===11?(X.value=0,de.value=mt+1):(X.value=dt+1,de.value=mt);return}const Ae=ot();Ce.value=Ae.left.month,Q.value=Ae.left.year,X.value=Ae.right.month,de.value=Ae.right.year}function V(R="start"){if(M.mode==="readonly")return;H.value=R;const W=we.value,I=ct.value;if(K.value&&W)f.value=W.getMonth(),be.value=W.getFullYear();else if(We.value)if(M.doubleCalendar)Ut();else{const ne=R==="start"&&I.start?I.start:I.end||I.start;ne&&(f.value=ne.getMonth(),be.value=ne.getFullYear())}qe.value=K.value?vt.value?.closest(".dss-datepicker__input-wrap"):q.value,pe.value="days",Ie.value=null,A.value=!0,e.nextTick(()=>{Tt()})}function w(){pe.value="days",Ie.value=null,Ee.value=null,A.value=!1}function S(R,W){Ie.value=R,pe.value=W}function Z(){pe.value="days",Ie.value=null}function J(R){const W=new Date,I=W.getFullYear(),ne=W.getMonth(),Ae=W.getDate();let dt,mt;if(Qe.value){const at=Y([...M.availableDates].filter(pt=>pt instanceof Date).map(pt=>new Date(pt.getFullYear(),pt.getMonth(),pt.getDate()))).sort((pt,dn)=>pt.getTime()-dn.getTime());if(at.length===0)return null;if(R==="all")dt=at[0],mt=at[at.length-1];else{const pt=parseInt(R.replace("last",""),10);if(pt<2||pt>5)return null;const dn=at.slice(-pt);if(dn.length===0)return null;dt=dn[0],mt=dn[dn.length-1]}}else{const at=new Date(I,ne,Ae);switch(R){case"today":dt=at,mt=at;break;case"lastWeek":dt=new Date(I,ne,Ae-6),mt=at;break;case"last15Days":dt=new Date(I,ne,Ae-14),mt=at;break;case"last30Days":dt=new Date(I,ne,Ae-29),mt=at;break;case"thisMonth":dt=new Date(I,ne,1),mt=at;break;case"last3Months":dt=new Date(I,ne-3,1),mt=new Date(I,ne,0);break;case"last6Months":dt=new Date(I,ne-6,1),mt=new Date(I,ne,0);break;case"last12Months":dt=new Date(I,ne-12,1),mt=new Date(I,ne,0);break;case"lastYear":dt=new Date(I-1,0,1),mt=new Date(I-1,11,31);break;default:return null}}return{start:dt,end:mt}}function Ze(R){const W=J(R);return W?ge(W.start,W.end):null}function gt(R){return Ze(R)!==null}function nt(R){const W=Ze(R);W&&(L("update:modelValue",W),Ut())}function xe(R){Ie.value==="left"?Ce.value=R:Ie.value==="right"?X.value=R:f.value=R,Z()}function Nt(R){Ie.value==="left"?Q.value=R:Ie.value==="right"?de.value=R:be.value=R,Z()}function zt(){f.value===0?(f.value=11,be.value--):f.value--}function $t(){f.value===11?(f.value=0,be.value++):f.value++}function it(){Ce.value===0?(Ce.value=11,Q.value--):Ce.value--}function Ct(){Ce.value===11?(Ce.value=0,Q.value++):Ce.value++}function Jn(){X.value===0?(X.value=11,de.value--):X.value--}function Xn(){X.value===11?(X.value=0,de.value++):X.value++}function Sn(R){if(!Le(R))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());if(K.value){L("update:modelValue",W),w();return}const I=ct.value;if(!I.start&&!I.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(I.start&&I.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(H.value==="start"){let ne=W,Ae=I.end;ne&&Ae&&ne>Ae&&([ne,Ae]=[Ae,ne]),L("update:modelValue",{start:ne||Ae,end:Ae||ne}),H.value="end"}else{let ne=I.start,Ae=W;ne&&Ae&&Ae<ne&&([ne,Ae]=[Ae,ne]),L("update:modelValue",{start:ne||Ae,end:Ae||ne}),H.value="start"}}e.watch(ct,()=>{M.doubleCalendar&&We.value&&A.value&&Ut()},{deep:!0});let un=null,Xt=null,Fn=null;function sl(){un&&(document.removeEventListener("keydown",un),un=null),Xt&&(window.removeEventListener("resize",Xt),Xt=null),Fn&&(window.removeEventListener("scroll",Fn,!0),Fn=null)}return e.watch(pe,R=>{R==="years"&&e.nextTick(()=>{$e.value?.querySelector(`[data-year="${ae.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,R=>{sl(),R&&(un=W=>{W.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Z():w())},Xt=()=>{Tt()},Fn=()=>{Tt()},document.addEventListener("keydown",un),window.addEventListener("resize",Xt),window.addEventListener("scroll",Fn,!0))}),e.onBeforeUnmount(()=>{sl()}),(R,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":T.mode==="readonly"}])},[T.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Sa,[W[10]||(W[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Qt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):K.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=I=>V("start"))},[W[11]||(W[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:vt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(fe)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):We.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:q,onClick:W[1]||(W[1]=I=>V("start"))},[W[12]||(W[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ye,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(fe)("datepicker.selectRange"),value:Rt.value,readonly:""},null,8,Ba)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(w,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Se,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&&We.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&&We.value&&pe.value==="days"&&T.quickSelect}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Xe.value)},[pe.value==="days"&&T.doubleCalendar&&We.value?(e.openBlock(),e.createElementBlock("div",Ma,[T.quickSelect?(e.openBlock(),e.createElementBlock("nav",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!gt(I.id),onClick:ne=>nt(I.id)},e.toDisplayString(e.unref(fe)(I.labelKey)),9,$a))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",La,[e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.prevMonth"),onClick:it}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=I=>S("left","months"))},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=I=>S("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:Ct}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])]),e.createElementVNode("div",Oa,[e.createElementVNode("div",Wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.prevMonth"),onClick:Jn}," ‹ ",8,qa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=I=>S("right","months"))},e.toDisplayString(je.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=I=>S("right","years"))},e.toDisplayString(de.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:Xn}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):pe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.prevMonth"),onClick:zt}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=I=>pe.value="months")},e.toDisplayString(me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=I=>pe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:$t}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=I=>pe.value="years")},e.toDisplayString(ae.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(I,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===It.value}]),onClick:Ae=>xe(ne)},e.toDisplayString(I),11,cs))),128))])],64)):pe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",us,[e.createElementVNode("span",ds,e.toDisplayString(kt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:$e},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":I===ae.value,"dss-datepicker__year-cell--current":I===e.unref(Ge)}]),"data-year":I,onClick:ne=>Nt(I)},e.toDisplayString(I),11,ps))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},fs=["data-chart-type"],vs={class:"dss-chart-header-titles"},gs={key:0,class:"dss-chart-title"},hs={key:1,class:"dss-chart-subtitle"},ys=["onClick","onMouseenter"],ks={class:"dss-legend-text"},Cs=["onClick","onMouseenter"],bs={class:"dss-legend-text"},ws=["title"],xs=["src"],Es={class:"dss-chart-area-wrapper"},Ss={key:0,class:"dss-chart-z-axis-label"},Vs=["width","height","data-smooth","data-animated"],Ns=["id"],Bs=["y","width","height"],Ms=["id"],_s=["d"],$s=["id"],Ls=["d"],Ts={key:0},As=["clip-path"],Ds=["x1","x2","y1","y2"],Hs={class:"dss-axes"},Rs=["x1","x2","y1","y2"],Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs={class:"dss-axis-labels"},Ps=["x","y"],Os=["x","y"],Ws=["x","y"],qs=["x","y"],Zs=["y","transform"],Us=["x","y","transform"],Xs={key:1,class:"dss-flag-markers"},Ys=["clip-path"],js=["x1","x2","y1","y2","onMouseover"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["cx","cy","onMouseover"],Js=["cx","cy","fill","onMouseover"],er=["x","y"],tr=["clip-path"],nr={key:0},lr=["d","onMouseover"],or=["x","y","width","height","fill","onMouseover"],ar={class:"dss-line-chart"},sr=["d","stroke","stroke-width","stroke-dasharray"],rr=["d","stroke","stroke-width","opacity"],ir=["cx","cy","r","fill","onMouseover"],cr={key:1},ur=["d","stroke","stroke-width","stroke-dasharray"],dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","opacity"],pr=["cx","cy","r","fill","onMouseover"],fr={key:2},vr=["id"],gr=["x","y","width","height"],hr=["d","fill","fill-opacity","mask"],yr=["d","stroke","stroke-width"],kr=["d","fill","onMouseover"],Cr=["x","y","width","height","onMouseover"],br=["clip-path"],wr=["x1","x2","y1","y2","stroke"],xr=["cx","cy","r","fill"],Er={key:1,class:"dss-bubble-chart"},Sr={key:0,class:"dss-bubble-group"},Vr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Nr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Br=["transform"],Mr=["cx","cy","r"],_r=["data-chart-type","clip-path"],$r=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Lr={key:1,class:"dss-radial-segment-data-labels"},Tr=["x","y"],Ar=["x","y","font-size","fill"],Dr=["x1","y1","x2","y2","stroke"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x","y","text-anchor","font-size"],Fr=["transform"],Ir={key:0,class:"dss-spider-grid"},zr=["cx","cy","r"],Pr={class:"dss-spider-grid-labels"},Or=["x","y"],Wr=["x","y"],qr=["x1","x2","y1","y2"],Zr={class:"dss-spider-labels"},Ur=["x","y","text-anchor","dominant-baseline"],Xr=["points","fill","fill-opacity","stroke","stroke-width"],Yr=["cx","cy","r","fill","onMouseover"],jr={class:"dss-chart-logos"},Kr=["cx","cy","r","fill"],Gr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Qr=["onClick","onMouseenter"],Jr=["src"],ei={class:"dss-marker-tooltip-category"},ti={key:0,class:"dss-marker-tooltip-description"},ni={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},li={class:"dss-tooltip-title dss-spider-tooltip-area-title"},oi={class:"dss-tooltip-series-name"},ai={class:"dss-tooltip-series-value"},si={key:1,class:"dss-tooltip-section"},ri={key:0,class:"dss-tooltip-title"},ii={class:"dss-bubble-tooltip-data"},ci={key:2,class:"dss-tooltip-section"},ui={class:"dss-tooltip-title"},di={class:"dss-tooltip-value"},mi={key:0,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-group-header"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-text"},hi={key:1,class:"dss-tooltip-section"},yi={class:"dss-tooltip-section-title"},ki={class:"dss-tooltip-item-content"},Ci={class:"dss-tooltip-item-title"},bi={key:0,class:"dss-tooltip-item-description"},wi={class:"dss-tooltip-section"},xi={class:"dss-tooltip-title"},Ei={key:0,class:"dss-bubble-tooltip-data"},Si={class:"dss-tooltip-series-name"},Vi={class:"dss-tooltip-series-value"},Ni={key:0,class:"dss-tooltip-section"},Bi={class:"dss-tooltip-section-title"},Mi={class:"dss-tooltip-group-header"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-text"},Li={key:1,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Ai={class:"dss-tooltip-item-content"},Di={class:"dss-tooltip-item-title"},Hi={key:0,class:"dss-tooltip-item-description"},Ri=["onClick","onMouseenter"],Fi={class:"dss-legend-text"},Ii={key:1,class:"dss-context-menu-separator"},zi={key:0,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi=["onClick"],Wi=["innerHTML"],qi={key:0,class:"dss-context-menu-icon"},Zi={class:"dss-marker-modal-header"},Ui={class:"dss-marker-modal-body"},Xi={class:"dss-form-group"},Yi={class:"dss-form-group"},ji={for:"dss-marker-description"},Ki={key:0,class:"dss-form-text-display"},Gi=["placeholder"],Qi={class:"dss-marker-modal-footer"},Ji={class:"modal-footer-left"},ec={class:"dss-modal-footer-right"},tc=["disabled"],nc={name:"DSSChart"},lc=Object.assign(nc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:oe}){const{t:M,locale:L}=Gl.useI18n(),fe=oe,P=e.ref(null),A=e.ref(null),pe=e.ref(null),ft=e.ref(0),ee=e.ref(0);let f=null,be=null;const Ce=20,Q=e.computed(()=>{if(ee.value,ft.value,!P.value||!A.value)return 0;try{const t=P.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${H.chartId}`),de=e.computed(()=>`url(#${X.value})`),H=T,Ee={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Ie(t,a){const n=Object.assign({},t);return vt(t)&&vt(a)&&Object.keys(a).forEach(i=>{vt(a[i])?i in t?n[i]=Ie(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const ot=()=>{let t=20,a=0,n=0;if(rt.value&&(t+=30),Et.value&&(t+=25),G.value&&H.series.length>0){const i=H.series.filter((p,g)=>!lt.value.has(g)).length;if(he.value==="top"||he.value==="bottom"){if(_e.value==="horizontal"){const g=Math.floor(Se.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function vt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const q=e.computed(()=>Ie(Ee,H.options)),Ye=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.height==="auto"}),Se=e.computed(()=>{const t=q.value;return Ye.value?ft.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),$e=e.ref(Ce),Ge=e.computed(()=>{if(qe.value){const t=Ge.value;return t??Math.max(0,(ee.value||400)-$e.value*5)}}),K=e.computed(()=>{const t=q.value;if(we.value==="mini-radial")return Se.value;if(qe.value){const a=Ge.value;return a??Math.max(0,(ee.value||400)-$e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),We=e.computed(()=>{if(qe.value&&we.value==="semi-radial"&&Ge.value!=null)return $e.value+K.value+"px";if(qe.value)return"100%";if(hn.value)return $e.value+K.value+"px";if(G.value&&he.value==="bottom"){const t=ot();return K.value+(t.legendHeight||35)+"px"}return K.value+(G.value?20:0)+"px"}),we=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),ct=e.computed(()=>{const t=H.series.map(a=>a.type||we.value);return new Set(t).size>1}),rt=e.computed(()=>{const t=q.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=q.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Rt=e.computed(()=>{const t=q.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Qt=e.computed(()=>{const t=q.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ae=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),me=e.computed(()=>{const t=ae.value;return t&&t.title&&t.title.text?t.title.text:""}),Pe=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return En;const a=t.yAxis.min;return typeof a=="number"||a===En?a:En}),Re=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return En;const a=t.yAxis.max;return typeof a=="number"||a===En?a:En}),Wt=e.computed(()=>{const t=ae.value;if(!t)return En;const a=t.min;return typeof a=="number"||a===En?a:En}),kt=e.computed(()=>{const t=ae.value;if(!t)return En;const a=t.max;return typeof a=="number"||a===En?a:En}),qt=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Bt=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Pt=e.computed(()=>{const t=q.value;return t&&t.grid&&t.grid.show!==!1}),G=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.show!==!1}),he=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),_e=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),je=e.computed(()=>{const t=q.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Qe=e.computed(()=>{const t=q.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Lt=e.computed(()=>{const t=q.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),tt=e.computed(()=>{const t=q.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Tt=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Xe=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Be=e.computed(()=>{const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Je=e.computed(()=>{if(!hn.value)return 0;const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),St=e.computed(()=>{const t=q.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),le=e.computed(()=>{const{maxX:t}=Zt.value;return t===0}),U=(t,a)=>le.value&&a===0?5:a,Y=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ge=e.computed(()=>{const t=q.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ke=e.computed(()=>{const t=q.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Le=e.computed(()=>{const t=q.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),xt=e.computed(()=>{const t=q.value;return ke.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Jt=e.computed(()=>{const t=q.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Vt=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.enabled!==!1}),Ut=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),w=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),S=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Z=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),J=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ze=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),gt=e.computed(()=>{const t=q.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),nt=e.computed(()=>q.value?.spider?.gridSteps||5),xe=e.computed(()=>{const t=[],a=nt.value;for(let n=1;n<=a;n++)t.push(ut.value/a*n);return t}),Nt=t=>{const a=zt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=xe.value[t];return Math.round(n/ut.value*100)+"%"},zt=e.computed(()=>q.value?.spider?.gridLabels||null),$t=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),it=e.computed(()=>{const t=q.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Ct=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Jn=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.icon?t.markers.icon:dn.value}),Xn=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Sn=e.computed(()=>{const t=q.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),un=e.computed(()=>{const a=q.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Xt=t=>{const a=un.value;if(t==null)return"";const n=String(t);return a?n+a:n},Fn=e.computed(()=>!re.value.isZooming);e.computed(()=>At.value.map(t=>{if(t.categoryIndex!==void 0&&(xn.value||jt.value)){const a=Kt(t.categoryIndex),n=Q.value+F.value.bottom-Sn.value/2;return{...t,x:a,y:n}}return t}));function sl(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,b]=t.split("-"),z=Number(b?.length===2?`20${b}`:b);n=new Date(z,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[b,z,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(z)-1,Number(b)),te=Math.abs(B-n);te<p&&(p=te,i=C)}),i}const R=e.computed(()=>{const t=H.markers.map(n=>{const i=sl(n.marker_date,H.categories),p=Kt(i),g=Q.value+F.value.bottom-Sn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=At.value.map(n=>{if(n.categoryIndex!==void 0&&(xn.value||jt.value)){const i=Kt(n.categoryIndex),p=Q.value+F.value.bottom-Sn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),W=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.enabled===!0}),I=e.computed(()=>{const t=q.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ne=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Ae=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dt=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let a,n;const i=String(ne.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),mt=e.computed(()=>{const{width:t,height:a}=dt.value,n=Ae.value;let i,p;const g=F.value.left,C=F.value.right,b=F.value.top,z=F.value.bottom,N=F.value.width,$=F.value.height;switch(n){case"center":i=g+(N-t)/2,p=b+($-a)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=C-t-15,p=b+5;break;case"bottom-left":i=g+15,p=z-a-5;break;case"bottom-right":default:i=C-t-15,p=z-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),at=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),pt=t=>{const a=at(t),n=Al(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:M("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},dn=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Vn=e.computed(()=>{const t=H.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),Cl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Nn=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Bn=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),dl=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),rt=e.ref(new Set),ie=e.ref(null),ol=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),fn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Te=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),bt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),se=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),_e=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return P.value&&t.push(...Object.keys(P.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Ut.value;return Array.from({length:t+1},(a,n)=>_("chart.fallback.item",{number:n+1}))}return H.categories});const bl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),_l=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),kn=e.computed(()=>_e.value.editingMarkerId!==null),Jt=e.computed(()=>_e.value.readonly),Kn=t=>{rt.value.has(t)||(Ko.value=!0,ie.value=t)},on=()=>{Ko.value=!1,ie.value=null},Zn=t=>{if(fo.value||To.value){Te.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.value?i>=R.value.left-50&&i<=R.value.right+50&&p>=R.value.top-50&&p<=R.value.bottom+100:i>=R.value.left&&i<=R.value.right&&p>=R.value.top&&p<=R.value.bottom;if(ol.value=g,jt.value){if(!lt.value||!g||se.value.isDragging||se.value.isZooming){Te.value.show=!1;return}if(j.value.find(ce=>!ce||ce.isHidden?!1:Math.sqrt(Math.pow(ce.x-i,2)+Math.pow(ce.y-p,2))<=ce.radius+3))Te.value.show=!1;else{const ce=j.value.filter(ke=>!ke||ke.isHidden?!1:Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2))<=250);if(ce.length>0){let ke=ce[0],Ne=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2));ce.forEach(ze=>{const $e=Math.sqrt(Math.pow(ze.x-i,2)+Math.pow(ze.y-p,2));$e<Ne&&(Ne=$e,ke=ze)});const fe=30,et=j.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-ke.x)<=fe).sort((ze,$e)=>ze.y-$e.y);Te.value={show:!0,x:ke.x,categoryIndex:Math.round(ke.originalX),data:(()=>{const ze=Nn.value,$e=Bn.value,Me=[];return et.forEach(De=>{ze.forEach($t=>{const Ft=$e[$t]||$t,On=el($t,De);On&&Me.push({seriesName:De.seriesName,label:De.label,value:`${Ft}: ${On}`,color:De.color,y:De.y})})}),Me})()}}else Te.value.show=!1}return}if(se.value.isDragging&&se.value.scale>1&&bn.value&&je.value){Te.value.show=!1;const Ze=t.clientX-se.value.lastMouseX,{minX:ce,maxX:ke}=Ut.value,Ne=ke-ce||1,et=Ze*.8;se.value.offsetX+=et;const ze=Ne/se.value.scale,$e=Ne-ze,Me=0,De=-$e/Ne*R.value.width,$t=Me;se.value.offsetX=Math.max(De,Math.min($t,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY;return}if(!lt.value||!bn.value||se.value.isDragging||se.value.isZooming||!g){Te.value.show=!1;return}const{minX:C,maxX:b}=Ut.value,F=b-C||1,N=F/se.value.scale,$=C-se.value.offsetX/R.value.width*F,B=(i-R.value.left)/R.value.width,te=$+B*N,Ee=Math.round(te);if(Ee>=0&&Ee<=b){const Ze=Kt(Ee),ce=Yn.value.map((ke,Ne)=>{const fe=H.series.findIndex(ze=>ze===ke),et=ke.data[Ee];return{seriesName:ke.name,value:et!==void 0?et:null,color:c(fe),y:et!==void 0?yn(ke,et):null}}).filter(ke=>ke.value!==null);Te.value={show:!0,x:Ze,categoryIndex:Ee,data:ce}}},al=()=>{Te.value.show=!1,ol.value=!1,To.value=!1,fo.value||(Cl.value.show=!1),se.value.isDragging&&(se.value.isDragging=!1),se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1,setTimeout(()=>{ie.value=null,gt.value.show=!1},150)},$l=t=>{if(t.preventDefault(),t.stopPropagation(),!Ct.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(vn.value){bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null});return}const p=Math.max(0,R.value.left-20),g=R.value.right,C=R.value.top,b=R.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=b&&(bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null;const F=Math.max(R.value.left,Math.min(n,R.value.right))-R.value.left,$=R.value.width/o.value.length,B=Math.floor(F/$);B>=0&&B<o.value.length&&(bt.value.categoryIndex=B)}))},Mn=t=>{if(!(t&&t.button===2)){if(bt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}bt.value.show=!1}},Cn=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:Tt.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:bt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Wl=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gn=t=>t.style||{},Rn=t=>t.type&&P.value[t.type]?P.value[t.type]:t.customIcon?t.customIcon:qn.value,Ll=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Tl=t=>Tt.value.length?Tt.value.filter(a=>a.categoryIndex===t):[],k=t=>{if(!bn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=le.value+R.value.bottom-Z.value/2;return{x:a,y:n}},h=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(bn.value||jt.value)){const a=k(t.categoryIndex);t.x=a.x,t.y=a.y}})},x=()=>{if(_e.value.description&&_e.value.description.length&&_e.value.date){if(kn.value){const t=Tt.value.findIndex(a=>a.id===_e.value.editingMarkerId);t!==-1?(Tt.value[t].description=_e.value.description||"",Tt.value[t].color=_e.value.color||"",Tt.value[t].type=_e.value.type||"default",ue("update-marker",Tt.value[t])):ue("update-marker",{id:_e.value.editingMarkerId,description:_e.value.description||"",color:_e.value.color||"",type:_e.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=mt(_e.value.date,H.categories||[]);if(jt.value){const{maxX:C}=Ut.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else bn.value&&(a=Math.max(0,Math.min(a,Ut.value.maxX)));const n=Kt(a),i=le.value+R.value.bottom-Z.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:_e.value.description||"",color:_e.value.color||"",type:_e.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};_e.value.categoryIndex=a,Tt.value.push(g),ue("add-marker",g)}O(),Yt()}},O=()=>{_e.value.show=!1,_e.value.title="",_e.value.description="",_e.value.color="#FF6B6B",_e.value.type="default",_e.value.editingMarkerId=null,_e.value.readonly=!1,_e.value.categoryIndex=null,_e.value.fromButton=!1,_e.value.date=null},de=()=>{kn.value&&(yt(_e.value.editingMarkerId),O())},yt=t=>{const a=Tt.value.findIndex(n=>n.id===t);a!==-1&&(Tt.value.splice(a,1),Yt()),ue("delete-marker",t)},_t=t=>{if(_e.value.show=!0,_e.value.title=t?.title??t?.comment??"",_e.value.description=t?.description??t?.comment??"",_e.value.color=t?.color??"",_e.value.type=t?.type??"default",_e.value.editingMarkerId=t?.id??t?.marker_id??null,_e.value.readonly=t?.readonly??!1,_e.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?_e.value.date=new Date(p,C,g):_e.value.date=null}else _e.value.date=null},Yt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},an=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(Tt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},tn=t=>{const a=ct.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},sn=()=>{const t=Te.value.show,a=gt.value.show;return Te.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Fn=t=>{Te.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},Al=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),F=b.getContext("2d");b.width=a,b.height=n,F.fillStyle="#fafafa",F.fillRect(0,0,a,n),F.drawImage(g,0,0,a,n);const N=b.toDataURL("image/png");i(N)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),Po=async()=>{try{const t=sn();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),Fn(t);return}const n=Pe(),i=Ve.value,p=G.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(fe=>fe.remove());const b=g.querySelectorAll("image"),F=Array.from(b).map(async fe=>{const et=fe.getAttribute("xlink:href")||fe.getAttribute("href");if(et&&!et.startsWith("data:"))try{const ze=await Al(et,32,32);fe.setAttribute("xlink:href",ze),fe.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(F);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(ct.value&&(B+=`
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Dn=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),zn=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=q.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const pl=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),_l=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Pl=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),_n=e.computed(()=>{const a=q.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),to=e.computed(()=>{const a=q.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),rl=e.computed(()=>{const a=q.value?.radialBar?.dataCenter;return Hl.value?!0:Rn.value&&a&&(a.show===!0||a.enabled===!0)}),vn=e.computed(()=>{if(!rl.value||!st.value.length)return"";if(Hl.value){const i=st.value[1]??st.value[0];return Xt(i?.value??0)}const n=q.value?.radialBar?.dataCenter?.showValueOnly===!0?st.value[0]?.value??0:st.value.reduce((i,p)=>i+(p.value??0),0);return Xt(n)}),Hn=e.computed(()=>{const a=q.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),Nn=e.computed(()=>({x:Dt.value,y:Hl.value?wt.value:wt.value-Hn.value/2})),wl=e.computed(()=>{const a=q.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),Ol=e.computed(()=>{if(!_n.value||!hn.value||!st.value.length)return[];const t=to.value*Math.PI/180,a=(Ot.value+ut.value)/2;return st.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Dt.value+Math.cos(n.midAngle)*a,C=wt.value+Math.sin(n.midAngle)*a;return{value:Xt(n.value),x:g,y:C,show:p,color:n.color,contrastColor:d(n.color)}})}),fl=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(a=>{const n=a.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(a)}),Array.from(t.entries()).map(([a,n])=>{const i=Kt(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),xl=e.ref({show:!1,x:0,y:0,content:"",count:0}),$n=e.computed(()=>q.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Ln=e.computed(()=>{const t=q.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),vl=e.computed(()=>q.value?.bubbles?.tooltip?.formatters||{}),lt=e.ref(new Set),ie=e.ref(null),il=e.ref(!1),ht=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),gn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Fe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),bt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),re=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),At=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Xn.value&&t.push(...Object.keys(Xn.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Zt.value;return Array.from({length:t+1},(a,n)=>M("chart.fallback.item",{number:n+1}))}return H.categories});const El=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),$l=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),bn=e.computed(()=>De.value.editingMarkerId!==null),en=e.computed(()=>De.value.readonly),el=t=>{lt.value.has(t)||(Ko.value=!0,ie.value=t)},on=()=>{Ko.value=!1,ie.value=null},Yn=t=>{if(fo.value||To.value){Fe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.value?i>=F.value.left-50&&i<=F.value.right+50&&p>=F.value.top-50&&p<=F.value.bottom+100:i>=F.value.left&&i<=F.value.right&&p>=F.value.top&&p<=F.value.bottom;if(il.value=g,jt.value){if(!Qe.value||!g||re.value.isDragging||re.value.isZooming){Fe.value.show=!1;return}if(j.value.find(ce=>!ce||ce.isHidden?!1:Math.sqrt(Math.pow(ce.x-i,2)+Math.pow(ce.y-p,2))<=ce.radius+3))Fe.value.show=!1;else{const ce=j.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(ce.length>0){let ye=ce[0],Me=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));ce.forEach(Ue=>{const He=Math.sqrt(Math.pow(Ue.x-i,2)+Math.pow(Ue.y-p,2));He<Me&&(Me=He,ye=Ue)});const ve=30,et=j.value.filter(Ue=>!Ue||Ue.isHidden?!1:Math.abs(Ue.x-ye.x)<=ve).sort((Ue,He)=>Ue.y-He.y);Fe.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Ue=$n.value,He=Ln.value,Te=[];return et.forEach(ze=>{Ue.forEach(_t=>{const Ft=He[_t]||_t,Zn=ol(_t,ze);Zn&&Te.push({seriesName:ze.seriesName,label:ze.label,value:`${Ft}: ${Zn}`,color:ze.color,y:ze.y})})}),Te})()}}else Fe.value.show=!1}return}if(re.value.isDragging&&re.value.scale>1&&xn.value&&tt.value){Fe.value.show=!1;const Ke=t.clientX-re.value.lastMouseX,{minX:ce,maxX:ye}=Zt.value,Me=ye-ce||1,et=Ke*.8;re.value.offsetX+=et;const Ue=Me/re.value.scale,He=Me-Ue,Te=0,ze=-He/Me*F.value.width,_t=Te;re.value.offsetX=Math.max(ze,Math.min(_t,re.value.offsetX)),re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY;return}if(!Qe.value||!xn.value||re.value.isDragging||re.value.isZooming||!g){Fe.value.show=!1;return}const{minX:C,maxX:b}=Zt.value,z=b-C||1,N=z/re.value.scale,$=C-re.value.offsetX/F.value.width*z,B=(i-F.value.left)/F.value.width,te=$+B*N,Ve=Math.round(te);if(Ve>=0&&Ve<=b){const Ke=Kt(Ve),ce=Gn.value.map((ye,Me)=>{const ve=H.series.findIndex(Ue=>Ue===ye),et=ye.data[Ve];return{seriesName:ye.name,value:et!==void 0?et:null,color:c(ve),y:et!==void 0?Cn(ye,et):null}}).filter(ye=>ye.value!==null);Fe.value={show:!0,x:Ke,categoryIndex:Ve,data:ce}}},cl=()=>{Fe.value.show=!1,il.value=!1,To.value=!1,fo.value||(xl.value.show=!1),re.value.isDragging&&(re.value.isDragging=!1),re.value.zoomTimeout&&(clearTimeout(re.value.zoomTimeout),re.value.zoomTimeout=null),re.value.isZooming=!1,setTimeout(()=>{ie.value=null,ht.value.show=!1},150)},Ll=t=>{if(t.preventDefault(),t.stopPropagation(),!$t.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(hn.value){bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,C=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=b&&(bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null;const z=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,$=F.value.width/o.value.length,B=Math.floor(z/$);B>=0&&B<o.value.length&&(bt.value.categoryIndex=B)}))},Tn=t=>{if(!(t&&t.button===2)){if(bt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}bt.value.show=!1}},wn=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:At.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:bt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Wl=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},tl=t=>t.style||{},In=t=>t.type&&Xn.value[t.type]?Xn.value[t.type]:t.customIcon?t.customIcon:Jn.value,Tl=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Al=t=>At.value.length?At.value.filter(a=>a.categoryIndex===t):[],k=t=>{if(!xn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=Q.value+F.value.bottom-Sn.value/2;return{x:a,y:n}},h=()=>{At.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xn.value||jt.value)){const a=k(t.categoryIndex);t.x=a.x,t.y=a.y}})},x=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(bn.value){const t=At.value.findIndex(a=>a.id===De.value.editingMarkerId);t!==-1?(At.value[t].description=De.value.description||"",At.value[t].color=De.value.color||"",At.value[t].type=De.value.type||"default",fe("update-marker",At.value[t])):fe("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=sl(De.value.date,H.categories||[]);if(jt.value){const{maxX:C}=Zt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else xn.value&&(a=Math.max(0,Math.min(a,Zt.value.maxX)));const n=Kt(a),i=Q.value+F.value.bottom-Sn.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};De.value.categoryIndex=a,At.value.push(g),fe("add-marker",g)}O(),Yt()}},O=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},ue=()=>{bn.value&&(yt(De.value.editingMarkerId),O())},yt=t=>{const a=At.value.findIndex(n=>n.id===t);a!==-1&&(At.value.splice(a,1),Yt()),fe("delete-marker",t)},Mt=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?De.value.date=new Date(p,C,g):De.value.date=null}else De.value.date=null},Yt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(At.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},an=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(At.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),At.value=[]}},nn=t=>{const a=rt.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},sn=()=>{const t=Fe.value.show,a=ht.value.show;return Fe.value.show=!1,ht.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Pn=t=>{Fe.value.show=t.originalCrosshair,ht.value.show=t.originalTooltip},Dl=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),z=b.getContext("2d");b.width=a,b.height=n,z.fillStyle="#fafafa",z.fillRect(0,0,a,n),z.drawImage(g,0,0,a,n);const N=b.toDataURL("image/png");i(N)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),Po=async()=>{try{const t=sn();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),Pn(t);return}const n=ot(),i=Se.value,p=K.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=g.querySelectorAll("image"),z=Array.from(b).map(async ve=>{const et=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(et&&!et.startsWith("data:"))try{const Ue=await Dl(et,32,32);ve.setAttribute("xlink:href",Ue),ve.setAttribute("href",Ue)}catch(Ue){console.warn("Failed to convert logo to base64:",Ue)}});await Promise.all(z);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(rt.value&&(B+=`
|
|
46
46
|
<text x="24" y="${te}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,te+=30),
|
|
51
|
+
${rt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,te+=30),Et.value&&(B+=`
|
|
53
53
|
<text x="24" y="${te}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,te+=25),
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${Et.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,te+=25),G.value&&H.series.length>0){let ve=i-200,et=rt.value||Et.value?35:25;const Ue=Math.floor((i-250)/120);let He=0;H.series.forEach((Te,ze)=>{if(!lt.value.has(ze)){const _t=c(ze),Ft=Te.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");B+=`<circle cx="${ve+6}" cy="${et-4}" r="6" fill="${_t}"/>`,B+=`<text x="${ve+18}" y="${et}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ft}</text>`,He++,He%Ue===0?(ve=i-200,et+=20):ve+=Math.min(120,Ft.length*8+35)}})}let Ve="";if(W.value)try{const{width:ve,height:et}=dt.value,Ue=Ae.value,He=F.value.left,Te=F.value.right,ze=F.value.top,_t=F.value.bottom,Ft=F.value.width,Zn=F.value.height;let fn,Un;switch(Ue){case"center":fn=He+(Ft-ve)/2,Un=ze+(Zn-et)/2;break;case"top-left":fn=He+15,Un=ze+5;break;case"top-right":fn=Te-ve-5,Un=ze+5;break;case"bottom-left":fn=He+15,Un=_t-et-5;break;case"bottom-right":default:fn=Te-ve-5,Un=_t-et-5;break}Ve=`
|
|
59
|
+
<g opacity="${I.value}">
|
|
60
|
+
<g transform="translate(${fn}, ${Un}) scale(${ve/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(
|
|
75
|
+
</g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),Ve=""}const Ke=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${i}" height="${p}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -87,32 +87,32 @@
|
|
|
87
87
|
${B}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
89
|
${$}
|
|
90
|
-
${
|
|
90
|
+
${Ve}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,ce=new Blob([
|
|
93
|
-
`),
|
|
94
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,ce=new Blob([Ke],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ce),Me=document.createElement("a");Me.href=ye,Me.download=nn("svg"),document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL(ye),Pn(t),Tn()}catch(a){console.error("Error downloading SVG:",a),Pn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},ho=async()=>{try{const t=sn();P.value&&P.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const a=ot(),n=Se.value,i=K.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=i*C,p.style.width=n+"px",p.style.height=i+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let b=30;if(rt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(rt.value,24,b),b+=30),Et.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Et.value,24,b),b+=25),G.value&&H.series.length>0){let ve=n-200,et=rt.value||Et.value?35:25;const Ue=Math.floor((n-250)/120);let He=0;g.font="12px Arial, sans-serif",H.series.forEach((Te,ze)=>{if(!lt.value.has(ze)){const _t=c(ze);g.beginPath(),g.arc(ve+6,et-4,6,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.fillStyle="#333",g.fillText(Te.name,ve+18,et),He++,He%Ue===0?(ve=n-200,et+=20):ve+=Math.min(120,Te.name.length*8+35)}})}const N=A.value.cloneNode(!0),$=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=N.querySelectorAll(".dss-crosshair"),te=N.querySelectorAll('[class*="tooltip"]');$.forEach(ve=>ve.remove()),B.forEach(ve=>ve.remove()),te.forEach(ve=>ve.remove()),N.querySelectorAll("image").forEach((ve,et)=>{const Ue=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ue&&!Ue.startsWith("data:")){const He=Lo.value[et],Te=He?c(He.seriesIndex):"#3B82F6",ze=ve.getAttribute("x")||0,_t=ve.getAttribute("y")||0,Ft=ve.getAttribute("width")||32,Zn=ve.getAttribute("height")||32,fn=document.createElementNS("http://www.w3.org/2000/svg","circle");fn.setAttribute("cx",parseFloat(ze)+parseFloat(Ft)/2),fn.setAttribute("cy",parseFloat(_t)+parseFloat(Zn)/2),fn.setAttribute("r",Math.min(parseFloat(Ft),parseFloat(Zn))/2-1),fn.setAttribute("fill",Te),fn.setAttribute("stroke","#fafafa"),fn.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(fn,ve)}});const Ke=new XMLSerializer().serializeToString(N),ce=new Blob([Ke],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ce),Me=new Image;return new Promise((ve,et)=>{Me.onload=async()=>{try{if(g.drawImage(Me,0,a.height),Lo.value.forEach(Ue=>{const He=Ue.x,Te=Ue.y+a.height,ze=(Ue.width||32)/2,_t=c(Ue.seriesIndex);g.save(),g.beginPath(),g.arc(He,Te,ze-1,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),W.value){const Ue=new Image,He=()=>{const{width:ze,height:_t}=dt.value,Ft=Ae.value,Zn=F.value.left,fn=F.value.right,Un=F.value.top,Do=F.value.bottom,xa=F.value.width,Ea=F.value.height;let jl,Kl;switch(Ft){case"center":jl=Zn+(xa-ze)/2,Kl=Un+a.height+(Ea-_t)/2;break;case"top-left":jl=Zn+15,Kl=Un+a.height+10;break;case"top-right":jl=fn-ze-5,Kl=Un+a.height+10;break;case"bottom-left":jl=Zn+15,Kl=Do+a.height-_t-5;break;case"bottom-right":default:jl=fn-ze-5,Kl=Do+a.height-_t-5;break}g.globalAlpha=I.value,g.drawImage(Ue,jl,Kl,ze,_t),g.globalAlpha=1,Te()},Te=()=>{p.toBlob(ze=>{const _t=URL.createObjectURL(ze),Ft=document.createElement("a");Ft.href=_t,Ft.download=nn("png"),document.body.appendChild(Ft),Ft.click(),document.body.removeChild(Ft),URL.revokeObjectURL(_t),URL.revokeObjectURL(ye),Pn(t),Tn(),ve()},"image/png")};Ue.onload=He,Ue.onerror=Te,Ue.src=Vn.value}else p.toBlob(Ue=>{const He=URL.createObjectURL(Ue),Te=document.createElement("a");Te.href=He,Te.download=nn("png"),document.body.appendChild(Te),Te.click(),document.body.removeChild(Te),URL.revokeObjectURL(He),URL.revokeObjectURL(ye),Pn(t),Tn(),ve()},"image/png")}catch(Ue){URL.revokeObjectURL(ye),Pn(t),et(Ue)}},Me.onerror=()=>{URL.revokeObjectURL(ye),Pn(t),et(new Error("Failed to load SVG image"))},Me.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},yo=()=>{try{let t="";rt.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${rt.value}
|
|
93
|
+
`),Et.value&&(t+=`# ${M("chart.csv.chartSubtitle")}: ${Et.value}
|
|
94
|
+
`),t+=`# ${M("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
96
|
`,t+="Category",H.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
97
|
-
`;const a=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let
|
|
98
|
-
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=tn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Mn()}catch(t){console.error("Error downloading CSV:",t)}},Oo=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:Tt.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:clampedCategoryIndex||bt.value.categoryIndex};t.action(a,n)}Mn()},Wo=()=>{O(),_e.value.show=!0,_e.value.categoryIndex=bt.value.categoryIndex,_e.value.fromButton=!1,Mn()},ko=()=>{O(),_e.value.show=!0,_e.value.categoryIndex=0,_e.value.fromButton=!0},Co=t=>{if(bt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(bt.value.show=!1)}},no=t=>{bt.value.show&&!t.target.closest(".context-menu")&&(bt.value.show=!1)},bo=t=>{if(!bn.value||!je.value)return;t.preventDefault(),t.stopPropagation(),se.value.isZooming=!0,Te.value.show=!1,se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<R.value.left-50||i>R.value.right+50||p<R.value.top-50||p>R.value.bottom+100){se.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(se.value.minScale,Math.min(se.value.maxScale,se.value.scale*g));if(C!==se.value.scale){const{minX:b,maxX:F}=Ut.value,N=F-b||1,$=N/se.value.scale,B=b-se.value.offsetX/R.value.width*N,te=(i-R.value.left)/R.value.width,Ee=B+te*$;se.value.scale=C;const Ze=N/se.value.scale,ce=Ee-te*Ze;se.value.offsetX=-(ce-b)/N*R.value.width,se.value.scale<=1.01&&(se.value.scale=1,se.value.offsetX=0)}se.value.zoomTimeout=setTimeout(()=>{se.value.isZooming=!1,se.value.zoomTimeout=null},300)},lo=t=>{if(!bn.value||!je.value||se.value.scale<=1)return;Te.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,se.value.isDragging=!0,se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY,t.preventDefault()},wo=()=>{se.value.isDragging=!1},oo=()=>{!bn.value||!je.value||(se.value.scale=1,se.value.offsetX=0,se.value.isDragging=!1,se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1)},qo=()=>!bn.value||!ol.value||!je.value?"default":se.value.isDragging?"grabbing":se.value.scale>1?"grab":"dss-crosshair",ql=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],b=p.x+(g.x-i.x)/6*st.value,F=p.y+(g.y-i.y)/6*st.value,N=g.x-(C.x-p.x)/6*st.value,$=g.y-(C.y-p.y)/6*st.value;a+=` C ${b} ${F} ${N} ${$} ${g.x} ${g.y}`}return a},En=e.computed(()=>{const a=U.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(qt.value?30:0)+60;if(Sn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(vn.value){const B=!J.value,te=yl.value,Ee=te?zl.value+Ml.value+Math.max(24,Bl.value+16):0,Ze=B?12:p;let ce=0;ct.value&&(ce+=B?8:15),St.value&&(ce+=B?6:10);const ke=Pe();let Ne=Ze+(B?4:16)+(te?Ee:0),fe=Ze+(te?Ee:0);J.value&&ye.value==="left"?Ne+=ke.legendWidth||150:J.value&&ye.value==="right"&&(fe+=ke.legendWidth||150);const ze=xe.value==="semi-radial"?te?Ee:8:te?Ee:B?8:p+80,$e=te?14:0,Me=Ze+ce+$e,De={left:Ne,top:Me,right:fe,bottom:ze};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??De.left,top:i.top??De.top,right:i.right??De.right,bottom:i.bottom??De.bottom}:De}let C=0;ct.value&&(C+=15),St.value&&(C+=10);const b=Pe();let F=p+16,N=p;J.value&&ye.value==="left"?F+=b.legendWidth||150:J.value&&ye.value==="right"&&(N+=b.legendWidth||150),_n.value&&(N+=44);const $={left:F,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),R=e.computed(()=>({left:En.value.left,top:En.value.top,right:Ve.value-En.value.right,bottom:G.value-En.value.bottom,width:Ve.value-(En.value.left+En.value.right),height:G.value-(En.value.top+En.value.bottom)})),bn=e.computed(()=>["line","area","bar"].includes(xe.value)||ht.value),In=e.computed(()=>ht.value),Dl=e.computed(()=>xe.value==="mini-radial"),vn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(xe.value)),Sn=e.computed(()=>xe.value==="spider"),jt=e.computed(()=>xe.value==="bubble"),Gt=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(xe.value==="bar"||In.value)),sl=t=>{const{minY:a,maxY:n}=Ut.value,i=n-a||1;return R.value.left+(t-a)/i*R.value.width},ml=t=>{const{maxX:a}=Ut.value,n=a+1,p=R.value.height/n;return R.value.top+(t+.5)*p},Ht=e.computed(()=>vn.value?En.value.left+(Ve.value-En.value.left-En.value.right)/2:Ve.value/2),wt=e.computed(()=>Sn.value?G.value/2-40:vn.value?En.value.top+(G.value-En.value.top-En.value.bottom)/2:G.value/2),dt=e.computed(()=>{if(Sn.value){const t=R.value.width-80,a=R.value.height-80;return Math.min(t,a)/2}return Math.min(R.value.width,R.value.height)/2}),Wt=e.computed(()=>{const t=U.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return dt.value*n}),Hl=e.computed(()=>{const t=U.value,a=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(vn.value||Sn.value)?1:1+a/100}),en=e.computed(()=>{const t=Hl.value;if(t===1||t<=0)return;const a=Ht.value,n=wt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),wl=e.ref(0),Zl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),Ln=e.computed(()=>xe.value==="semi-radial"),Qn=e.computed(()=>Ln.value&&Lt.value&&!hl.value),Jn=e.computed(()=>Ln.value&&Lt.value&&!hl.value&&Qt.value==="fill"),pl=e.computed(()=>{const t=Qn.value?wl.value:1,a=Ht.value,n=wt.value,i=Wt.value,p=dt.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const b=a+p*Math.cos(g),F=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),te=n+i*Math.sin(C),Ee=a+i*Math.cos(g),Ze=n+i*Math.sin(g),ce=t>.5?1:0;return`M ${a} ${n} L ${b} ${F} A ${p} ${p} 0 ${ce} 1 ${N} ${$} L ${B} ${te} A ${i} ${i} 0 ${ce} 1 ${Ee} ${Ze} Z`}),fl=e.computed(()=>{if(!(!Ln.value||!Qn.value)&&!Jn.value)return`url(#${Zl.value})`}),Zo=t=>{if(!(!Jn.value||t!==0))return`url(#${Zl.value})`},vl=e.ref(0),xl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Un=e.computed(()=>xe.value==="radial"),Rl=e.computed(()=>{const t=Un.value?vl.value:1,a=Ht.value,n=wt.value,i=Math.max(dt.value*1.5,Ve.value,G.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,te=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${te} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),b=n+i*Math.sin(p),F=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${b} A ${i} ${i} 0 ${$} 1 ${F} ${N} Z`}),xo=e.computed(()=>{if(fl.value)return fl.value;if(Un.value)return`url(#${xl.value})`});let Fl=null;const Uo=()=>{if(!Qn.value)return;wl.value=0;const t=V.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);wl.value=Go(S.value,g),g<1&&(Fl=requestAnimationFrame(n))};Fl=requestAnimationFrame(n)},Il=e.computed(()=>U.value?.bubbles?.minSize||8),ao=e.computed(()=>U.value?.bubbles?.maxSize||50),Ul=e.computed(()=>U.value?.bubbles?.opacity||.7),Eo=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},So=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},so=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Xn=e.computed(()=>H.series),Yn=e.computed(()=>H.series.filter((t,a)=>!rt.value.has(a))),Xl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ro=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Vo=e.computed(()=>Yn.value.filter(t=>Xl(t)==="primary")),El=e.computed(()=>Yn.value.filter(t=>Xl(t)==="secondary")),_n=e.computed(()=>!Gt.value&&!!Q.value&&El.value.length>0),wn="auto",io=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let b;if(a===wn){const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}else if(typeof a=="number")b=a;else{const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}let F;if(n===wn){const N=C-g,$=N>0?N*.1:2;F=C+$}else if(typeof n=="number")F=n;else{const N=C-g,$=N>0?N*.1:2;F=C+$}return{minY:b,maxY:F}},Ut=e.computed(()=>{if(jt.value)return Xo();if(!Yn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Yn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),H.categories.length>0&&(t=Math.max(t,H.categories.length-1));const a=io(Vo.value.length?Vo.value:Yn.value,He.value,Ye.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),No=e.computed(()=>_n.value?io(El.value,Zt.value,kt.value,Ut.value.minY,Ut.value.maxY):{minY:Ut.value.minY,maxY:Ut.value.maxY}),Xo=()=>{if(!Yn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(Yn.value.forEach((Ee,Ze)=>{Ee?.data?.length&&Ee.data.forEach((ce,ke)=>{let Ne,fe,et;if(typeof ce=="object"&&ce!==null&&!Array.isArray(ce))Ne=typeof ce.x=="number"?ce.x:ke,fe=typeof ce.y=="number"?ce.y:0,et=typeof ce.size=="number"?ce.size:20;else if(Array.isArray(ce)&&ce.length>=3)Ne=typeof ce[0]=="number"?ce[0]:ke,fe=typeof ce[1]=="number"?ce[1]:0,et=typeof ce[2]=="number"?ce[2]:20;else if(typeof ce=="number")Ne=ke,fe=ce,et=Eo(Ze,ke);else return;isFinite(Ne)&&isFinite(fe)&&isFinite(et)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),n=Math.min(n,fe),i=Math.max(i,fe),p=Math.min(p,et),g=Math.max(g,et),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=a-t,F=i-n;let N,$,B,te;return Ot.value!==null?N=Ot.value:N=t-b*.1,xt.value!==null?$=xt.value:$=a+b*.1,He.value!==null&&typeof He.value=="number"?B=He.value:B=Math.max(0,n-F*.1),Ye.value!==null&&typeof Ye.value=="number"?te=Ye.value:te=i+F*.1,{minX:N,maxX:$,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:b,maxX:F}=Ut.value,N=F-b||1;return R.value.left+(t-b)/N*R.value.width}const{minX:a,maxX:n}=Ut.value,i=n-a;if(n===0||i===0)return R.value.left+R.value.width/2;const p=i/se.value.scale,g=a-se.value.offsetX/R.value.width*i,C=(t-g)/p;return R.value.left+C*R.value.width},hn=t=>{const{minY:a,maxY:n}=Ut.value,i=n-a||1;return R.value.bottom-(t-a)/i*R.value.height},Bo=t=>{const{minY:a,maxY:n}=No.value,i=n-a||1;return R.value.bottom-(t-a)/i*R.value.height},yn=(t,a)=>_n.value&&Xl(t)==="secondary"?Bo(a):hn(a),co=t=>{if(!jt.value)return K.value||4;const{maxSize:a}=Ut.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return Il.value+i*(ao.value-Il.value)},Sl=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Sl.canvas||(Sl.canvas=document.createElement("canvas"));const i=Sl.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},uo=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Sl(t,n)<=a)return t;const i="..";if(Sl(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(Sl(C,n)<=a)return C;g-=1}return i},Mo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(xe.value==="bar"){if(Gt.value){const Me=[],{minY:De,maxY:$t}=Ut.value,Ft=5,On=$t-De||1;for(let mn=0;mn<=Ft;mn++){const Wn=De+On*(mn/Ft),Do=sl(Wn);Me.push({x:Do,y:R.value.bottom+20,text:re(Math.round(Wn))})}return Me}const ke=[],{maxX:Ne}=Ut.value,fe=Ne+1,et=5,$e=(R.value.width-et*2)/fe;for(let Me=0;Me<=Ne;Me++){const De=R.value.left+et+(Me+.5)*$e;ke.push({x:De,y:R.value.bottom+20,text:uo(H.categories[Me]||_("chart.fallback.item",{number:Me+1}),Math.max($e-8,24))})}return ke}const t=[],{minX:a,maxX:n}=Ut.value,i=Ot.value!==null?Ot.value:a,p=xt.value!==null?xt.value:n,g=p-i||1,C=g/se.value.scale,b=i-se.value.offsetX/R.value.width*g,F=b+C,N=Math.max(0,Math.floor(b-2)),$=Math.min(p,Math.ceil(F+2)),B=$-N,te=R.value.width,Ze=Math.floor(te/60);let ce=1;B>Ze&&(ce=Math.ceil(B/Ze));for(let ke=N;ke<=$;ke+=ce)if(ke>=0&&ke<=p){const Ne=Kt(ke);Ne>=R.value.left-100&&Ne<=R.value.right+100&&t.push({x:Ne,y:R.value.bottom+20,text:H.categories[ke]||`Item ${ke+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Ut.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(R.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,b=Kt(C);if(b>=R.value.left-10&&b<=R.value.right+10){const F=Math.round(C),N=H.categories?.[F];t.push({x:b,y:R.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Ut.value;for(let C=0;C<=g;C++)p.push({x:R.value.left-10,y:ml(C),text:uo(H.categories[C]||`Item ${C+1}`,Math.max(R.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Ut.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:R.value.left-10,y:hn(g),text:re(C)})}return t}),r=e.computed(()=>{if(!_n.value||Gt.value)return[];const t=[],{minY:a,maxY:n}=No.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:R.value.right+10,y:Bo(g),text:re(C)})}return t}),c=t=>{const a=ln.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const b=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,i=Number(b[2])/255,p=Number(b[3])/255;else{const F=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(F){let N=F[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${b})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),C=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${b}, ${i[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),F=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,b,F].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=U.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(i*i+p*p)}return a},y=e.computed(()=>xe.value==="line"||In.value?(In.value?H.series.filter(a=>(a.type||xe.value)==="line"):Xn.value).map((a,n)=>{const i=H.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,te)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Gt.value?sl(B):Kt(te),y:Gt.value?ml(te):yn(a,B),index:te})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let te="";tt.value?te=ql(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ee=>` L ${Ee.x} ${Ee.y}`).join(""),C+=(C?" ":"")+te}});const b=p.reduce((B,te)=>B+v(te),0),F=rt.value.has(i),N=ie.value===i,$=ie.value!==null&&ie.value!==i;return{path:C,color:c(i),strokeDasharray:ro(a),pathLength:b,seriesIndex:i,animationDelay:n*Y.value,isHighlighted:N,isDimmed:$,isHidden:F}}):[]),M=e.computed(()=>{if(!(xe.value==="line"||In.value))return[];const t=In.value?H.series.filter(n=>(n.type||xe.value)==="line"):Xn.value,a=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let b=-1,F=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)F++;else{b=N;break}}if(F>0&&b!==-1){const N=n.data[b],$=Gt.value?sl(C):Kt(g),B=Gt.value?ml(g):yn(n,C),te=Gt.value?sl(N):Kt(b),Ee=Gt.value?ml(b):yn(n,N),Ze=rt.value.has(p),ce=ie.value===p,ke=ie.value!==null&&ie.value!==p;a.push({path:`M ${$} ${B} L ${te} ${Ee}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ce,isDimmed:ke,isHidden:Ze,gapSize:F}),g=b-1}}}}),a}),D=e.computed(()=>xe.value==="line"||In.value?!Lt.value||hl.value||Rt.value.hasAnimated?[]:(In.value?H.series.filter(a=>(a.type||xe.value)==="line"):Xn.value).map((a,n)=>{const i=H.series.findIndex(F=>F===a);let p="",g=null;a.data.forEach((F,N)=>{if(F!=null){const $={x:Gt.value?sl(F):Kt(N),y:Gt.value?ml(N):yn(a,F)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,te)=>te>N&&B!==null&&B!==void 0);if($!==-1){const B={x:Gt.value?sl(a.data[$]):Kt($),y:Gt.value?ml($):yn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((F,N)=>F==null?null:{x:Gt.value?sl(F):Kt(N),y:Gt.value?ml(N):yn(a,F)}).filter(F=>F!==null),b=v(C);return{path:p,pathLength:b,color:c(i),strokeDasharray:ro(a),animationDelay:n*Y.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(xe.value!=="line")return[];const t=[];return Xn.value.forEach((a,n)=>{const i=ie.value===n,p=ie.value!==null&&ie.value!==n,g=rt.value.has(n);a.data.forEach((C,b)=>{C!=null&&t.push({x:Kt(b),y:yn(a,C),color:c(n),value:C,label:H.categories[b]||b.toString(),seriesName:a.name,categoryIndex:b,dataIndex:b,animationDelay:(n*a.data.length+b)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),ae=e.computed(()=>{if(!In.value)return[];const t=[];return H.series.filter(n=>(n.type||xe.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(F=>F===n),g=ie.value===p,C=ie.value!==null&&ie.value!==p,b=rt.value.has(p);n.data.forEach((F,N)=>{F!=null&&t.push({x:Kt(N),y:yn(n,F),color:c(p),value:F,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:C,isHidden:b})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Xn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=ie.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=rt.value.has(n);a.data.forEach((b,F)=>{let N,$,B,te,Ee;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:F,$=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,te=b.label||H.categories?.[F]||`Point ${F+1}`,Ee=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:F,$=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,te=b[3]||H.categories?.[F]||`Point ${F+1}`,Ee=b[4];else if(typeof b=="number")N=F,$=b,B=Eo(n,F),te=H.categories?.[F]||`Point ${F+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:hn($),radius:co(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:te,imageUrl:Ee,seriesIndex:n,dataIndex:F,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Ul.value})})}),t}),Re=e.computed(()=>xe.value!=="area"?[]:Xn.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,te)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(te),y:yn(t,B),index:te})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:rt.value.has(a)};const p=R.value.bottom+1;let g="",C="";n.forEach((B,te)=>{if(B.length===0)return;let Ee=`M ${B[0].x} ${B[0].y}`;tt.value&&B.length>1?Ee=ql(B):B.slice(1).forEach(ce=>{Ee+=` L ${ce.x} ${ce.y}`}),g+=(g?" ":"")+Ee;let Ze=`M ${B[0].x} ${p}`;if(Ze+=` L ${B[0].x} ${B[0].y}`,tt.value&&B.length>1){const ce=ql(B),ke=ce.substring(ce.indexOf("C")||ce.indexOf("Q")||ce.indexOf("L"));ke?Ze+=" "+ke:B.slice(1).forEach(Ne=>{Ze+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(ce=>{Ze+=` L ${ce.x} ${ce.y}`});Ze+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ze});const b=ie.value===a,F=ie.value!==null&&ie.value!==a,N=rt.value.has(a),$=n.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:b,isDimmed:F,isHidden:N}})),Se=e.computed(()=>{if(!(["bar"].includes(xe.value)||In.value))return[];const t=[],{maxX:a}=Ut.value,n=In.value?H.series.filter(p=>(p.type||xe.value)==="bar"):Xn.value,i=n.length;if(Gt.value){const p=a+1,C=R.value.height/p,b=C*(2/3),F=Math.min(4,b/i*.15),N=b-(i-1)*F,$=Math.max(4,N/i);n.forEach((B,te)=>{const Ee=H.series.findIndex(Ne=>Ne===B),Ze=ie.value===Ee,ce=ie.value!==null&&ie.value!==Ee,ke=rt.value.has(Ee);B.data.forEach((Ne,fe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const $e=R.value.top+(fe+.5)*C-b/2+te*($+F),Me=R.value.left,De=Math.abs(sl(Ne)-R.value.left);let $t="";if(tt.value&&De>0){const Ft=Math.min(Xt.value,$/2,De/2);$t=[`M ${Me} ${$e}`,`L ${Me+De-Ft} ${$e}`,`Q ${Me+De} ${$e} ${Me+De} ${$e+Ft}`,`L ${Me+De} ${$e+$-Ft}`,`Q ${Me+De} ${$e+$} ${Me+De-Ft} ${$e+$}`,`L ${Me} ${$e+$}`,"Z"].join(" ")}t.push({x:Me,y:$e,width:De,height:$,color:c(i===1?fe:Ee),value:Ne,label:H.categories[fe]||fe.toString(),seriesName:B.name,animationDelay:(te*n.length+fe)*(Y.value/4),isHighlighted:Ze,isDimmed:ce,isHidden:ke,barPath:$t,isSmooth:tt.value&&De>0})})})}else{const p=a+1,C=R.value.width/p,b=C*.8,F=b/i,N=F*.05,$=F-N;n.forEach((B,te)=>{const Ee=H.series.findIndex(Ne=>Ne===B),Ze=ie.value===Ee,ce=ie.value!==null&&ie.value!==Ee,ke=rt.value.has(Ee);B.data.forEach((Ne,fe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const $e=R.value.left+(fe+.5)*C-b/2+te*F+N/2,Me=hn(Math.max(0,Ne)),De=Math.abs(hn(0)-hn(Ne));let $t="";if(tt.value&&De>0){const Ft=Math.min(Xt.value,$/2,De/2);$t=[`M ${$e} ${Me+De}`,`L ${$e} ${Me+Ft}`,`Q ${$e} ${Me} ${$e+Ft} ${Me}`,`L ${$e+$-Ft} ${Me}`,`Q ${$e+$} ${Me} ${$e+$} ${Me+Ft}`,`L ${$e+$} ${Me+De}`,"Z"].join(" ")}t.push({x:$e,y:Me,width:$,height:De,color:c(i===1?fe:Ee),value:Ne,label:H.categories[fe]||fe.toString(),seriesName:B.name,animationDelay:(te*n.length+fe)*(Y.value/4),isHighlighted:Ze,isDimmed:ce,isHidden:ke,barPath:$t,isSmooth:tt.value&&De>0})})})}return t}),it=e.computed(()=>{if(!vn.value)return[];const t=Xn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!rt.value.has(C));if(t.length===0)return[];let a=xe.value==="semi-radial"?Math.PI:-Math.PI/2;const n=xe.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,b,F,N,$,B)=>{const te=C+(b-C)/2,Ee=b-C,Ze=Ht.value+Math.cos(C)*Wt.value,ce=wt.value+Math.sin(C)*Wt.value,ke=Ht.value+Math.cos(b)*Wt.value,Ne=wt.value+Math.sin(b)*Wt.value,fe=Ht.value+Math.cos(b)*dt.value,et=wt.value+Math.sin(b)*dt.value,ze=Ht.value+Math.cos(C)*dt.value,$e=wt.value+Math.sin(C)*dt.value,Me=Ee>Math.PI?1:0,De=[`M ${Ze} ${ce}`,`A ${Wt.value} ${Wt.value} 0 ${Me} 1 ${ke} ${Ne}`,`L ${fe} ${et}`,`A ${dt.value} ${dt.value} 0 ${Me} 0 ${ze} ${$e}`,"Z"].join(" "),$t=B||c(F);return{path:De,color:$t,strokeWidth:q.value,strokeColor:m(i.length,$t),value:$,seriesName:N,opacity:.8,isHighlighted:ie.value===F,isDimmed:ie.value!==null&&ie.value!==F,isHidden:!1,startAngle:C,endAngle:b,midAngle:te}};if(Dl.value){const{series:C,originalIndex:b}=t[0],F=Number(C?.data?.[0]??0),N=Number.isFinite(F)?Math.min(Math.max(F,0),100):0,$=U.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Ee=(N<=0?B:N)/100*n,Ze=Number($?.miniRadial?.thresholds?.low??33),ce=Number($?.miniRadial?.thresholds?.medium??66),ke=$?.miniRadial?.colors?.low||"#E53E3E",Ne=$?.miniRadial?.colors?.medium||"#ED8936",fe=$?.miniRadial?.colors?.high||"#38A169",et=N<=Ze?ke:N<=ce?Ne:fe,ze=$?.miniRadial?.trackColor||"#E5E7EB",$e=C?.name||"Score";return i.push(p(a,a+n-.001,b+1,"Track",100,ze)),i.push(p(a,a+Ee,b,$e,N,et)),i}if(t.length===1){const{series:C,originalIndex:b}=t[0],F=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,te=Ht.value+Math.cos(N)*Wt.value,Ee=wt.value+Math.sin(N)*Wt.value,Ze=Ht.value+Math.cos($)*Wt.value,ce=wt.value+Math.sin($)*Wt.value,ke=Ht.value+Math.cos($)*dt.value,Ne=wt.value+Math.sin($)*dt.value,fe=Ht.value+Math.cos(N)*dt.value,et=wt.value+Math.sin(N)*dt.value,ze=1,$e=[`M ${te} ${Ee}`,`A ${Wt.value} ${Wt.value} 0 ${ze} 1 ${Ze} ${ce}`,`L ${ke} ${Ne}`,`A ${dt.value} ${dt.value} 0 ${ze} 0 ${fe} ${et}`,"Z"].join(" "),Me=c(b);return i.push({path:$e,color:Me,strokeWidth:q.value,strokeColor:m(0,Me),value:F,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(Jn.value&&t.length===2){const C=t[0],b=t[1],F=Math.min(100,Math.max(0,C.series.data[0]||0)),N=F/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,F)),i.push(p(a,a+n,b.originalIndex,b.series.name,100)),i}const g=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const F=C.data[0]||0,N=F/g*n,$=a,B=a+N,te=$+N/2,Ee=Ht.value+Math.cos($)*Wt.value,Ze=wt.value+Math.sin($)*Wt.value,ce=Ht.value+Math.cos(B)*Wt.value,ke=wt.value+Math.sin(B)*Wt.value,Ne=Ht.value+Math.cos(B)*dt.value,fe=wt.value+Math.sin(B)*dt.value,et=Ht.value+Math.cos($)*dt.value,ze=wt.value+Math.sin($)*dt.value,$e=N>Math.PI?1:0,Me=[`M ${Ee} ${Ze}`,`A ${Wt.value} ${Wt.value} 0 ${$e} 1 ${ce} ${ke}`,`L ${Ne} ${fe}`,`A ${dt.value} ${dt.value} 0 ${$e} 0 ${et} ${ze}`,"Z"].join(" "),De=c(b);i.push({path:Me,color:De,strokeWidth:q.value,strokeColor:m(i.length,De),value:F,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:ie.value!==null&&ie.value!==b,isHidden:!1,startAngle:$,endAngle:B,midAngle:te}),a=B}),i)}),gn=e.computed(()=>{const t=it.value;return Jn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),un=e.computed(()=>{if(!yl.value||!vn.value)return[];const t=Bl.value,a=zl.value,n=Ml.value,i=Pl.value,p=15,g=t*1.3,C=.55,b=(B,te)=>{const Ee=Ht.value+Math.cos(B.midAngle)*dt.value,Ze=wt.value+Math.sin(B.midAngle)*dt.value,ce=Ht.value+Math.cos(B.midAngle)*(dt.value+a),ke=wt.value+Math.sin(B.midAngle)*(dt.value+a),fe=ce+n*(te?1:-1),et=te?ce+p:ce-p,ze=ke-i,$e=`${B.seriesName}: ${re(B.value)}`,Me=$e.length*t*C;return{pointerStartX:Ee,pointerStartY:Ze,pointerEndX:ce,pointerEndY:ke,horizontalEndX:fe,horizontalEndY:ke,textX:et,textY:ze,text:$e,textWidth:Me,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ce-Ee,ke-Ze),horizontalLineLength:Math.hypot(fe-ce,0)}},F=(B,te)=>{const Ee=Math.abs(B.textY-te.textY)<g,Ze=B.isRightSide?B.textX:B.textX-B.textWidth,ce=B.isRightSide?B.textX+B.textWidth:B.textX,ke=te.isRightSide?te.textX:te.textX-te.textWidth,Ne=te.isRightSide?te.textX+te.textWidth:te.textX,fe=Ze<Ne&&ke<ce;return Ee&&fe},N=it.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const te=N[B];let Ee=Math.cos(te.midAngle)>=0;if(B>0){const ce=$[B-1],ke=b(te,Ee);F(ce,ke)&&(Ee=!Ee)}const Ze=b(te,Ee);$.push({...Ze,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return $}),nn=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Ul.value||.7;return ie.value===null||ie.value===void 0?a:ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},dn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):a*.7:a},rn=(t,a)=>{if(t)try{if(ie.value===t.seriesIndex?ie.value=null:ie.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},cn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},zn=(t,a)=>{if(!t||(a.stopPropagation(),To.value=!0,ie.value=t.seriesIndex,Te.value.show=!1,!We.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120;p+C>Ve.value&&(p=a.clientX-i.left-C-10),g+b>i.height&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const F=Nn.value,N=Bn.value,$=F.map(B=>{const te=N[B]||B,Ee=el(B,t);return Ee?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Ee}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},el=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=dl.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return z.value?p+z.value:p}return n?.toString()||""},rl=()=>{if(!jt.value||!Te.value.data||Te.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Te.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},mo=(t,a)=>{t&&(To.value=!1,ie.value=null,gt.value.show=!1,gt.value.bubbleData=[])},_o=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Ll(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,b=a.clientY-i.top-10;const F=200,N=g?80:50;C+F>Ve.value&&(C=a.clientX-i.left-F-15),b+N>G.value&&(b=a.clientY-i.top-N-10),C<0&&(C=10),b<0&&(b=10),fn.value={show:!0,x:C,y:b,categoryValue:p,description:g}},Yo=()=>{fn.value.show=!1},gl=e.computed(()=>H.categories.length||Math.max(...Yn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Yn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),po=e.computed(()=>{const t=[],a=gl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Ht.value+Math.cos(i)*dt.value,g=wt.value+Math.sin(i)*dt.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Yl=e.computed(()=>{const t=[],a=gl.value;return po.value.forEach((n,i)=>{const p=dt.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Ht.value+Math.cos(g)*p,b=wt.value+Math.sin(g)*p+5;let F="middle",N="middle";Math.abs(Math.cos(g))>.5&&(F=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:F,baseline:N})}),t}),$o=e.ref(new Set),tl=(t,a,n)=>{const i=`current-${n}`,p=$o.value.has(i);return!p&&ie.value===null?a.fillOpacity||vt.value:a.isHighlighted||p?(a.fillOpacity||vt.value)+.15:a.isDimmed?(a.fillOpacity||vt.value)*.3:a.fillOpacity||vt.value},jn=e.computed(()=>{if(!Sn.value)return[];const t=[],a=gl.value;return Xn.value.forEach((n,i)=>{const p=[],g=[],C=[],b=ie.value===i,F=ie.value!==null&&ie.value!==i,N=rt.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Ee=B/ta.value*dt.value,Ze=$*2*Math.PI/a-Math.PI/2,ce=Ht.value+Math.cos(Ze)*Ee,ke=wt.value+Math.sin(Ze)*Ee;p.push(`${ce},${ke}`),g.push({x:ce,y:ke}),C.push({x:ce,y:ke,value:B,label:H.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:vt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:F,isHidden:N,seriesIndex:i})}),t}),Pn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,b=a[p].x,F=a[p].y;C>t.y!=F>t.y&&t.x<(b-g)*(t.y-C)/(F-C)+g&&(n=!n)}return n},na=t=>{if(!Sn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=A.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=jn.value.filter(b=>b.isHidden?!1:Pn({x:p,y:g},b.polygonPoints));if(C.length>0){C.length,ie.value=C[0].seriesIndex;const b=t.clientX-n.left+10,F=t.clientY-n.top-10,N=C.length>1?460:260,$=70+gl.value*20;let B=b,te=F;B+N>Ve.value&&(B=t.clientX-n.left-N-10),te+$>G.value&&(te=t.clientY-n.top-$-10),B<0&&(B=10),te<0&&(te=10);const Ee=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(ce=>({label:ce.label,value:re(ce.value)}))}));gt.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Ee}}else il()},Lo=e.computed(()=>{const t=U.value;return t.logos.map((a,n)=>{const i=H.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||rt.value.has(a.seriesIndex))return null;let p,g;if(bn.value){let b=-1,F=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){b=$,F=i.data[$];break}if(b===-1||F===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:yn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const $=Rt.value.currentFrame/Rt.value.totalFrames,B=Go(t.animations.easing,Math.min($,1)),te=wa(N,B);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(b)+(a.offsetX||0),g=hn(F)+(a.offsetY||0)}else if(vn.value||Sn.value){const b=Math.PI*2/t.logos.length*n;p=Ht.value+Math.cos(b)*(dt.value+30)+(a.offsetX||0),g=wt.value+Math.sin(b)*(dt.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),fa=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},va=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},jo=t=>{rt.value.has(t)?rt.value.delete(t):rt.value.add(t)},ga=e.computed(()=>{if(!gt.value.show&&!(lt.value&&Te.value.show&&!se.value.isZooming))return{display:"none"};let t,a;if(lt.value&&Te.value.show&&!se.value.isZooming){t=Te.value.x+15,a=R.value.top;const n=jt.value?200:150;t+n>Ve.value&&(t=Te.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=gt.value.x,a=gt.value.y;return{left:t+"px",top:a+"px"}}),Vl=(t,a)=>{if(!We.value||fo.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120,F=Ve.value,N=G.value;p+C>F&&(p=a.clientX-i.left-C-10),g+b>N&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&H.categories.includes(t.label)&&($=H.categories.indexOf(t.label));const B=(Gt.value||xe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:B,value:re(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),To=e.ref(!1),il=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],Te.value.show=!1,Ko.value||(ie.value=null)},fo=e.ref(!1),vo=(t,a)=>{fo.value=!0,gt.value.show=!1,Te.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>Ve.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),Cl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},go=()=>{fo.value=!1,Cl.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Go=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},hl=e.computed(()=>Oe.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!Lt.value||hl.value){Rt.value.hasAnimated=!0,Un.value&&(vl.value=1);return}Un.value&&(vl.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const a=Rt.value.currentFrame/Rt.value.totalFrames,n=Go(S.value,Math.min(a,1));ha(n),Un.value&&(vl.value=n),a<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):ya()};Rt.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,Un.value&&(vl.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},Qo=e.computed(()=>!vn.value||Rt.value.hasAnimated?!0:Un.value?vl.value>=1:Ln.value?wl.value>=1:!0),oa=e.computed(()=>yl.value&&Qo.value),Ao=e.ref(!1);e.watch(oa,t=>{t?(Ao.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ao.value=!0})})):Ao.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!Lt.value||hl.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Ca(S.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),Ca=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ba=()=>{if(!Lt.value||hl.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${Qt.value}`),Rt.value.hasAnimated||(vn.value&&xe.value!=="semi-radial"?t.push("dss-animate-fill"):vn.value||t.push(`dss-animate-${Qt.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{ee.value&&a&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),w.value)}))},{deep:!0}),e.watch(()=>se.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{h()},50)}),e.watch(()=>[se.value.scale,se.value.offsetX],()=>{!se.value.isZooming&&!se.value.isDragging&&h()},{flush:"post"}),e.watch([Nt,Ke],([t,a])=>{se.value.minScale=t,se.value.maxScale=a,(se.value.scale<t||se.value.scale>a)&&oo()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>bt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",no)}):document.removeEventListener("click",no)}),e.onMounted(()=>{ie.value=null,Un.value&&(!Lt.value||hl.value)&&(vl.value=1),an(),I.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(Ce&&cancelAnimationFrame(Ce),Ce=requestAnimationFrame(()=>{Ce=null;const{width:n,height:i}=a.contentRect;Ge.value=Math.round(n),ge.value=Math.round(i),X.value&&(Le.value=X.value.offsetHeight||he)}))}),f.observe(I.value)),Lt.value&&!hl.value?xe.value==="semi-radial"?setTimeout(()=>Uo(),w.value):setTimeout(()=>la(),w.value):(Rt.value.hasAnimated=!0,xe.value==="semi-radial"&&(wl.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",Co)}),e.onUnmounted(()=>{Ce&&cancelAnimationFrame(Ce),f&&I.value&&(f.unobserve(I.value),f.disconnect(),f=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),Fl&&(cancelAnimationFrame(Fl),Fl=null),se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",Co),document.removeEventListener("click",no)});const aa=t=>{if(se.value.isDragging&&se.value.scale>1&&bn.value){Te.value.show=!1;const a=t.clientX-se.value.lastMouseX,{minX:n,maxX:i}=Ut.value,p=i-n||1,C=a*.8;se.value.offsetX+=C;const b=p/se.value.scale,F=p-b,N=0,$=-F/p*R.value.width,B=N;se.value.offsetX=Math.max($,Math.min(B,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY}},sa=()=>{se.value.isDragging&&(se.value.isDragging=!1,setTimeout(()=>{!se.value.isDragging&&se.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let b=1;b<n.length;b++){const F=n[b].x-n[b-1].x,N=n[b].y-n[b-1].y,$=Math.sqrt(F*F+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let b=0;b<p.length;b++){const F=C+p[b];if(g<=F){const N=(g-C)/p[b],$=n[b],B=n[b+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=F}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ba(),{"dss-chart-fill-width":Ue.value,"dss-chart-fill-height":Qe.value,"dss-chart-compact":vn.value&&!J.value}]]),style:e.normalizeStyle({width:Ue.value?"100%":Ve.value+"px",height:Fe.value,...Ue.value||Qe.value?{overflow:vn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:qo()}),"data-chart-type":xe.value,ref_key:"containerEl",ref:I,onWheel:bo,onMousedown:lo,onMousemove:Zn,onMouseup:wo,onMouseleave:al,onDblclick:oo,onContextmenu:e.withModifiers($l,["prevent"]),onClick:e.withModifiers(Mn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",vs,[ct.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),St.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(St.value),1)):e.createCommentVNode("",!0)]),J.value&&ye.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-top":ye.value==="top","dss-legend-bottom":ye.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":rt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ks,e.toDisplayString(n.name),1)],46,ys))),128))],2)):e.createCommentVNode("",!0),J.value&&(ye.value==="left"||ye.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ye.value==="left","dss-legend-right":ye.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":rt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",bs,e.toDisplayString(n.name),1)],46,Cs))),128))],2)):e.createCommentVNode("",!0)],512),T.showAddMarkerButton&&Ct.value&&at.value.addMarker&&(bn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:qn.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,xs),a[4]||(a[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ws)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[jt.value&&At.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(At.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ve.value,height:G.value,class:"dss-chart-svg","data-smooth":tt.value,"data-animated":Lt.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:oe.value},[e.createElementVNode("rect",{x:0,y:R.value.top,width:Ve.value,height:R.value.height*4},null,8,Bs)],8,Ns),Ln.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Zl.value},[e.createElementVNode("path",{d:pl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),Un.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:xl.value},[e.createElementVNode("path",{d:Rl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),bn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[zt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:R.value.left,x2:R.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[e.createElementVNode("line",{x1:R.value.left,x2:R.value.right,y1:R.value.bottom,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Rs),e.createElementVNode("line",{x1:R.value.left,x2:R.value.left,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Fs),_n.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:R.value.right,x2:R.value.right,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Is)):e.createCommentVNode("",!0)]),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Os))),128)),_n.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Ws))),128)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:R.value.left+R.value.width/2,y:R.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(qt.value),9,qs)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${R.value.top+R.value.height/2})`},e.toDisplayString(It.value),9,Zs)):e.createCommentVNode("",!0),_n.value&&pe.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ve.value-15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${Ve.value-15}, ${R.value.top+R.value.height/2})`},e.toDisplayString(pe.value),9,Us)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,js)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:R.value.bottom,y2:R.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Ks)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Gs)):e.createCommentVNode("",!0)],8,Ys),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,R.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Qs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,R.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Js),e.createElementVNode("text",{x:n.x,y:Math.max(15,R.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[In.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,lr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,sr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,rr))),128)),K.value>0||ve.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ae.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Je(n.isHighlighted?qe(n,K.value)+2:qe(n,K.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,ir))),128)):e.createCommentVNode("",!0)])])):xe.value==="line"?(e.openBlock(),e.createElementBlock("g",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":W.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ur))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,mr))),128)),K.value>0||ve.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Je(n.isHighlighted?qe(n,K.value)+2:qe(n,K.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,pr))),128)):e.createCommentVNode("",!0)])):xe.value==="area"?(e.openBlock(),e.createElementBlock("g",fr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.chartId}`},[e.createElementVNode("rect",{x:R.value.left-10,y:R.value.top-10,width:R.value.width+20,height:R.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${R.value.width+20}px`})},null,12,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?Bt.value+.2:Bt.value,mask:`url(#area-mask-${i}-${T.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?W.value+1:W.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Y.value}ms`})},null,14,yr))),128))])):xe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,kr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Vl(n,p),onMouseleave:il},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),lt.value&&Te.value.show&&!se.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:Te.value.x,x2:Te.value.x,y1:R.value.top,y2:R.value.bottom,stroke:Vt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Te.value.x,cy:n.y,r:Je(K.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,xr))),128))],8,br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Je(n.radius),fill:n.color,"fill-opacity":nn(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(cn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>zn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,42,Vr),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:dn(n)}),onLoad:p=>So(i),onError:p=>so(i),onMouseenter:p=>zn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:en.value},[xe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ht.value,cy:wt.value,r:dt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Mr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":xe.value,"clip-path":xo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Zo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>Vl(n.segment,p),onMouseleave:il},null,42,$r))),128))],8,_r),Vn.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ol.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,Tr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),ll.value&&(Qo.value||Ln.value||Dl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:xn.value.x,y:xn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":$n.value,fill:kl.value,class:"dss-radial-data-center"},e.toDisplayString(pn.value),9,Ar)):e.createCommentVNode("",!0),oa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Ao.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Dr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,Hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Bl.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:en.value},[zt.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Ht.value,cy:wt.value,r:Je(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,zr))),128)),e.createElementVNode("g",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Ht.value-16,y:wt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:Ht.value,y:wt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Mt(i)),9,Wr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Ht.value,x2:n.x,y1:wt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,qr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/gl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/gl.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Ur))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:il},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":tl("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?W.value+1:W.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Xr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:Je(n.isHighlighted?K.value+1:K.value>0?K.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Vl(p,C),onMouseleave:il},null,46,Yr))),128))]))),128))],32)],8,Fr)):e.createCommentVNode("",!0),e.createElementVNode("g",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Je(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Kr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>fa(i),onError:p=>va(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Gr))),128))])],8,Vs))]),nt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ve.value+"px",height:G.value+"px",backgroundImage:`url('${nl.value}')`,backgroundRepeat:"no-repeat",...Dn.value,opacity:Et.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Z.value+"px",height:Z.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>_t(n),["stop"]),onMouseenter:p=>_o(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:Rn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Jr)],44,Qr)),[[e.vShow,Ie.value]])),128)),fn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:fn.value.x+"px",top:fn.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(fn.value.categoryValue),1),fn.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(fn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),We.value&&(gt.value.show||lt.value&&Te.value.show&&!se.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":lt.value&&Te.value.show&&!se.value.isZooming,"dss-spider-tooltip":Sn.value&>.value.spiderAreas&>.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!lt.value||!Te.value.show||se.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Sn.value&>.value.spiderAreas&>.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",li,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",oi,e.toDisplayString(p.label),1),e.createElementVNode("span",ai,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&>.value.bubbleData&>.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[gt.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ci,[e.createElementVNode("div",ui,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",di,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Hn(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",mi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(gt.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",fi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",vi,[e.createElementVNode("div",gi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",yi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(gt.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ki,[e.createElementVNode("div",Ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",bi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",wi,[e.createElementVNode("div",xi,e.toDisplayString(jt.value?rl():T.categories[Te.value.categoryIndex]||`Category ${Te.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Te.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Si,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Vi,e.toDisplayString(re(n.value)),1)]))),128))]),Hn(Te.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ni,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Te.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Mi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(Te.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Li,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Te.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Ai,[e.createElementVNode("div",Di,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Hi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),bn.value&&je.value&&se.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(se.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,fs),J.value&&ye.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":rt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Fi,e.toDisplayString(n.name),1)],46,Ri))),128))],2)):e.createCommentVNode("",!0),bt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:bt.value.x+"px",top:bt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[at.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Wo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),at.value.addMarker&&(at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv||pt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),at.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Po},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),at.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ho},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:yo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),pt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Wl(n)),style:e.normalizeStyle(Gn(n)),onClick:p=>Oo(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Cn(n),class:"dss-custom-menu-content"},null,8,Wi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",qi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Oi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:O},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Zi,[e.createElementVNode("h3",null,e.toDisplayString(Jt.value?e.unref(_)("chart.modalMarker.viewMarker"):kn.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:O},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:_e.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>_e.value.date=n),"min-date":bl.value,"max-date":_l.value,disabled:Jt.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Jt.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString(_e.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>_e.value.description=n),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,_e.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[kn.value&&!Jt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:de},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:O},e.toDisplayString(Jt.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Jt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:x,disabled:!(_e.value.description&&_e.value.description.length)},e.toDisplayString(kn.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,tc))])])])])):e.createCommentVNode("",!0)],64))}}),oc={class:"dss-modal-title"},ac={class:"dss-modal-actions"},Jo={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(T,{emit:ne}){const _=T,L=ne,ue=e.ref(null),I=e.ref(null),A=e.computed(()=>{const oe={"max-width":_.width};return _.height!=="auto"&&(oe.height=_.height,oe["min-height"]="0"),oe}),X=e.computed(()=>({}));function Ge(){L("close-modal")}function ge(){_.backDrop&&!ue.value&&L("close-modal")}function f(oe){oe.target.tagName==="INPUT"&&(ue.value=oe.target.tagName)}function Ce(){setTimeout(()=>{ue.value=null},300)}function he(){const oe=document.body,me=document.documentElement;I.value={bodyOverflow:oe.style.overflow,bodyPosition:oe.style.position,bodyTop:oe.style.top,bodyWidth:oe.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},oe.style.overflow="hidden",oe.style.position="fixed",oe.style.top=`-${I.value.scrollY}px`,oe.style.width="100%",oe.style.left="0",me.style.overflow="hidden"}function le(){if(!I.value)return;const oe=document.body,me=document.documentElement,{bodyOverflow:H,bodyPosition:be,bodyTop:Ae,bodyWidth:Pe,htmlOverflow:ut,scrollY:U}=I.value;oe.style.overflow=H||"",oe.style.position=be||"",oe.style.top=Ae||"",oe.style.width=Pe||"",oe.style.left="",me.style.overflow=ut||"",window.scrollTo(0,U||0)}return e.watch(()=>_.showModal,oe=>{if(oe)he(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",f),me.addEventListener("focusout",Ce))},100);else{le(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",f),me.removeEventListener("focusout",Ce))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&le()}),(oe,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ge},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",oc,[e.renderSlot(oe.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(oe.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ge,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(oe.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(oe.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},sc={key:0,class:"dss-table-toolbar"},rc={class:"dss-table-toolbar-left"},ic=["aria-expanded"],cc={class:"dss-pagination-select-dropdown",role:"listbox"},uc={class:"dss-table-column-visibility-label"},dc={class:"dss-table-checkbox-wrapper"},mc=["checked","onChange"],pc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fc={class:"dss-table-column-visibility-text"},vc={class:"dss-table-toolbar-right"},gc=["placeholder","aria-label"],hc=["aria-label"],yc=["aria-label","aria-expanded"],kc={key:1,class:"dss-table-toolbar-extra"},Cc={class:"dss-table-thead"},bc={key:0,class:"dss-table-th dss-table-selection-column"},wc={key:0,class:"dss-table-checkbox-wrapper"},xc=["checked","indeterminate"],Ec={key:0,class:"dss-table-checkbox__indeterminate"},Sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Vc=["aria-label"],Nc=["onClick"],Bc={class:"dss-table-th-content"},Mc={class:"dss-table-th-text"},_c={key:0},$c={key:1},Lc={key:2},Tc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Ac={class:"dss-table-tbody"},Dc=["onClick"],Hc={class:"dss-table-checkbox-wrapper"},Rc=["type","name","checked","disabled","onChange"],Fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ic={key:1,class:"dss-table-checkbox__dot"},zc=["onClick"],Pc=["aria-expanded","aria-label"],Oc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Wc={key:0,class:"dss-table-expansion-row"},qc=["colspan"],Zc=["colspan"],Uc={key:1,class:"dss-table-pagination"},Xc={class:"dss-table-pagination-left"},Yc={key:0},jc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Kc={class:"dss-table-pagination-center"},Gc={key:0,class:"dss-pagination-controls"},Qc=["disabled","title"],Jc=["disabled","title"],eu=["aria-label","onKeydown"],tu={class:"dss-pagination-of"},nu=["disabled","title"],lu=["disabled","title"],ou={class:"dss-table-pagination-right"},au={class:"dss-pagination-rows-label"},su=["aria-expanded"],ru=["aria-selected","onClick"],iu={key:0,class:"dss-table-filter-row"},cu=["value","placeholder"],uu=["min","max","value"],du=["min","max","value"],mu={class:"dss-table-filter-double-range-values"},pu={key:2,class:"dss-table-filter-daterange"},fu={class:"dss-table-filter-daterange-row"},vu={class:"dss-table-filter-daterange-label"},gu=["value"],hu={class:"dss-table-filter-daterange-row"},yu={class:"dss-table-filter-daterange-label"},ku=["value"],Cu=["value","placeholder"],bu={class:"dss-table-filter-list"},wu=["checked","onChange"],xu={class:"dss-table-filter-actions"},Eu={name:"DSSTable"},Su=Object.assign(Eu,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(T,{emit:ne}){const{t:_,locale:L}=Gl.useI18n(),ue=T,I=ne,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function X(k,h){const x=Object.assign({},k);return Ge(k)&&Ge(h)&&Object.keys(h).forEach(O=>{Ge(h[O])?O in k?x[O]=X(k[O],h[O]):Object.assign(x,{[O]:h[O]}):Object.assign(x,{[O]:h[O]})}),x}function Ge(k){return k&&typeof k=="object"&&!Array.isArray(k)}const ge=e.computed(()=>X(A,ue.options)),f=e.computed(()=>{const k=ge.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),Ce=e.computed(()=>ge.value.table.height),he=e.computed(()=>ge.value.table.rowHeight??"auto"),le=e.computed(()=>({height:he.value})),oe=e.computed(()=>ge.value.table.expandable===!0),me=e.computed(()=>ge.value.table.expandableRowData??null),H=e.computed(()=>ge.value.table.expandableRowCondition??null),be=e.computed(()=>ge.value.table.truncated===!0),Ae=e.computed(()=>ge.value.table.striped),Pe=e.computed(()=>ge.value.table.bordered),ut=e.computed(()=>ge.value.table.hoverable),U=e.computed(()=>ge.value.table.size),Ue=e.computed(()=>ge.value.table.align||"left");e.computed(()=>ge.value.title.text),e.computed(()=>ge.value.subtitle.text);const Qe=e.computed(()=>ge.value.selection.enabled),Ve=e.computed(()=>ge.value.selection.mode),Le=e.computed(()=>ge.value.selection.rowCondition??null),Xe=e.computed(()=>ge.value.sorting.enabled),G=e.computed(()=>ge.value.sorting.mode),Fe=e.computed(()=>ge.value.pagination.enabled),xe=e.computed(()=>ge.value.pagination.rows),ht=e.computed(()=>ge.value.pagination.rowsPerPageOptions),ct=e.computed(()=>ge.value.pagination.showCounter!==!1),St=e.computed(()=>ge.value.pagination.showControlsGroup),At=e.computed(()=>St.value===!1?!1:ge.value.pagination.showControls!==!1),qt=e.computed(()=>St.value===!1?!1:ge.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>Fe.value&&(ct.value||At.value||qt.value)),Q=e.computed(()=>ge.value.scrollable),pe=e.computed(()=>ge.value.emptyMessage||_("table.emptyMessage")),He=e.computed(()=>ge.value.toolbar?.downloads?.pdf!==!1),Ye=e.computed(()=>ge.value.toolbar?.downloads?.excel!==!1),Zt=e.computed(()=>ge.value.toolbar?.search!==!1),kt=e.computed(()=>He.value||Ye.value||Zt.value||Ot.value),Ot=e.computed(()=>ge.value.toolbar?.columnVisibility!==!1),xt=e.ref(""),zt=e.ref(!1),J=e.ref(null);let ye=null;function Be(){zt.value?(ye&&(clearTimeout(ye),ye=null),zt.value=!1,xt.value="",I("search",""),J.value?.blur()):(zt.value=!0,ye=setTimeout(()=>{ye=null,J.value?.focus()},80))}function We(){xt.value||(zt.value=!1)}function lt(){xt.value="",I("search",""),J.value?.focus()}const Vt=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":Pe.value,"dss-table-hoverable":ut.value,[`dss-table-${U.value}`]:U.value!=="default","dss-table-truncated":be.value})),je=(k,h)=>k?.field??k?.key??h,Nt=e.ref(new Set);function Ke(){const k=new Set;ue.columns.forEach((h,x)=>{h?.hidden!==!0&&k.add(je(h,x))}),Nt.value=k}const W=e.computed(()=>ue.columns.filter((k,h)=>Nt.value.has(je(k,h)))),q=k=>{const h=ue.columns.findIndex(x=>x===k);return je(k,h>=0?h:0)},K=(k,h)=>Nt.value.has(je(k,h));function ve(k,h){const x=je(k,h),O=new Set(Nt.value);O.has(x)?O.delete(x):O.add(x),Nt.value=O}const qe=e.ref(null),Je=e.ref(!1);function Bt(k){qe.value&&!qe.value.contains(k.target)&&(Je.value=!1)}const tt=e.computed(()=>W.value.length+(Qe.value?1:0)+(oe.value?1:0)),st=(k,h)=>k?.id??k?.key??h,Xt=e.ref(new Set),ln=e.ref(null),Lt=(k,h)=>Xt.value.has(st(k,h)),Qt=(k,h)=>{if(!oe.value)return!1;if(typeof H.value=="function")return!!H.value(k,h);if(typeof me.value=="string"&&me.value.trim()){const x=Rn(k,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},V=(k,h,x)=>{if(x&&x.stopPropagation(),!Qt(k,h))return;const O=st(k,h),de=new Set(Xt.value);de.has(O)?(de.delete(O),I("row-collapse",{data:k,index:h})):(de.add(O),I("row-expand",{data:k,index:h})),Xt.value=de},w=(k,h)=>{if(!be.value)return;const x=st(k,h);ln.value!==x&&(ln.value=x)},S=e.ref(null),Y=e.ref(0),ee=e.ref([]),Oe=k=>{if(G.value==="single")return S.value===k.field?Y.value:0;{const h=ee.value.find(x=>x.field===k.field);return h?h.order:0}},vt=k=>{const h=Oe(k);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},ot=e.ref({}),we=e.ref(null),Mt=e.ref(null),Dt=220,Ct=e.ref(null),at=e.computed(()=>W.value.find(k=>q(k)===we.value)??null),pt=e.computed(()=>{if(!at.value||at.value.filter!=="range")return null;const k=at.value,h=we.value,{min:x,max:O}=cl(k),de=k.filterMin??x,yt=k.filterMax??O,_t=z(h),Yt=_t.min??de,an=_t.max??yt,tn=yt-de,sn=tn===0?0:(Yt-de)/tn*100,Fn=tn===0?100:(an-de)/tn*100;return{rangeMin:de,rangeMax:yt,currentMin:Yt,currentMax:an,minPct:sn,maxPct:Fn}}),qn=e.ref(null),P=e.ref("max");function Z(k){const h=qn.value,x=pt.value;if(!h||!x)return;const O=h.getBoundingClientRect(),yt=(k.clientX-O.left)/O.width*100,_t=(x.minPct+x.maxPct)/2;P.value=yt<_t?"min":"max"}function z(k){return ot.value[k]??{}}function re(k,h){ot.value={...ot.value,[k]:h}}function Ie(k){const h=ot.value[k];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function mt(k){const h={...ot.value};delete h[k],ot.value=h,we.value=null,Mt.value=null}function ft(){if(!we.value){Mt.value=null;return}const k=Ct.value;if(!k)return;const h=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${we.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Mt.value={top:x.bottom+6,left:Math.max(8,x.right-Dt)}}const nt=e.computed(()=>{const k=String(xt.value??"").trim().toLowerCase();return k?ue.data.filter(h=>W.value.some(x=>Pt(Gn(h,x)).some(de=>String(de).toLowerCase().includes(k)))):ue.data}),Et=e.computed(()=>{let k=[...nt.value];const h=(xt.value??"").trim().toLowerCase();return h&&(k=k.filter(x=>ue.columns.some(O=>{if(!O||!O.field)return!1;const de=Gn(x,O);return String(de??"").toLowerCase().includes(h)}))),W.value.forEach(x=>{const O=q(x),de=ot.value[O];if(!de)return;const yt=x.field;if(yt){if(de.type==="string"&&de.value?.trim()){const _t=de.value.trim().toLowerCase();k=k.filter(Yt=>{const an=Gn(Yt,x);return String(an??"").toLowerCase().includes(_t)})}else if(de.type==="range")k=k.filter(_t=>{const Yt=Rn(_t,yt),an=Number(Yt);return!(Number.isNaN(an)||de.min!=null&&an<de.min||de.max!=null&&an>de.max)});else if(de.type==="dateRange"){const _t=de.from?new Date(de.from).getTime():null,Yt=de.to?new Date(de.to).getTime():null;k=k.filter(an=>{const tn=Rn(an,yt),sn=tn?new Date(tn).getTime():NaN;return!(Number.isNaN(sn)||_t!=null&&sn<_t||Yt!=null&&sn>Yt)})}else if(de.type==="list"&&de.selected?.length){const _t=new Set(de.selected);k=k.filter(Yt=>Pt(Gn(Yt,x)).some(tn=>_t.has(tn)))}}}),k});function Pt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(Pt);if(typeof k=="object"){const h=k?.label??k?.name??k?.value??k?.title;return[h!=null?String(h):String(k)]}return[String(k)]}function Tn(k){const h=new Set;return ue.data.forEach(x=>{Pt(Gn(x,k)).forEach(de=>h.add(de))}),Array.from(h).sort((x,O)=>String(x).localeCompare(String(O)))}function An(k,h){if(we.value===k){we.value=null,Mt.value=null;return}if(we.value=k,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Mt.value={top:x.bottom+6,left:Math.max(8,x.right-Dt)}}else ft()}function Dn(k,h){re(k,{type:"string",value:h})}function cl(k){const h=k.field;if(!h)return{min:0,max:100};let x=1/0,O=-1/0;return ue.data.forEach(de=>{const yt=Rn(de,h),_t=Number(yt);Number.isNaN(_t)||(x=Math.min(x,_t),O=Math.max(O,_t))}),{min:x===1/0?0:x,max:O===-1/0?100:O}}function Hn(k,h,x){const O={...z(k),type:"range"},de=x===""?null:Number(x),yt=de===null||Number.isNaN(de)?null:de;O[h]=yt,yt!=null&&(h==="min"&&O.max!=null&&yt>O.max&&(O.max=yt),h==="max"&&O.min!=null&&yt<O.min&&(O.min=yt)),re(k,O)}function Nl(k,h,x){const O={...z(k),type:"dateRange"};O[h]=x||"",re(k,O)}const nl=e.reactive({});function yl(k,h){nl[k]=h}function Bl(k){const h=q(k),x=(nl[h]??"").trim().toLowerCase(),O=Tn(k);return x?O.filter(de=>String(de).toLowerCase().includes(x)):O}function zl(k,h){return(z(k).selected??[]).includes(h!=null?String(h):"")}function Ml(k,h){const O=[...z(k).selected??[]],de=h!=null?String(h):"",yt=O.indexOf(de);yt>=0?O.splice(yt,1):O.push(de),re(k,{type:"list",selected:O})}function Pl(k){we.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(we.value=null,Mt.value=null)}function Vn(){ft(),xn.value&&dl()}const to=k=>{if(!(k.sortable===!1||!Xe.value))if(G.value==="single")S.value===k.field?Y.value=Y.value===1?-1:Y.value===-1?0:1:(S.value=k.field,Y.value=1),Y.value===0&&(S.value=null),I("sort",{field:S.value,order:Y.value});else{const h=ee.value.findIndex(x=>x.field===k.field);h>=0?ee.value[h].order===1?ee.value[h].order=-1:ee.value.splice(h,1):ee.value.push({field:k.field,order:1}),I("sort",{multiSortMeta:ee.value})}},ll=e.computed(()=>{if(!Xe.value)return Et.value;let k=[...Et.value];return G.value==="single"&&S.value&&Y.value!==0?k.sort((h,x)=>{const O=Rn(h,S.value),de=Rn(x,S.value);return O===de?0:O==null?1:de==null?-1:(O<de?-1:O>de?1:0)*Y.value}):G.value==="multiple"&&ee.value.length>0&&k.sort((h,x)=>{for(const O of ee.value){const de=Rn(h,O.field),yt=Rn(x,O.field);if(de===yt)continue;if(de==null)return 1;if(yt==null)return-1;const _t=de<yt?-1:de>yt?1:0;if(_t!==0)return _t*O.order}return 0}),k}),pn=e.ref(0),$n=e.ref(xe.value),xn=e.ref(!1),kl=e.ref(null),Ol=e.ref(null),ul=e.ref("bottom"),Cl=e.ref(null),Nn=k=>{$n.value=k,xn.value=!1,pn.value=0,I("page",{page:0,rows:$n.value})};function Bn(k){kl.value&&!kl.value.contains(k.target)&&(xn.value=!1)}function dl(){const k=kl.value,h=Ol.value;if(!k||!h)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const O=h.getBoundingClientRect(),de=x.offsetHeight||0,_t=(window.innerHeight||document.documentElement.clientHeight)-O.bottom,Yt=O.top;ul.value=_t<de+8&&Yt>_t?"top":"bottom",Cl.value={width:`${Math.ceil(O.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const rt=e.computed(()=>ll.value.length),ie=e.computed(()=>Math.ceil(rt.value/$n.value)),ol=e.computed(()=>Math.max(ie.value,1)),gt=e.computed(()=>rt.value===0?0:Te.value+1),fn=e.computed(()=>bt.value),Te=e.computed(()=>Fe.value?pn.value*$n.value:0),bt=e.computed(()=>Fe.value?Math.min((pn.value+1)*$n.value,rt.value):rt.value),se=e.computed(()=>{if(!Fe.value)return ll.value;const k=Te.value,h=bt.value;return ll.value.slice(k,h)}),Tt=e.ref(new Set),_e=e.computed(()=>ll.value.filter((k,h)=>Tt.value.has(st(k,h)))),bl=(k,h)=>{const x=Le.value;return typeof x!="function"?!0:!!x(k,h)},_l=e.computed(()=>ll.value.map((k,h)=>({row:k,index:h})).filter(({row:k,index:h})=>bl(k,h))),kn=e.computed(()=>{const k=_l.value;return k.length===0?!1:k.every(({row:h,index:x})=>Tt.value.has(st(h,x)))}),Jt=e.computed(()=>{const k=_l.value;if(k.length===0)return!1;const h=k.filter(({row:x,index:O})=>Tt.value.has(st(x,O))).length;return h>0&&h<k.length}),Kn=(k,h)=>Tt.value.has(st(k,h)),on=()=>{if(kn.value)Tt.value=new Set,I("unselect-all");else{const k=new Set;_l.value.forEach(({row:h,index:x})=>k.add(st(h,x))),Tt.value=k,I("select-all",_e.value)}},Zn=(k,h)=>{if(!bl(k,h))return;const x=st(k,h),O=new Set(Tt.value),de=O.has(x);Ve.value==="single"?de?(O.delete(x),I("row-unselect",k)):(O.clear(),O.add(x),I("row-select",k)):de?(O.delete(x),I("row-unselect",k)):(O.add(x),I("row-select",k)),Tt.value=O},al=e.ref("1"),$l=()=>{const k=Number.parseInt(String(al.value),10);if(!Number.isFinite(k)){al.value=String(pn.value+1);return}const h=Math.min(ol.value,Math.max(1,k));h!==pn.value+1?Mn(h-1):al.value=String(h)},Mn=k=>{k<0||k>=ie.value||(pn.value=k,I("page",{page:k,rows:$n.value}))},Cn=(k,h,x)=>{I("row-click",{data:k,index:h,originalEvent:x}),w(k,Te.value+h)},Wl=(k,h)=>{const x=Te.value+h;return{"dss-table-row-selected":Kn(k,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":be.value,"dss-table-row-truncated-expanded":ln.value===st(k,x)}},Gn=(k,h)=>h.field?Rn(k,h.field):"",Rn=(k,h)=>h.split(".").reduce((x,O)=>x&&x[O],k),Ll=k=>{const h=k.align??Ue.value;return{"dss-table-sortable":k.sortable!==!1&&Xe.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[k.className]:k.className}},Tl=k=>{const h={};return k.width&&(h.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(h.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(h.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),h};return e.watch(()=>ue.locale,k=>{k&&k!==L.value&&(L.value=k)},{immediate:!0}),e.watch(xe,k=>{$n.value=k,pn.value=0}),e.watch(xn,async k=>{k&&(await e.nextTick(),dl())}),e.watch(pn,k=>{al.value=String(k+1)},{immediate:!0}),e.watch(xt,k=>{I("search",k??"")}),e.watch(()=>ue.columns,()=>{Ke()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Bn),document.addEventListener("click",Bt),document.addEventListener("click",Pl),window.addEventListener("resize",Vn),window.addEventListener("scroll",Vn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Bn),document.removeEventListener("click",Bt),document.removeEventListener("click",Pl),window.removeEventListener("resize",Vn),window.removeEventListener("scroll",Vn,!0)}),(k,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Ct,style:e.normalizeStyle({width:f.value+"px",height:Ce.value?Ce.value+"px":"auto"})},[kt.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",rc,[He.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>I("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>I("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Ot.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:qe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Je.value}]),onClick:h[2]||(h[2]=x=>Je.value=!Je.value),"aria-expanded":Je.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ic),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,(x,O)=>(e.openBlock(),e.createElementBlock("li",{key:je(x,O),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",uc,[e.createElementVNode("span",dc,[e.createElementVNode("input",{type:"checkbox",checked:K(x,O),onChange:de=>ve(x,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),K(x,O)?(e.openBlock(),e.createElementBlock("span",pc,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",fc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Je.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":zt.value||xt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:J,"onUpdate:modelValue":h[4]||(h[4]=x=>xt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>zt.value=!0),onBlur:We},null,40,gc),[[e.vModelText,xt.value]]),xt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:lt},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,hc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":zt.value||!!xt.value,onMousedown:e.withModifiers(Be,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,yc)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Q.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Vt.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[Qe.value?(e.openBlock(),e.createElementBlock("th",bc,[Ve.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:kn.value,indeterminate:Jt.value,onChange:on,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),Jt.value?(e.openBlock(),e.createElementBlock("span",Ec)):kn.value?(e.openBlock(),e.createElementBlock("span",Sc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Vc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(x,O)=>(e.openBlock(),e.createElementBlock("th",{key:q(x),class:e.normalizeClass(["dss-table-th",Ll(x)]),style:e.normalizeStyle(Tl(x)),onClick:de=>to(x)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(x.header),1),x.sortable!==!1&&Xe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",vt(x)])},[Oe(x)===0?(e.openBlock(),e.createElementBlock("span",_c,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Oe(x)===1?(e.openBlock(),e.createElementBlock("span",$c,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Oe(x)===-1?(e.openBlock(),e.createElementBlock("span",Lc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":we.value===q(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Ie(q(x))}]),"data-filter-column-key":q(x),"aria-expanded":we.value===q(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:de=>An(q(x),de)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(x,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:st(x,Te.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Wl(x,O)]),style:e.normalizeStyle(le.value),onClick:de=>Cn(x,O,de)},[Qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Hc,[e.createElementVNode("input",{type:Ve.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:Kn(x,Te.value+O),disabled:!bl(x,Te.value+O),onChange:de=>Zn(x,Te.value+O),class:e.normalizeClass(["dss-table-checkbox",Ve.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!bl(x,Te.value+O)}])},null,42,Rc),Ve.value==="multiple"&&Kn(x,Te.value+O)?(e.openBlock(),e.createElementBlock("span",Fc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ve.value==="single"&&Kn(x,Te.value+O)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(de=>V(x,Te.value+O,de),["stop"])},[Qt(x,Te.value+O)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Lt(x,Te.value+O),"aria-label":Lt(x,Te.value+O)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Lt(x,Te.value+O)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Pc)):(e.openBlock(),e.createElementBlock("span",Oc))],8,zc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(de,yt)=>(e.openBlock(),e.createElementBlock("td",{key:q(de),class:e.normalizeClass(["dss-table-td",Ll(de)]),style:e.normalizeStyle(Tl(de))},[e.renderSlot(k.$slots,`cell-${de.field}`,{data:x,column:de,rowIndex:O,isExpanded:ln.value===st(x,Te.value+O)},()=>[e.createTextVNode(e.toDisplayString(Gn(x,de)),1)])],6))),128))],14,Dc),oe.value&&Qt(x,Te.value+O)&&Lt(x,Te.value+O)?(e.openBlock(),e.createElementBlock("tr",Wc,[e.createElementVNode("td",{colspan:tt.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:O})],8,qc)])):e.createCommentVNode("",!0)],64))),128)),se.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(le.value)},[e.createElementVNode("td",{colspan:tt.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(pe.value),1)])],8,Zc)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[ct.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(_)("table.showingRange",{start:gt.value,end:fn.value,total:rt.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[At.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value===0,onClick:h[8]||(h[8]=x=>Mn(0)),title:e.unref(_)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Qc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value===0,onClick:h[9]||(h[9]=x=>Mn(pn.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>al.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:$l,onKeydown:e.withKeys(e.withModifiers($l,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,al.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(_)("table.ofPages",{total:ol.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value>=ie.value-1,onClick:h[11]||(h[11]=x=>Mn(pn.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value>=ie.value-1,onClick:h[12]||(h[12]=x=>Mn(ie.value-1)),title:e.unref(_)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,lu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ou,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:kl},[e.createElementVNode("span",au,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":xn.value}]),onClick:h[13]||(h[13]=x=>xn.value=!xn.value),"aria-expanded":xn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ol},[e.createTextVNode(e.toDisplayString($n.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,su),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":ul.value==="top"}]),style:e.normalizeStyle(Cl.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===$n.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===$n.value}]),onClick:O=>Nn(x)},e.toDisplayString(x),11,ru))),128))],6),[[e.vShow,xn.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Mt.value?{top:Mt.value.top+"px",left:Mt.value.left+"px",width:Dt+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[at.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[at.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:z(we.value).value??"",onInput:h[14]||(h[14]=x=>Dn(we.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,cu)])):at.value.filter==="range"&&pt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pt.value.minPct+"%","--range-max-pct":pt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:qn,class:"dss-table-filter-double-range-track",onMousemove:Z,onMouseenter:Z},[e.createElementVNode("input",{type:"range",min:pt.value.rangeMin,max:pt.value.rangeMax,value:pt.value.currentMin,onInput:h[15]||(h[15]=x=>Hn(we.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:P.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:pt.value.rangeMin,max:pt.value.rangeMax,value:pt.value.currentMax,onInput:h[16]||(h[16]=x=>Hn(we.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:P.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(pt.value.currentMin)+" – "+e.toDisplayString(pt.value.currentMax),1)],4)):at.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",fu,[e.createElementVNode("label",vu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:z(we.value).from??"",onInput:h[17]||(h[17]=x=>Nl(we.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,gu)]),e.createElementVNode("div",hu,[e.createElementVNode("label",yu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:z(we.value).to??"",onInput:h[18]||(h[18]=x=>Nl(we.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):at.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nl[we.value]??"",onInput:h[19]||(h[19]=x=>yl(we.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,Cu),e.createElementVNode("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl(at.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:zl(we.value,x),onChange:O=>Ml(we.value,x)},null,40,wu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>mt(we.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,we.value&&at.value&&Mt.value]])]),_:1})]))],64))}}),Vu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Nu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Bu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",_u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",$u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Lu={class:"dss-toolbar-left"},Tu=["title"],Au=["title"],Du={class:"dss-toolbar-dropdown-wrapper"},Hu=["title"],Ru=["src"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],Wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},qu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["title"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad={key:2,class:"dss-toolbar-separator"},sd=["title"],rd={key:4,class:"dss-toolbar-separator"},id={key:5,class:"dss-toolbar-dropdown-wrapper"},cd=["title"],ud={class:"dss-toolbar-dropdown-ai"},dd={class:"dss-toolbar-right"},md={key:0,class:"dss-toolbar-custom-group"},pd={key:1,class:"dss-toolbar-separator"},fd={class:"dss-link-modal-content"},vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-image-modal-tabs"},wd={key:0,class:"dss-image-tab-content"},xd={class:"dss-link-modal-content"},Ed={class:"dss-link-modal-field"},Sd={key:0,class:"dss-link-modal-label"},Vd=["src"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-link-modal-field"},$d={class:"dss-link-modal-label"},Ld=["placeholder"],Td={class:"dss-link-modal-field"},Ad={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={key:1,class:"dss-image-tab-content"},Rd={class:"dss-link-modal-content"},Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},Wd=["placeholder"],qd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-text-editor-title-input-container"},Gd={key:0,class:"dss-text-editor-title-preview"},Qd={key:0},Jd={key:1,class:"dss-text-editor-preview-placeholder"},e1=["value","placeholder","disabled"],t1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},n1={class:"dss-text-editor-description-input-container"},l1={key:0,class:"dss-text-editor-description-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},i1=["data-comment-id","onMouseenter"],c1=["onClick"],u1=["src","alt"],d1={key:1},m1=["onClick"],p1=["src","alt"],f1={key:1},v1=["data-has-second-user","onClick"],g1={class:"editor-comment-marker-count"},h1={key:4,class:"dss-text-editor-textarea-wrapper"},y1=["value","placeholder","rows","disabled"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1={key:5,class:"dss-text-editor-content-wrapper"},E1={key:0,class:"dss-comment-overlay-body"},S1={class:"dss-comment-selection-wrapper"},V1=["innerHTML"],N1={class:"dss-comment-messages-wrapper"},B1={key:0,class:"dss-comment-avatar-wrapper"},M1={class:"dss-comment-avatar"},_1=["src","alt"],$1={key:1},L1={class:"dss-comment-header"},T1={class:"dss-comment-header-text"},A1={class:"dss-comment-author"},D1={key:0,class:"dss-comment-date"},H1=["onClick","title"],R1={class:"dss-comment-overlay-inner"},F1=["placeholder","onKeydown"],I1={class:"dss-text-editor-footer"},z1={class:"dss-text-editor-footer-content"},P1={class:"dss-text-editor-footer-stat"},O1={class:"dss-text-editor-footer-stat"},W1=["title"],q1=["title"],Z1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},U1={class:"dss-image-popup-content"},X1={key:0,class:"dss-image-popup-no-alt-icon"},Y1=["title"],j1=["title"],K1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},G1={class:"dss-toolbar-left"},Q1=["title"],J1=["title"],em={class:"dss-toolbar-dropdown-wrapper"},tm=["title"],nm=["src"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},cm=["title"],um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km={key:2,class:"dss-toolbar-separator"},Cm={key:3,class:"dss-toolbar-dropdown-wrapper"},bm=["title"],wm={class:"dss-toolbar-dropdown-ai"},xm={key:0,class:"dss-toolbar-right"},Em={key:0,class:"dss-toolbar-separator"},Sm={key:0,class:"dss-toolbar-custom-group"},Vm={key:1,class:"dss-toolbar-separator"},Nm={name:"DSSTextEditor"},Bm=Object.assign(Nm,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(T,{expose:ne,emit:_}){const{t:L,locale:ue}=Gl.useI18n(),I={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,X=_,Ge=e.useSlots(),ge=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
97
|
+
`;const a=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let z='"'+(H.categories[g]||M("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach(N=>{const $=N.data&&N.data[g]!==void 0?N.data[g]:"";z+=","+$}),t+=z+`
|
|
98
|
+
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=nn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Tn()}catch(t){console.error("Error downloading CSV:",t)}},Oo=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:At.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:clampedCategoryIndex||bt.value.categoryIndex};t.action(a,n)}Tn()},Wo=()=>{O(),De.value.show=!0,De.value.categoryIndex=bt.value.categoryIndex,De.value.fromButton=!1,Tn()},ko=()=>{O(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},Co=t=>{if(bt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(bt.value.show=!1)}},no=t=>{bt.value.show&&!t.target.closest(".context-menu")&&(bt.value.show=!1)},bo=t=>{if(!xn.value||!tt.value)return;t.preventDefault(),t.stopPropagation(),re.value.isZooming=!0,Fe.value.show=!1,re.value.zoomTimeout&&clearTimeout(re.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||p<F.value.top-50||p>F.value.bottom+100){re.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(re.value.minScale,Math.min(re.value.maxScale,re.value.scale*g));if(C!==re.value.scale){const{minX:b,maxX:z}=Zt.value,N=z-b||1,$=N/re.value.scale,B=b-re.value.offsetX/F.value.width*N,te=(i-F.value.left)/F.value.width,Ve=B+te*$;re.value.scale=C;const Ke=N/re.value.scale,ce=Ve-te*Ke;re.value.offsetX=-(ce-b)/N*F.value.width,re.value.scale<=1.01&&(re.value.scale=1,re.value.offsetX=0)}re.value.zoomTimeout=setTimeout(()=>{re.value.isZooming=!1,re.value.zoomTimeout=null},300)},lo=t=>{if(!xn.value||!tt.value||re.value.scale<=1)return;Fe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,re.value.isDragging=!0,re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY,t.preventDefault()},wo=()=>{re.value.isDragging=!1},oo=()=>{!xn.value||!tt.value||(re.value.scale=1,re.value.offsetX=0,re.value.isDragging=!1,re.value.zoomTimeout&&(clearTimeout(re.value.zoomTimeout),re.value.zoomTimeout=null),re.value.isZooming=!1)},qo=()=>!xn.value||!il.value||!tt.value?"default":re.value.isDragging?"grabbing":re.value.scale>1?"grab":"dss-crosshair",ql=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],b=p.x+(g.x-i.x)/6*Le.value,z=p.y+(g.y-i.y)/6*Le.value,N=g.x-(C.x-p.x)/6*Le.value,$=g.y-(C.y-p.y)/6*Le.value;a+=` C ${b} ${z} ${N} ${$} ${g.x} ${g.y}`}return a},Bn=e.computed(()=>{const a=q.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(Qt.value?30:0)+60;if(Mn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(hn.value){const B=!G.value,te=Dn.value,Ve=te?pl.value+_l.value+Math.max(24,zn.value+16):0,Ke=B?12:p;let ce=0;rt.value&&(ce+=B?8:15),Et.value&&(ce+=B?6:10);const ye=ot();let Me=Ke+(B?4:16)+(te?Ve:0),ve=Ke+(te?Ve:0);G.value&&he.value==="left"?Me+=ye.legendWidth||150:G.value&&he.value==="right"&&(ve+=ye.legendWidth||150);const Ue=we.value==="semi-radial"?te?Ve:8:te?Ve:B?8:p+80,He=te?14:0,Te=Ke+ce+He,ze={left:Me,top:Te,right:ve,bottom:Ue};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??ze.left,top:i.top??ze.top,right:i.right??ze.right,bottom:i.bottom??ze.bottom}:ze}let C=0;rt.value&&(C+=15),Et.value&&(C+=10);const b=ot();let z=p+16,N=p;G.value&&he.value==="left"?z+=b.legendWidth||150:G.value&&he.value==="right"&&(N+=b.legendWidth||150),An.value&&(N+=44);const $={left:z,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),F=e.computed(()=>({left:Bn.value.left,top:Bn.value.top,right:Se.value-Bn.value.right,bottom:K.value-Bn.value.bottom,width:Se.value-(Bn.value.left+Bn.value.right),height:K.value-(Bn.value.top+Bn.value.bottom)})),xn=e.computed(()=>["line","area","bar"].includes(we.value)||ct.value),On=e.computed(()=>ct.value),Hl=e.computed(()=>we.value==="mini-radial"),hn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),Mn=e.computed(()=>we.value==="spider"),jt=e.computed(()=>we.value==="bubble"),Gt=e.computed(()=>q.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||On.value)),ul=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.left+(t-a)/i*F.value.width},gl=t=>{const{maxX:a}=Zt.value,n=a+1,p=F.value.height/n;return F.value.top+(t+.5)*p},Dt=e.computed(()=>hn.value?Bn.value.left+(Se.value-Bn.value.left-Bn.value.right)/2:Se.value/2),wt=e.computed(()=>Mn.value?K.value/2-40:hn.value?Bn.value.top+(K.value-Bn.value.top-Bn.value.bottom)/2:K.value/2),ut=e.computed(()=>{if(Mn.value){const t=F.value.width-80,a=F.value.height-80;return Math.min(t,a)/2}return Math.min(F.value.width,F.value.height)/2}),Ot=e.computed(()=>{const t=q.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return ut.value*n}),Rl=e.computed(()=>{const t=q.value,a=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(hn.value||Mn.value)?1:1+a/100}),tn=e.computed(()=>{const t=Rl.value;if(t===1||t<=0)return;const a=Dt.value,n=wt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Sl=e.ref(0),Zl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),Rn=e.computed(()=>we.value==="semi-radial"),nl=e.computed(()=>Rn.value&&Vt.value&&!bl.value),ll=e.computed(()=>Rn.value&&Vt.value&&!bl.value&&Ut.value==="fill"),hl=e.computed(()=>{const t=nl.value?Sl.value:1,a=Dt.value,n=wt.value,i=Ot.value,p=ut.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const b=a+p*Math.cos(g),z=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),te=n+i*Math.sin(C),Ve=a+i*Math.cos(g),Ke=n+i*Math.sin(g),ce=t>.5?1:0;return`M ${a} ${n} L ${b} ${z} A ${p} ${p} 0 ${ce} 1 ${N} ${$} L ${B} ${te} A ${i} ${i} 0 ${ce} 1 ${Ve} ${Ke} Z`}),yl=e.computed(()=>{if(!(!Rn.value||!nl.value)&&!ll.value)return`url(#${Zl.value})`}),Zo=t=>{if(!(!ll.value||t!==0))return`url(#${Zl.value})`},kl=e.ref(0),Vl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),jn=e.computed(()=>we.value==="radial"),Fl=e.computed(()=>{const t=jn.value?kl.value:1,a=Dt.value,n=wt.value,i=Math.max(ut.value*1.5,Se.value,K.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,te=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${te} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),b=n+i*Math.sin(p),z=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${b} A ${i} ${i} 0 ${$} 1 ${z} ${N} Z`}),xo=e.computed(()=>{if(yl.value)return yl.value;if(jn.value)return`url(#${Vl.value})`});let Il=null;const Uo=()=>{if(!nl.value)return;Sl.value=0;const t=V.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);Sl.value=Go(S.value,g),g<1&&(Il=requestAnimationFrame(n))};Il=requestAnimationFrame(n)},zl=e.computed(()=>q.value?.bubbles?.minSize||8),ao=e.computed(()=>q.value?.bubbles?.maxSize||50),Ul=e.computed(()=>q.value?.bubbles?.opacity||.7),Eo=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},So=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},so=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Kn=e.computed(()=>H.series),Gn=e.computed(()=>H.series.filter((t,a)=>!lt.value.has(a))),Xl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ro=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Vo=e.computed(()=>Gn.value.filter(t=>Xl(t)==="primary")),Nl=e.computed(()=>Gn.value.filter(t=>Xl(t)==="secondary")),An=e.computed(()=>!Gt.value&&!!ae.value&&Nl.value.length>0),En="auto",io=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let b;if(a===En){const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}else if(typeof a=="number")b=a;else{const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}let z;if(n===En){const N=C-g,$=N>0?N*.1:2;z=C+$}else if(typeof n=="number")z=n;else{const N=C-g,$=N>0?N*.1:2;z=C+$}return{minY:b,maxY:z}},Zt=e.computed(()=>{if(jt.value)return Xo();if(!Gn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Gn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),H.categories.length>0&&(t=Math.max(t,H.categories.length-1));const a=io(Vo.value.length?Vo.value:Gn.value,Pe.value,Re.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),No=e.computed(()=>An.value?io(Nl.value,Wt.value,kt.value,Zt.value.minY,Zt.value.maxY):{minY:Zt.value.minY,maxY:Zt.value.maxY}),Xo=()=>{if(!Gn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(Gn.value.forEach((Ve,Ke)=>{Ve?.data?.length&&Ve.data.forEach((ce,ye)=>{let Me,ve,et;if(typeof ce=="object"&&ce!==null&&!Array.isArray(ce))Me=typeof ce.x=="number"?ce.x:ye,ve=typeof ce.y=="number"?ce.y:0,et=typeof ce.size=="number"?ce.size:20;else if(Array.isArray(ce)&&ce.length>=3)Me=typeof ce[0]=="number"?ce[0]:ye,ve=typeof ce[1]=="number"?ce[1]:0,et=typeof ce[2]=="number"?ce[2]:20;else if(typeof ce=="number")Me=ye,ve=ce,et=Eo(Ke,ye);else return;isFinite(Me)&&isFinite(ve)&&isFinite(et)&&(t=Math.min(t,Me),a=Math.max(a,Me),n=Math.min(n,ve),i=Math.max(i,ve),p=Math.min(p,et),g=Math.max(g,et),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=a-t,z=i-n;let N,$,B,te;return qt.value!==null?N=qt.value:N=t-b*.1,Bt.value!==null?$=Bt.value:$=a+b*.1,Pe.value!==null&&typeof Pe.value=="number"?B=Pe.value:B=Math.max(0,n-z*.1),Re.value!==null&&typeof Re.value=="number"?te=Re.value:te=i+z*.1,{minX:N,maxX:$,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:b,maxX:z}=Zt.value,N=z-b||1;return F.value.left+(t-b)/N*F.value.width}const{minX:a,maxX:n}=Zt.value,i=n-a;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/re.value.scale,g=a-re.value.offsetX/F.value.width*i,C=(t-g)/p;return F.value.left+C*F.value.width},kn=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Bo=t=>{const{minY:a,maxY:n}=No.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Cn=(t,a)=>An.value&&Xl(t)==="secondary"?Bo(a):kn(a),co=t=>{if(!jt.value)return St.value||4;const{maxSize:a}=Zt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return zl.value+i*(ao.value-zl.value)},Bl=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Bl.canvas||(Bl.canvas=document.createElement("canvas"));const i=Bl.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},uo=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Bl(t,n)<=a)return t;const i="..";if(Bl(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(Bl(C,n)<=a)return C;g-=1}return i},Mo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(we.value==="bar"){if(Gt.value){const Te=[],{minY:ze,maxY:_t}=Zt.value,Ft=5,Zn=_t-ze||1;for(let fn=0;fn<=Ft;fn++){const Un=ze+Zn*(fn/Ft),Do=ul(Un);Te.push({x:Do,y:F.value.bottom+20,text:Xt(Math.round(Un))})}return Te}const ye=[],{maxX:Me}=Zt.value,ve=Me+1,et=5,He=(F.value.width-et*2)/ve;for(let Te=0;Te<=Me;Te++){const ze=F.value.left+et+(Te+.5)*He;ye.push({x:ze,y:F.value.bottom+20,text:uo(H.categories[Te]||M("chart.fallback.item",{number:Te+1}),Math.max(He-8,24))})}return ye}const t=[],{minX:a,maxX:n}=Zt.value,i=qt.value!==null?qt.value:a,p=Bt.value!==null?Bt.value:n,g=p-i||1,C=g/re.value.scale,b=i-re.value.offsetX/F.value.width*g,z=b+C,N=Math.max(0,Math.floor(b-2)),$=Math.min(p,Math.ceil(z+2)),B=$-N,te=F.value.width,Ke=Math.floor(te/60);let ce=1;B>Ke&&(ce=Math.ceil(B/Ke));for(let ye=N;ye<=$;ye+=ce)if(ye>=0&&ye<=p){const Me=Kt(ye);Me>=F.value.left-100&&Me<=F.value.right+100&&t.push({x:Me,y:F.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Zt.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,b=Kt(C);if(b>=F.value.left-10&&b<=F.value.right+10){const z=Math.round(C),N=H.categories?.[z];t.push({x:b,y:F.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Zt.value;for(let C=0;C<=g;C++)p.push({x:F.value.left-10,y:gl(C),text:uo(H.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Zt.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.left-10,y:kn(g),text:Xt(C)})}return t}),r=e.computed(()=>{if(!An.value||Gt.value)return[];const t=[],{minY:a,maxY:n}=No.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.right+10,y:Bo(g),text:Xt(C)})}return t}),c=t=>{const a=Jt.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const b=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,i=Number(b[2])/255,p=Number(b[3])/255;else{const z=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(z){let N=z[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${b})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),C=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${b}, ${i[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),z=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,b,z].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=q.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(i*i+p*p)}return a},y=e.computed(()=>we.value==="line"||On.value?(On.value?H.series.filter(a=>(a.type||we.value)==="line"):Kn.value).map((a,n)=>{const i=H.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,te)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Gt.value?ul(B):Kt(te),y:Gt.value?gl(te):Cn(a,B),index:te})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let te="";ke.value?te=ql(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),C+=(C?" ":"")+te}});const b=p.reduce((B,te)=>B+v(te),0),z=lt.value.has(i),N=ie.value===i,$=ie.value!==null&&ie.value!==i;return{path:C,color:c(i),strokeDasharray:ro(a),pathLength:b,seriesIndex:i,animationDelay:n*Z.value,isHighlighted:N,isDimmed:$,isHidden:z}}):[]),_=e.computed(()=>{if(!(we.value==="line"||On.value))return[];const t=On.value?H.series.filter(n=>(n.type||we.value)==="line"):Kn.value,a=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let b=-1,z=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)z++;else{b=N;break}}if(z>0&&b!==-1){const N=n.data[b],$=Gt.value?ul(C):Kt(g),B=Gt.value?gl(g):Cn(n,C),te=Gt.value?ul(N):Kt(b),Ve=Gt.value?gl(b):Cn(n,N),Ke=lt.value.has(p),ce=ie.value===p,ye=ie.value!==null&&ie.value!==p;a.push({path:`M ${$} ${B} L ${te} ${Ve}`,color:c(p),seriesIndex:p,animationDelay:i*Z.value,isHighlighted:ce,isDimmed:ye,isHidden:Ke,gapSize:z}),g=b-1}}}}),a}),D=e.computed(()=>we.value==="line"||On.value?!Vt.value||bl.value||Ht.value.hasAnimated?[]:(On.value?H.series.filter(a=>(a.type||we.value)==="line"):Kn.value).map((a,n)=>{const i=H.series.findIndex(z=>z===a);let p="",g=null;a.data.forEach((z,N)=>{if(z!=null){const $={x:Gt.value?ul(z):Kt(N),y:Gt.value?gl(N):Cn(a,z)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,te)=>te>N&&B!==null&&B!==void 0);if($!==-1){const B={x:Gt.value?ul(a.data[$]):Kt($),y:Gt.value?gl($):Cn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((z,N)=>z==null?null:{x:Gt.value?ul(z):Kt(N),y:Gt.value?gl(N):Cn(a,z)}).filter(z=>z!==null),b=v(C);return{path:p,pathLength:b,color:c(i),strokeDasharray:ro(a),animationDelay:n*Z.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Kn.value.forEach((a,n)=>{const i=ie.value===n,p=ie.value!==null&&ie.value!==n,g=lt.value.has(n);a.data.forEach((C,b)=>{C!=null&&t.push({x:Kt(b),y:Cn(a,C),color:c(n),value:C,label:H.categories[b]||b.toString(),seriesName:a.name,categoryIndex:b,dataIndex:b,animationDelay:(n*a.data.length+b)*(Z.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),se=e.computed(()=>{if(!On.value)return[];const t=[];return H.series.filter(n=>(n.type||we.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(z=>z===n),g=ie.value===p,C=ie.value!==null&&ie.value!==p,b=lt.value.has(p);n.data.forEach((z,N)=>{z!=null&&t.push({x:Kt(N),y:Cn(n,z),color:c(p),value:z,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Z.value/8),isHighlighted:g,isDimmed:C,isHidden:b})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Kn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=ie.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=lt.value.has(n);a.data.forEach((b,z)=>{let N,$,B,te,Ve;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:z,$=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,te=b.label||H.categories?.[z]||`Point ${z+1}`,Ve=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:z,$=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,te=b[3]||H.categories?.[z]||`Point ${z+1}`,Ve=b[4];else if(typeof b=="number")N=z,$=b,B=Eo(n,z),te=H.categories?.[z]||`Point ${z+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:kn($),radius:co(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:te,imageUrl:Ve,seriesIndex:n,dataIndex:z,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Ul.value})})}),t}),Oe=e.computed(()=>we.value!=="area"?[]:Kn.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,te)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(te),y:Cn(t,B),index:te})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:lt.value.has(a)};const p=F.value.bottom+1;let g="",C="";n.forEach((B,te)=>{if(B.length===0)return;let Ve=`M ${B[0].x} ${B[0].y}`;ke.value&&B.length>1?Ve=ql(B):B.slice(1).forEach(ce=>{Ve+=` L ${ce.x} ${ce.y}`}),g+=(g?" ":"")+Ve;let Ke=`M ${B[0].x} ${p}`;if(Ke+=` L ${B[0].x} ${B[0].y}`,ke.value&&B.length>1){const ce=ql(B),ye=ce.substring(ce.indexOf("C")||ce.indexOf("Q")||ce.indexOf("L"));ye?Ke+=" "+ye:B.slice(1).forEach(Me=>{Ke+=` L ${Me.x} ${Me.y}`})}else B.slice(1).forEach(ce=>{Ke+=` L ${ce.x} ${ce.y}`});Ke+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ke});const b=ie.value===a,z=ie.value!==null&&ie.value!==a,N=lt.value.has(a),$=n.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:b,isDimmed:z,isHidden:N}})),Ne=e.computed(()=>{if(!(["bar"].includes(we.value)||On.value))return[];const t=[],{maxX:a}=Zt.value,n=On.value?H.series.filter(p=>(p.type||we.value)==="bar"):Kn.value,i=n.length;if(Gt.value){const p=a+1,C=F.value.height/p,b=C*(2/3),z=Math.min(4,b/i*.15),N=b-(i-1)*z,$=Math.max(4,N/i);n.forEach((B,te)=>{const Ve=H.series.findIndex(Me=>Me===B),Ke=ie.value===Ve,ce=ie.value!==null&&ie.value!==Ve,ye=lt.value.has(Ve);B.data.forEach((Me,ve)=>{if(Me==null||typeof Me!="number"||!isFinite(Me))return;const He=F.value.top+(ve+.5)*C-b/2+te*($+z),Te=F.value.left,ze=Math.abs(ul(Me)-F.value.left);let _t="";if(ke.value&&ze>0){const Ft=Math.min(xt.value,$/2,ze/2);_t=[`M ${Te} ${He}`,`L ${Te+ze-Ft} ${He}`,`Q ${Te+ze} ${He} ${Te+ze} ${He+Ft}`,`L ${Te+ze} ${He+$-Ft}`,`Q ${Te+ze} ${He+$} ${Te+ze-Ft} ${He+$}`,`L ${Te} ${He+$}`,"Z"].join(" ")}t.push({x:Te,y:He,width:ze,height:$,color:c(i===1?ve:Ve),value:Me,label:H.categories[ve]||ve.toString(),seriesName:B.name,animationDelay:(te*n.length+ve)*(Z.value/4),isHighlighted:Ke,isDimmed:ce,isHidden:ye,barPath:_t,isSmooth:ke.value&&ze>0})})})}else{const p=a+1,C=F.value.width/p,b=C*.8,z=b/i,N=z*.05,$=z-N;n.forEach((B,te)=>{const Ve=H.series.findIndex(Me=>Me===B),Ke=ie.value===Ve,ce=ie.value!==null&&ie.value!==Ve,ye=lt.value.has(Ve);B.data.forEach((Me,ve)=>{if(Me==null||typeof Me!="number"||!isFinite(Me))return;const He=F.value.left+(ve+.5)*C-b/2+te*z+N/2,Te=kn(Math.max(0,Me)),ze=Math.abs(kn(0)-kn(Me));let _t="";if(ke.value&&ze>0){const Ft=Math.min(xt.value,$/2,ze/2);_t=[`M ${He} ${Te+ze}`,`L ${He} ${Te+Ft}`,`Q ${He} ${Te} ${He+Ft} ${Te}`,`L ${He+$-Ft} ${Te}`,`Q ${He+$} ${Te} ${He+$} ${Te+Ft}`,`L ${He+$} ${Te+ze}`,"Z"].join(" ")}t.push({x:He,y:Te,width:$,height:ze,color:c(i===1?ve:Ve),value:Me,label:H.categories[ve]||ve.toString(),seriesName:B.name,animationDelay:(te*n.length+ve)*(Z.value/4),isHighlighted:Ke,isDimmed:ce,isHidden:ye,barPath:_t,isSmooth:ke.value&&ze>0})})})}return t}),st=e.computed(()=>{if(!hn.value)return[];const t=Kn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!lt.value.has(C));if(t.length===0)return[];let a=we.value==="semi-radial"?Math.PI:-Math.PI/2;const n=we.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,b,z,N,$,B)=>{const te=C+(b-C)/2,Ve=b-C,Ke=Dt.value+Math.cos(C)*Ot.value,ce=wt.value+Math.sin(C)*Ot.value,ye=Dt.value+Math.cos(b)*Ot.value,Me=wt.value+Math.sin(b)*Ot.value,ve=Dt.value+Math.cos(b)*ut.value,et=wt.value+Math.sin(b)*ut.value,Ue=Dt.value+Math.cos(C)*ut.value,He=wt.value+Math.sin(C)*ut.value,Te=Ve>Math.PI?1:0,ze=[`M ${Ke} ${ce}`,`A ${Ot.value} ${Ot.value} 0 ${Te} 1 ${ye} ${Me}`,`L ${ve} ${et}`,`A ${ut.value} ${ut.value} 0 ${Te} 0 ${Ue} ${He}`,"Z"].join(" "),_t=B||c(z);return{path:ze,color:_t,strokeWidth:Je.value,strokeColor:m(i.length,_t),value:$,seriesName:N,opacity:.8,isHighlighted:ie.value===z,isDimmed:ie.value!==null&&ie.value!==z,isHidden:!1,startAngle:C,endAngle:b,midAngle:te}};if(Hl.value){const{series:C,originalIndex:b}=t[0],z=Number(C?.data?.[0]??0),N=Number.isFinite(z)?Math.min(Math.max(z,0),100):0,$=q.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Ve=(N<=0?B:N)/100*n,Ke=Number($?.miniRadial?.thresholds?.low??33),ce=Number($?.miniRadial?.thresholds?.medium??66),ye=$?.miniRadial?.colors?.low||"#E53E3E",Me=$?.miniRadial?.colors?.medium||"#ED8936",ve=$?.miniRadial?.colors?.high||"#38A169",et=N<=Ke?ye:N<=ce?Me:ve,Ue=$?.miniRadial?.trackColor||"#E5E7EB",He=C?.name||"Score";return i.push(p(a,a+n-.001,b+1,"Track",100,Ue)),i.push(p(a,a+Ve,b,He,N,et)),i}if(t.length===1){const{series:C,originalIndex:b}=t[0],z=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,te=Dt.value+Math.cos(N)*Ot.value,Ve=wt.value+Math.sin(N)*Ot.value,Ke=Dt.value+Math.cos($)*Ot.value,ce=wt.value+Math.sin($)*Ot.value,ye=Dt.value+Math.cos($)*ut.value,Me=wt.value+Math.sin($)*ut.value,ve=Dt.value+Math.cos(N)*ut.value,et=wt.value+Math.sin(N)*ut.value,Ue=1,He=[`M ${te} ${Ve}`,`A ${Ot.value} ${Ot.value} 0 ${Ue} 1 ${Ke} ${ce}`,`L ${ye} ${Me}`,`A ${ut.value} ${ut.value} 0 ${Ue} 0 ${ve} ${et}`,"Z"].join(" "),Te=c(b);return i.push({path:He,color:Te,strokeWidth:Je.value,strokeColor:m(0,Te),value:z,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(ll.value&&t.length===2){const C=t[0],b=t[1],z=Math.min(100,Math.max(0,C.series.data[0]||0)),N=z/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,z)),i.push(p(a,a+n,b.originalIndex,b.series.name,100)),i}const g=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const z=C.data[0]||0,N=z/g*n,$=a,B=a+N,te=$+N/2,Ve=Dt.value+Math.cos($)*Ot.value,Ke=wt.value+Math.sin($)*Ot.value,ce=Dt.value+Math.cos(B)*Ot.value,ye=wt.value+Math.sin(B)*Ot.value,Me=Dt.value+Math.cos(B)*ut.value,ve=wt.value+Math.sin(B)*ut.value,et=Dt.value+Math.cos($)*ut.value,Ue=wt.value+Math.sin($)*ut.value,He=N>Math.PI?1:0,Te=[`M ${Ve} ${Ke}`,`A ${Ot.value} ${Ot.value} 0 ${He} 1 ${ce} ${ye}`,`L ${Me} ${ve}`,`A ${ut.value} ${ut.value} 0 ${He} 0 ${et} ${Ue}`,"Z"].join(" "),ze=c(b);i.push({path:Te,color:ze,strokeWidth:Je.value,strokeColor:m(i.length,ze),value:z,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:ie.value!==null&&ie.value!==b,isHidden:!1,startAngle:$,endAngle:B,midAngle:te}),a=B}),i)}),yn=e.computed(()=>{const t=st.value;return ll.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),mn=e.computed(()=>{if(!Dn.value||!hn.value)return[];const t=zn.value,a=pl.value,n=_l.value,i=Pl.value,p=15,g=t*1.3,C=.55,b=(B,te)=>{const Ve=Dt.value+Math.cos(B.midAngle)*ut.value,Ke=wt.value+Math.sin(B.midAngle)*ut.value,ce=Dt.value+Math.cos(B.midAngle)*(ut.value+a),ye=wt.value+Math.sin(B.midAngle)*(ut.value+a),ve=ce+n*(te?1:-1),et=te?ce+p:ce-p,Ue=ye-i,He=`${B.seriesName}: ${Xt(B.value)}`,Te=He.length*t*C;return{pointerStartX:Ve,pointerStartY:Ke,pointerEndX:ce,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:et,textY:Ue,text:He,textWidth:Te,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ce-Ve,ye-Ke),horizontalLineLength:Math.hypot(ve-ce,0)}},z=(B,te)=>{const Ve=Math.abs(B.textY-te.textY)<g,Ke=B.isRightSide?B.textX:B.textX-B.textWidth,ce=B.isRightSide?B.textX+B.textWidth:B.textX,ye=te.isRightSide?te.textX:te.textX-te.textWidth,Me=te.isRightSide?te.textX+te.textWidth:te.textX,ve=Ke<Me&&ye<ce;return Ve&&ve},N=st.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const te=N[B];let Ve=Math.cos(te.midAngle)>=0;if(B>0){const ce=$[B-1],ye=b(te,Ve);z(ce,ye)&&(Ve=!Ve)}const Ke=b(te,Ve);$.push({...Ke,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return $}),ln=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Ul.value||.7;return ie.value===null||ie.value===void 0?a:ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},pn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):a*.7:a},rn=(t,a)=>{if(t)try{if(ie.value===t.seriesIndex?ie.value=null:ie.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},cn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},Wn=(t,a)=>{if(!t||(a.stopPropagation(),To.value=!0,ie.value=t.seriesIndex,Fe.value.show=!1,!je.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120;p+C>Se.value&&(p=a.clientX-i.left-C-10),g+b>i.height&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const z=$n.value,N=Ln.value,$=z.map(B=>{const te=N[B]||B,Ve=ol(B,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Ve}`,color:t.color}:null}).filter(Boolean);ht.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},ol=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=vl.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return un.value?p+un.value:p}return n?.toString()||""},dl=()=>{if(!jt.value||!Fe.value.data||Fe.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Fe.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},mo=(t,a)=>{t&&(To.value=!1,ie.value=null,ht.value.show=!1,ht.value.bubbleData=[])},_o=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Tl(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,b=a.clientY-i.top-10;const z=200,N=g?80:50;C+z>Se.value&&(C=a.clientX-i.left-z-15),b+N>K.value&&(b=a.clientY-i.top-N-10),C<0&&(C=10),b<0&&(b=10),gn.value={show:!0,x:C,y:b,categoryValue:p,description:g}},Yo=()=>{gn.value.show=!1},Cl=e.computed(()=>H.categories.length||Math.max(...Gn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Gn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),po=e.computed(()=>{const t=[],a=Cl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Dt.value+Math.cos(i)*ut.value,g=wt.value+Math.sin(i)*ut.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Yl=e.computed(()=>{const t=[],a=Cl.value;return po.value.forEach((n,i)=>{const p=ut.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Dt.value+Math.cos(g)*p,b=wt.value+Math.sin(g)*p+5;let z="middle",N="middle";Math.abs(Math.cos(g))>.5&&(z=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:z,baseline:N})}),t}),$o=e.ref(new Set),al=(t,a,n)=>{const i=`current-${n}`,p=$o.value.has(i);return!p&&ie.value===null?a.fillOpacity||gt.value:a.isHighlighted||p?(a.fillOpacity||gt.value)+.15:a.isDimmed?(a.fillOpacity||gt.value)*.3:a.fillOpacity||gt.value},Qn=e.computed(()=>{if(!Mn.value)return[];const t=[],a=Cl.value;return Kn.value.forEach((n,i)=>{const p=[],g=[],C=[],b=ie.value===i,z=ie.value!==null&&ie.value!==i,N=lt.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Ve=B/ta.value*ut.value,Ke=$*2*Math.PI/a-Math.PI/2,ce=Dt.value+Math.cos(Ke)*Ve,ye=wt.value+Math.sin(Ke)*Ve;p.push(`${ce},${ye}`),g.push({x:ce,y:ye}),C.push({x:ce,y:ye,value:B,label:H.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:gt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:z,isHidden:N,seriesIndex:i})}),t}),qn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,b=a[p].x,z=a[p].y;C>t.y!=z>t.y&&t.x<(b-g)*(t.y-C)/(z-C)+g&&(n=!n)}return n},na=t=>{if(!Mn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=A.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=Qn.value.filter(b=>b.isHidden?!1:qn({x:p,y:g},b.polygonPoints));if(C.length>0){C.length,ie.value=C[0].seriesIndex;const b=t.clientX-n.left+10,z=t.clientY-n.top-10,N=C.length>1?460:260,$=70+Cl.value*20;let B=b,te=z;B+N>Se.value&&(B=t.clientX-n.left-N-10),te+$>K.value&&(te=t.clientY-n.top-$-10),B<0&&(B=10),te<0&&(te=10);const Ve=C.map(Ke=>({seriesName:Ke.seriesName,color:Ke.color,points:Ke.dataPoints.map(ce=>({label:ce.label,value:Xt(ce.value)}))}));ht.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else ml()},Lo=e.computed(()=>{const t=q.value;return t.logos.map((a,n)=>{const i=H.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||lt.value.has(a.seriesIndex))return null;let p,g;if(xn.value){let b=-1,z=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){b=$,z=i.data[$];break}if(b===-1||z===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:Cn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!bl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ht.value.isAnimating||!Ht.value.hasAnimated))if(Ht.value.isAnimating){const $=Ht.value.currentFrame/Ht.value.totalFrames,B=Go(t.animations.easing,Math.min($,1)),te=wa(N,B);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(b)+(a.offsetX||0),g=kn(z)+(a.offsetY||0)}else if(hn.value||Mn.value){const b=Math.PI*2/t.logos.length*n;p=Dt.value+Math.cos(b)*(ut.value+30)+(a.offsetX||0),g=wt.value+Math.sin(b)*(ut.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),fa=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},va=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},jo=t=>{lt.value.has(t)?lt.value.delete(t):lt.value.add(t)},ga=e.computed(()=>{if(!ht.value.show&&!(Qe.value&&Fe.value.show&&!re.value.isZooming))return{display:"none"};let t,a;if(Qe.value&&Fe.value.show&&!re.value.isZooming){t=Fe.value.x+15,a=F.value.top;const n=jt.value?200:150;t+n>Se.value&&(t=Fe.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=ht.value.x,a=ht.value.y;return{left:t+"px",top:a+"px"}}),Ml=(t,a)=>{if(!je.value||fo.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120,z=Se.value,N=K.value;p+C>z&&(p=a.clientX-i.left-C-10),g+b>N&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&H.categories.includes(t.label)&&($=H.categories.indexOf(t.label));const B=(Gt.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ht.value={show:!0,x:p,y:g,title:B,value:Xt(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),To=e.ref(!1),ml=()=>{ht.value.show=!1,ht.value.spiderAreas=[],ht.value.bubbleData=[],Fe.value.show=!1,Ko.value||(ie.value=null)},fo=e.ref(!1),vo=(t,a)=>{fo.value=!0,ht.value.show=!1,Fe.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>Se.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),xl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},go=()=>{fo.value=!1,xl.value.show=!1},Ht=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Go=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},bl=e.computed(()=>Ze.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!Vt.value||bl.value){Ht.value.hasAnimated=!0,jn.value&&(kl.value=1);return}jn.value&&(kl.value=0),Ht.value.isAnimating=!0,Ht.value.currentFrame=0,Ht.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const a=Ht.value.currentFrame/Ht.value.totalFrames,n=Go(S.value,Math.min(a,1));ha(n),jn.value&&(kl.value=n),a<1?(Ht.value.currentFrame++,Ht.value.animationId=requestAnimationFrame(t)):ya()};Ht.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=P.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Ht.value.isAnimating=!1,Ht.value.hasAnimated=!0,jn.value&&(kl.value=1),Ht.value.animationId&&(cancelAnimationFrame(Ht.value.animationId),Ht.value.animationId=null)},Qo=e.computed(()=>!hn.value||Ht.value.hasAnimated?!0:jn.value?kl.value>=1:Rn.value?Sl.value>=1:!0),oa=e.computed(()=>Dn.value&&Qo.value),Ao=e.ref(!1);e.watch(oa,t=>{t?(Ao.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ao.value=!0})})):Ao.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!Vt.value||bl.value||Ht.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Ca(S.value),t["--dss-stagger-delay"]=`${Z.value}ms`,t}),Ca=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ba=()=>{if(!Vt.value||bl.value)return"";const t=["dss-chart-animated"];return Ht.value.hasAnimated||t.push(`dss-animate-${Ut.value}`),Ht.value.hasAnimated||(hn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):hn.value||t.push(`dss-animate-${Ut.value}`)),Ht.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{J.value&&a&&Ht.value.hasAnimated&&(Ht.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),w.value)}))},{deep:!0}),e.watch(()=>re.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{h()},50)}),e.watch(()=>[re.value.scale,re.value.offsetX],()=>{!re.value.isZooming&&!re.value.isDragging&&h()},{flush:"post"}),e.watch([Tt,Xe],([t,a])=>{re.value.minScale=t,re.value.maxScale=a,(re.value.scale<t||re.value.scale>a)&&oo()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>bt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",no)}):document.removeEventListener("click",no)}),e.onMounted(()=>{ie.value=null,jn.value&&(!Vt.value||bl.value)&&(kl.value=1),an(),P.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:n,height:i}=a.contentRect;ft.value=Math.round(n),ee.value=Math.round(i),pe.value&&($e.value=pe.value.offsetHeight||Ce)}))}),f.observe(P.value)),Vt.value&&!bl.value?we.value==="semi-radial"?setTimeout(()=>Uo(),w.value):setTimeout(()=>la(),w.value):(Ht.value.hasAnimated=!0,we.value==="semi-radial"&&(Sl.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",Co)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&P.value&&(f.unobserve(P.value),f.disconnect(),f=null),Ht.value.animationId&&cancelAnimationFrame(Ht.value.animationId),Il&&(cancelAnimationFrame(Il),Il=null),re.value.zoomTimeout&&clearTimeout(re.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",Co),document.removeEventListener("click",no)});const aa=t=>{if(re.value.isDragging&&re.value.scale>1&&xn.value){Fe.value.show=!1;const a=t.clientX-re.value.lastMouseX,{minX:n,maxX:i}=Zt.value,p=i-n||1,C=a*.8;re.value.offsetX+=C;const b=p/re.value.scale,z=p-b,N=0,$=-z/p*F.value.width,B=N;re.value.offsetX=Math.max($,Math.min(B,re.value.offsetX)),re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY}},sa=()=>{re.value.isDragging&&(re.value.isDragging=!1,setTimeout(()=>{!re.value.isDragging&&re.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let b=1;b<n.length;b++){const z=n[b].x-n[b-1].x,N=n[b].y-n[b-1].y,$=Math.sqrt(z*z+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let b=0;b<p.length;b++){const z=C+p[b];if(g<=z){const N=(g-C)/p[b],$=n[b],B=n[b+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=z}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ba(),{"dss-chart-fill-width":Ye.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":hn.value&&!G.value}]]),style:e.normalizeStyle({width:Ye.value?"100%":Se.value+"px",height:We.value,...Ye.value||qe.value?{overflow:hn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:qo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:P,onWheel:bo,onMousedown:lo,onMousemove:Yn,onMouseup:wo,onMouseleave:cl,onDblclick:oo,onContextmenu:e.withModifiers(Ll,["prevent"]),onClick:e.withModifiers(Tn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:pe},[e.createElementVNode("div",vs,[rt.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0)]),G.value&&he.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":_e.value==="horizontal","dss-legend-vertical":_e.value==="vertical","dss-legend-top":he.value==="top","dss-legend-bottom":he.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ks,e.toDisplayString(n.name),1)],46,ys))),128))],2)):e.createCommentVNode("",!0),G.value&&(he.value==="left"||he.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":he.value==="left","dss-legend-right":he.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",bs,e.toDisplayString(n.name),1)],46,Cs))),128))],2)):e.createCommentVNode("",!0)],512),T.showAddMarkerButton&&$t.value&&it.value.addMarker&&(xn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Jn.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,xs),a[4]||(a[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ws)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[jt.value&&Rt.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(Rt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Se.value,height:K.value,class:"dss-chart-svg","data-smooth":ke.value,"data-animated":Vt.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Se.value,height:F.value.height*4},null,8,Bs)],8,Ns),Rn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Zl.value},[e.createElementVNode("path",{d:hl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),jn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Vl.value},[e.createElementVNode("path",{d:Fl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),xn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[Pt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":de.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:F.value.left,x2:F.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Rs),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Fs),An.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Is)):e.createCommentVNode("",!0)]),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Os))),128)),An.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Ws))),128)):e.createCommentVNode("",!0),Qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Qt.value),9,qs)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(It.value),9,Zs)):e.createCommentVNode("",!0),An.value&&me.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Se.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${Se.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(me.value),9,Us)):e.createCommentVNode("",!0)]),fl.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":de.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,js)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Ks)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Gs)):e.createCommentVNode("",!0)],8,Ys),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Qs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,F.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Js),e.createElementVNode("text",{x:n.x,y:Math.max(15,F.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":de.value},[On.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,lr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,sr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,rr))),128)),St.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Y(n.isHighlighted?U(n,St.value)+2:U(n,St.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,ir))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":Be.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ht.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ur))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,mr))),128)),St.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Y(n.isHighlighted?U(n,St.value)+2:U(n,St.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,pr))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",fr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ge.value+.2:ge.value,mask:`url(#area-mask-${i}-${T.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+1:Be.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Z.value}ms`})},null,14,yr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,kr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ml(n,p),onMouseleave:ml},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),Qe.value&&Fe.value.show&&!re.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":de.value},[e.createElementVNode("line",{x1:Fe.value.x,x2:Fe.value.x,y1:F.value.top,y2:F.value.bottom,stroke:Lt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Fe.value.x,cy:n.y,r:Y(St.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,xr))),128))],8,br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Y(n.radius),fill:n.color,"fill-opacity":ln(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(cn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Wn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,42,Vr),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:pn(n)}),onLoad:p=>So(i),onError:p=>so(i),onMouseenter:p=>Wn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),hn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:tn.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:wt.value,r:ut.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Mr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":xo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Zo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>Ml(n.segment,p),onMouseleave:ml},null,42,$r))),128))],8,_r),_n.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ol.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,Tr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),rl.value&&(Qo.value||Rn.value||Hl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Nn.value.x,y:Nn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Hn.value,fill:wl.value,class:"dss-radial-data-center"},e.toDisplayString(vn.value),9,Ar)):e.createCommentVNode("",!0),oa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Ao.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Dr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,Hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":zn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),Mn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:tn.value},[Pt.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Dt.value,cy:wt.value,r:Y(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,zr))),128)),e.createElementVNode("g",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Dt.value-16,y:wt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:Dt.value,y:wt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Nt(i)),9,Wr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Dt.value,x2:n.x,y1:wt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,qr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/Cl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/Cl.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Ur))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:ml},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":al("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Be.value+1:Be.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Z.value}ms`,transition:"all 0.2s ease"})},null,14,Xr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:Y(n.isHighlighted?St.value+1:St.value>0?St.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Z.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Ml(p,C),onMouseleave:ml},null,46,Yr))),128))]))),128))],32)],8,Fr)):e.createCommentVNode("",!0),e.createElementVNode("g",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Y(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Kr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>fa(i),onError:p=>va(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Gr))),128))])],8,Vs))]),W.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Se.value+"px",height:K.value+"px",backgroundImage:`url('${Vn.value}')`,backgroundRepeat:"no-repeat",...mt.value,opacity:I.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Sn.value+"px",height:Sn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Mt(n),["stop"]),onMouseenter:p=>_o(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:In(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Jr)],44,Qr)),[[e.vShow,Fn.value]])),128)),gn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:gn.value.x+"px",top:gn.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(gn.value.categoryValue),1),gn.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(gn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),je.value&&(ht.value.show||Qe.value&&Fe.value.show&&!re.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Qe.value&&Fe.value.show&&!re.value.isZooming,"dss-spider-tooltip":Mn.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!Qe.value||!Fe.value.show||re.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Mn.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",li,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",oi,e.toDisplayString(p.label),1),e.createElementVNode("span",ai,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&ht.value.bubbleData&&ht.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[ht.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(ht.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ci,[e.createElementVNode("div",ui,e.toDisplayString(ht.value.title),1),e.createElementVNode("div",di,e.toDisplayString(ht.value.value),1)])),ht.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[pt(ht.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",mi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt(ht.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",fi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",vi,[e.createElementVNode("div",gi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),pt(ht.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",yi,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt(ht.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ki,[e.createElementVNode("div",Ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",bi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",wi,[e.createElementVNode("div",xi,e.toDisplayString(jt.value?dl():T.categories[Fe.value.categoryIndex]||`Category ${Fe.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Fe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Si,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Vi,e.toDisplayString(Xt(n.value)),1)]))),128))]),pt(Fe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ni,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt(Fe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Mi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),pt(Fe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Li,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt(Fe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Ai,[e.createElementVNode("div",Di,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Hi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xn.value&&tt.value&&re.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(re.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,fs),G.value&&he.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":_e.value==="horizontal","dss-legend-vertical":_e.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Fi,e.toDisplayString(n.name),1)],46,Ri))),128))],2)):e.createCommentVNode("",!0),bt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:bt.value.x+"px",top:bt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[it.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Wo},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),it.value.addMarker&&(it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv||Ct.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),it.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Po},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),it.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ho},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:yo},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ct.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Wl(n)),style:e.normalizeStyle(tl(n)),onClick:p=>Oo(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:wn(n),class:"dss-custom-menu-content"},null,8,Wi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",qi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Oi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:O},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Zi,[e.createElementVNode("h3",null,e.toDisplayString(en.value?e.unref(M)("chart.modalMarker.viewMarker"):bn.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:O},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>De.value.date=n),"min-date":El.value,"max-date":$l.value,disabled:en.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),en.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>De.value.description=n),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[bn.value&&!en.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:ue},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:O},e.toDisplayString(en.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),en.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:x,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(bn.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,tc))])])])])):e.createCommentVNode("",!0)],64))}}),oc={class:"dss-modal-title"},ac={class:"dss-modal-actions"},Jo={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(T,{emit:oe}){const M=T,L=oe,fe=e.ref(null),P=e.ref(null),A=e.computed(()=>{const X={"max-width":M.width};return M.height!=="auto"&&(X.height=M.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function ft(){L("close-modal")}function ee(){M.backDrop&&!fe.value&&L("close-modal")}function f(X){X.target.tagName==="INPUT"&&(fe.value=X.target.tagName)}function be(){setTimeout(()=>{fe.value=null},300)}function Ce(){const X=document.body,de=document.documentElement;P.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:de.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${P.value.scrollY}px`,X.style.width="100%",X.style.left="0",de.style.overflow="hidden"}function Q(){if(!P.value)return;const X=document.body,de=document.documentElement,{bodyOverflow:H,bodyPosition:Ee,bodyTop:Ie,bodyWidth:ot,htmlOverflow:vt,scrollY:q}=P.value;X.style.overflow=H||"",X.style.position=Ee||"",X.style.top=Ie||"",X.style.width=ot||"",X.style.left="",de.style.overflow=vt||"",window.scrollTo(0,q||0)}return e.watch(()=>M.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const de=document.getElementById("dss-modal-backdrop");de&&(de.addEventListener("focusin",f),de.addEventListener("focusout",be))},100);else{Q(),document.body.classList.remove("dss-modal-open");const de=document.getElementById("dss-modal-backdrop");de&&(de.removeEventListener("focusin",f),de.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&Q()}),(X,de)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:de[0]||(de[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",oc,[e.renderSlot(X.$slots,"title",{},()=>[de[1]||(de[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ft,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[de[2]||(de[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},sc={key:0,class:"dss-table-toolbar"},rc={class:"dss-table-toolbar-left"},ic=["aria-expanded"],cc={class:"dss-pagination-select-dropdown",role:"listbox"},uc={class:"dss-table-column-visibility-label"},dc={class:"dss-table-checkbox-wrapper"},mc=["checked","onChange"],pc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fc={class:"dss-table-column-visibility-text"},vc={class:"dss-table-toolbar-right"},gc=["placeholder","aria-label"],hc=["aria-label"],yc=["aria-label","aria-expanded"],kc={key:1,class:"dss-table-toolbar-extra"},Cc={class:"dss-table-thead"},bc={key:0,class:"dss-table-th dss-table-selection-column"},wc={key:0,class:"dss-table-checkbox-wrapper"},xc=["checked","indeterminate"],Ec={key:0,class:"dss-table-checkbox__indeterminate"},Sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Vc=["aria-label"],Nc=["onClick"],Bc={class:"dss-table-th-content"},Mc={class:"dss-table-th-text"},_c={key:0},$c={key:1},Lc={key:2},Tc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Ac={class:"dss-table-tbody"},Dc=["onClick"],Hc={class:"dss-table-checkbox-wrapper"},Rc=["type","name","checked","disabled","onChange"],Fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ic={key:1,class:"dss-table-checkbox__dot"},zc=["onClick"],Pc=["aria-expanded","aria-label"],Oc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Wc={key:0,class:"dss-table-expansion-row"},qc=["colspan"],Zc=["colspan"],Uc={key:1,class:"dss-table-pagination"},Xc={class:"dss-table-pagination-left"},Yc={key:0},jc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Kc={class:"dss-table-pagination-center"},Gc={key:0,class:"dss-pagination-controls"},Qc=["disabled","title"],Jc=["disabled","title"],eu=["aria-label","onKeydown"],tu={class:"dss-pagination-of"},nu=["disabled","title"],lu=["disabled","title"],ou={class:"dss-table-pagination-right"},au={class:"dss-pagination-rows-label"},su=["aria-expanded"],ru=["aria-selected","onClick"],iu={key:0,class:"dss-table-filter-row"},cu=["value","placeholder"],uu=["min","max","value"],du=["min","max","value"],mu={class:"dss-table-filter-double-range-values"},pu={key:2,class:"dss-table-filter-daterange"},fu={class:"dss-table-filter-daterange-row"},vu={class:"dss-table-filter-daterange-label"},gu=["value"],hu={class:"dss-table-filter-daterange-row"},yu={class:"dss-table-filter-daterange-label"},ku=["value"],Cu=["value","placeholder"],bu={class:"dss-table-filter-list"},wu=["checked","onChange"],xu={class:"dss-table-filter-actions"},Eu={name:"DSSTable"},Su=Object.assign(Eu,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(T,{emit:oe}){const{t:M,locale:L}=Gl.useI18n(),fe=T,P=oe,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function pe(k,h){const x=Object.assign({},k);return ft(k)&&ft(h)&&Object.keys(h).forEach(O=>{ft(h[O])?O in k?x[O]=pe(k[O],h[O]):Object.assign(x,{[O]:h[O]}):Object.assign(x,{[O]:h[O]})}),x}function ft(k){return k&&typeof k=="object"&&!Array.isArray(k)}const ee=e.computed(()=>pe(A,fe.options)),f=e.computed(()=>{const k=ee.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),be=e.computed(()=>ee.value.table.height),Ce=e.computed(()=>ee.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:Ce.value})),X=e.computed(()=>ee.value.table.expandable===!0),de=e.computed(()=>ee.value.table.expandableRowData??null),H=e.computed(()=>ee.value.table.expandableRowCondition??null),Ee=e.computed(()=>ee.value.table.truncated===!0),Ie=e.computed(()=>ee.value.table.striped),ot=e.computed(()=>ee.value.table.bordered),vt=e.computed(()=>ee.value.table.hoverable),q=e.computed(()=>ee.value.table.size),Ye=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const qe=e.computed(()=>ee.value.selection.enabled),Se=e.computed(()=>ee.value.selection.mode),$e=e.computed(()=>ee.value.selection.rowCondition??null),Ge=e.computed(()=>ee.value.sorting.enabled),K=e.computed(()=>ee.value.sorting.mode),We=e.computed(()=>ee.value.pagination.enabled),we=e.computed(()=>ee.value.pagination.rows),ct=e.computed(()=>ee.value.pagination.rowsPerPageOptions),rt=e.computed(()=>ee.value.pagination.showCounter!==!1),Et=e.computed(()=>ee.value.pagination.showControlsGroup),Rt=e.computed(()=>Et.value===!1?!1:ee.value.pagination.showControls!==!1),Qt=e.computed(()=>Et.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>We.value&&(rt.value||Rt.value||Qt.value)),ae=e.computed(()=>ee.value.scrollable),me=e.computed(()=>ee.value.emptyMessage||M("table.emptyMessage")),Pe=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),Re=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Wt=e.computed(()=>ee.value.toolbar?.search!==!1),kt=e.computed(()=>Pe.value||Re.value||Wt.value||qt.value),qt=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),Bt=e.ref(""),Pt=e.ref(!1),G=e.ref(null);let he=null;function _e(){Pt.value?(he&&(clearTimeout(he),he=null),Pt.value=!1,Bt.value="",P("search",""),G.value?.blur()):(Pt.value=!0,he=setTimeout(()=>{he=null,G.value?.focus()},80))}function je(){Bt.value||(Pt.value=!1)}function Qe(){Bt.value="",P("search",""),G.value?.focus()}const Lt=e.computed(()=>({"dss-table-striped":Ie.value,"dss-table-bordered":ot.value,"dss-table-hoverable":vt.value,[`dss-table-${q.value}`]:q.value!=="default","dss-table-truncated":Ee.value})),tt=(k,h)=>k?.field??k?.key??h,Tt=e.ref(new Set);function Xe(){const k=new Set;fe.columns.forEach((h,x)=>{h?.hidden!==!0&&k.add(tt(h,x))}),Tt.value=k}const Be=e.computed(()=>fe.columns.filter((k,h)=>Tt.value.has(tt(k,h)))),Je=k=>{const h=fe.columns.findIndex(x=>x===k);return tt(k,h>=0?h:0)},St=(k,h)=>Tt.value.has(tt(k,h));function le(k,h){const x=tt(k,h),O=new Set(Tt.value);O.has(x)?O.delete(x):O.add(x),Tt.value=O}const U=e.ref(null),Y=e.ref(!1);function ge(k){U.value&&!U.value.contains(k.target)&&(Y.value=!1)}const ke=e.computed(()=>Be.value.length+(qe.value?1:0)+(X.value?1:0)),Le=(k,h)=>k?.id??k?.key??h,xt=e.ref(new Set),Jt=e.ref(null),Vt=(k,h)=>xt.value.has(Le(k,h)),Ut=(k,h)=>{if(!X.value)return!1;if(typeof H.value=="function")return!!H.value(k,h);if(typeof de.value=="string"&&de.value.trim()){const x=In(k,de.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},V=(k,h,x)=>{if(x&&x.stopPropagation(),!Ut(k,h))return;const O=Le(k,h),ue=new Set(xt.value);ue.has(O)?(ue.delete(O),P("row-collapse",{data:k,index:h})):(ue.add(O),P("row-expand",{data:k,index:h})),xt.value=ue},w=(k,h)=>{if(!Ee.value)return;const x=Le(k,h);Jt.value!==x&&(Jt.value=x)},S=e.ref(null),Z=e.ref(0),J=e.ref([]),Ze=k=>{if(K.value==="single")return S.value===k.field?Z.value:0;{const h=J.value.find(x=>x.field===k.field);return h?h.order:0}},gt=k=>{const h=Ze(k);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},nt=e.ref({}),xe=e.ref(null),Nt=e.ref(null),zt=220,$t=e.ref(null),it=e.computed(()=>Be.value.find(k=>Je(k)===xe.value)??null),Ct=e.computed(()=>{if(!it.value||it.value.filter!=="range")return null;const k=it.value,h=xe.value,{min:x,max:O}=at(k),ue=k.filterMin??x,yt=k.filterMax??O,Mt=un(h),Yt=Mt.min??ue,an=Mt.max??yt,nn=yt-ue,sn=nn===0?0:(Yt-ue)/nn*100,Pn=nn===0?100:(an-ue)/nn*100;return{rangeMin:ue,rangeMax:yt,currentMin:Yt,currentMax:an,minPct:sn,maxPct:Pn}}),Jn=e.ref(null),Xn=e.ref("max");function Sn(k){const h=Jn.value,x=Ct.value;if(!h||!x)return;const O=h.getBoundingClientRect(),yt=(k.clientX-O.left)/O.width*100,Mt=(x.minPct+x.maxPct)/2;Xn.value=yt<Mt?"min":"max"}function un(k){return nt.value[k]??{}}function Xt(k,h){nt.value={...nt.value,[k]:h}}function Fn(k){const h=nt.value[k];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function sl(k){const h={...nt.value};delete h[k],nt.value=h,xe.value=null,Nt.value=null}function R(){if(!xe.value){Nt.value=null;return}const k=$t.value;if(!k)return;const h=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${xe.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Nt.value={top:x.bottom+6,left:Math.max(8,x.right-zt)}}const W=e.computed(()=>{const k=String(Bt.value??"").trim().toLowerCase();return k?fe.data.filter(h=>Be.value.some(x=>ne(tl(h,x)).some(ue=>String(ue).toLowerCase().includes(k)))):fe.data}),I=e.computed(()=>{let k=[...W.value];const h=(Bt.value??"").trim().toLowerCase();return h&&(k=k.filter(x=>fe.columns.some(O=>{if(!O||!O.field)return!1;const ue=tl(x,O);return String(ue??"").toLowerCase().includes(h)}))),Be.value.forEach(x=>{const O=Je(x),ue=nt.value[O];if(!ue)return;const yt=x.field;if(yt){if(ue.type==="string"&&ue.value?.trim()){const Mt=ue.value.trim().toLowerCase();k=k.filter(Yt=>{const an=tl(Yt,x);return String(an??"").toLowerCase().includes(Mt)})}else if(ue.type==="range")k=k.filter(Mt=>{const Yt=In(Mt,yt),an=Number(Yt);return!(Number.isNaN(an)||ue.min!=null&&an<ue.min||ue.max!=null&&an>ue.max)});else if(ue.type==="dateRange"){const Mt=ue.from?new Date(ue.from).getTime():null,Yt=ue.to?new Date(ue.to).getTime():null;k=k.filter(an=>{const nn=In(an,yt),sn=nn?new Date(nn).getTime():NaN;return!(Number.isNaN(sn)||Mt!=null&&sn<Mt||Yt!=null&&sn>Yt)})}else if(ue.type==="list"&&ue.selected?.length){const Mt=new Set(ue.selected);k=k.filter(Yt=>ne(tl(Yt,x)).some(nn=>Mt.has(nn)))}}}),k});function ne(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(ne);if(typeof k=="object"){const h=k?.label??k?.name??k?.value??k?.title;return[h!=null?String(h):String(k)]}return[String(k)]}function Ae(k){const h=new Set;return fe.data.forEach(x=>{ne(tl(x,k)).forEach(ue=>h.add(ue))}),Array.from(h).sort((x,O)=>String(x).localeCompare(String(O)))}function dt(k,h){if(xe.value===k){xe.value=null,Nt.value=null;return}if(xe.value=k,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Nt.value={top:x.bottom+6,left:Math.max(8,x.right-zt)}}else R()}function mt(k,h){Xt(k,{type:"string",value:h})}function at(k){const h=k.field;if(!h)return{min:0,max:100};let x=1/0,O=-1/0;return fe.data.forEach(ue=>{const yt=In(ue,h),Mt=Number(yt);Number.isNaN(Mt)||(x=Math.min(x,Mt),O=Math.max(O,Mt))}),{min:x===1/0?0:x,max:O===-1/0?100:O}}function pt(k,h,x){const O={...un(k),type:"range"},ue=x===""?null:Number(x),yt=ue===null||Number.isNaN(ue)?null:ue;O[h]=yt,yt!=null&&(h==="min"&&O.max!=null&&yt>O.max&&(O.max=yt),h==="max"&&O.min!=null&&yt<O.min&&(O.min=yt)),Xt(k,O)}function dn(k,h,x){const O={...un(k),type:"dateRange"};O[h]=x||"",Xt(k,O)}const Vn=e.reactive({});function Dn(k,h){Vn[k]=h}function zn(k){const h=Je(k),x=(Vn[h]??"").trim().toLowerCase(),O=Ae(k);return x?O.filter(ue=>String(ue).toLowerCase().includes(x)):O}function pl(k,h){return(un(k).selected??[]).includes(h!=null?String(h):"")}function _l(k,h){const O=[...un(k).selected??[]],ue=h!=null?String(h):"",yt=O.indexOf(ue);yt>=0?O.splice(yt,1):O.push(ue),Xt(k,{type:"list",selected:O})}function Pl(k){xe.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(xe.value=null,Nt.value=null)}function _n(){R(),Nn.value&&vl()}const to=k=>{if(!(k.sortable===!1||!Ge.value))if(K.value==="single")S.value===k.field?Z.value=Z.value===1?-1:Z.value===-1?0:1:(S.value=k.field,Z.value=1),Z.value===0&&(S.value=null),P("sort",{field:S.value,order:Z.value});else{const h=J.value.findIndex(x=>x.field===k.field);h>=0?J.value[h].order===1?J.value[h].order=-1:J.value.splice(h,1):J.value.push({field:k.field,order:1}),P("sort",{multiSortMeta:J.value})}},rl=e.computed(()=>{if(!Ge.value)return I.value;let k=[...I.value];return K.value==="single"&&S.value&&Z.value!==0?k.sort((h,x)=>{const O=In(h,S.value),ue=In(x,S.value);return O===ue?0:O==null?1:ue==null?-1:(O<ue?-1:O>ue?1:0)*Z.value}):K.value==="multiple"&&J.value.length>0&&k.sort((h,x)=>{for(const O of J.value){const ue=In(h,O.field),yt=In(x,O.field);if(ue===yt)continue;if(ue==null)return 1;if(yt==null)return-1;const Mt=ue<yt?-1:ue>yt?1:0;if(Mt!==0)return Mt*O.order}return 0}),k}),vn=e.ref(0),Hn=e.ref(we.value),Nn=e.ref(!1),wl=e.ref(null),Ol=e.ref(null),fl=e.ref("bottom"),xl=e.ref(null),$n=k=>{Hn.value=k,Nn.value=!1,vn.value=0,P("page",{page:0,rows:Hn.value})};function Ln(k){wl.value&&!wl.value.contains(k.target)&&(Nn.value=!1)}function vl(){const k=wl.value,h=Ol.value;if(!k||!h)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const O=h.getBoundingClientRect(),ue=x.offsetHeight||0,Mt=(window.innerHeight||document.documentElement.clientHeight)-O.bottom,Yt=O.top;fl.value=Mt<ue+8&&Yt>Mt?"top":"bottom",xl.value={width:`${Math.ceil(O.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const lt=e.computed(()=>rl.value.length),ie=e.computed(()=>Math.ceil(lt.value/Hn.value)),il=e.computed(()=>Math.max(ie.value,1)),ht=e.computed(()=>lt.value===0?0:Fe.value+1),gn=e.computed(()=>bt.value),Fe=e.computed(()=>We.value?vn.value*Hn.value:0),bt=e.computed(()=>We.value?Math.min((vn.value+1)*Hn.value,lt.value):lt.value),re=e.computed(()=>{if(!We.value)return rl.value;const k=Fe.value,h=bt.value;return rl.value.slice(k,h)}),At=e.ref(new Set),De=e.computed(()=>rl.value.filter((k,h)=>At.value.has(Le(k,h)))),El=(k,h)=>{const x=$e.value;return typeof x!="function"?!0:!!x(k,h)},$l=e.computed(()=>rl.value.map((k,h)=>({row:k,index:h})).filter(({row:k,index:h})=>El(k,h))),bn=e.computed(()=>{const k=$l.value;return k.length===0?!1:k.every(({row:h,index:x})=>At.value.has(Le(h,x)))}),en=e.computed(()=>{const k=$l.value;if(k.length===0)return!1;const h=k.filter(({row:x,index:O})=>At.value.has(Le(x,O))).length;return h>0&&h<k.length}),el=(k,h)=>At.value.has(Le(k,h)),on=()=>{if(bn.value)At.value=new Set,P("unselect-all");else{const k=new Set;$l.value.forEach(({row:h,index:x})=>k.add(Le(h,x))),At.value=k,P("select-all",De.value)}},Yn=(k,h)=>{if(!El(k,h))return;const x=Le(k,h),O=new Set(At.value),ue=O.has(x);Se.value==="single"?ue?(O.delete(x),P("row-unselect",k)):(O.clear(),O.add(x),P("row-select",k)):ue?(O.delete(x),P("row-unselect",k)):(O.add(x),P("row-select",k)),At.value=O},cl=e.ref("1"),Ll=()=>{const k=Number.parseInt(String(cl.value),10);if(!Number.isFinite(k)){cl.value=String(vn.value+1);return}const h=Math.min(il.value,Math.max(1,k));h!==vn.value+1?Tn(h-1):cl.value=String(h)},Tn=k=>{k<0||k>=ie.value||(vn.value=k,P("page",{page:k,rows:Hn.value}))},wn=(k,h,x)=>{P("row-click",{data:k,index:h,originalEvent:x}),w(k,Fe.value+h)},Wl=(k,h)=>{const x=Fe.value+h;return{"dss-table-row-selected":el(k,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":Ee.value,"dss-table-row-truncated-expanded":Jt.value===Le(k,x)}},tl=(k,h)=>h.field?In(k,h.field):"",In=(k,h)=>h.split(".").reduce((x,O)=>x&&x[O],k),Tl=k=>{const h=k.align??Ye.value;return{"dss-table-sortable":k.sortable!==!1&&Ge.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[k.className]:k.className}},Al=k=>{const h={};return k.width&&(h.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(h.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(h.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),h};return e.watch(()=>fe.locale,k=>{k&&k!==L.value&&(L.value=k)},{immediate:!0}),e.watch(we,k=>{Hn.value=k,vn.value=0}),e.watch(Nn,async k=>{k&&(await e.nextTick(),vl())}),e.watch(vn,k=>{cl.value=String(k+1)},{immediate:!0}),e.watch(Bt,k=>{P("search",k??"")}),e.watch(()=>fe.columns,()=>{Xe()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Ln),document.addEventListener("click",ge),document.addEventListener("click",Pl),window.addEventListener("resize",_n),window.addEventListener("scroll",_n,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Ln),document.removeEventListener("click",ge),document.removeEventListener("click",Pl),window.removeEventListener("resize",_n),window.removeEventListener("scroll",_n,!0)}),(k,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:$t,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[kt.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",rc,[Pe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>P("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Re.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>P("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:U},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Y.value}]),onClick:h[2]||(h[2]=x=>Y.value=!Y.value),"aria-expanded":Y.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ic),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,(x,O)=>(e.openBlock(),e.createElementBlock("li",{key:tt(x,O),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",uc,[e.createElementVNode("span",dc,[e.createElementVNode("input",{type:"checkbox",checked:St(x,O),onChange:ue=>le(x,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),St(x,O)?(e.openBlock(),e.createElementBlock("span",pc,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",fc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Y.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Pt.value||Bt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:G,"onUpdate:modelValue":h[4]||(h[4]=x=>Bt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Pt.value=!0),onBlur:je},null,40,gc),[[e.vModelText,Bt.value]]),Bt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Qe},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,hc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":Pt.value||!!Bt.value,onMousedown:e.withModifiers(_e,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,yc)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":ae.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Lt.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",bc,[Se.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:bn.value,indeterminate:en.value,onChange:on,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),en.value?(e.openBlock(),e.createElementBlock("span",Ec)):bn.value?(e.openBlock(),e.createElementBlock("span",Sc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,Vc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(x,O)=>(e.openBlock(),e.createElementBlock("th",{key:Je(x),class:e.normalizeClass(["dss-table-th",Tl(x)]),style:e.normalizeStyle(Al(x)),onClick:ue=>to(x)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ge.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",gt(x)])},[Ze(x)===0?(e.openBlock(),e.createElementBlock("span",_c,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Ze(x)===1?(e.openBlock(),e.createElementBlock("span",$c,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Ze(x)===-1?(e.openBlock(),e.createElementBlock("span",Lc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":xe.value===Je(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Fn(Je(x))}]),"data-filter-column-key":Je(x),"aria-expanded":xe.value===Je(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ue=>dt(Je(x),ue)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(x,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Le(x,Fe.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Wl(x,O)]),style:e.normalizeStyle(Q.value),onClick:ue=>wn(x,O,ue)},[qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Hc,[e.createElementVNode("input",{type:Se.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:el(x,Fe.value+O),disabled:!El(x,Fe.value+O),onChange:ue=>Yn(x,Fe.value+O),class:e.normalizeClass(["dss-table-checkbox",Se.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!El(x,Fe.value+O)}])},null,42,Rc),Se.value==="multiple"&&el(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("span",Fc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Se.value==="single"&&el(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>V(x,Fe.value+O,ue),["stop"])},[Ut(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Vt(x,Fe.value+O),"aria-label":Vt(x,Fe.value+O)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Vt(x,Fe.value+O)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Pc)):(e.openBlock(),e.createElementBlock("span",Oc))],8,zc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(ue,yt)=>(e.openBlock(),e.createElementBlock("td",{key:Je(ue),class:e.normalizeClass(["dss-table-td",Tl(ue)]),style:e.normalizeStyle(Al(ue))},[e.renderSlot(k.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:O,isExpanded:Jt.value===Le(x,Fe.value+O)},()=>[e.createTextVNode(e.toDisplayString(tl(x,ue)),1)])],6))),128))],14,Dc),X.value&&Ut(x,Fe.value+O)&&Vt(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("tr",Wc,[e.createElementVNode("td",{colspan:ke.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:O})],8,qc)])):e.createCommentVNode("",!0)],64))),128)),re.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:ke.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(me.value),1)])],8,Zc)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[rt.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(M)("table.showingRange",{start:ht.value,end:gn.value,total:lt.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[Rt.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value===0,onClick:h[8]||(h[8]=x=>Tn(0)),title:e.unref(M)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Qc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value===0,onClick:h[9]||(h[9]=x=>Tn(vn.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:Ll,onKeydown:e.withKeys(e.withModifiers(Ll,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,cl.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(M)("table.ofPages",{total:il.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value>=ie.value-1,onClick:h[11]||(h[11]=x=>Tn(vn.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value>=ie.value-1,onClick:h[12]||(h[12]=x=>Tn(ie.value-1)),title:e.unref(M)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,lu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ou,[Qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:wl},[e.createElementVNode("span",au,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Nn.value}]),onClick:h[13]||(h[13]=x=>Nn.value=!Nn.value),"aria-expanded":Nn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ol},[e.createTextVNode(e.toDisplayString(Hn.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,su),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":fl.value==="top"}]),style:e.normalizeStyle(xl.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Hn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Hn.value}]),onClick:O=>$n(x)},e.toDisplayString(x),11,ru))),128))],6),[[e.vShow,Nn.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Nt.value?{top:Nt.value.top+"px",left:Nt.value.left+"px",width:zt+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[it.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[it.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:un(xe.value).value??"",onInput:h[14]||(h[14]=x=>mt(xe.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,cu)])):it.value.filter==="range"&&Ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ct.value.minPct+"%","--range-max-pct":Ct.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Jn,class:"dss-table-filter-double-range-track",onMousemove:Sn,onMouseenter:Sn},[e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMin,onInput:h[15]||(h[15]=x=>pt(xe.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Xn.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMax,onInput:h[16]||(h[16]=x=>pt(xe.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Xn.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(Ct.value.currentMin)+" – "+e.toDisplayString(Ct.value.currentMax),1)],4)):it.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",fu,[e.createElementVNode("label",vu,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:un(xe.value).from??"",onInput:h[17]||(h[17]=x=>dn(xe.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,gu)]),e.createElementVNode("div",hu,[e.createElementVNode("label",yu,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:un(xe.value).to??"",onInput:h[18]||(h[18]=x=>dn(xe.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):it.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Vn[xe.value]??"",onInput:h[19]||(h[19]=x=>Dn(xe.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,Cu),e.createElementVNode("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn(it.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:pl(xe.value,x),onChange:O=>_l(xe.value,x)},null,40,wu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>sl(xe.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,xe.value&&it.value&&Nt.value]])]),_:1})]))],64))}}),Vu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Nu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Bu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",_u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",$u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Lu={class:"dss-toolbar-left"},Tu=["title"],Au=["title"],Du={class:"dss-toolbar-dropdown-wrapper"},Hu=["title"],Ru=["src"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],Wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},qu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["title"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad={key:2,class:"dss-toolbar-separator"},sd=["title"],rd={key:4,class:"dss-toolbar-separator"},id={key:5,class:"dss-toolbar-dropdown-wrapper"},cd=["title"],ud={class:"dss-toolbar-dropdown-ai"},dd={class:"dss-toolbar-right"},md={key:0,class:"dss-toolbar-custom-group"},pd={key:1,class:"dss-toolbar-separator"},fd={class:"dss-link-modal-content"},vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-image-modal-tabs"},wd={key:0,class:"dss-image-tab-content"},xd={class:"dss-link-modal-content"},Ed={class:"dss-link-modal-field"},Sd={key:0,class:"dss-link-modal-label"},Vd=["src"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-link-modal-field"},$d={class:"dss-link-modal-label"},Ld=["placeholder"],Td={class:"dss-link-modal-field"},Ad={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={key:1,class:"dss-image-tab-content"},Rd={class:"dss-link-modal-content"},Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},Wd=["placeholder"],qd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-text-editor-title-input-container"},Gd={key:0,class:"dss-text-editor-title-preview"},Qd={key:0},Jd={key:1,class:"dss-text-editor-preview-placeholder"},e1=["value","placeholder","disabled"],t1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},n1={class:"dss-text-editor-description-input-container"},l1={key:0,class:"dss-text-editor-description-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},i1=["data-comment-id","onMouseenter"],c1=["onClick"],u1=["src","alt"],d1={key:1},m1=["onClick"],p1=["src","alt"],f1={key:1},v1=["data-has-second-user","onClick"],g1={class:"editor-comment-marker-count"},h1={key:4,class:"dss-text-editor-textarea-wrapper"},y1=["value","placeholder","rows","disabled"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1={key:5,class:"dss-text-editor-content-wrapper"},E1={key:0,class:"dss-comment-overlay-body"},S1={class:"dss-comment-selection-wrapper"},V1=["innerHTML"],N1={class:"dss-comment-messages-wrapper"},B1={key:0,class:"dss-comment-avatar-wrapper"},M1={class:"dss-comment-avatar"},_1=["src","alt"],$1={key:1},L1={class:"dss-comment-header"},T1={class:"dss-comment-header-text"},A1={class:"dss-comment-author"},D1={key:0,class:"dss-comment-date"},H1=["onClick","title"],R1={class:"dss-comment-overlay-inner"},F1=["placeholder","onKeydown"],I1={class:"dss-text-editor-footer"},z1={class:"dss-text-editor-footer-content"},P1={class:"dss-text-editor-footer-stat"},O1={class:"dss-text-editor-footer-stat"},W1=["title"],q1=["title"],Z1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},U1={class:"dss-image-popup-content"},X1={key:0,class:"dss-image-popup-no-alt-icon"},Y1=["title"],j1=["title"],K1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},G1={class:"dss-toolbar-left"},Q1=["title"],J1=["title"],em={class:"dss-toolbar-dropdown-wrapper"},tm=["title"],nm=["src"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},cm=["title"],um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km={key:2,class:"dss-toolbar-separator"},Cm={key:3,class:"dss-toolbar-dropdown-wrapper"},bm=["title"],wm={class:"dss-toolbar-dropdown-ai"},xm={key:0,class:"dss-toolbar-right"},Em={key:0,class:"dss-toolbar-separator"},Sm={key:0,class:"dss-toolbar-custom-group"},Vm={key:1,class:"dss-toolbar-separator"},Nm={name:"DSSTextEditor"},Bm=Object.assign(Nm,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(T,{expose:oe,emit:M}){const{t:L,locale:fe}=Gl.useI18n(),P={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,pe=M,ft=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
99
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
100
|
-
</svg>`,f=e.ref(null),Ce=e.ref(null),he=e.ref(!1),le=e.ref(!1),oe=e.ref(!1),me=e.ref(""),H=e.ref({}),be=e.ref(!1),Ae=e.ref(!1),Pe=e.ref(""),ut=e.ref(""),U=e.ref(null),Ue=e.ref(null),Qe=e.ref(null),Ve=e.ref(null),Le=e.ref(""),Xe=e.ref(!1),G=e.ref({}),Fe=e.ref(!1),xe=e.ref({}),ht=e.ref(null),ct=e.ref(null),St=e.ref(!1),At=e.ref(""),qt=e.ref(null),It=e.ref(""),Q=e.ref(""),pe=e.ref(""),He=e.ref(null),Ye=e.ref(null),Zt=e.ref(null),kt=e.ref(null),Ot=e.ref(null),xt=e.ref(!1),zt=e.ref(""),J=e.ref({}),ye=e.ref(!1),Be=e.ref("upload"),We=e.ref(""),lt=e.ref(null),Vt=e.ref(null),je=e.ref([]),Nt=e.ref([]),Ke=e.ref(null),W=e.ref(!1),q=e.ref(""),K=e.ref(""),ve=e.ref(""),qe=e.ref(""),Je=e.ref(""),Bt=e.ref(""),tt=e.ref(null),st=e.ref(null),Xt=e.ref(null),ln=e.ref(!1),Lt=e.ref(null),Qt=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),Y=e.ref(!1),ee=e.ref([]),Oe=e.ref(null),vt=e.ref(null),ot=e.ref(null),we=e.ref(!1),Mt=e.ref(0),Dt=100,Ct=e.ref(null),at=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":O.value!==null})),pt=e.computed(()=>({})),qn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),P=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),Z=e.computed(()=>A.richText&&Nt.value.length>0),z=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return A.modelValue}),re=e.computed(()=>{const o=z.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Ie=e.computed(()=>z.value.length),mt=e.computed(()=>kt.value!==null&&Be.value==="upload"&&It.value&&It.value.startsWith("data:")),ft=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),nt=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),Et=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),Pt=o=>Ge&&Ge[o]!==void 0,Tn=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++)if(Pt(A.customToolbarSlots[l]))return!0;return!1},An=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++){const s=A.customToolbarSlots[l];if(Pt(s)&&Dn(s))return!0}return!1},Dn=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,cl=e.computed(()=>A.customToolbarSlots.some(o=>Pt(o)&&Dn(o))),Hn=e.computed(()=>Pt("title-slot")),Nl=e.computed(()=>Pt("description-slot")),nl=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},yl=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Bl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},zl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Ml=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=L("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Pl=o=>{const l=o.target.value;X("update:modelValue",l),X("change",l)},Vn=()=>{if(!tt.value)return;const o=tt.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},to=()=>{Qt.value=!0,Vn()},ll=()=>{Qt.value=!1,pn()},pn=()=>{if(!tt.value)return;const o=tt.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},$n=o=>{const s=o.target.value;Qt.value&&Vn(),X("update:title",s),X("title-change",s),Xt.value="title",A.richText&&(W.value||(K.value=q.value,Je.value=ve.value,Bt.value=qe.value),Ke.value&&clearTimeout(Ke.value),W.value=!0,Ke.value=setTimeout(()=>{W.value=!1,rt()},500))},xn=()=>{if(!st.value)return;const o=st.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},kl=()=>{V.value=!0,xn()},Ol=()=>{V.value=!1,ul()},ul=()=>{if(!st.value)return;const o=st.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Cl=o=>{const s=o.target.value;V.value&&xn(),X("update:description",s),X("description-change",s),Xt.value="description",A.richText&&(W.value||(K.value=q.value,Je.value=ve.value,Bt.value=qe.value),Ke.value&&clearTimeout(Ke.value),W.value=!0,Ke.value=setTimeout(()=>{W.value=!1,rt()},500))},Nn=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Bn=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(s)}catch{f.value.focus()}},dl=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},rt=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===q.value&&s===ve.value&&r===qe.value)return;const c={content:K.value||q.value,title:Je.value!==void 0?Je.value:ve.value,description:Bt.value!==void 0?Bt.value:qe.value},d=je.value.length>0?je.value[je.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(je.value.push(c),je.value.length>50&&je.value.shift(),Nt.value=[]),q.value=l,ve.value=s,qe.value=r,K.value=l,Je.value=s,Bt.value=r},ie=o=>{if(!f.value)return;ol(),f.value&&Bl(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Nn(),gt()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&w.value&&(w.value=null),le.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=nl(r);X("update:modelValue",c),X("change",c),Xt.value="editor",W.value||(K.value=q.value,Je.value=ve.value,Bt.value=qe.value),Ke.value&&clearTimeout(Ke.value),W.value=!0,Ke.value=setTimeout(()=>{W.value=!1,rt(),Ul(),So()},500),e.nextTick(()=>{l&&Bn(l),ol();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(y=>{try{if(v&&w.value?.command===y){G.value[y]=w.value.state;return}if(y==="bold")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M;let E=!1;if(D&&((D.tagName==="STRONG"||D.tagName==="B"||D.closest&&D.closest("strong, b"))&&(E=!0),!E&&D.style&&parseInt(D.style.fontWeight)>=600&&(E=!0),!E))try{const ae=window.getComputedStyle(D);parseInt(ae.fontWeight)>=600&&(E=!0)}catch{}G.value[y]=E}else G.value.hasOwnProperty(y)||(G.value[y]=!1);else if(y==="italic")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M,E=D&&(D.tagName==="EM"||D.tagName==="I"||D.closest&&D.closest("em, i"));G.value[y]=!!E}else{const M=document.queryCommandState(y);G.value[y]=M}else{const M=document.queryCommandState(y);G.value[y]=M}}catch{}}),k(),fn(),_e(),en(),wt(),hn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>So(y),0),(y===" "||y===`
|
|
101
|
-
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Ul()},100)}le.value=!1})},ol=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},gt=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},fn=()=>{if(f.value&&!ln.value){ln.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===y;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=ge,m.appendChild(y)}else if(v&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{ln.value=!1}}},Te=o=>{Ul(),X("blur",o),Hl()},bt=()=>{if(A.disabled||!A.richText||!f.value)return;on(),Ke.value&&(clearTimeout(Ke.value),Ke.value=null),W.value&&(rt(),W.value=!1);const o=Xt.value==="title",l=Xt.value==="description",s=Xt.value==="editor";if(je.value.length===0){o&&tt.value?tt.value.focus():l&&st.value?st.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Nt.value.push(r);const c=je.value.pop();if(c!==void 0){le.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,q.value=d,ve.value=u,qe.value=m,K.value=d,Je.value=u,Bt.value=m,e.nextTick(()=>{k(),Cn(),dt(),en();const v=nl(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),le.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(tt.value){tt.value.focus();const y=u.length;tt.value.setSelectionRange&&tt.value.setSelectionRange(y,y),Vn()}}else if(l){if(st.value){st.value.focus();const y=m.length;st.value.setSelectionRange(y,y)}}else if(s)dl();else if(tt.value&&document.activeElement===tt.value){const y=u.length;tt.value.setSelectionRange&&tt.value.setSelectionRange(y,y),Vn()}else if(st.value&&document.activeElement===st.value){const y=m.length;st.value.setSelectionRange(y,y)}else f.value&&dl()},10)})})}},se=()=>{if(A.disabled||!A.richText||!f.value)return;on();const o=Xt.value==="title",l=Xt.value==="description",s=Xt.value==="editor";if(Nt.value.length===0){o&&tt.value?tt.value.focus():l&&st.value?st.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};je.value.push(r);const c=Nt.value.pop();if(c!==void 0){le.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,q.value=d,ve.value=u,qe.value=m,K.value=d,Je.value=u,Bt.value=m,e.nextTick(()=>{k(),Cn(),dt(),en();const v=nl(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),le.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(tt.value){tt.value.focus();const y=u.length;tt.value.setSelectionRange&&tt.value.setSelectionRange(y,y),Vn()}}else if(l){if(st.value){st.value.focus();const y=m.length;st.value.setSelectionRange(y,y)}}else if(s)dl();else if(tt.value&&document.activeElement===tt.value){const y=u.length;tt.value.setSelectionRange&&tt.value.setSelectionRange(y,y),Vn()}else if(st.value&&document.activeElement===st.value){const y=m.length;st.value.setSelectionRange(y,y)}else f.value&&dl()},10)})})}},Tt=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},_e=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},bl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{_e()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{_e()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{_e()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{_e()})}return!0},_l=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Tt()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);v.appendChild(y),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Tt()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Tt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tt()})}return!0},kn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt(),on(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Wt(d)&&(r=Nn())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=_l();G.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(Bn(r),e.nextTick(()=>{const m=Jt("bold");G.value.bold=m})),ie(),Cn(),en()});return}if(o==="italic"){const d=bl();G.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(Bn(r),e.nextTick(()=>{const m=Jt("italic");G.value.italic=m})),ie(),_e(),Cn(),en()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&Bn(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Jt("bold");G.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Jt("italic");G.value.italic=u});else{const u=document.queryCommandState(o);G.value[o]=u}else{const u=document.queryCommandState(o);G.value[o]=u}}catch{G.value.hasOwnProperty(o)?G.value[o]=!G.value[o]:G.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",l)})}ie(),Cn(),en()})},Jt=(o,l=null)=>{if(A.disabled||!f.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const y=window.getComputedStyle(v);parseInt(y.fontWeight)>=600&&(u=!0)}catch{}return G.value.hasOwnProperty(o)?G.value[o]:(G.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}}if(u)break}}return G.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return G.value.hasOwnProperty(o)?G.value[o]:(G.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return G.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&G.value.hasOwnProperty(o)?G.value[o]:(G.value[o]=d,d)}return G.value.hasOwnProperty(o)?G.value[o]:!1}catch{return G.value.hasOwnProperty(o)?G.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Kn=o=>{A.disabled||!A.richText||(Ce.value=Ce.value===o?null:o,o==="askAi"&&(ct.value=null))},on=()=>{Ce.value=null,lt.value=null},Zn=o=>{kn("formatBlock",o),on()},al=o=>{if(!o||!f.value)return o;const l=Re=>{let Se=Re.nodeType===Node.TEXT_NODE?Re.parentElement:Re;for(;Se&&Se!==f.value;){const it=Se.tagName;if(it==="P"){const gn=Se.parentElement;if(gn===f.value||gn.tagName==="BLOCKQUOTE")return Se}if(it==="BLOCKQUOTE")break;Se=Se.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Re=>{const Se=Re.tagName;if(Se==="P"){const it=Re.parentElement;if(it===f.value||it.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Se==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const y=Math.min(m,v),M=Math.max(m,v),D=c.slice(y,M+1);if(D.length===0)return o;const E=D[0],ae=D[D.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(ae),j},$l=()=>{if(A.disabled||!A.richText||!f.value)return;W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt(),on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Wt(l)&&(l=al(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&Wt(l)&&(s=Nn());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=y.nextNode();)v.push(M);if(v.forEach(E=>{const ae=document.createElement("p");E.parentNode.insertBefore(ae,E),ae.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Bn(s),dt(),ie(),en()})},Mn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const D=M.textContent||"",ae=(M.innerHTML||"").trim();return D.trim()===""||ae===""||ae==="<br>"||ae==="<br/>"||ae==="<p></p>"||ae==="<p><br></p>"||ae==="<p><br/></p>"||ae==="<p> </p>"||ae==="<p><br> </p>"||ae==="<div></div>"||ae==="<div><br></div>"||ae==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const D=r.children[M];if((D.tagName==="P"||D.tagName==="DIV")&&c(D))D.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const y=document.createRange();y.selectNodeContents(v),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{dt(),ie()})},Cn=()=>{if(!f.value){he.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");he.value=!!r}else he.value=!1}catch{he.value=!1}},Wl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ve.value=Nn();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),Pe.value="",ut.value=s,Le.value="",Qe.value=null,Ae.value=!0,on(),e.nextTick(()=>{U.value&&U.value.focus()})},Gn=()=>{if(!f.value)return;W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Qe.value&&(l=Qe.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Qe.value=null}else kn("unlink");he.value=!1,on(),e.nextTick(()=>{ie(),Cn()})},Rn=()=>{A.disabled||!A.richText||f.value&&(W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt(),on(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{k(),ie(),en()}))},Ll=()=>{A.disabled||!A.richText||f.value&&(W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt(),on(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{k(),ie(),en()}))},Tl=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},k=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=Tl(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},h=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{k(),ie()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=Tl(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),k();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ie(),en()})}else document.execCommand("indent",!1),e.nextTick(()=>{k(),ie(),en()})},x=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{k(),ie()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),k();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ie(),en()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{k(),ie(),en()})},O=e.ref(null),de=e.ref(null),yt=e.ref({}),_t=e.ref(""),Yt=e.ref(null),an=e.ref("");e.ref("");const tn=e.ref(null);e.ref("");const sn=e.ref([]),Fn=e.ref(!1),Al=e.ref(!1),Po=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},ho=()=>{if(A.disabled||!A.richText||!f.value)return;if(O.value!==null){O.value=null,_t.value="",an.value="",tn.value=null,sn.value=[],yn(!0);return}on(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Wt(l))return;an.value=Po(l)||"",tn.value=Nn();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);yt.value={top:`${m}px`,bottom:"auto"},O.value=Date.now(),e.nextTick(()=>{if(_t.value="",Yt.value){const y=Yt.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const M=r.getBoundingClientRect(),D=v.getBoundingClientRect(),E=y.getBoundingClientRect(),ae=D.bottom-M.top,j=E.top-M.top,Re=8;if(ae>j-Re){const Se=E.height;yt.value={bottom:`${Se+Re}px`,top:"auto"}}else yt.value={top:`${m}px`,bottom:"auto"}}}})},yo=()=>{if(!_t.value.trim())return;const o=_t.value.trim(),l=new Date,s={text:o,selectionText:an.value,selectionRange:tn.value,commentId:O.value,user:A.commentUser||null,createdAt:l.toISOString()};sn.value=[...sn.value,s],X("comment-submitted",s),no(s),tn.value&&!Wo(tn.value)&&Co(O.value,tn.value),_t.value="",e.nextTick(()=>{if(Yt.value){const r=Yt.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}hn("sendComment")})},Oo=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(sn.value=sn.value.filter((s,r)=>r!==l),O.value!==null&&f.value){const s=String(O.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&sn.value.length>0){const c=[],d=new Set;sn.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(sn.value.length))}else r&&sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:o,index:l,commentId:O.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",s)}e.nextTick(()=>{hn("deleteComment")})}},Wo=o=>{if(!o||!f.value)return!1;try{const l=ko(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ko=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Co=(o,l)=>{if(!(!o||!l||!f.value))try{const s=ko(l);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,y=s.startOffset,M=s.endOffset,D=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(D===E&&y===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(D.tagName==="P"||D.tagName==="DIV"||D.tagName==="H1"||D.tagName==="H2"||D.tagName==="H3"||D.tagName==="H4"||D.tagName==="H5"||D.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{hn("wrapSelectionWithCommentMarker"),ie()})}catch{}},no=o=>{if(!o||!o.commentId)return;const l=Array.isArray(A.comments)?[...A.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(v=>v.article_id)?.article_id||null,m={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Fn.value=!0,X("update:comments",l)},bo=(o,l=[])=>{if(A.disabled||!A.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;on(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),an.value=r.innerHTML||"",tn.value=Nn();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const M=m.getBoundingClientRect(),D=u.bottom-M.top,ae=Math.max(D+8,0);yt.value={top:`${ae}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(v&&A.comments&&Array.isArray(A.comments)){const M=A.comments.find(D=>String(D.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const D=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));y.push(...D)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((M,D)=>{const E=Re=>{if(!Re)return 0;const Se=new Date(Re).getTime();return isNaN(Se)?0:Se},ae=E(M.createdAt),j=E(D.createdAt);return ae===j?0:ae-j}),sn.value=y,yn(!0),O.value=v||null,r&&(de.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(_t.value="",Yt.value){const M=Yt.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const D=m.querySelector(".dss-text-editor-footer");if(D){const E=m.getBoundingClientRect(),ae=M.getBoundingClientRect(),j=D.getBoundingClientRect(),Re=ae.bottom-E.top,Se=j.top-E.top,it=8;if(Re>Se-it){const gn=j.height;yt.value={bottom:`${gn+it}px`,top:"auto"}}}}}hn("openCommentOverlayForSelector")})},lo=e.ref(null),wo=e.ref(0),oo=o=>{if(!(A.disabled||!A.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Mn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,y=c.contains(m)||m===c,D=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!y||D.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{ie()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?x():h();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const y=v.closest("p, div");if(y&&y!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const D=s.startOffset;D<u.length&&(M=u.splitText(D));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(E,y.nextSibling):y.parentNode.appendChild(E);const ae=document.createRange();M?ae.setStart(M,0):ae.setStart(E,0),ae.collapse(!0),l.removeAllRanges(),l.addRange(ae),e.nextTick(()=>{ie()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Re=j.textContent||"",it=(j.innerHTML||"").trim(),gn=it.replace(/<br\s*\/?>/gi,"").trim();return Re.trim()===""||it===""||gn===""||it==="<br>"||it==="<br/>"||it==="<p></p>"||it==="<p><br></p>"||it==="<p><br/></p>"||it==="<p> </p>"||it==="<p><br> </p>"||it==="<div></div>"||it==="<div><br></div>"||it==="<div><br/></div>"},v=c.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",M=s.startContainer,D=M.nodeType===3?M.parentElement:M,E=D===c||D&&D.parentElement===c;if(u&&m(u)||y&&E){o.preventDefault(),setTimeout(()=>{Mn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-wo.value;if(lo.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),h();return}}}}lo.value=" ",wo.value=l}else lo.value=o.key}},qo=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),rt();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let y=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(D=>{if(y>0){const E=v.createElement("p");E.innerHTML=D.innerHTML,D.parentNode.replaceChild(E,D)}else y++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(ae=>D.includes(ae.tagName));if(E.length===1){const ae=E[0].tagName,j=c.tagName,Re=c.textContent.trim()===""&&!c.querySelector("img");let Se=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Se=!0:Re||(ae===j||ae==="P")&&(Se=!0),Se)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);ie()},ql=o=>{if(Ce.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&on()}if(Fe.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Hl()}if(ct.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Zl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(lt.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&Wt(r)}else Y.value=!1}if(O.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(O.value=null,_t.value="",an.value="",tn.value=null,sn.value=[],yn(!0))}},En=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),Vt.value&&(clearTimeout(Vt.value),Vt.value=null),lt.value=l},R=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Vt.value&&clearTimeout(Vt.value),Vt.value=setTimeout(()=>{lt.value=null,Vt.value=null},150)},bn=o=>{lt.value=null};let In=0;const Dl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++In}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},vn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Dl(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const y=c.getAttribute("data-submenu-id");y&&En(v,y)},m=R;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=y=>{const M=c.getAttribute("data-submenu-id");M&&En(y,M)},m=R;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",bn)})})})};let Sn=null;const jt=()=>{if(lt.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${lt.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${lt.value}"]`);o&&l&&Mo(o,l)}if(Fe.value&&en(),A.richText){if(Sn!==null)return;Sn=setTimeout(()=>{Sn=null,hn("handleWindowResize")},150)}},Gt=()=>{if(!A.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},sl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Qt.value?Vn():pn(),V.value?xn():ul()})}),e.nextTick(()=>{sl()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",ql),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{vn(),Gt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!A.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),D=v.closest(".dss-image-wrapper");if(M||D&&v===D){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),ae=document.createRange();ae.setStartAfter(D),ae.collapse(!0),E.removeAllRanges(),E.addRange(ae)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Re=j.nodeType===3?j.parentElement:j;if(D.contains(Re)&&Re!==D.querySelector("img")){const Se=document.createRange();Se.setStartAfter(D),Se.collapse(!0),E.removeAllRanges(),E.addRange(Se)}}else{const ae=document.createRange();ae.setStartAfter(D),ae.collapse(!0),E.addRange(ae)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,y=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(y||M&&v.tagName!=="IMG"){m.preventDefault();const D=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),D.removeAllRanges(),D.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const D=y.getAttribute("alt")||y.alt||"";if(D){const E=y.getAttribute("src")||y.src||"",ae=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===E||D===ae;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),fn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,y=v.tagName==="IMG"?v:v.closest("img"),M=y?.closest(".dss-image-wrapper");y&&f.value.contains(y)&&(Lt.value=M||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Lt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Lt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Lt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Lt.value,y=v.classList?.contains("dss-image-wrapper"),M=y?v.querySelector("img"):v,D=y?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){Lt.value=null;return}let E=null;const ae=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(ae,j);else{const nn=window.getSelection();nn.rangeCount>0?E=nn.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){Lt.value=null;return}const Re=E.commonAncestorContainer,Se=Re.nodeType===3?Re.parentElement:Re;if(Se?.closest(".dss-image-wrapper")===D||D&&D.contains(Se)){Lt.value=null;return}if(D&&(Se===D||D.contains(Se))){Lt.value=null;return}const gn=M.getAttribute("src");let un=null;D?un=D.cloneNode(!0):un=M.cloneNode(!0);try{let nn=E.startContainer;if(nn.nodeType===3&&(nn=nn.parentElement),D&&(nn===D||D.contains(nn))){const cn=document.createRange();cn.setStartAfter(D),cn.collapse(!0),E=cn}E.insertNode(un);const dn=document.createRange();dn.setStartAfter(un),dn.collapse(!0);const rn=window.getSelection();rn.removeAllRanges(),rn.addRange(dn)}catch{if(f.value.childNodes.length===0){const dn=document.createElement("p");dn.appendChild(un),f.value.appendChild(dn)}else{const dn=f.value.lastChild;if(dn&&dn.nodeType===1)dn.appendChild(un);else{const rn=document.createElement("p");rn.appendChild(un),f.value.appendChild(rn)}}}D?D.remove():M.remove(),Lt.value=null,e.nextTick(()=>{const nn=f.value.querySelectorAll("img");let dn=!1;nn.forEach(rn=>{if(rn.getAttribute("src")===gn)if(!dn)dn=!0;else{const cn=rn.closest(".dss-image-wrapper");cn?cn.remove():rn.remove()}}),fn(),ie()})}),f.value.addEventListener("dragend",m=>{Lt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const M=y.querySelectorAll&&y.querySelectorAll("img");M&&M.forEach(D=>{D.removeAttribute("alt"),D.removeAttribute("data-alt"),D.setAttribute("alt",""),D.setAttribute("data-alt",""),D.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{fn(),Gt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Gt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=yl(A.modelValue);f.value.innerHTML=m,gt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",y=A.description||"";q.value=m,ve.value=v,qe.value=y,Je.value=v,Bt.value=y,k(),fn(),_e(),wt(),uo(),wn()}),Cn(),dt(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",ql),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Sn!==null&&(clearTimeout(Sn),Sn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Ke.value&&clearTimeout(Ke.value),Vt.value&&clearTimeout(Vt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Oe.value&&Oe.value.disconnect(),vt.value!==null&&(cancelAnimationFrame(vt.value),vt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),Ct.value!==null&&(clearTimeout(Ct.value),Ct.value=null),yn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ml=o=>{const l=o.target,s=l.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}fn(),Cn(),dt(),en(),wt()}):e.nextTick(()=>{fn(),Cn(),dt(),en(),wt()})},Ht=()=>{ol();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&Wt(s),!s.collapsed&&w.value&&(w.value=null)}else Y.value=!1;if(fn(),Cn(),dt(),en(),wt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}G.value[s]=m}else{const d=document.queryCommandState(s);G.value[s]=d}}}catch{}})},wt=()=>{if(!A.richText||A.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},dt=()=>{if(!f.value){Xe.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&f.value.contains(c))}Xe.value=l}catch{Xe.value=!1}},Wt=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Hl=()=>{Fe.value=!1},en=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){Fe.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Fe.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Wt(l)){Fe.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Fe.value=!1;return}const r=f.value;if(!r){Fe.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){Fe.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let M=0;ht.value&&(M=ht.value.getBoundingClientRect().width);const D=(M||320)/2;let E=c.left+D,ae=c.right-D;if(ae<E){const j=c.left+c.width/2;E=j,ae=j}if(y>0){const j=D+u,Re=y-D-u;if(E=Math.max(E,j),ae=Math.min(ae,Re),ae<E){const Se=y/2;E=Se,ae=Se}}v<E?v=E:v>ae&&(v=ae),xe.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Fe.value=!0},wl=o=>{A.disabled||!A.richText||(ct.value=ct.value===o?null:o,o==="askAi"&&(Ce.value=null))},Zl=()=>{ct.value=null,lt.value=null},Ln=o=>{Zn(o),Zl()};let Qn=null,Jn=null,pl=null,fl=null;const Zo=o=>{if(A.disabled||!A.richText){xl(),Rl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(Qn&&(clearTimeout(Qn),Qn=null),pl&&(clearTimeout(pl),pl=null),s&&s!==Jn){Rl(),Jn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Qe.value=s,me.value=c,oe.value=!0,be.value=!0,Un(s)}else!s&&Jn?(Jn=null,Qn=setTimeout(()=>{be.value||xl()},150)):s&&s===Jn&&Un(s);if(r&&r!==fl){xl(),fl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),kt.value=r,zt.value=c.trim()||L("textEditor.image.noAlt"),xt.value=!0,ye.value=!0,xo(r)}else!r&&fl?(fl=null,pl=setTimeout(()=>{ye.value||Rl()},150)):r&&r===fl&&xo(r)},vl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Jn=null,fl=null,Qn&&(clearTimeout(Qn),Qn=null),pl&&(clearTimeout(pl),pl=null),xl(),Rl())},xl=()=>{be.value=!1,setTimeout(()=>{be.value||(oe.value=!1,me.value="",Ae.value||(Qe.value=null))},100)},Un=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Rl=()=>{ye.value=!1,setTimeout(()=>{ye.value||(xt.value=!1,zt.value="",St.value||(kt.value=null))},100)},xo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;J.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Fl=()=>{if(!me.value||!Qe.value)return;let l=Qe.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(Qe.value){const o=Qe.value.textContent||"",l=Qe.value.getAttribute("href")||"",s=Qe.value;Pe.value=l,ut.value=o,Le.value=o,be.value=!1,oe.value=!1,me.value="",Qe.value=s,Ae.value=!0}else if(he.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";Pe.value=d,ut.value=c,Le.value=c,Qe.value=r,Ae.value=!0}}}else{Ve.value=Nn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Pe.value="",ut.value=l,Le.value="",Qe.value=null,Ae.value=!0}e.nextTick(()=>{U.value&&(U.value.focus(),U.value.select())})},Il=()=>{Ae.value=!1,Pe.value="",ut.value="",Le.value="",Qe.value=null,Ve.value=null},ao=()=>{if(!Pe.value.trim()){Il();return}if(W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt(),ut.value.trim()||(ut.value=Pe.value.trim()),Qe.value&&f.value&&f.value.contains(Qe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Qe.value;if(l.setAttribute("href",Pe.value.trim()),ut.value.trim()!==Le.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ut.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),ie()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ve.value&&Bn(Ve.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=Pe.value.trim(),s.textContent=ut.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(f.value),l.collapse(!1));const s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=Pe.value.trim(),d.textContent=ut.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=s.textContent.substring(0,l.startOffset),M=y[y.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
100
|
+
</svg>`,f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),Q=e.ref(!1),X=e.ref(!1),de=e.ref(""),H=e.ref({}),Ee=e.ref(!1),Ie=e.ref(!1),ot=e.ref(""),vt=e.ref(""),q=e.ref(null),Ye=e.ref(null),qe=e.ref(null),Se=e.ref(null),$e=e.ref(""),Ge=e.ref(!1),K=e.ref({}),We=e.ref(!1),we=e.ref({}),ct=e.ref(null),rt=e.ref(null),Et=e.ref(!1),Rt=e.ref(""),Qt=e.ref(null),It=e.ref(""),ae=e.ref(""),me=e.ref(""),Pe=e.ref(null),Re=e.ref(null),Wt=e.ref(null),kt=e.ref(null),qt=e.ref(null),Bt=e.ref(!1),Pt=e.ref(""),G=e.ref({}),he=e.ref(!1),_e=e.ref("upload"),je=e.ref(""),Qe=e.ref(null),Lt=e.ref(null),tt=e.ref([]),Tt=e.ref([]),Xe=e.ref(null),Be=e.ref(!1),Je=e.ref(""),St=e.ref(""),le=e.ref(""),U=e.ref(""),Y=e.ref(""),ge=e.ref(""),ke=e.ref(null),Le=e.ref(null),xt=e.ref(null),Jt=e.ref(!1),Vt=e.ref(null),Ut=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),Z=e.ref(!1),J=e.ref([]),Ze=e.ref(null),gt=e.ref(null),nt=e.ref(null),xe=e.ref(!1),Nt=e.ref(0),zt=100,$t=e.ref(null),it=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":O.value!==null})),Ct=e.computed(()=>({})),Jn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),Xn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),Sn=e.computed(()=>A.richText&&Tt.value.length>0),un=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return A.modelValue}),Xt=e.computed(()=>{const o=un.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Fn=e.computed(()=>un.value.length),sl=e.computed(()=>kt.value!==null&&_e.value==="upload"&&It.value&&It.value.startsWith("data:")),R=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),W=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),I=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),ne=o=>ft&&ft[o]!==void 0,Ae=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++)if(ne(A.customToolbarSlots[l]))return!0;return!1},dt=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++){const s=A.customToolbarSlots[l];if(ne(s)&&mt(s))return!0}return!1},mt=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,at=e.computed(()=>A.customToolbarSlots.some(o=>ne(o)&&mt(o))),pt=e.computed(()=>ne("title-slot")),dn=e.computed(()=>ne("description-slot")),Vn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Dn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},zn=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},pl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},_l=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=L("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Pl=o=>{const l=o.target.value;pe("update:modelValue",l),pe("change",l)},_n=()=>{if(!ke.value)return;const o=ke.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},to=()=>{Ut.value=!0,_n()},rl=()=>{Ut.value=!1,vn()},vn=()=>{if(!ke.value)return;const o=ke.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Hn=o=>{const s=o.target.value;Ut.value&&_n(),pe("update:title",s),pe("title-change",s),xt.value="title",A.richText&&(Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt()},500))},Nn=()=>{if(!Le.value)return;const o=Le.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},wl=()=>{V.value=!0,Nn()},Ol=()=>{V.value=!1,fl()},fl=()=>{if(!Le.value)return;const o=Le.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},xl=o=>{const s=o.target.value;V.value&&Nn(),pe("update:description",s),pe("description-change",s),xt.value="description",A.richText&&(Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt()},500))},$n=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Ln=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(s)}catch{f.value.focus()}},vl=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},lt=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===Je.value&&s===le.value&&r===U.value)return;const c={content:St.value||Je.value,title:Y.value!==void 0?Y.value:le.value,description:ge.value!==void 0?ge.value:U.value},d=tt.value.length>0?tt.value[tt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(tt.value.push(c),tt.value.length>50&&tt.value.shift(),Tt.value=[]),Je.value=l,le.value=s,U.value=r,St.value=l,Y.value=s,ge.value=r},ie=o=>{if(!f.value)return;il(),f.value&&zn(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=$n(),ht()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&w.value&&(w.value=null),Q.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Vn(r);pe("update:modelValue",c),pe("change",c),xt.value="editor",Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt(),Ul(),So()},500),e.nextTick(()=>{l&&Ln(l),il();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(y=>{try{if(v&&w.value?.command===y){K.value[y]=w.value.state;return}if(y==="bold")if(m){const _=m.commonAncestorContainer,D=_.nodeType===3?_.parentElement:_;let E=!1;if(D&&((D.tagName==="STRONG"||D.tagName==="B"||D.closest&&D.closest("strong, b"))&&(E=!0),!E&&D.style&&parseInt(D.style.fontWeight)>=600&&(E=!0),!E))try{const se=window.getComputedStyle(D);parseInt(se.fontWeight)>=600&&(E=!0)}catch{}K.value[y]=E}else K.value.hasOwnProperty(y)||(K.value[y]=!1);else if(y==="italic")if(m){const _=m.commonAncestorContainer,D=_.nodeType===3?_.parentElement:_,E=D&&(D.tagName==="EM"||D.tagName==="I"||D.closest&&D.closest("em, i"));K.value[y]=!!E}else{const _=document.queryCommandState(y);K.value[y]=_}else{const _=document.queryCommandState(y);K.value[y]=_}}catch{}}),k(),gn(),De(),tn(),wt(),kn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>So(y),0),(y===" "||y===`
|
|
101
|
+
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Ul()},100)}Q.value=!1})},il=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},ht=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},gn=()=>{if(f.value&&!Jt.value){Jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===y;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=ee,m.appendChild(y)}else if(v&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{Jt.value=!1}}},Fe=o=>{Ul(),pe("blur",o),Rl()},bt=()=>{if(A.disabled||!A.richText||!f.value)return;on(),Xe.value&&(clearTimeout(Xe.value),Xe.value=null),Be.value&&(lt(),Be.value=!1);const o=xt.value==="title",l=xt.value==="description",s=xt.value==="editor";if(tt.value.length===0){o&&ke.value?ke.value.focus():l&&Le.value?Le.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Tt.value.push(r);const c=tt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Je.value=d,le.value=u,U.value=m,St.value=d,Y.value=u,ge.value=m,e.nextTick(()=>{k(),wn(),ut(),tn();const v=Vn(d);pe("update:modelValue",v),pe("update:title",u),pe("update:description",m),pe("change",v),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}}else if(l){if(Le.value){Le.value.focus();const y=m.length;Le.value.setSelectionRange(y,y)}}else if(s)vl();else if(ke.value&&document.activeElement===ke.value){const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}else if(Le.value&&document.activeElement===Le.value){const y=m.length;Le.value.setSelectionRange(y,y)}else f.value&&vl()},10)})})}},re=()=>{if(A.disabled||!A.richText||!f.value)return;on();const o=xt.value==="title",l=xt.value==="description",s=xt.value==="editor";if(Tt.value.length===0){o&&ke.value?ke.value.focus():l&&Le.value?Le.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};tt.value.push(r);const c=Tt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Je.value=d,le.value=u,U.value=m,St.value=d,Y.value=u,ge.value=m,e.nextTick(()=>{k(),wn(),ut(),tn();const v=Vn(d);pe("update:modelValue",v),pe("update:title",u),pe("update:description",m),pe("change",v),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}}else if(l){if(Le.value){Le.value.focus();const y=m.length;Le.value.setSelectionRange(y,y)}}else if(s)vl();else if(ke.value&&document.activeElement===ke.value){const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}else if(Le.value&&document.activeElement===Le.value){const y=m.length;Le.value.setSelectionRange(y,y)}else f.value&&vl()},10)})})}},At=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},De=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},El=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{De()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{De()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{De()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{De()})}return!0},$l=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{At()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);v.appendChild(y),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}At()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{At()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{At()})}return!0},bn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Ot(d)&&(r=$n())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=$l();K.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(Ln(r),e.nextTick(()=>{const m=en("bold");K.value.bold=m})),ie(),wn(),tn()});return}if(o==="italic"){const d=El();K.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(Ln(r),e.nextTick(()=>{const m=en("italic");K.value.italic=m})),ie(),De(),wn(),tn()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&Ln(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=en("bold");K.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=en("italic");K.value.italic=u});else{const u=document.queryCommandState(o);K.value[o]=u}else{const u=document.queryCommandState(o);K.value[o]=u}}catch{K.value.hasOwnProperty(o)?K.value[o]=!K.value[o]:K.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",l)})}ie(),wn(),tn()})},en=(o,l=null)=>{if(A.disabled||!f.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const y=window.getComputedStyle(v);parseInt(y.fontWeight)>=600&&(u=!0)}catch{}return K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(_.nodeType===1){const D=_;if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}}if(u)break}}return K.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(_.nodeType===1){const D=_;if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return K.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=d,d)}return K.value.hasOwnProperty(o)?K.value[o]:!1}catch{return K.value.hasOwnProperty(o)?K.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},el=o=>{A.disabled||!A.richText||(be.value=be.value===o?null:o,o==="askAi"&&(rt.value=null))},on=()=>{be.value=null,Qe.value=null},Yn=o=>{bn("formatBlock",o),on()},cl=o=>{if(!o||!f.value)return o;const l=Oe=>{let Ne=Oe.nodeType===Node.TEXT_NODE?Oe.parentElement:Oe;for(;Ne&&Ne!==f.value;){const st=Ne.tagName;if(st==="P"){const yn=Ne.parentElement;if(yn===f.value||yn.tagName==="BLOCKQUOTE")return Ne}if(st==="BLOCKQUOTE")break;Ne=Ne.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Oe=>{const Ne=Oe.tagName;if(Ne==="P"){const st=Oe.parentElement;if(st===f.value||st.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ne==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const y=Math.min(m,v),_=Math.max(m,v),D=c.slice(y,_+1);if(D.length===0)return o;const E=D[0],se=D[D.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(se),j},Ll=()=>{if(A.disabled||!A.richText||!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Ot(l)&&(l=cl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&Ot(l)&&(s=$n());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=y.nextNode();)v.push(_);if(v.forEach(E=>{const se=document.createElement("p");E.parentNode.insertBefore(se,E),se.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Ln(s),ut(),ie(),tn()})},Tn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=_=>{if(!_)return!1;const D=_.textContent||"",se=(_.innerHTML||"").trim();return D.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const D=r.children[_];if((D.tagName==="P"||D.tagName==="DIV")&&c(D))D.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const y=document.createRange();y.selectNodeContents(v),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{ut(),ie()})},wn=()=>{if(!f.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},Wl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Se.value=$n();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),ot.value="",vt.value=s,$e.value="",qe.value=null,Ie.value=!0,on(),e.nextTick(()=>{q.value&&q.value.focus()})},tl=()=>{if(!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&qe.value&&(l=qe.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}qe.value=null}else bn("unlink");Ce.value=!1,on(),e.nextTick(()=>{ie(),wn()})},In=()=>{A.disabled||!A.richText||f.value&&(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{k(),ie(),tn()}))},Tl=()=>{A.disabled||!A.richText||f.value&&(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{k(),ie(),tn()}))},Al=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},k=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=Al(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},h=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{k(),ie()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=Al(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),k();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ie(),tn()})}else document.execCommand("indent",!1),e.nextTick(()=>{k(),ie(),tn()})},x=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{k(),ie()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),k();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ie(),tn()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{k(),ie(),tn()})},O=e.ref(null),ue=e.ref(null),yt=e.ref({}),Mt=e.ref(""),Yt=e.ref(null),an=e.ref("");e.ref("");const nn=e.ref(null);e.ref("");const sn=e.ref([]),Pn=e.ref(!1),Dl=e.ref(!1),Po=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},ho=()=>{if(A.disabled||!A.richText||!f.value)return;if(O.value!==null){O.value=null,Mt.value="",an.value="",nn.value=null,sn.value=[],Cn(!0);return}on(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Ot(l))return;an.value=Po(l)||"",nn.value=$n();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);yt.value={top:`${m}px`,bottom:"auto"},O.value=Date.now(),e.nextTick(()=>{if(Mt.value="",Yt.value){const y=Yt.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const _=r.getBoundingClientRect(),D=v.getBoundingClientRect(),E=y.getBoundingClientRect(),se=D.bottom-_.top,j=E.top-_.top,Oe=8;if(se>j-Oe){const Ne=E.height;yt.value={bottom:`${Ne+Oe}px`,top:"auto"}}else yt.value={top:`${m}px`,bottom:"auto"}}}})},yo=()=>{if(!Mt.value.trim())return;const o=Mt.value.trim(),l=new Date,s={text:o,selectionText:an.value,selectionRange:nn.value,commentId:O.value,user:A.commentUser||null,createdAt:l.toISOString()};sn.value=[...sn.value,s],pe("comment-submitted",s),no(s),nn.value&&!Wo(nn.value)&&Co(O.value,nn.value),Mt.value="",e.nextTick(()=>{if(Yt.value){const r=Yt.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}kn("sendComment")})},Oo=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(sn.value=sn.value.filter((s,r)=>r!==l),O.value!==null&&f.value){const s=String(O.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&sn.value.length>0){const c=[],d=new Set;sn.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(sn.value.length))}else r&&sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(pe("comment-deleted",{comment:o,index:l,commentId:O.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));pe("update:comments",s)}e.nextTick(()=>{kn("deleteComment")})}},Wo=o=>{if(!o||!f.value)return!1;try{const l=ko(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ko=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Co=(o,l)=>{if(!(!o||!l||!f.value))try{const s=ko(l);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,y=s.startOffset,_=s.endOffset,D=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(D===E&&y===0&&_===(v.nodeType===3?v.length:E.childNodes.length)&&(D.tagName==="P"||D.tagName==="DIV"||D.tagName==="H1"||D.tagName==="H2"||D.tagName==="H3"||D.tagName==="H4"||D.tagName==="H5"||D.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{kn("wrapSelectionWithCommentMarker"),ie()})}catch{}},no=o=>{if(!o||!o.commentId)return;const l=Array.isArray(A.comments)?[...A.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(v=>v.article_id)?.article_id||null,m={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Pn.value=!0,pe("update:comments",l)},bo=(o,l=[])=>{if(A.disabled||!A.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;on(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),an.value=r.innerHTML||"",nn.value=$n();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const _=m.getBoundingClientRect(),D=u.bottom-_.top,se=Math.max(D+8,0);yt.value={top:`${se}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(v&&A.comments&&Array.isArray(A.comments)){const _=A.comments.find(D=>String(D.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const D=_.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:_.id||_.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));y.push(...D)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((_,D)=>{const E=Oe=>{if(!Oe)return 0;const Ne=new Date(Oe).getTime();return isNaN(Ne)?0:Ne},se=E(_.createdAt),j=E(D.createdAt);return se===j?0:se-j}),sn.value=y,Cn(!0),O.value=v||null,r&&(ue.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Mt.value="",Yt.value){const _=Yt.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const D=m.querySelector(".dss-text-editor-footer");if(D){const E=m.getBoundingClientRect(),se=_.getBoundingClientRect(),j=D.getBoundingClientRect(),Oe=se.bottom-E.top,Ne=j.top-E.top,st=8;if(Oe>Ne-st){const yn=j.height;yt.value={bottom:`${yn+st}px`,top:"auto"}}}}}kn("openCommentOverlayForSelector")})},lo=e.ref(null),wo=e.ref(0),oo=o=>{if(!(A.disabled||!A.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Tn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,y=c.contains(m)||m===c,D=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!y||D.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{ie()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?x():h();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const y=v.closest("p, div");if(y&&y!==f.value){o.preventDefault(),o.stopPropagation();let _=null;const D=s.startOffset;D<u.length&&(_=u.splitText(D));const E=document.createElement("p");if(_?E.appendChild(_):E.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(E,y.nextSibling):y.parentNode.appendChild(E);const se=document.createRange();_?se.setStart(_,0):se.setStart(E,0),se.collapse(!0),l.removeAllRanges(),l.addRange(se),e.nextTick(()=>{ie()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Oe=j.textContent||"",st=(j.innerHTML||"").trim(),yn=st.replace(/<br\s*\/?>/gi,"").trim();return Oe.trim()===""||st===""||yn===""||st==="<br>"||st==="<br/>"||st==="<p></p>"||st==="<p><br></p>"||st==="<p><br/></p>"||st==="<p> </p>"||st==="<p><br> </p>"||st==="<div></div>"||st==="<div><br></div>"||st==="<div><br/></div>"},v=c.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",_=s.startContainer,D=_.nodeType===3?_.parentElement:_,E=D===c||D&&D.parentElement===c;if(u&&m(u)||y&&E){o.preventDefault(),setTimeout(()=>{Tn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-wo.value;if(lo.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),h();return}}}}lo.value=" ",wo.value=l}else lo.value=o.key}},qo=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),lt();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let y=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(D=>{if(y>0){const E=v.createElement("p");E.innerHTML=D.innerHTML,D.parentNode.replaceChild(E,D)}else y++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(se=>D.includes(se.tagName));if(E.length===1){const se=E[0].tagName,j=c.tagName,Oe=c.textContent.trim()===""&&!c.querySelector("img");let Ne=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ne=!0:Oe||(se===j||se==="P")&&(Ne=!0),Ne)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);ie()},ql=o=>{if(be.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&on()}if(We.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Rl()}if(rt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Zl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Qe.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Z.value=!r.collapsed&&Ot(r)}else Z.value=!1}if(O.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(O.value=null,Mt.value="",an.value="",nn.value=null,sn.value=[],Cn(!0))}},Bn=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),Lt.value&&(clearTimeout(Lt.value),Lt.value=null),Qe.value=l},F=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Lt.value&&clearTimeout(Lt.value),Lt.value=setTimeout(()=>{Qe.value=null,Lt.value=null},150)},xn=o=>{Qe.value=null};let On=0;const Hl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++On}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},hn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Hl(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const y=c.getAttribute("data-submenu-id");y&&Bn(v,y)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=y=>{const _=c.getAttribute("data-submenu-id");_&&Bn(y,_)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",xn)})})})};let Mn=null;const jt=()=>{if(Qe.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Qe.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Qe.value}"]`);o&&l&&Mo(o,l)}if(We.value&&tn(),A.richText){if(Mn!==null)return;Mn=setTimeout(()=>{Mn=null,kn("handleWindowResize")},150)}},Gt=()=>{if(!A.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},ul=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ut.value?_n():vn(),V.value?Nn():fl()})}),e.nextTick(()=>{ul()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",ql),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{hn(),Gt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!A.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),D=v.closest(".dss-image-wrapper");if(_||D&&v===D){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),se=document.createRange();se.setStartAfter(D),se.collapse(!0),E.removeAllRanges(),E.addRange(se)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Oe=j.nodeType===3?j.parentElement:j;if(D.contains(Oe)&&Oe!==D.querySelector("img")){const Ne=document.createRange();Ne.setStartAfter(D),Ne.collapse(!0),E.removeAllRanges(),E.addRange(Ne)}}else{const se=document.createRange();se.setStartAfter(D),se.collapse(!0),E.addRange(se)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,y=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(y||_&&v.tagName!=="IMG"){m.preventDefault();const D=window.getSelection(),E=document.createRange();_&&(E.setStartAfter(_),E.collapse(!0),D.removeAllRanges(),D.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const D=y.getAttribute("alt")||y.alt||"";if(D){const E=y.getAttribute("src")||y.src||"",se=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===E||D===se;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),gn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,y=v.tagName==="IMG"?v:v.closest("img"),_=y?.closest(".dss-image-wrapper");y&&f.value.contains(y)&&(Vt.value=_||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Vt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Vt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Vt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Vt.value,y=v.classList?.contains("dss-image-wrapper"),_=y?v.querySelector("img"):v,D=y?v:_?.closest(".dss-image-wrapper");if(!_||!f.value.contains(_)){Vt.value=null;return}let E=null;const se=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(se,j);else{const ln=window.getSelection();ln.rangeCount>0?E=ln.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){Vt.value=null;return}const Oe=E.commonAncestorContainer,Ne=Oe.nodeType===3?Oe.parentElement:Oe;if(Ne?.closest(".dss-image-wrapper")===D||D&&D.contains(Ne)){Vt.value=null;return}if(D&&(Ne===D||D.contains(Ne))){Vt.value=null;return}const yn=_.getAttribute("src");let mn=null;D?mn=D.cloneNode(!0):mn=_.cloneNode(!0);try{let ln=E.startContainer;if(ln.nodeType===3&&(ln=ln.parentElement),D&&(ln===D||D.contains(ln))){const cn=document.createRange();cn.setStartAfter(D),cn.collapse(!0),E=cn}E.insertNode(mn);const pn=document.createRange();pn.setStartAfter(mn),pn.collapse(!0);const rn=window.getSelection();rn.removeAllRanges(),rn.addRange(pn)}catch{if(f.value.childNodes.length===0){const pn=document.createElement("p");pn.appendChild(mn),f.value.appendChild(pn)}else{const pn=f.value.lastChild;if(pn&&pn.nodeType===1)pn.appendChild(mn);else{const rn=document.createElement("p");rn.appendChild(mn),f.value.appendChild(rn)}}}D?D.remove():_.remove(),Vt.value=null,e.nextTick(()=>{const ln=f.value.querySelectorAll("img");let pn=!1;ln.forEach(rn=>{if(rn.getAttribute("src")===yn)if(!pn)pn=!0;else{const cn=rn.closest(".dss-image-wrapper");cn?cn.remove():rn.remove()}}),gn(),ie()})}),f.value.addEventListener("dragend",m=>{Vt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const _=y.querySelectorAll&&y.querySelectorAll("img");_&&_.forEach(D=>{D.removeAttribute("alt"),D.removeAttribute("data-alt"),D.setAttribute("alt",""),D.setAttribute("data-alt",""),D.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{gn(),Gt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Gt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=Dn(A.modelValue);f.value.innerHTML=m,ht()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",y=A.description||"";Je.value=m,le.value=v,U.value=y,Y.value=v,ge.value=y,k(),gn(),De(),wt(),uo(),En()}),wn(),ut(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",ql),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Mn!==null&&(clearTimeout(Mn),Mn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Xe.value&&clearTimeout(Xe.value),Lt.value&&clearTimeout(Lt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ze.value&&Ze.value.disconnect(),gt.value!==null&&(cancelAnimationFrame(gt.value),gt.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),$t.value!==null&&(clearTimeout($t.value),$t.value=null),Cn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const gl=o=>{const l=o.target,s=l.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}gn(),wn(),ut(),tn(),wt()}):e.nextTick(()=>{gn(),wn(),ut(),tn(),wt()})},Dt=()=>{il();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Z.value=!s.collapsed&&Ot(s),!s.collapsed&&w.value&&(w.value=null)}else Z.value=!1;if(gn(),wn(),ut(),tn(),wt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Z.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}K.value[s]=m}else{const d=document.queryCommandState(s);K.value[s]=d}}}catch{}})},wt=()=>{if(!A.richText||A.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},ut=()=>{if(!f.value){Ge.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&f.value.contains(c))}Ge.value=l}catch{Ge.value=!1}},Ot=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Rl=()=>{We.value=!1},tn=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){We.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){We.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Ot(l)){We.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){We.value=!1;return}const r=f.value;if(!r){We.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){We.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let _=0;ct.value&&(_=ct.value.getBoundingClientRect().width);const D=(_||320)/2;let E=c.left+D,se=c.right-D;if(se<E){const j=c.left+c.width/2;E=j,se=j}if(y>0){const j=D+u,Oe=y-D-u;if(E=Math.max(E,j),se=Math.min(se,Oe),se<E){const Ne=y/2;E=Ne,se=Ne}}v<E?v=E:v>se&&(v=se),we.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},We.value=!0},Sl=o=>{A.disabled||!A.richText||(rt.value=rt.value===o?null:o,o==="askAi"&&(be.value=null))},Zl=()=>{rt.value=null,Qe.value=null},Rn=o=>{Yn(o),Zl()};let nl=null,ll=null,hl=null,yl=null;const Zo=o=>{if(A.disabled||!A.richText){Vl(),Fl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(nl&&(clearTimeout(nl),nl=null),hl&&(clearTimeout(hl),hl=null),s&&s!==ll){Fl(),ll=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,de.value=c,X.value=!0,Ee.value=!0,jn(s)}else!s&&ll?(ll=null,nl=setTimeout(()=>{Ee.value||Vl()},150)):s&&s===ll&&jn(s);if(r&&r!==yl){Vl(),yl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),kt.value=r,Pt.value=c.trim()||L("textEditor.image.noAlt"),Bt.value=!0,he.value=!0,xo(r)}else!r&&yl?(yl=null,hl=setTimeout(()=>{he.value||Fl()},150)):r&&r===yl&&xo(r)},kl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(ll=null,yl=null,nl&&(clearTimeout(nl),nl=null),hl&&(clearTimeout(hl),hl=null),Vl(),Fl())},Vl=()=>{Ee.value=!1,setTimeout(()=>{Ee.value||(X.value=!1,de.value="",Ie.value||(qe.value=null))},100)},jn=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Fl=()=>{he.value=!1,setTimeout(()=>{he.value||(Bt.value=!1,Pt.value="",Et.value||(kt.value=null))},100)},xo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;G.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Il=()=>{if(!de.value||!qe.value)return;let l=qe.value.getAttribute("href")||de.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(qe.value){const o=qe.value.textContent||"",l=qe.value.getAttribute("href")||"",s=qe.value;ot.value=l,vt.value=o,$e.value=o,Ee.value=!1,X.value=!1,de.value="",qe.value=s,Ie.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";ot.value=d,vt.value=c,$e.value=c,qe.value=r,Ie.value=!0}}}else{Se.value=$n();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),ot.value="",vt.value=l,$e.value="",qe.value=null,Ie.value=!0}e.nextTick(()=>{q.value&&(q.value.focus(),q.value.select())})},zl=()=>{Ie.value=!1,ot.value="",vt.value="",$e.value="",qe.value=null,Se.value=null},ao=()=>{if(!ot.value.trim()){zl();return}if(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),vt.value.trim()||(vt.value=ot.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=qe.value;if(l.setAttribute("href",ot.value.trim()),vt.value.trim()!==$e.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=vt.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),ie()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Se.value&&Ln(Se.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=ot.value.trim(),s.textContent=vt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(f.value),l.collapse(!1));const s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=ot.value.trim(),d.textContent=vt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=s.textContent.substring(0,l.startOffset),_=y[y.length-1];if(_&&_!==" "&&_!==" "&&_!==`
|
|
102
102
|
`){const D=document.createTextNode(" ");l.insertNode(D),l.setStartAfter(D)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=s.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
|
|
103
|
-
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}ie()}e.nextTick(()=>{Cn(),Il()})},Ul=()=>{if(!f.value||le.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Nn());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],y=v.textContent;s.lastIndex=0;const M=[...y.matchAll(s)];if(M.length===0)continue;const D=M.filter(j=>{const Re=j[0],Se=j.index;if(Se>0&&y[Se-1]==="@"||Se+Re.length<y.length&&y[Se+Re.length]==="@")return!1;const it=v.parentElement;return!(it&&it.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===y.trim()){const j=D[0][0],Re=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Se=document.createElement("a");Se.href=Re,Se.textContent=j,Se.style.color="#60afdf",Se.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Se,v),u=!0);continue}let E=0;const ae=document.createDocumentFragment();if(D.forEach(j=>{const Re=j.index,Se=j[0];if(Re>E){const un=y.substring(E,Re);un&&ae.appendChild(document.createTextNode(un))}const it=Se.startsWith("http://")||Se.startsWith("https://")?Se:`https://${Se}`,gn=document.createElement("a");gn.href=it,gn.textContent=Se,gn.style.color="#60afdf",gn.style.textDecoration="underline",ae.appendChild(gn),E=Re+Se.length}),E<y.length){const j=y.substring(E);j&&ae.appendChild(document.createTextNode(j))}v.parentNode&&ae.childNodes.length>0&&(v.parentNode.replaceChild(ae,v),u=!0)}u&&l&&e.nextTick(()=>{Bn(l),Cn()})},Eo=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const y=document.createDocumentFragment();m.forEach(M=>{const D=M.index,E=M[0].startsWith("<u>")?"u":"ins",ae=M[1]||M[2]||"";D>v&&y.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(E);j.textContent=ae,y.appendChild(j),v=D+M[0].length}),v<u.length&&y.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},So=o=>{if(!f.value||le.value)return;if(!o){Eo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let un="",nn=0,dn=!1;const rn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:zn=>zn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let cn=0;for(;rn.nextNode();){const zn=rn.currentNode,el=zn.textContent||"",rl=cn;if(cn+=el.length,zn===r.startContainer){un+=el.substring(0,r.startOffset),nn=rl+r.startOffset,dn=!0;break}un+=el}return dn||(nn=un.length),{textBeforeCursor:un,cursorCharOffset:nn}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],M=m[1],D=u.length-y.length,ae=(un=>{let nn=0;const dn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:cn=>cn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let rn;for(;rn=dn.nextNode();){const cn=(rn.textContent||"").length;if(nn+cn>=un)return{node:rn,offset:un-nn};nn+=cn}return null})(D);if(!ae)return;const j=document.createRange();j.setStart(ae.node,ae.offset),j.setEnd(r.endContainer,r.endOffset);const Re=document.createElement(v);Re.textContent=M,j.deleteContents(),j.insertNode(Re);const Se=window.getSelection(),it=document.createRange();it.setStartAfter(Re),it.collapse(!0),Se.removeAllRanges(),Se.addRange(it);const gn=Nn();e.nextTick(()=>{ie(),gn&&Bn(gn)})},so=()=>{f.value&&(Ot.value=Nn(),At.value="",It.value="",We.value="",Q.value="",pe.value="",qt.value=null,kt.value=null,Be.value="upload",St.value=!0,on(),e.nextTick(()=>{He.value&&He.value.focus(),Ye.value&&(Ye.value.value="")}))},Xn=o=>{const l=o.target?.files?.[0];if(!l){qt.value=null,It.value="";return}qt.value=l;const s=new FileReader;s.onload=r=>{It.value=r.target?.result||""},s.readAsDataURL(l)},Yn=()=>{Ye.value&&Ye.value.click()},Xl=()=>{Q.value&&(pe.value="")},ro=()=>{pe.value&&(Q.value="")},Vo=()=>{let o=kt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";kt.value=o,At.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(We.value=s,It.value="",Be.value="url"):(It.value=s,We.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Q.value=c.endsWith("px")?c.replace("px",""):c,pe.value=d.endsWith("px")?d.replace("px",""):d,Ot.value=null}else{so();return}St.value=!0,ye.value=!1,xt.value=!1,e.nextTick(()=>{Be.value==="url"&&Zt.value?(Zt.value.focus(),Zt.value.select()):He.value&&(He.value.focus(),He.value.select()),Ye.value&&(Ye.value.value="")})},El=()=>{St.value=!1,At.value="",It.value="",We.value="",Q.value="",pe.value="",qt.value=null,kt.value=null,Ot.value=null,Be.value="upload"},_n=()=>{const o=(At.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),W.value?(Ke.value&&(clearTimeout(Ke.value),Ke.value=null),rt(),W.value=!1):rt();const s=Be.value==="url"?We.value.trim():It.value;if(kt.value&&f.value&&f.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),Q.value?(kt.value.style.width=`${Q.value}px`,kt.value.setAttribute("width",Q.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),pe.value?(kt.value.style.height=`${pe.value}px`,kt.value.setAttribute("height",pe.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),r.addRange(c)}ie()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),El();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Ot.value&&(Bn(Ot.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){El();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),Q.value&&(v.style.width=`${Q.value}px`,v.setAttribute("width",Q.value)),pe.value&&(v.style.height=`${pe.value}px`,v.setAttribute("height",pe.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const D=document.createElement("p");f.value.appendChild(D),D.appendChild(v)}else{const D=f.value.lastChild;if(D&&D.nodeType===1)D.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}kt.value=v,ie()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Cn(),en(),El()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!le.value){const l=yl(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=Nn();f.value.innerHTML=l,e.nextTick(()=>{gt();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";q.value=u,ve.value=m,qe.value=v,K.value=u,Je.value=m,Bt.value=v,je.value=[],Nt.value=[],Ke.value&&(clearTimeout(Ke.value),Ke.value=null),W.value=!1,d&&Bn(d),k(),fn(),_e(),Cn(),en(),wt(),hn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(en(),e.nextTick(()=>{uo()})):(Hl(),ee.value=[],Oe.value&&(Oe.value.disconnect(),Oe.value=null)),wt()}),e.watch(()=>A.floatingToolbar,o=>{o?en():Hl()}),e.watch(()=>A.disabled,o=>{o&&Hl(),wt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{V.value?xn():ul()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{Qt.value?Vn():pn()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{Gt()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(Fn.value){Fn.value=!1;return}Al.value||A.richText&&f.value&&e.nextTick(()=>{wn()})},{deep:!0,immediate:!1});const wn=()=>{if(!Al.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Al.value=!0;try{const o=new Set,l=A.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const y=f.value.querySelector(`[data-comment="${v}"]`);if(y){Kt(y,u),d.add(v);return}try{const M=Xo(u.selection_range,u.selection_text);if(M&&!M.collapsed){const D=M.commonAncestorContainer,E=D.nodeType===3?D.parentElement:D;if(E){const Re=E.closest("[data-comment], [data-fake-comment]");if(Re){const Se=Re.getAttribute("data-comment")||Re.getAttribute("data-fake-comment");if(String(Se)===String(m)){Re.setAttribute("data-comment",v),Re.removeAttribute("data-fake-comment"),Kt(Re,u),d.add(v);return}else return}}const ae=f.value.querySelector(`[data-comment="${v}"]`);if(ae){Kt(ae,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{M.surroundContents(j),c++,d.add(v)}catch{try{const Se=document.createRange();Se.setStart(M.startContainer,M.startOffset),Se.setEnd(M.endContainer,M.endOffset),io(Se),Se.surroundContents(j),c++,d.add(v)}catch{try{const it=M.extractContents();j.appendChild(it),M.insertNode(j),c++,d.add(v)}catch(it){console.warn("Failed to create comment marker:",it)}}}}}catch{}}),e.nextTick(()=>{hn("restoreCommentsFromModel"),ie(),Al.value=!1})}catch{Al.value=!1}}},io=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Ut(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!No(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Ut=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},No=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Xo=(o,l)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?io(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},hn=(o="unknown")=>{if(!A.richText||!f.value){ee.value=[];return}Date.now()-Mt.value<Dt&&vt.value!==null||vt.value===null&&(vt.value=requestAnimationFrame(()=>{if(vt.value=null,Mt.value=Date.now(),we.value)return;we.value=!0;const s={},r=f.value;if(!r){we.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){we.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const ae=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");ae&&E.tagName==="SPAN"&&(m.has(ae)||(u.push(E),m.add(ae)))}),d.forEach(E=>{const ae=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!ae||m.has(ae)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${ae}"], span[data-fake-comment="${ae}"]`)||(u.push(E),m.add(ae)):E.tagName!=="SPAN"&&(u.push(E),m.add(ae)))});const v=c.getBoundingClientRect(),y=r.getBoundingClientRect();u.forEach((E,ae)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const tl=E.textContent?.trim(),jn=A.comments?.find(Pn=>(typeof Pn.conversation_id=="string"&&Pn.conversation_id.startsWith("comment-")?null:Pn.conversation_id)&&Pn.selection_text?.trim()===tl);jn?(j=String(jn.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Re=E.getBoundingClientRect(),Se=window.getComputedStyle(E),it=parseFloat(Se.lineHeight)||parseFloat(Se.fontSize)*1.2,nn=Re.top-y.top+it/2-15,rn=y.top-v.top+nn;let cn=null,zn=null,el=0;const rl=[],mo=new Set;if(j&&A.comments){const tl=A.comments.find(jn=>String(jn.conversation_id||jn.id)===String(j));if(tl){const jn=tl.conversation||[];jn.length>0?(jn.forEach(Pn=>{Pn.user&&Pn.user.id&&!mo.has(Pn.user.id)&&(mo.add(Pn.user.id),rl.push(Pn.user))}),el=jn.length):(el=0,cn=null,zn=null),rl.length>0?cn=rl[0]:cn=null,rl.length>1?zn=rl[1]:zn=null}}const _o=Re.top+it/2-15,Yo=_o+30,gl=5,po=Yo>y.top+gl&&_o<y.bottom-gl?1:0;ee.value.find(tl=>tl.id===j);let Yl=E;if(!Yl&&j&&f.value){const tl=String(j);Yl=f.value.querySelector(`[data-comment="${tl}"], [data-fake-comment="${tl}"]`)}const $o=rl.length;s[j]?(s[j].top=rn,s[j].opacity=po,s[j].element=Yl,s[j].firstUser=cn,s[j].secondUser=zn,s[j].totalCount=el,s[j].uniqueUserCount=$o):s[j]={id:j,top:rn,opacity:po,element:Yl,firstUser:cn,secondUser:zn,totalCount:el,uniqueUserCount:$o}});const M=Object.values(s).map(E=>{const ae=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Re=String(E.id);E.element=f.value.querySelector(`[data-comment="${Re}"], [data-fake-comment="${Re}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:ae}});(ee.value.length!==M.length||M.some((E,ae)=>{const j=ee.value[ae];if(!j)return!0;const Re=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Se=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Re||Se||j.element!==E.element}))&&(ee.value=M),we.value=!1}))},Bo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(yn(),de.value=l,l.classList.add("editor-comment-highlighted"))},yn=(o=!1)=>{!o&&O.value!==null&&de.value&&(de.value.getAttribute("data-comment")||de.value.getAttribute("data-fake-comment"))===O.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),de.value&&(de.value.classList.remove("editor-comment-highlighted"),de.value=null))},co=o=>{if(!o||!o.element)return;yn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;X("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Sl=()=>{yn()},uo=()=>{!A.richText||!f.value||(Oe.value&&Oe.value.disconnect(),Ct.value!==null&&(clearTimeout(Ct.value),Ct.value=null),Oe.value=new MutationObserver(()=>{Ct.value===null&&(Ct.value=setTimeout(()=>{Ct.value=null,e.nextTick(()=>{hn("MutationObserver")})},200))}),Oe.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),hn("setupCommentMarkersObserver-initial"))},Mo=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>lt.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[Ce.value,ct.value],()=>{Ce.value==="askAi"||ct.value==="askAi"?e.nextTick(()=>{vn()}):(lt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>A.locale,o=>{o&&o!==ue.value&&(ue.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:bo,updateCommentMarkers:hn,restoreCommentsFromModel:wn}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",at.value]),style:e.normalizeStyle(pt.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Lu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:bt,title:e.unref(L)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:se,title:e.unref(L)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Au),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Du,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Kn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ou)):(e.openBlock(),e.createElementBlock("svg",Wu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Hu),Ce.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>Zn("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Zn("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Zn("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Zn("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Zn("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Zn("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Zn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:l[9]||(l[9]=s=>kn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:l[10]||(l[10]=s=>kn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:l[11]||(l[11]=s=>kn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xe.value}]),onClick:$l,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Ju),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Gn,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,td)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Wl,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,ed)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:Rn,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:Ll,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ld),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:so,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,od),Y.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:ho},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Kn("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",ud,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,cd),Ce.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Pt(s)?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Pt(s)&&r<T.customToolbarSlots.length-1&&Tn(r)?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Ce.value==="paragraph"||Ce.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:on})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:Il},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fd,[e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ue,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,hd),[[e.vModelText,ut.value]])]),e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:U,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>Pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,Cd),[[e.vModelText,Pe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Il},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:St.value,width:"500px",height:"80vh",onCloseModal:El},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:l[17]||(l[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:l[18]||(l[18]=s=>Be.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[mt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),mt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Yn},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Vd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Ye,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Xn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ye,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Xn},null,544))]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:He,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>At.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_n,["enter"])},null,40,Md),[[e.vModelText,At.value]])]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>Q.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:Xl},null,40,Ld),[[e.vModelText,Q.value]])]),e.createElementVNode("div",Td,[e.createElementVNode("label",Ad,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:ro},null,40,Dd),[[e.vModelText,pe.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Zt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>We.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(_n,["enter"])},null,40,zd),[[e.vModelText,We.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>At.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_n,["enter"])},null,40,Wd),[[e.vModelText,At.value]])]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>Q.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:Xl},null,40,Ud),[[e.vModelText,Q.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:ro},null,40,jd),[[e.vModelText,pe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:El},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:_n},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Hn.value&&Qt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[Qt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gd,[T.title?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(ft.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:tt,value:T.title,onInput:$n,onFocus:to,onBlur:ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Qt.value}]),placeholder:ft.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),Hn.value&&Qt.value?(e.openBlock(),e.createElementBlock("div",t1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Nl.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l1,[T.description?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:st,value:T.description,onInput:Cl,onFocus:kl,onBlur:Ol,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:nt.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),Nl.value&&V.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":O.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>Bo(s),onMouseleave:Sl},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,c1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,p1)):(e.openBlock(),e.createElementBlock("span",f1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,m1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>co(s),["stop"])},[e.createElementVNode("span",g1,"+"+e.toDisplayString(s.additionalCount),1)],12,v1)):e.createCommentVNode("",!0)],46,i1))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(P.value),onInput:ie,onBlur:Te,onClick:ml,onMouseup:Ht,onKeyup:Ht,onKeydown:oo,onPaste:qo,onMousemove:Zo,onMouseleave:vl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[O.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(yt.value)},[an.value||sn.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[an.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:an.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,_1)):(e.openBlock(),e.createElementBlock("span",$1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",L1,[e.createElementVNode("div",T1,[e.createElementVNode("div",A1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",D1,e.toDisplayString(zl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Ml(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!Ml(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Oo(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,H1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",R1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Yt,"onUpdate:modelValue":l[26]||(l[26]=s=>_t.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Yt.value){const s=Yt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,_t.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yo,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",I1,[e.createElementVNode("div",z1,[e.createElementVNode("span",P1,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",O1,e.toDisplayString(Ie.value)+" "+e.toDisplayString(Ie.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("textarea",{value:T.modelValue,onInput:Pl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:Et.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(qn.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Ie.value)+" "+e.toDisplayString(Ie.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[oe.value&&me.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:l[28]||(l[28]=s=>be.value=!0),onMouseleave:xl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Fl,["stop"]),title:me.value},e.toDisplayString(me.value),9,W1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Z1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,q1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xt.value&&zt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(J.value),onMouseenter:l[29]||(l[29]=s=>ye.value=!0),onMouseleave:Rl},[e.createElementVNode("div",U1,[zt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",X1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:zt.value},e.toDisplayString(zt.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",K1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,j1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&Fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ht,class:"dss-floating-toolbar",style:e.normalizeStyle(xe.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",G1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(bt,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:e.withModifiers(se,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,J1),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",em,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>wl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,rm)):(e.openBlock(),e.createElementBlock("svg",im,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,tm),ct.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=s=>Ln("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>Ln("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>Ln("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>Ln("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>Ln("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>Ln("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>Ln("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>kn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>kn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>kn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xe.value}]),onClick:e.withModifiers($l,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,mm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Gn,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,fm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Wl,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,pm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:e.withModifiers(Ll,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,gm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,hm),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(ho,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,ym),T.askAi?(e.openBlock(),e.createElementBlock("div",km)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>wl("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",wm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,bm),ct.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),cl.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&cl.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Pt(s)&&Dn(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Pt(s)&&Dn(s)&&r<T.customToolbarSlots.length-1&&An(r)?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mm={class:"dss-color-picker__section-title"},_m={class:"dss-color-picker__presets-row"},$m=["title","onClick"],Lm={key:1,class:"dss-color-picker__section"},Tm={class:"dss-color-picker__presets-row"},Am=["title","onClick"],Dm={class:"dss-color-picker__section"},Hm={class:"dss-color-picker__section-header"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im=["onClick"],zm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Pm=["title","onClick"],Om={class:"dss-color-picker__input-row"},Wm=["value"],qm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(T,{emit:ne}){function _(W){const q=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(W);if(!q)return{h:0,s:0,l:50};const K=parseInt(q[1],16)/255,ve=parseInt(q[2],16)/255,qe=parseInt(q[3],16)/255,Je=Math.max(K,ve,qe),Bt=Math.min(K,ve,qe);let tt=0,st=0;const Xt=(Je+Bt)/2;if(Je!==Bt){const ln=Je-Bt;switch(st=Xt>.5?ln/(2-Je-Bt):ln/(Je+Bt),Je){case K:tt=((ve-qe)/ln+(ve<qe?6:0))/6;break;case ve:tt=((qe-K)/ln+2)/6;break;case qe:tt=((K-ve)/ln+4)/6;break}}return{h:tt*360,s:st*100,l:Xt*100}}function L(W,q,K){q/=100,K/=100;const ve=q*Math.min(K,1-K),qe=Je=>{const Bt=(Je+W/30)%12,tt=K-ve*Math.max(Math.min(Bt-3,9-Bt,1),-1);return Math.round(255*tt).toString(16).padStart(2,"0")};return`#${qe(0)}${qe(8)}${qe(4)}`}function ue(W){const q=W.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!q)return null;let K=q[1];return K.length===3&&(K=K.split("").map(ve=>ve+ve).join("")),"#"+K}function I(W,q,K){q/=100,K/=100;const ve=K+q*Math.min(K,1-K),qe=ve===0?0:2-2*K/ve;return{h:W,s:qe*100,v:ve*100}}function A(W,q,K){q/=100,K/=100;const ve=K*(1-q/2),qe=ve===0||ve===1?0:(K-ve)/Math.min(ve,1-ve);return{h:W,s:qe*100,l:ve*100}}const X=T,Ge=ne,ge=e.ref(!1),f=e.ref(!1),Ce=e.ref(!1),he=e.ref(-1),le=e.ref(-1),oe=e.ref(null),me=e.ref(null),H=e.ref(null),be=e.ref(null),Ae=e.ref({top:0,left:0}),Pe=e.ref(_(X.modelValue||"#b8a5de")),ut=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),U=e.computed(()=>ut.value?0:X.initialPresetCount!=null?X.initialPresetCount:le.value<0?null:le.value),Ue=e.computed(()=>{const W=U.value;return W==null?!0:Math.max(0,X.presetColors.length-W)<X.max}),Qe=e.computed(()=>!!(f.value||he.value>=0||!Ve.value&&X.presetColors.length===0));e.computed(()=>{const W=U.value;return W!=null&&X.presetColors.length>W});const Ve=e.computed(()=>ut.value||U.value!=null),Le=e.computed(()=>{const W=U.value;return W==null?[]:X.presetColors.slice(0,W)}),Xe=e.computed(()=>{const W=U.value;return W==null?[]:X.presetColors.slice(W)});function G(W){const q=U.value;return q!=null?q+W:-1}function Fe(W){const q=U.value;return q!=null&&W>=q}function xe(W){Fe(W)&&(he.value=W,Pe.value=_(X.presetColors[W]),f.value=!0,e.nextTick(()=>be.value?.focus()))}function ht(W){if(!Fe(W))return;const q=X.presetColors.filter((qe,Je)=>Je!==W);Ge("update:presetColors",q);const K=ue(X.modelValue),ve=ue(X.presetColors[W]);if(K&&ve&&K.toLowerCase()===ve.toLowerCase()){const qe=q[Math.max(0,W-1)]||q[0];qe&&Ge("update:modelValue",qe)}}function ct(){Ce.value=!Ce.value,Ce.value||(he.value=-1,f.value=!1)}function St(){if(he.value<0)return;const W=Q.value,q=ue(W);if(q){const K=[...X.presetColors];K[he.value]=q,Ge("update:presetColors",K),Ge("update:modelValue",q),he.value=-1,f.value=!1}}function At(){X.disabled||(he.value=-1,f.value=!f.value,f.value&&(xt(),e.nextTick(()=>be.value?.focus())))}function qt(W){const q=ue(W),K=ue(X.modelValue);return q&&K&&q.toLowerCase()===K.toLowerCase()}function It(){if(X.disabled||!Ue.value)return;const W=Q.value,q=ue(W);if(q){const K=[...X.presetColors,q];Ge("update:presetColors",K),Ge("update:modelValue",q);const ve=U.value??le.value;ve>=0&&K.length-ve>=X.max&&(f.value=!1)}}const Q=e.computed(()=>{const{h:W,s:q,l:K}=Pe.value;return L(W,q,K)}),pe=e.computed(()=>Q.value.toLowerCase()),He=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Pe.value.h}, 100%, 50%))`})),Ye=e.computed(()=>{const W=I(Pe.value.h,Pe.value.s,Pe.value.l);return{left:`${W.s}%`,bottom:`${W.v}%`,transform:"translate(-50%, 50%)"}}),Zt=e.computed(()=>({left:`${Pe.value.h/360*100}%`,transform:"translateX(-50%)"})),kt=e.computed(()=>({position:"fixed",left:`${Ae.value.left}px`,top:`${Ae.value.top}px`,zIndex:1002}));function Ot(){if(!oe.value||!ge.value)return;const W=oe.value.getBoundingClientRect(),q=window.innerHeight||document.documentElement.clientHeight;let K=W.bottom+4;const ve=me.value;ve&&K+ve.offsetHeight>q-8&&(K=W.top-4-ve.offsetHeight),Ae.value={top:K,left:W.left}}function xt(){const W=X.modelValue||"#b8a5de";ue(W)&&(Pe.value=_(W))}function zt(){Ge("update:modelValue",Q.value)}function J(){X.disabled||(ge.value=!ge.value,ge.value&&(xt(),e.nextTick(()=>{Ot(),be.value?.focus()})))}function ye(){const W=Q.value,q=ue(W);if(q){if(he.value>=0){const K=[...X.presetColors];K[he.value]=q,Ge("update:presetColors",K),Ge("update:modelValue",q)}else if((X.presetColors.length>0||ut.value)&&f.value&&Ue.value&&!X.presetColors.some(ve=>ue(ve)?.toLowerCase()===q.toLowerCase())){const ve=[...X.presetColors,q];Ge("update:presetColors",ve),Ge("update:modelValue",q)}}ge.value=!1,f.value=!1,Ce.value=!1,he.value=-1}function Be(W){if(!H.value)return;const q=H.value.getBoundingClientRect(),K=ve=>{const qe=Math.max(0,Math.min(1,(ve.clientX-q.left)/q.width)),Je=Math.max(0,Math.min(1,1-(ve.clientY-q.top)/q.height)),Bt={h:Pe.value.h,s:qe*100,v:Je*100};Pe.value=A(Bt.h,Bt.s,Bt.v)};K(W),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),zt()},{once:!0})}function We(W){if(!W.currentTarget)return;const K=W.currentTarget.getBoundingClientRect(),ve=qe=>{const Je=Math.max(0,Math.min(1,(qe.clientX-K.left)/K.width));Pe.value={...Pe.value,h:Je*360}};ve(W),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ve),zt()},{once:!0})}function lt(W){const q=W.target.value,K=ue(q);K&&(Pe.value=_(K),Ge("update:modelValue",K))}function Vt(W){if(X.disabled)return;const q=ue(W);q&&(Pe.value=_(q),Ge("update:modelValue",q))}let je=null,Nt=null;function Ke(){je&&(document.removeEventListener("keydown",je),je=null),Nt&&(window.removeEventListener("resize",Nt),Nt=null)}return e.watch(ge,W=>{if(Ke(),W){if(!ut.value&&X.initialPresetCount==null){const q=X.presetColors.length;q>0&&(le.value<0||q<le.value)&&(le.value=q)}je=q=>{q.key==="Escape"&&ye()},Nt=Ot,document.addEventListener("keydown",je),window.addEventListener("resize",Nt)}}),e.watch(()=>X.modelValue,()=>{ge.value&&xt()},{immediate:!1}),e.watch(Xe,W=>{W.length===0&&(Ce.value=!1,he.value=-1,f.value=!1)}),e.onBeforeUnmount(Ke),(W,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":T.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:oe,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":ge.value}]),onClick:J},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Q.value})},[...q[0]||(q[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ye,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"dss-color-picker__dropdown",style:e.normalizeStyle(kt.value)},[Ve.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(K,ve)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ve,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(K.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(qe,Je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ve+"-"+Je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(qe)}]),style:e.normalizeStyle({backgroundColor:qe}),title:qe,onClick:e.withModifiers(Bt=>Vt(qe),["stop"])},null,14,$m))),128))])]))),128)):Le.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[q[1]||(q[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(K,ve)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ve,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(qe=>Vt(K),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dm,[e.createElementVNode("div",Hm,[q[3]||(q[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Xe.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":Ce.value}]),title:"Manage custom colors",onClick:e.withModifiers(ct,["stop"])},[...q[2]||(q[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(K,ve)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ve,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Ce.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Ce.value&&qt(K),"dss-color-picker__preset-bubble--editing":Ce.value&&he.value===G(ve)}]),style:e.normalizeStyle({backgroundColor:he.value===G(ve)?Q.value:K}),title:he.value===G(ve)?Q.value:K,onClick:e.withModifiers(qe=>Ce.value?xe(G(ve)):Vt(K),["stop"])},null,14,Fm),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(qe=>ht(G(ve)),["stop"])},[...q[4]||(q[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Im)):e.createCommentVNode("",!0)],2))),128)),Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(At,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):T.presetColors.length?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.presetColors,(K,ve)=>(e.openBlock(),e.createElementBlock("button",{key:ve,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(qe=>Vt(K),["stop"])},null,14,Pm))),128)),Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(At,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Qe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Be},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(He.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ye.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:We},[q[5]||(q[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Zt.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:be,type:"text",class:"dss-color-picker__hex-input",value:pe.value,onInput:lt},null,40,Wm)]),Ve.value&&(T.presetColors.length||ut.value)&&Ue.value&&he.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),Ve.value&&he.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:St}," Save color ")):e.createCommentVNode("",!0),Ve.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ye}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Zm={key:0,class:"dss-loader"},Um={key:0,class:"dss-loader-label"},Xm={key:1,class:"dss-loader"},Ym={key:0,class:"dss-loader-label"},jm={key:2,class:"dss-loader"},Km={key:0,class:"dss-loader-label"},Gm={key:3,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:4,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:5,class:"dss-loader dss-loader--inline"},n2={class:"dss-loader-inline-text"},l2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(T){const ne=T,_=e.computed(()=>ne.size==="small"?"dss-loaders--size-small":ne.size==="large"?"dss-loaders--size-large":ne.size==="medium"||ne.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const ue={};if(!(ne.size==="small"||ne.size==="medium"||ne.size==="large"||ne.size==null)){const I=typeof ne.size=="number"?`${ne.size}px`:String(ne.size);ue["--dss-loader-size"]=I}return ne.color&&(ue["--dss-loader-accent"]=ne.color,ue["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ue});return(ue,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(L.value)},[T.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Zm,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="dots"?(e.openBlock(),e.createElementBlock("div",Xm,[I[1]||(I[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Ym,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="battery"?(e.openBlock(),e.createElementBlock("div",jm,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Km,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Gm,[I[3]||(I[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="bars"?(e.openBlock(),e.createElementBlock("div",Jm,[I[4]||(I[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="inline"?(e.openBlock(),e.createElementBlock("div",t2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(ue.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])])])):e.createCommentVNode("",!0)],6))}},ia="dss-skeleton-item",o2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:T=>["single","multiple"].includes(T)},targetClass:{type:String,default:ia},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(T){const ne=T,_=e.computed(()=>{const I={"dss-skeleton--loading":ne.loading,"dss-skeleton--static":!ne.shimmer,"dss-skeleton--multiple":ne.mode==="multiple","dss-skeleton--dark":ne.darkMode};return ne.mode==="multiple"&&ne.targetClass!==ia&&(I[`dss-skeleton--target-${ne.targetClass}`]=!0),I}),L=e.computed(()=>{const I={};return ne.borderRadius&&(I.borderRadius=ne.borderRadius),I}),ue=e.computed(()=>{const I={};return ne.borderRadius&&(I["--dss-skeleton-border-radius"]=ne.borderRadius),ne.darkMode?(I["--dss-skeleton-bg"]=ne.bgDark||"#322c3f",I["--dss-skeleton-shimmer"]=ne.shimmerDark||"#3e3f41",I):(ne.bgColor&&(I["--dss-skeleton-bg"]=ne.bgColor),ne.shimmerColor&&(I["--dss-skeleton-shimmer"]=ne.shimmerColor),I)});return(I,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(ue.value)},[T.loading&&T.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":T.loading&&T.mode==="single"}])},[e.renderSlot(I.$slots,"default")],2)],6))}},a2={key:0,class:"dss-dnd-column-header"},s2={class:"dss-dnd-column-title"},r2={class:"dss-dnd-column-count"},i2=["data-column"],c2={key:0,class:"dss-dnd-indicator"},u2=["onPointerdown"],d2=["onPointerdown"],m2={class:"dss-dnd-item-content"},p2={class:"dss-dnd-item-default"},f2={key:0,class:"dss-dnd-empty"},v2={name:"DSSDnd"},g2=Object.assign(v2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(T,{emit:ne}){const _=T,L=ne,ue=e.useSlots(),I=e.computed(()=>!!ue["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},X=e.computed(()=>({...A,..._.options})),Ge=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function ge(J){if(!X.value.ColColor||!J)return{};const ye=J.background||J.color;return ye?{background:ye}:{}}const f=e.ref(null),Ce=e.ref(null),he=e.ref(!1),le=e.ref(-1),oe=e.ref(null);let me=null,H=null,be=null,Ae=null,Pe=0,ut=0,U="",Ue=null;const Qe=5,Ve=e.computed(()=>{const J={};for(const ye of _.columns)J[ye.value]=_.items.filter(Be=>Be[_.columnKey]===ye.value).sort((Be,We)=>(Be[_.positionKey]??0)-(We[_.positionKey]??0));return J}),Le=e.computed(()=>{const J={},ye=!!f.value,Be=f.value?.[_.itemKey],We=Ce.value,lt=le.value;for(const Vt of _.columns){const je=Ve.value[Vt.value]||[],Nt=[],Ke=We==Vt.value;let W=0;for(let q=0;q<je.length;q++){const K=je[q],ve=ye&&K[_.itemKey]===Be;!ve&&Ke&<===W&&Nt.push({type:"indicator",key:`ind-${W}`}),ve||W++,Nt.push({type:"item",item:K,isDragged:ve,key:`item-${K[_.itemKey]}`})}Ke&<>=W&&Nt.push({type:"indicator",key:"ind-end"}),J[Vt.value]=Nt}return J});function Xe(J,ye){const We=(Ve.value[J]||[]).filter(je=>je[_.itemKey]!==f.value?.[_.itemKey]);if(We.length===0)return 1;if(ye<=0){const je=We[0][_.positionKey];return je!=null&&je>0?je/2:.5}if(ye>=We.length){const je=We[We.length-1][_.positionKey];return(je??0)+1}const lt=We[ye-1][_.positionKey]??0,Vt=We[ye][_.positionKey]??0;return(lt+Vt)/2}function G(J,ye,Be){be&&be.remove();const We=J.getBoundingClientRect(),lt=J.cloneNode(!0);lt.classList.add("dss-dnd-ghost"),lt.style.cssText=`
|
|
103
|
+
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}ie()}e.nextTick(()=>{wn(),zl()})},Ul=()=>{if(!f.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=$n());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],y=v.textContent;s.lastIndex=0;const _=[...y.matchAll(s)];if(_.length===0)continue;const D=_.filter(j=>{const Oe=j[0],Ne=j.index;if(Ne>0&&y[Ne-1]==="@"||Ne+Oe.length<y.length&&y[Ne+Oe.length]==="@")return!1;const st=v.parentElement;return!(st&&st.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===y.trim()){const j=D[0][0],Oe=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ne=document.createElement("a");Ne.href=Oe,Ne.textContent=j,Ne.style.color="#60afdf",Ne.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ne,v),u=!0);continue}let E=0;const se=document.createDocumentFragment();if(D.forEach(j=>{const Oe=j.index,Ne=j[0];if(Oe>E){const mn=y.substring(E,Oe);mn&&se.appendChild(document.createTextNode(mn))}const st=Ne.startsWith("http://")||Ne.startsWith("https://")?Ne:`https://${Ne}`,yn=document.createElement("a");yn.href=st,yn.textContent=Ne,yn.style.color="#60afdf",yn.style.textDecoration="underline",se.appendChild(yn),E=Oe+Ne.length}),E<y.length){const j=y.substring(E);j&&se.appendChild(document.createTextNode(j))}v.parentNode&&se.childNodes.length>0&&(v.parentNode.replaceChild(se,v),u=!0)}u&&l&&e.nextTick(()=>{Ln(l),wn()})},Eo=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const y=document.createDocumentFragment();m.forEach(_=>{const D=_.index,E=_[0].startsWith("<u>")?"u":"ins",se=_[1]||_[2]||"";D>v&&y.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(E);j.textContent=se,y.appendChild(j),v=D+_[0].length}),v<u.length&&y.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},So=o=>{if(!f.value||Q.value)return;if(!o){Eo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let mn="",ln=0,pn=!1;const rn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Wn=>Wn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let cn=0;for(;rn.nextNode();){const Wn=rn.currentNode,ol=Wn.textContent||"",dl=cn;if(cn+=ol.length,Wn===r.startContainer){mn+=ol.substring(0,r.startOffset),ln=dl+r.startOffset,pn=!0;break}mn+=ol}return pn||(ln=mn.length),{textBeforeCursor:mn,cursorCharOffset:ln}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],_=m[1],D=u.length-y.length,se=(mn=>{let ln=0;const pn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:cn=>cn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let rn;for(;rn=pn.nextNode();){const cn=(rn.textContent||"").length;if(ln+cn>=mn)return{node:rn,offset:mn-ln};ln+=cn}return null})(D);if(!se)return;const j=document.createRange();j.setStart(se.node,se.offset),j.setEnd(r.endContainer,r.endOffset);const Oe=document.createElement(v);Oe.textContent=_,j.deleteContents(),j.insertNode(Oe);const Ne=window.getSelection(),st=document.createRange();st.setStartAfter(Oe),st.collapse(!0),Ne.removeAllRanges(),Ne.addRange(st);const yn=$n();e.nextTick(()=>{ie(),yn&&Ln(yn)})},so=()=>{f.value&&(qt.value=$n(),Rt.value="",It.value="",je.value="",ae.value="",me.value="",Qt.value=null,kt.value=null,_e.value="upload",Et.value=!0,on(),e.nextTick(()=>{Pe.value&&Pe.value.focus(),Re.value&&(Re.value.value="")}))},Kn=o=>{const l=o.target?.files?.[0];if(!l){Qt.value=null,It.value="";return}Qt.value=l;const s=new FileReader;s.onload=r=>{It.value=r.target?.result||""},s.readAsDataURL(l)},Gn=()=>{Re.value&&Re.value.click()},Xl=()=>{ae.value&&(me.value="")},ro=()=>{me.value&&(ae.value="")},Vo=()=>{let o=kt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";kt.value=o,Rt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(je.value=s,It.value="",_e.value="url"):(It.value=s,je.value="",_e.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";ae.value=c.endsWith("px")?c.replace("px",""):c,me.value=d.endsWith("px")?d.replace("px",""):d,qt.value=null}else{so();return}Et.value=!0,he.value=!1,Bt.value=!1,e.nextTick(()=>{_e.value==="url"&&Wt.value?(Wt.value.focus(),Wt.value.select()):Pe.value&&(Pe.value.focus(),Pe.value.select()),Re.value&&(Re.value.value="")})},Nl=()=>{Et.value=!1,Rt.value="",It.value="",je.value="",ae.value="",me.value="",Qt.value=null,kt.value=null,qt.value=null,_e.value="upload"},An=()=>{const o=(Rt.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt();const s=_e.value==="url"?je.value.trim():It.value;if(kt.value&&f.value&&f.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),ae.value?(kt.value.style.width=`${ae.value}px`,kt.value.setAttribute("width",ae.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),me.value?(kt.value.style.height=`${me.value}px`,kt.value.setAttribute("height",me.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),r.addRange(c)}ie()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Nl();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(qt.value&&(Ln(qt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Nl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),ae.value&&(v.style.width=`${ae.value}px`,v.setAttribute("width",ae.value)),me.value&&(v.style.height=`${me.value}px`,v.setAttribute("height",me.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const D=document.createElement("p");f.value.appendChild(D),D.appendChild(v)}else{const D=f.value.lastChild;if(D&&D.nodeType===1)D.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}kt.value=v,ie()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),wn(),tn(),Nl()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!Q.value){const l=Dn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=$n();f.value.innerHTML=l,e.nextTick(()=>{ht();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";Je.value=u,le.value=m,U.value=v,St.value=u,Y.value=m,ge.value=v,tt.value=[],Tt.value=[],Xe.value&&(clearTimeout(Xe.value),Xe.value=null),Be.value=!1,d&&Ln(d),k(),gn(),De(),wn(),tn(),wt(),kn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(tn(),e.nextTick(()=>{uo()})):(Rl(),J.value=[],Ze.value&&(Ze.value.disconnect(),Ze.value=null)),wt()}),e.watch(()=>A.floatingToolbar,o=>{o?tn():Rl()}),e.watch(()=>A.disabled,o=>{o&&Rl(),wt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{V.value?Nn():fl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{Ut.value?_n():vn()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{Gt()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(Pn.value){Pn.value=!1;return}Dl.value||A.richText&&f.value&&e.nextTick(()=>{En()})},{deep:!0,immediate:!1});const En=()=>{if(!Dl.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Dl.value=!0;try{const o=new Set,l=A.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const y=f.value.querySelector(`[data-comment="${v}"]`);if(y){Kt(y,u),d.add(v);return}try{const _=Xo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const D=_.commonAncestorContainer,E=D.nodeType===3?D.parentElement:D;if(E){const Oe=E.closest("[data-comment], [data-fake-comment]");if(Oe){const Ne=Oe.getAttribute("data-comment")||Oe.getAttribute("data-fake-comment");if(String(Ne)===String(m)){Oe.setAttribute("data-comment",v),Oe.removeAttribute("data-fake-comment"),Kt(Oe,u),d.add(v);return}else return}}const se=f.value.querySelector(`[data-comment="${v}"]`);if(se){Kt(se,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{_.surroundContents(j),c++,d.add(v)}catch{try{const Ne=document.createRange();Ne.setStart(_.startContainer,_.startOffset),Ne.setEnd(_.endContainer,_.endOffset),io(Ne),Ne.surroundContents(j),c++,d.add(v)}catch{try{const st=_.extractContents();j.appendChild(st),_.insertNode(j),c++,d.add(v)}catch(st){console.warn("Failed to create comment marker:",st)}}}}}catch{}}),e.nextTick(()=>{kn("restoreCommentsFromModel"),ie(),Dl.value=!1})}catch{Dl.value=!1}}},io=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Zt(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!No(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Zt=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},No=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Xo=(o,l)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?io(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},kn=(o="unknown")=>{if(!A.richText||!f.value){J.value=[];return}Date.now()-Nt.value<zt&>.value!==null||gt.value===null&&(gt.value=requestAnimationFrame(()=>{if(gt.value=null,Nt.value=Date.now(),xe.value)return;xe.value=!0;const s={},r=f.value;if(!r){xe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){xe.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");se&&E.tagName==="SPAN"&&(m.has(se)||(u.push(E),m.add(se)))}),d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!se||m.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(E),m.add(se)):E.tagName!=="SPAN"&&(u.push(E),m.add(se)))});const v=c.getBoundingClientRect(),y=r.getBoundingClientRect();u.forEach((E,se)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const al=E.textContent?.trim(),Qn=A.comments?.find(qn=>(typeof qn.conversation_id=="string"&&qn.conversation_id.startsWith("comment-")?null:qn.conversation_id)&&qn.selection_text?.trim()===al);Qn?(j=String(Qn.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Oe=E.getBoundingClientRect(),Ne=window.getComputedStyle(E),st=parseFloat(Ne.lineHeight)||parseFloat(Ne.fontSize)*1.2,ln=Oe.top-y.top+st/2-15,rn=y.top-v.top+ln;let cn=null,Wn=null,ol=0;const dl=[],mo=new Set;if(j&&A.comments){const al=A.comments.find(Qn=>String(Qn.conversation_id||Qn.id)===String(j));if(al){const Qn=al.conversation||[];Qn.length>0?(Qn.forEach(qn=>{qn.user&&qn.user.id&&!mo.has(qn.user.id)&&(mo.add(qn.user.id),dl.push(qn.user))}),ol=Qn.length):(ol=0,cn=null,Wn=null),dl.length>0?cn=dl[0]:cn=null,dl.length>1?Wn=dl[1]:Wn=null}}const _o=Oe.top+st/2-15,Yo=_o+30,Cl=5,po=Yo>y.top+Cl&&_o<y.bottom-Cl?1:0;J.value.find(al=>al.id===j);let Yl=E;if(!Yl&&j&&f.value){const al=String(j);Yl=f.value.querySelector(`[data-comment="${al}"], [data-fake-comment="${al}"]`)}const $o=dl.length;s[j]?(s[j].top=rn,s[j].opacity=po,s[j].element=Yl,s[j].firstUser=cn,s[j].secondUser=Wn,s[j].totalCount=ol,s[j].uniqueUserCount=$o):s[j]={id:j,top:rn,opacity:po,element:Yl,firstUser:cn,secondUser:Wn,totalCount:ol,uniqueUserCount:$o}});const _=Object.values(s).map(E=>{const se=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Oe=String(E.id);E.element=f.value.querySelector(`[data-comment="${Oe}"], [data-fake-comment="${Oe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:se}});(J.value.length!==_.length||_.some((E,se)=>{const j=J.value[se];if(!j)return!0;const Oe=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ne=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Oe||Ne||j.element!==E.element}))&&(J.value=_),xe.value=!1}))},Bo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(Cn(),ue.value=l,l.classList.add("editor-comment-highlighted"))},Cn=(o=!1)=>{!o&&O.value!==null&&ue.value&&(ue.value.getAttribute("data-comment")||ue.value.getAttribute("data-fake-comment"))===O.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),ue.value&&(ue.value.classList.remove("editor-comment-highlighted"),ue.value=null))},co=o=>{if(!o||!o.element)return;Cn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;pe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Bl=()=>{Cn()},uo=()=>{!A.richText||!f.value||(Ze.value&&Ze.value.disconnect(),$t.value!==null&&(clearTimeout($t.value),$t.value=null),Ze.value=new MutationObserver(()=>{$t.value===null&&($t.value=setTimeout(()=>{$t.value=null,e.nextTick(()=>{kn("MutationObserver")})},200))}),Ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),kn("setupCommentMarkersObserver-initial"))},Mo=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Qe.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,rt.value],()=>{be.value==="askAi"||rt.value==="askAi"?e.nextTick(()=>{hn()}):(Qe.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>A.locale,o=>{o&&o!==fe.value&&(fe.value=o)},{immediate:!0}),oe({openCommentOverlayForSelector:bo,updateCommentMarkers:kn,restoreCommentsFromModel:En}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",it.value]),style:e.normalizeStyle(Ct.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Lu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:bt,title:e.unref(L)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Sn.value}]),onClick:re,title:e.unref(L)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Au),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Du,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>el("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ou)):(e.openBlock(),e.createElementBlock("svg",Wu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Hu),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>Yn("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Yn("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Yn("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Yn("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Yn("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Yn("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Yn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("bold")}]),onClick:l[9]||(l[9]=s=>bn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("italic")}]),onClick:l[10]||(l[10]=s=>bn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("underline")}]),onClick:l[11]||(l[11]=s=>bn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ge.value}]),onClick:Ll,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Ju),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:tl,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,td)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Wl,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,ed)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("insertUnorderedList")}]),onClick:In,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("insertOrderedList")}]),onClick:Tl,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ld),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:so,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,od),Z.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:ho},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>el("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",ud,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,cd),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ne(s)?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),ne(s)&&r<T.customToolbarSlots.length-1&&Ae(r)?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:on})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:Ie.value,width:"500px",height:"55vh",onCloseModal:zl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fd,[e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ye,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,hd),[[e.vModelText,vt.value]])]),e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:q,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>ot.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,Cd),[[e.vModelText,ot.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:zl},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:Et.value,width:"500px",height:"80vh",onCloseModal:Nl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":_e.value==="upload"}]),onClick:l[17]||(l[17]=s=>_e.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":_e.value==="url"}]),onClick:l[18]||(l[18]=s=>_e.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),_e.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),sl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Gn},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Vd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Re,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Kn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Re,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Kn},null,544))]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Pe,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,Md),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:Xl},null,40,Ld),[[e.vModelText,ae.value]])]),e.createElementVNode("div",Td,[e.createElementVNode("label",Ad,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:ro},null,40,Dd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0),_e.value==="url"?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Wt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>je.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(An,["enter"])},null,40,zd),[[e.vModelText,je.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>Rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,Wd),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:Xl},null,40,Ud),[[e.vModelText,ae.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:ro},null,40,jd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Nl},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:An},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":pt.value&&Ut.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[Ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gd,[T.title?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(R.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ke,value:T.title,onInput:Hn,onFocus:to,onBlur:rl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ut.value}]),placeholder:R.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),pt.value&&Ut.value?(e.openBlock(),e.createElementBlock("div",t1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":dn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l1,[T.description?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(W.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Le,value:T.description,onInput:xl,onFocus:wl,onBlur:Ol,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:W.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),dn.value&&V.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":O.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>Bo(s),onMouseleave:Bl},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,c1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,p1)):(e.openBlock(),e.createElementBlock("span",f1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,m1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>co(s),["stop"])},[e.createElementVNode("span",g1,"+"+e.toDisplayString(s.additionalCount),1)],12,v1)):e.createCommentVNode("",!0)],46,i1))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(Xn.value),onInput:ie,onBlur:Fe,onClick:gl,onMouseup:Dt,onKeyup:Dt,onKeydown:oo,onPaste:qo,onMousemove:Zo,onMouseleave:kl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[O.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(yt.value)},[an.value||sn.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[an.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:an.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,_1)):(e.openBlock(),e.createElementBlock("span",$1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",L1,[e.createElementVNode("div",T1,[e.createElementVNode("div",A1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",D1,e.toDisplayString(pl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":_l(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!_l(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Oo(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,H1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",R1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Yt,"onUpdate:modelValue":l[26]||(l[26]=s=>Mt.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Yt.value){const s=Yt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,Mt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yo,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",I1,[e.createElementVNode("div",z1,[e.createElementVNode("span",P1,e.toDisplayString(Xt.value)+" "+e.toDisplayString(Xt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",O1,e.toDisplayString(Fn.value)+" "+e.toDisplayString(Fn.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("textarea",{value:T.modelValue,onInput:Pl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:I.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Jn.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(Xt.value)+" "+e.toDisplayString(Xt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Fn.value)+" "+e.toDisplayString(Fn.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&de.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:l[28]||(l[28]=s=>Ee.value=!0),onMouseleave:Vl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Il,["stop"]),title:de.value},e.toDisplayString(de.value),9,W1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Z1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,q1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Bt.value&&Pt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(G.value),onMouseenter:l[29]||(l[29]=s=>he.value=!0),onMouseleave:Fl},[e.createElementVNode("div",U1,[Pt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",X1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Pt.value},e.toDisplayString(Pt.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",K1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,j1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&We.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ct,class:"dss-floating-toolbar",style:e.normalizeStyle(we.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",G1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(bt,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Sn.value}]),onClick:e.withModifiers(re,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,J1),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",em,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>Sl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,rm)):(e.openBlock(),e.createElementBlock("svg",im,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,tm),rt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=s=>Rn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>Rn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>Rn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>Rn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>Rn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>Rn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>Rn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>bn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>bn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>bn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ge.value}]),onClick:e.withModifiers(Ll,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,mm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(tl,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,fm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Wl,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,pm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("insertUnorderedList")}]),onClick:e.withModifiers(In,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("insertOrderedList")}]),onClick:e.withModifiers(Tl,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,gm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,hm),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(ho,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,ym),T.askAi?(e.openBlock(),e.createElementBlock("div",km)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>Sl("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",wm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,bm),rt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),at.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&at.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ne(s)&&mt(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),ne(s)&&mt(s)&&r<T.customToolbarSlots.length-1&&dt(r)?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mm={class:"dss-color-picker__section-title"},_m={class:"dss-color-picker__presets-row"},$m=["title","onClick"],Lm={key:1,class:"dss-color-picker__section"},Tm={class:"dss-color-picker__presets-row"},Am=["title","onClick"],Dm={key:2,class:"dss-color-picker__section"},Hm={class:"dss-color-picker__section-header"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im=["onClick"],zm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Pm=["title","onClick"],Om={class:"dss-color-picker__input-row"},Wm=["value"],qm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(T,{emit:oe}){function M(le){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(le);if(!U)return{h:0,s:0,l:50};const Y=parseInt(U[1],16)/255,ge=parseInt(U[2],16)/255,ke=parseInt(U[3],16)/255,Le=Math.max(Y,ge,ke),xt=Math.min(Y,ge,ke);let Jt=0,Vt=0;const Ut=(Le+xt)/2;if(Le!==xt){const V=Le-xt;switch(Vt=Ut>.5?V/(2-Le-xt):V/(Le+xt),Le){case Y:Jt=((ge-ke)/V+(ge<ke?6:0))/6;break;case ge:Jt=((ke-Y)/V+2)/6;break;case ke:Jt=((Y-ge)/V+4)/6;break}}return{h:Jt*360,s:Vt*100,l:Ut*100}}function L(le,U,Y){U/=100,Y/=100;const ge=U*Math.min(Y,1-Y),ke=Le=>{const xt=(Le+le/30)%12,Jt=Y-ge*Math.max(Math.min(xt-3,9-xt,1),-1);return Math.round(255*Jt).toString(16).padStart(2,"0")};return`#${ke(0)}${ke(8)}${ke(4)}`}function fe(le){const U=le.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let Y=U[1];return Y.length===3&&(Y=Y.split("").map(ge=>ge+ge).join("")),"#"+Y}function P(le){const U=le.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!U)return null;const Y=Math.max(0,Math.min(255,Number.parseInt(U[1],10))),ge=Math.max(0,Math.min(255,Number.parseInt(U[2],10))),ke=Math.max(0,Math.min(255,Number.parseInt(U[3],10)));return`#${Y.toString(16).padStart(2,"0")}${ge.toString(16).padStart(2,"0")}${ke.toString(16).padStart(2,"0")}`}function A(le){if(typeof le!="string")return null;const U=le.trim();return fe(U)||P(U)}function pe(le,U,Y){U/=100,Y/=100;const ge=Y+U*Math.min(Y,1-Y),ke=ge===0?0:2-2*Y/ge;return{h:le,s:ke*100,v:ge*100}}function ft(le,U,Y){U/=100,Y/=100;const ge=Y*(1-U/2),ke=ge===0||ge===1?0:(Y-ge)/Math.min(ge,1-ge);return{h:le,s:ke*100,l:ge*100}}const ee=T,f=oe,be=e.ref(!1),Ce=e.ref(!1),Q=e.ref(!1),X=e.ref(-1),de=e.ref(-1),H=e.ref(null),Ee=e.ref(null),Ie=e.ref(null),ot=e.ref(null),vt=e.ref({top:0,left:0}),q=e.ref(M(ee.modelValue||"#b8a5de")),Ye=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Se=e.computed(()=>Ye.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:de.value<0?null:de.value),$e=e.computed(()=>{const le=Se.value;return le==null?!0:Math.max(0,ee.presetColors.length-le)<ee.max}),Ge=e.computed(()=>!!(Ce.value||X.value>=0||!K.value&&ee.presetColors.length===0));e.computed(()=>{const le=Se.value;return le!=null&&ee.presetColors.length>le});const K=e.computed(()=>Ye.value||Se.value!=null),We=e.computed(()=>{const le=Se.value;return le==null?[]:ee.presetColors.slice(0,le)}),we=e.computed(()=>{const le=Se.value;return le==null?[]:ee.presetColors.slice(le)});function ct(le){const U=Se.value;return U!=null?U+le:-1}function rt(le){const U=Se.value;return U!=null&&le>=U}function Et(le){rt(le)&&(X.value=le,q.value=M(ee.presetColors[le]),Ce.value=!0,e.nextTick(()=>ot.value?.focus()))}function Rt(le){if(!rt(le))return;const U=ee.presetColors.filter((ke,Le)=>Le!==le);f("update:presetColors",U);const Y=fe(ee.modelValue),ge=fe(ee.presetColors[le]);if(Y&&ge&&Y.toLowerCase()===ge.toLowerCase()){const ke=U[Math.max(0,le-1)]||U[0];ke&&f("update:modelValue",ke)}}function Qt(){Q.value=!Q.value,Q.value||(X.value=-1,Ce.value=!1)}function It(){if(!qe.value||X.value<0)return;const le=Re.value,U=fe(le);if(U){const Y=[...ee.presetColors];Y[X.value]=U,f("update:presetColors",Y),f("update:modelValue",U),X.value=-1,Ce.value=!1}}function ae(){ee.disabled||!qe.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(he(),e.nextTick(()=>ot.value?.focus())))}function me(le){const U=A(le),Y=A(ee.modelValue);return U&&Y&&U.toLowerCase()===Y.toLowerCase()}function Pe(){if(ee.disabled||!qe.value||!$e.value)return;const le=Re.value,U=fe(le);if(U){const Y=[...ee.presetColors,U];f("update:presetColors",Y),f("update:modelValue",U);const ge=Se.value??de.value;ge>=0&&Y.length-ge>=ee.max&&(Ce.value=!1)}}const Re=e.computed(()=>{const{h:le,s:U,l:Y}=q.value;return L(le,U,Y)}),Wt=e.computed(()=>Re.value.toLowerCase()),kt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${q.value.h}, 100%, 50%))`})),qt=e.computed(()=>{const le=pe(q.value.h,q.value.s,q.value.l);return{left:`${le.s}%`,bottom:`${le.v}%`,transform:"translate(-50%, 50%)"}}),Bt=e.computed(()=>({left:`${q.value.h/360*100}%`,transform:"translateX(-50%)"})),Pt=e.computed(()=>({position:"fixed",left:`${vt.value.left}px`,top:`${vt.value.top}px`,zIndex:1002}));function G(){if(!H.value||!be.value)return;const le=H.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let Y=le.bottom+4;const ge=Ee.value;ge&&Y+ge.offsetHeight>U-8&&(Y=le.top-4-ge.offsetHeight),vt.value={top:Y,left:le.left}}function he(){const le=ee.modelValue||"#b8a5de",U=A(le);U&&(q.value=M(U))}function _e(){f("update:modelValue",Re.value)}function je(){ee.disabled||(be.value=!be.value,be.value&&(he(),e.nextTick(()=>{G(),ot.value?.focus()})))}function Qe(){const le=Re.value,U=fe(le);if(U){if(X.value>=0){const Y=[...ee.presetColors];Y[X.value]=U,f("update:presetColors",Y),f("update:modelValue",U)}else if(qe.value&&(ee.presetColors.length>0||Ye.value)&&Ce.value&&$e.value&&!ee.presetColors.some(ge=>fe(ge)?.toLowerCase()===U.toLowerCase())){const ge=[...ee.presetColors,U];f("update:presetColors",ge),f("update:modelValue",U)}}be.value=!1,Ce.value=!1,Q.value=!1,X.value=-1}function Lt(le){if(!Ie.value)return;const U=Ie.value.getBoundingClientRect(),Y=ge=>{const ke=Math.max(0,Math.min(1,(ge.clientX-U.left)/U.width)),Le=Math.max(0,Math.min(1,1-(ge.clientY-U.top)/U.height)),xt={h:q.value.h,s:ke*100,v:Le*100};q.value=ft(xt.h,xt.s,xt.v)};Y(le),document.addEventListener("mousemove",Y),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Y),_e()},{once:!0})}function tt(le){if(!le.currentTarget)return;const Y=le.currentTarget.getBoundingClientRect(),ge=ke=>{const Le=Math.max(0,Math.min(1,(ke.clientX-Y.left)/Y.width));q.value={...q.value,h:Le*360}};ge(le),document.addEventListener("mousemove",ge),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ge),_e()},{once:!0})}function Tt(le){const U=le.target.value,Y=A(U);Y&&(q.value=M(Y),f("update:modelValue",Y))}function Xe(le){if(ee.disabled)return;const U=A(le);U&&(q.value=M(U),f("update:modelValue",U))}let Be=null,Je=null;function St(){Be&&(document.removeEventListener("keydown",Be),Be=null),Je&&(window.removeEventListener("resize",Je),Je=null)}return e.watch(be,le=>{if(St(),le){if(!Ye.value&&ee.initialPresetCount==null){const U=ee.presetColors.length;U>0&&(de.value<0||U<de.value)&&(de.value=U)}Be=U=>{U.key==="Escape"&&Qe()},Je=G,document.addEventListener("keydown",Be),window.addEventListener("resize",Je)}}),e.watch(()=>ee.modelValue,()=>{be.value&&he()},{immediate:!1}),e.watch(we,le=>{le.length===0&&(Q.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount(St),(le,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":T.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:H,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:je},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Re.value})},[...U[0]||(U[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Qe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Pt.value)},[K.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ye.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(Y,ge)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ge,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(Y.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.colors,(ke,Le)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ge+"-"+Le,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(ke)}]),style:e.normalizeStyle({backgroundColor:ke,"--dss-preset-color":ke}),title:ke,onClick:e.withModifiers(xt=>Xe(ke),["stop"])},null,14,$m))),128))])]))),128)):We.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(Y,ge)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(Y)}]),style:e.normalizeStyle({backgroundColor:Y,"--dss-preset-color":Y}),title:Y,onClick:e.withModifiers(ke=>Xe(Y),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",Dm,[e.createElementVNode("div",Hm,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),we.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":Q.value}]),title:"Manage custom colors",onClick:e.withModifiers(Qt,["stop"])},[...U[2]||(U[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(Y,ge)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ge,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Q.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Q.value&&me(Y),"dss-color-picker__preset-bubble--editing":Q.value&&X.value===ct(ge)}]),style:e.normalizeStyle({backgroundColor:X.value===ct(ge)?Re.value:Y,"--dss-preset-color":X.value===ct(ge)?Re.value:Y}),title:X.value===ct(ge)?Re.value:Y,onClick:e.withModifiers(ke=>Q.value?Et(ct(ge)):Xe(Y),["stop"])},null,14,Fm),Q.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ke=>Rt(ct(ge)),["stop"])},[...U[4]||(U[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Im)):e.createCommentVNode("",!0)],2))),128)),$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(ae,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):T.presetColors.length?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.presetColors,(Y,ge)=>(e.openBlock(),e.createElementBlock("button",{key:ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(Y)}]),style:e.normalizeStyle({backgroundColor:Y,"--dss-preset-color":Y}),title:Y,onClick:e.withModifiers(ke=>Xe(Y),["stop"])},null,14,Pm))),128)),qe.value&&$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(ae,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ie,onMousedown:Lt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(kt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(qt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:tt},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Bt.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ot,type:"text",class:"dss-color-picker__hex-input",value:Wt.value,onInput:Tt},null,40,Wm)]),qe.value&&K.value&&(T.presetColors.length||Ye.value)&&$e.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Pe}," Save color ")):e.createCommentVNode("",!0),qe.value&&K.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),K.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Qe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Zm={key:0,class:"dss-loader"},Um={key:0,class:"dss-loader-label"},Xm={key:1,class:"dss-loader"},Ym={key:0,class:"dss-loader-label"},jm={key:2,class:"dss-loader"},Km={key:0,class:"dss-loader-label"},Gm={key:3,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:4,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:5,class:"dss-loader dss-loader--inline"},n2={class:"dss-loader-inline-text"},l2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(T){const oe=T,M=e.computed(()=>oe.size==="small"?"dss-loaders--size-small":oe.size==="large"?"dss-loaders--size-large":oe.size==="medium"||oe.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const fe={};if(!(oe.size==="small"||oe.size==="medium"||oe.size==="large"||oe.size==null)){const P=typeof oe.size=="number"?`${oe.size}px`:String(oe.size);fe["--dss-loader-size"]=P}return oe.color&&(fe["--dss-loader-accent"]=oe.color,fe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${oe.color} 30%, white)`),fe});return(fe,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle(L.value)},[T.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Zm,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="dots"?(e.openBlock(),e.createElementBlock("div",Xm,[P[1]||(P[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Ym,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="battery"?(e.openBlock(),e.createElementBlock("div",jm,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Km,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Gm,[P[3]||(P[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="bars"?(e.openBlock(),e.createElementBlock("div",Jm,[P[4]||(P[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="inline"?(e.openBlock(),e.createElementBlock("div",t2,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(fe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])])])):e.createCommentVNode("",!0)],6))}},ia="dss-skeleton-item",o2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:T=>["single","multiple"].includes(T)},targetClass:{type:String,default:ia},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(T){const oe=T,M=e.computed(()=>{const P={"dss-skeleton--loading":oe.loading,"dss-skeleton--static":!oe.shimmer,"dss-skeleton--multiple":oe.mode==="multiple","dss-skeleton--dark":oe.darkMode};return oe.mode==="multiple"&&oe.targetClass!==ia&&(P[`dss-skeleton--target-${oe.targetClass}`]=!0),P}),L=e.computed(()=>{const P={};return oe.borderRadius&&(P.borderRadius=oe.borderRadius),P}),fe=e.computed(()=>{const P={};return oe.borderRadius&&(P["--dss-skeleton-border-radius"]=oe.borderRadius),oe.darkMode?(P["--dss-skeleton-bg"]=oe.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=oe.shimmerDark||"#3e3f41",P):(oe.bgColor&&(P["--dss-skeleton-bg"]=oe.bgColor),oe.shimmerColor&&(P["--dss-skeleton-shimmer"]=oe.shimmerColor),P)});return(P,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(fe.value)},[T.loading&&T.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":T.loading&&T.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},a2={key:0,class:"dss-dnd-column-header"},s2={class:"dss-dnd-column-title"},r2={class:"dss-dnd-column-count"},i2=["data-column"],c2={key:0,class:"dss-dnd-indicator"},u2=["onPointerdown"],d2=["onPointerdown"],m2={class:"dss-dnd-item-content"},p2={class:"dss-dnd-item-default"},f2={key:0,class:"dss-dnd-empty"},v2={name:"DSSDnd"},g2=Object.assign(v2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(T,{emit:oe}){const M=T,L=oe,fe=e.useSlots(),P=e.computed(()=>!!fe["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},pe=e.computed(()=>({...A,...M.options})),ft=e.computed(()=>({"--dss-dnd-col-min-w":pe.value.columnMinWidth,"--dss-dnd-col-max-w":pe.value.columnMaxWidth,"--dss-dnd-col-gap":pe.value.columnGap,"--dss-dnd-indicator-color":pe.value.indicatorColor,"--dss-dnd-body-max-h":pe.value.columnBodyMaxHeight}));function ee(G){if(!pe.value.ColColor||!G)return{};const he=G.background||G.color;return he?{background:he}:{}}const f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),Q=e.ref(-1),X=e.ref(null);let de=null,H=null,Ee=null,Ie=null,ot=0,vt=0,q="",Ye=null;const qe=5,Se=e.computed(()=>{const G={};for(const he of M.columns)G[he.value]=M.items.filter(_e=>_e[M.columnKey]===he.value).sort((_e,je)=>(_e[M.positionKey]??0)-(je[M.positionKey]??0));return G}),$e=e.computed(()=>{const G={},he=!!f.value,_e=f.value?.[M.itemKey],je=be.value,Qe=Q.value;for(const Lt of M.columns){const tt=Se.value[Lt.value]||[],Tt=[],Xe=je==Lt.value;let Be=0;for(let Je=0;Je<tt.length;Je++){const St=tt[Je],le=he&&St[M.itemKey]===_e;!le&&Xe&&Qe===Be&&Tt.push({type:"indicator",key:`ind-${Be}`}),le||Be++,Tt.push({type:"item",item:St,isDragged:le,key:`item-${St[M.itemKey]}`})}Xe&&Qe>=Be&&Tt.push({type:"indicator",key:"ind-end"}),G[Lt.value]=Tt}return G});function Ge(G,he){const je=(Se.value[G]||[]).filter(tt=>tt[M.itemKey]!==f.value?.[M.itemKey]);if(je.length===0)return 1;if(he<=0){const tt=je[0][M.positionKey];return tt!=null&&tt>0?tt/2:.5}if(he>=je.length){const tt=je[je.length-1][M.positionKey];return(tt??0)+1}const Qe=je[he-1][M.positionKey]??0,Lt=je[he][M.positionKey]??0;return(Qe+Lt)/2}function K(G,he,_e){Ee&&Ee.remove();const je=G.getBoundingClientRect(),Qe=G.cloneNode(!0);Qe.classList.add("dss-dnd-ghost"),Qe.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
|
-
left: ${
|
|
106
|
-
top: ${
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
105
|
+
left: ${he-ot}px;
|
|
106
|
+
top: ${_e-vt}px;
|
|
107
|
+
width: ${je.width}px;
|
|
108
|
+
height: ${je.height}px;
|
|
109
109
|
z-index: 9999;
|
|
110
110
|
pointer-events: none;
|
|
111
|
-
opacity: ${
|
|
111
|
+
opacity: ${pe.value.dragGhostOpacity};
|
|
112
112
|
box-sizing: border-box;
|
|
113
113
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
114
|
-
background-color: ${
|
|
114
|
+
background-color: ${pe.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(lt),be=lt}function Fe(J,ye){be&&(be.style.left=`${J-Pe}px`,be.style.top=`${ye-ut}px`)}function xe(J){J.classList.add("dss-dnd-item--dragging"),J.style.background=X.value.dragSourceBackground,J.style.borderColor=X.value.dragSourceBorder,J.style.transform="scale(0.97)"}function ht(J){J.classList.remove("dss-dnd-item--dragging"),J.style.background="",J.style.borderColor="",J.style.transform=""}function ct(J,ye){return document.elementFromPoint(J,ye)?.closest(".dss-dnd-column-body")??null}function St(J,ye){return!!document.elementFromPoint(J,ye)?.closest("[data-dss-dnd-delete-zone]")}function At(J,ye){if(I.value&&St(J,ye)){he.value=!0,Ce.value=null,le.value=-1;return}he.value=!1;const Be=ct(J,ye),We=Be?.getAttribute("data-column")??null;if(!We){Ce.value=null,le.value=-1;return}Ce.value=We;const lt=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Vt=lt.length;for(let je=0;je<lt.length;je++){const Nt=lt[je].getBoundingClientRect();if(ye<Nt.top+Nt.height/2){Vt=je;break}}le.value=Vt}function qt(J){J.preventDefault(),Fe(J.clientX,J.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,At(J.clientX,J.clientY)}))}function It(J){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Ae?.releasePointerCapture?.(J.pointerId),ht(Ae),Ae=null;const ye=I.value&&St(J.clientX,J.clientY);if(f.value&&ye)L("delete",{item:f.value});else{const We=ct(J.clientX,J.clientY)?.getAttribute("data-column")??null;if(f.value&&We){const lt=f.value[_.columnKey],Vt=We,Nt=(Ve.value[Vt]||[]).filter(K=>K[_.itemKey]!==f.value[_.itemKey]),Ke=Math.max(0,Math.min(le.value,Nt.length)),W=Xe(Vt,Ke),q=f.value[_.itemKey];L("move",{item:f.value,from:lt,to:Vt,position:W,index:Ke}),H&&clearTimeout(H),oe.value={id:q,from:lt,to:Vt},H=setTimeout(()=>{oe.value=null},3500)}}be&&(be.remove(),be=null),U!==null&&(document.body.style.cursor=U,U=""),zt()}function Q(J,ye){J.preventDefault();const Be=J.target.closest(".dss-dnd-item");if(!Be)return;const We=Be.getBoundingClientRect();Pe=J.clientX-We.left,ut=J.clientY-We.top,U=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=ye,Ae=Be,G(Be,J.clientX,J.clientY),requestAnimationFrame(()=>xe(Be)),Be.setPointerCapture?.(J.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function pe(){Ue&&(window.removeEventListener("pointermove",He),window.removeEventListener("pointerup",Ye),window.removeEventListener("pointercancel",Ye),Ue=null)}function He(J){if(!Ue||J.pointerId!==Ue.pointerId)return;const ye=J.clientX-Ue.startX,Be=J.clientY-Ue.startY;if(Math.abs(ye)>=Qe||Math.abs(Be)>=Qe){const We=Ue.item;pe(),Q(J,We)}}function Ye(J){!Ue||J.pointerId!==Ue.pointerId||pe()}function Zt(J,ye){pe(),Ue={item:ye,startX:J.clientX,startY:J.clientY,pointerId:J.pointerId},window.addEventListener("pointermove",He),window.addEventListener("pointerup",Ye),window.addEventListener("pointercancel",Ye)}function kt(J,ye){X.value.useHandle||Zt(J,ye)}function Ot(J,ye){Zt(J,ye)}function xt(){me&&(cancelAnimationFrame(me),me=null)}function zt(){xt(),f.value=null,Ce.value=null,he.value=!1,le.value=-1}return e.onBeforeUnmount(()=>{xt(),pe(),H&&clearTimeout(H),be&&(be.remove(),be=null)}),(J,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(Ge.value)},[I.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":he.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(J.$slots,"delete-zone",{isDragging:!!f.value,isOver:he.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Ce.value==Be.value},Be.class||""]]),style:e.normalizeStyle(ge(Be))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(J.$slots,"column-header",{column:Be,items:Ve.value[Be.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",r2,e.toDisplayString((Ve.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Be.value],We=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:We.key},[We.type==="indicator"?(e.openBlock(),e.createElementBlock("div",c2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":We.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:lt=>kt(lt,We.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(lt=>Ot(lt,We.item),["stop"])},[e.renderSlot(J.$slots,"handle",{},()=>[ye[0]||(ye[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,d2)):e.createCommentVNode("",!0),e.createElementVNode("div",m2,[e.renderSlot(J.$slots,"item",{item:We.item,column:Be,justDropped:oe.value?.id===We.item[T.itemKey],droppedFrom:oe.value?.id===We.item[T.itemKey]?oe.value.from:null,droppedTo:oe.value?.id===We.item[T.itemKey]?oe.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(We.item[T.itemKey]),1)])])],42,u2))],64))),128)),(Ve.value[Be.value]||[]).length===0&&Ce.value!=Be.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(J.$slots,"empty",{column:Be},()=>[ye[1]||(ye[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,i2)],6))),128))],6))}}),h2={name:"DSSConfetti"},y2=Object.assign(h2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(T){const ne=T,_=e.ref(null),L=e.ref(!1);let ue=[],I=null,A=null;function X(le,oe){const me=[];for(let H=0;H<ne.count;H++)me.push(Ge(le));return me}function Ge(le,oe){return{x:Math.random()*le,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ne.colors[Math.floor(Math.random()*ne.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ge(le,oe,me,H){le.clearRect(0,0,oe,me);for(const be of ue)le.save(),le.globalAlpha=be.opacity*H,le.beginPath(),le.lineWidth=be.r,le.strokeStyle=be.color,le.moveTo(be.x+be.tilt+be.r/2,be.y),le.lineTo(be.x+be.tilt,be.y+be.tilt+be.r/2),le.stroke(),le.restore()}function f(le,oe,me){const H=.3+me*.7;for(let be=0;be<ue.length;be++){const Ae=ue[be];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*H,Ae.x+=Math.sin(Ae.d)*.5*H,Ae.tilt=Math.sin(Ae.tiltAngle)*15,me>=.99&&Ae.y>oe+20&&(ue[be]=Ge(le))}}function Ce(){L.value=!0,e.nextTick(()=>{const le=_.value;if(!le)return;const oe=le.getContext("2d"),me=le.parentElement;if(!me)return;const H=me.getBoundingClientRect();le.width=H.width,le.height=H.height,ue=X(le.width,le.height);const be=Date.now(),Ae=be+ne.duration,Pe=()=>{const ut=Date.now(),U=ut-be;if(ut<Ae){let Ue=1;U>ne.fadeStart&&(Ue=1-(U-ne.fadeStart)/(ne.duration-ne.fadeStart)),ge(oe,le.width,le.height,Ue),f(le.width,le.height,Ue),I=requestAnimationFrame(Pe)}else he()};Pe()})}function he(){I&&(cancelAnimationFrame(I),I=null),ue=[],L.value=!1}return e.watch(()=>ne.trigger,le=>{le&&(A&&clearTimeout(A),A=setTimeout(Ce,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{he(),A&&clearTimeout(A)}),(le,oe)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),k2={class:"dss-filter-global-inner"},C2=["placeholder","value"],b2=["title"],w2={key:0,class:"dss-filter-funnel-badge"},x2={key:1,class:"dss-filter-sortby"},E2=["value"],S2=["value"],V2=["disabled","title"],N2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_2={class:"dss-filter-panel"},$2={key:0,class:"dss-filter-empty"},L2={class:"dss-filter-row-prefix"},T2={class:"dss-filter-cell"},A2=["onClick"],D2={class:"dss-filter-trigger-text"},H2=["placeholder"],R2={class:"dss-filter-popup-list"},F2=["onClick"],I2={key:0,class:"dss-filter-popup-empty"},z2={key:0,class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},W2={class:"dss-filter-popup-list"},q2=["onClick"],Z2={key:1,class:"dss-filter-cell dss-filter-cell--value"},U2=["placeholder","onUpdate:modelValue"],X2={key:1,class:"dss-filter-date-wrap"},Y2=["placeholder","onUpdate:modelValue"],j2=["placeholder","value","onInput","step"],K2={key:4,class:"dss-filter-between"},G2=["placeholder","value","onInput","step"],Q2={class:"dss-filter-between-sep"},J2=["placeholder","value","onInput","step"],e0={key:5,class:"dss-filter-multiselect"},t0=["onClick"],n0={class:"dss-filter-trigger-text"},l0=["placeholder"],o0={class:"dss-filter-popup-list dss-filter-popup-list--check"},a0=["onClick"],s0=["checked"],r0={key:0,class:"dss-filter-popup-empty"},i0=["onClick"],c0={class:"dss-filter-foot"},u0={class:"dss-filter-cell"},d0=["placeholder"],m0={class:"dss-filter-popup-list"},p0=["onClick"],f0={key:0,class:"dss-filter-popup-divider"},v0=["onClick"],g0=["placeholder"],h0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:0,class:"dss-filter-popup-empty"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={name:"DSSFilter"},S0=Object.assign(E0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{expose:ne,emit:_}){const{t:L}=Gl.useI18n(),ue=T,I=_,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...A,...ue.options})),Ge={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ge=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],Ce=e.ref(""),he=e.ref([]),le=e.ref(null),oe=e.ref(!1),me=e.ref(null),H=e.ref(""),be=e.ref(null),Ae=e.ref(""),Pe=e.ref("asc");let ut=1;function U(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function Ue(V,w){const S=w.filter(Y=>Y!=null&&Y!=="NULL");if(S.length===0)return null;if(S.every(Y=>Array.isArray(Y))){const Y=S.flatMap(Oe=>Oe).filter(Oe=>Oe!=null);return Y.length===0?null:typeof Y.find(Oe=>Oe!=null)=="object"?"arraySelect":"arrayText"}return S.every(Y=>typeof Y=="boolean")?"boolean":S.every(Y=>typeof Y=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(Y=>typeof Y=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const Qe=e.computed(()=>{if(!ue.data?.length)return[];const V=new Set;for(const ee of ue.data)if(ee&&typeof ee=="object")for(const Oe of Object.keys(ee))V.add(Oe);const w=new Set(ue.exclude),S=[];for(const ee of V){if(w.has(ee))continue;const Oe=ue.config[ee]||{},vt=ue.data.map(Ct=>Ct?.[ee]),ot=Oe.type||Ue(ee,vt);if(!ot)continue;const we=Oe.filterMode||"contain",Mt=we==="date"?"date":we==="string"?"text":ot,Dt={key:ee,label:Oe.label||Lt(ee),type:Mt,filterMode:we};if(ot==="select"){const Ct=vt.filter(at=>at!=null&&at!=="NULL");Dt.uniqueValues=[...new Set(Ct)].sort((at,pt)=>typeof at=="number"&&typeof pt=="number"?at-pt:String(at).localeCompare(String(pt)))}else if(ot==="range"||ot==="int"){const Ct=vt.filter(at=>typeof at=="number");Dt.min=Math.min(...Ct),Dt.max=Math.max(...Ct)}else if(ot==="arraySelect"){const Ct=Oe.displayKey||U(vt.flatMap(at=>Array.isArray(at)?at:[]));if(Dt.displayKey=Ct,Array.isArray(Oe.uniqueValues)&&Oe.uniqueValues.length>0)Dt.uniqueValues=Oe.uniqueValues.map(at=>String(at));else{const at=vt.flatMap(pt=>Array.isArray(pt)?pt:[]).filter(pt=>pt!=null).map(pt=>Ct&&typeof pt=="object"?pt[Ct]:String(pt)).filter(pt=>pt!=null&&pt!=="");Dt.uniqueValues=[...new Set(at)].sort((pt,qn)=>String(pt).localeCompare(String(qn)))}}S.push(Dt)}const Y=ue.config._order;return Y&&S.sort((ee,Oe)=>{const vt=Y.indexOf(ee.key),ot=Y.indexOf(Oe.key);return vt===-1&&ot===-1?0:vt===-1?1:ot===-1?-1:vt-ot}),S}),Ve=e.computed(()=>{const V={};for(const w of Qe.value)V[w.key]=w;return V}),Le=e.computed(()=>Array.isArray(ue.config.groups)&&ue.config.groups.length>0),Xe=e.computed(()=>{if(!Le.value)return[];const V=new Set(Qe.value.map(w=>w.key));return ue.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),G=e.computed(()=>{if(!Le.value)return[];const V=new Set(ue.config.groups.flatMap(w=>w.keys));return Qe.value.filter(w=>!V.has(w.key))}),Fe=e.computed(()=>{if(!be.value)return[];const V=new Set(be.value.keys),w=Qe.value.filter(Y=>V.has(Y.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Y=>Y.label.toLowerCase().includes(S))}),xe=e.computed(()=>{if(!H.value)return Qe.value;const V=H.value.toLowerCase();return Qe.value.filter(w=>w.label.toLowerCase().includes(V))}),ht=e.computed(()=>Qe.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),ct=e.computed(()=>Ae.value?Pe.value==="asc"?"Ascending":"Descending":"No sort selected");function St(V){le.value===V?At():(le.value=V,H.value="",be.value=null)}function At(){le.value=null,H.value="",be.value=null}function qt(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");le.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&At(),oe.value&&me.value&&!me.value.contains(V.target)&&(w||(oe.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function It(V){return Ve.value[V]?.label||Lt(V)}function Q(V){return Ve.value[V.key]?.filterMode||"contain"}function pe(V){return L(`filter.operators.${V}`)}function He(V){const w=Ve.value[V.key];return(Ge[w?.type]||Ge.text).map(S=>({...S,label:L(`filter.operators.${S.value}`)}))}function Ye(V){return ge.has(V)}function Zt(V){const w=Ve.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function kt(V){return Ge[V]?.[0]?.value||"contains"}function Ot(V,w){return ge.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function xt(V){return Ve.value[V.key]?.uniqueValues||[]}function zt(V){const w=xt(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Y=>String(Y).toLowerCase().includes(S))}function J(V){const w=V.value;return!w||w.length===0?L("filter.select"):w.length<=2?w.join(", "):L("filter.selectedCount",{count:w.length})}function ye(V){const w=Ve.value[V],S=w?.filterMode||"contain",Y=w?.type||"text",ee=S==="string"?"contains":kt(Y);he.value.push(e.reactive({id:ut++,key:V,operator:ee,value:Ot(Y,ee)})),At()}function Be(V){he.value=he.value.filter(w=>w.id!==V)}function We(V,w){const Y=Ve.value[w]?.type||"text";V.key=w,V.operator=kt(Y),V.value=Ot(Y,V.operator),At()}function lt(V,w){const S=Zt(V);V.operator=w;const Y=Zt(V);if(S!==Y||ge.has(w)){const ee=Ve.value[V.key];V.value=Ot(ee?.type||"text",w)}At()}function Vt(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function je(V,w,S){const Y=S.target.value,ee=Y===""?null:Number(Y);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(ee)?null:ee}}function Nt(V,w){const S=V.value||[],Y=S.indexOf(w);V.value=Y>=0?S.filter(ee=>ee!==w):[...S,w]}function Ke(){he.value=[],Ce.value="",At()}function W(V){Ce.value=V.target.value}function q(V){Ae.value=V.target.value}function K(){Pe.value=Pe.value==="asc"?"desc":"asc"}const ve=e.computed(()=>{if(!ue.data)return[];let V=ue.data;if(Ce.value){const w=Ce.value.toLowerCase();V=V.filter(S=>{for(const Y of Object.keys(S)){const ee=S[Y];if(typeof ee=="string"&&ee.toLowerCase().includes(w)||typeof ee=="number"&&String(ee).includes(w)||Array.isArray(ee)&&ee.some(Oe=>Oe!=null&&(typeof Oe=="string"?Oe.toLowerCase().includes(w):typeof Oe=="object"?Object.values(Oe).some(vt=>typeof vt=="string"&&vt.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of he.value){if(!Bt(w))continue;const S=Ve.value[w.key];S&&(V=V.filter(Y=>tt(Y,w,S)))}if(ue.showSortBy&&Ae.value){const w=Ae.value,S=Pe.value==="asc"?1:-1;V=[...V].sort((Y,ee)=>qe(Y?.[w],ee?.[w])*S)}return V});function qe(V,w){const S=Je(V),Y=Je(w);return S==null&&Y==null?0:S==null?1:Y==null?-1:typeof S=="number"&&typeof Y=="number"?S-Y:String(S).localeCompare(String(Y),void 0,{numeric:!0,sensitivity:"base"})}function Je(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function Bt(V){return ge.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function tt(V,w,S){const Y=V?.[w.key],ee=w.value,Oe=w.operator;if(Oe==="is_empty")return ln(Y);if(Oe==="is_not_empty")return!ln(Y);const vt=S.type;if(vt==="text"||vt==="arrayText"){const ot=vt==="arrayText"&&Array.isArray(Y)?Y.filter(Dt=>Dt!=null).map(String).join(" "):Y!=null?String(Y):"",we=String(ee).toLowerCase(),Mt=ot.toLowerCase();switch(Oe){case"contains":return Mt.includes(we);case"not_contains":return!Mt.includes(we);case"equals":return Mt===we;case"not_equals":return Mt!==we;case"starts_with":return Mt.startsWith(we);case"ends_with":return Mt.endsWith(we);default:return!0}}if(vt==="select")switch(Oe){case"is_any_of":return ee.includes(Y);case"is_none_of":return!ee.includes(Y);default:return!0}if(vt==="range"||vt==="int"){const ot=typeof Y=="number"?Y:Number(Y);if(typeof ot!="number"||isNaN(ot))return!1;if(Oe==="between"){const Mt=ee?.min!=null?Number(ee.min):null,Dt=ee?.max!=null?Number(ee.max):null,Ct=Mt!=null&&!isNaN(Mt)?Mt:null,at=Dt!=null&&!isNaN(Dt)?Dt:null;return(Ct==null||ot>=Ct)&&(at==null||ot<=at)}const we=typeof ee=="number"&&!isNaN(ee)?ee:Number(ee);if(Oe==="contains"||Oe==="not_contains"){const Mt=String(ot),Dt=String(ee??"").toLowerCase(),Ct=Mt.toLowerCase().includes(Dt);return Oe==="contains"?Ct:!Ct}if(typeof we!="number"||isNaN(we))return!1;switch(Oe){case"eq":return ot===we;case"neq":return ot!==we;case"gt":return ot>we;case"gte":return ot>=we;case"lt":return ot<we;case"lte":return ot<=we;default:return!0}}if(vt==="arraySelect"){if(!Array.isArray(Y))return!1;const ot=Y.filter(we=>we!=null).map(we=>S.displayKey&&typeof we=="object"?we[S.displayKey]:String(we));switch(Oe){case"contains_any":return ot.some(we=>ee.includes(we));case"contains_all":return ee.every(we=>ot.includes(we));case"not_contains_any":return!ot.some(we=>ee.includes(we));default:return!0}}if(vt==="date"){const ot=st(ee);if(!ot||isNaN(ot.getTime()))return!1;const we=st(Y);if(!we||isNaN(we.getTime()))return!1;const Mt=Xt(we),Dt=Xt(ot);switch(Oe){case"eq":return Mt===Dt;case"before":return Mt<Dt;case"after":return Mt>Dt;default:return!0}}if(vt==="boolean"){const ot=Y===!0||Y==="true"||Y===1,we=Y===!1||Y==="false"||Y===0;switch(Oe){case"is_true":return ot;case"is_false":return we;default:return!0}}return!0}function st(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function Xt(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),Y=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${Y}`}function ln(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(ve,V=>I("update:modelValue",V),{immediate:!0}),e.watch(()=>ue.data,()=>{he.value=[],Ce.value="",oe.value=!1,Ae.value="",Pe.value="asc",At()});function Lt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Qt(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const Y of Object.keys(w))S[Y]=V(w[Y]);return S}return w};return{globalSearch:Ce.value,rows:he.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:Ve.value[w.key]?.type,defFilterMode:Ve.value[w.key]?.filterMode})),filteredCount:ve.value?.length??0}}return ne({getDebugState:Qt}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",k2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:Ce.value,onInput:W},null,40,C2),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>Ce.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:oe.value||he.value.length>0,"dss-filter-funnel-btn--with-sort":ue.showSortBy}]),onClick:w[1]||(w[1]=S=>oe.value=!oe.value),type:"button",title:oe.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),he.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(he.value.length),1)):e.createCommentVNode("",!0)],10,b2),ue.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ae.value,onChange:q},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:K,disabled:!Ae.value,title:ct.value},[Ae.value?Pe.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),oe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_2,[he.value.length===0?(e.openBlock(),e.createElementBlock("div",$2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(S,Y)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Y===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",T2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ee=>St(`${S.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(It(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),le.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=ee=>H.value=ee),placeholder:e.unref(L)("filter.searchAttributes")},null,8,H2),[[e.vModelText,H.value]]),e.createElementVNode("ul",R2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,ee=>(e.openBlock(),e.createElementBlock("li",{key:ee.key,class:"dss-filter-popup-item",onClick:Oe=>We(S,ee.key)},e.toDisplayString(ee.label),9,F2))),128)),xe.value.length===0?(e.openBlock(),e.createElementBlock("li",I2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Q(S)==="contain"||Q(S)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ee=>St(`${S.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(pe(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),le.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He(S),ee=>(e.openBlock(),e.createElementBlock("li",{key:ee.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===ee.value}]),onClick:Oe=>lt(S,ee.value)},e.toDisplayString(ee.label),11,q2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[Q(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ee=>S.value=ee},null,8,U2)),[[e.vModelText,S.value]]):Q(S)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:S.value,"onUpdate:modelValue":ee=>S.value=ee},null,8,["modelValue","onUpdate:modelValue"])])):Zt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ee=>S.value=ee},null,8,Y2)),[[e.vModelText,S.value]]):Zt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:S.value,onInput:ee=>Vt(S,ee),step:Ve.value[S.key]?.type==="int"?1:void 0},null,40,j2)):Zt(S)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:S.value?.min,onInput:ee=>je(S,"min",ee),step:Ve.value[S.key]?.type==="int"?1:void 0},null,40,G2),e.createElementVNode("span",Q2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:S.value?.max,onInput:ee=>je(S,"max",ee),step:Ve.value[S.key]?.type==="int"?1:void 0},null,40,J2)])):Zt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ee=>St(`${S.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(J(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),le.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[xt(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=ee=>H.value=ee),placeholder:e.unref(L)("filter.search")},null,8,l0)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",o0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt(S),ee=>(e.openBlock(),e.createElementBlock("li",{key:ee,class:"dss-filter-popup-item",onClick:Oe=>Nt(S,ee)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(ee),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(ee),1)],8,a0))),128)),zt(S).length===0?(e.openBlock(),e.createElementBlock("li",r0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ee=>Be(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>St("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),le.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!be.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,d0),[[e.vModelText,H.value]]),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>be.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p0))),128)),G.value.length>0?(e.openBlock(),e.createElementBlock("li",f0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,v0))),128))])],64)):be.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>be.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(be.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,g0),[[e.vModelText,H.value]]),e.createElementVNode("ul",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,y0))),128)),Fe.value.length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,C0),[[e.vModelText,H.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,w0))),128)),xe.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),he.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ke},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V0={class:"dss-pill-field__pills"},N0=["data-value"],B0=["disabled"],M0={class:"dss-pill-field__pill-text"},_0={key:0,class:"dss-pill-field__pill-actions"},$0=["onClick"],L0=["onClick"],T0=["placeholder","disabled"],A0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{emit:ne}){const _=T,L=ne,ue=e.ref(""),I=e.ref([..._.modelValue]),A=e.ref(null);let X=null;const Ge=e.ref(null),ge=e.ref(""),f=e.ref(null),Ce=e.ref(null),he=e.computed(()=>{if(!Ce.value)return;const{width:Le,height:Xe}=Ce.value;return{minWidth:`${Le}px`,height:`${Xe}px`}});function le(Le,Xe){Ge.value===Xe&&(f.value=Le)}function oe(){Ge.value=null,ge.value="",Ce.value=null,f.value=null}const me=e.computed(()=>new Set(I.value.map(Le=>Le.trim()).filter(Boolean)));function H(Le){A.value=Le,X&&clearTimeout(X),X=setTimeout(()=>{A.value=null,X=null},900)}function be(Le){const Xe=Le.trim();return Xe?me.value.has(Xe)?(H(Xe),!1):(I.value=[...I.value,Xe],L("update:modelValue",[...I.value]),!0):!1}function Ae(Le){const Xe=Le.split(/\r?\n/g).map(ht=>ht.trim()).filter(Boolean);if(!Xe.length)return;const G=new Set(I.value.map(ht=>ht.trim()).filter(Boolean)),Fe=[...I.value];let xe=null;for(const ht of Xe){if(G.has(ht)){xe??=ht;continue}G.add(ht),Fe.push(ht)}Fe.length!==I.value.length&&(I.value=Fe,L("update:modelValue",[...I.value])),xe&&H(xe)}function Pe(Le){_.disabled||(Ge.value===Le&&oe(),I.value=I.value.filter((Xe,G)=>G!==Le),L("update:modelValue",[...I.value]))}async function ut(Le,Xe){if(_.disabled)return;const G=Xe.currentTarget.closest(".dss-pill-field__pill");G&&(Ce.value={width:G.offsetWidth,height:G.offsetHeight}),Ge.value=Le,ge.value=I.value[Le]??"",await e.nextTick();const Fe=f.value;if(!Fe)return;Fe.focus();const xe=Fe.value.length;Fe.setSelectionRange(xe,xe)}function U(){oe()}function Ue(){if(_.disabled||Ge.value===null)return;const Le=Ge.value,Xe=I.value[Le]??"",G=ge.value.trim();if(oe(),G!==Xe&&me.value.has(G)){H(G);return}if(!G){I.value=I.value.filter((xe,ht)=>ht!==Le),L("update:modelValue",[...I.value]);return}const Fe=I.value.map((xe,ht)=>ht===Le?G:xe);I.value=Fe,L("update:modelValue",[...I.value])}function Qe(Le){Le.preventDefault(),!_.disabled&&(be(ue.value),ue.value="")}function Ve(Le){if(_.disabled)return;const Xe=Le.clipboardData?.getData("text")??"";!Xe.includes(`
|
|
118
|
-
`)&&!Xe.includes("\r")||(Le.preventDefault(),Ae(Xe),ue.value="")}return e.watch(()=>_.modelValue,Le=>{I.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(Le,Xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(G,Fe)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===G,"dss-pill-field__pill--editing":Ge.value===Fe}]),style:e.normalizeStyle(Ge.value===Fe&&Ce.value?he.value:void 0)},[Ge.value===Fe?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ge.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:xe=>le(xe,Fe),"onUpdate:modelValue":Xe[0]||(Xe[0]=xe=>ge.value=xe),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(Ue,["enter"]),e.withKeys(U,["esc"])],onBlur:Ue},null,40,B0),[[e.vModelText,ge.value]])],8,N0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",M0,e.toDisplayString(G),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",_0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:xe=>ut(Fe,xe)},[...Xe[2]||(Xe[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,$0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:xe=>Pe(Fe)}," × ",8,L0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Xe[1]||(Xe[1]=G=>ue.value=G),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Ve,onKeydown:e.withKeys(Qe,["enter"])},null,40,T0),[[e.vModelText,ue.value]])])],2))}}),D0={class:"dss-step-bar__header"},H0={class:"dss-step-bar__label"},R0={key:0,class:"dss-step-bar__counter"},F0={class:"dss-step-bar__track-wrapper"},I0=["aria-valuemax","aria-valuenow","aria-label"],z0=["onMouseenter"],P0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:T=>["input","desc","asc"].includes(T)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(T){const ne=T,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=Q=>Q&&typeof Q=="object"&&!Array.isArray(Q),ue=(Q,pe)=>{const He=Object.assign({},Q);return!L(Q)||!L(pe)||Object.keys(pe).forEach(Ye=>{if(L(pe[Ye])){Ye in Q?He[Ye]=ue(Q[Ye],pe[Ye]):Object.assign(He,{[Ye]:pe[Ye]});return}Object.assign(He,{[Ye]:pe[Ye]})}),He},I=e.computed(()=>ue(_,ne.options)),A=e.computed(()=>Math.max(1,Number(ne.steps)||1)),X=e.computed(()=>Math.min(A.value,Math.max(0,Number(ne.currentStep)||0))),Ge=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),ge=e.computed(()=>{if(!Ge.value)return[];const Q=ne.segments.map((pe,He)=>{const Ye=Number(pe?.value);return{label:pe?.label||`Step ${He+1}`,value:Number.isFinite(Ye)&&Ye>0?Ye:0,color:pe?.color||ne.activeColor,marker:pe?.marker}});return ne.segmentOrder==="desc"?[...Q].sort((pe,He)=>He.value-pe.value):ne.segmentOrder==="asc"?[...Q].sort((pe,He)=>pe.value-He.value):Q}),f=e.computed(()=>Ge.value?ge.value.reduce((Q,pe)=>Q+pe.value,0):X.value),Ce=e.computed(()=>Ge.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,f.value):A.value),he=e.computed(()=>Ge.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),le=e.computed(()=>he.value?Math.max(0,Number(ne.totalValue)-f.value):0),oe=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),me=e.computed(()=>le.value>0),H=e.computed(()=>ge.value.reduce((Q,pe)=>Math.max(Q,Number(pe.value)||0),0)),be=e.computed(()=>ge.value.filter(Q=>Q.value>0).map(Q=>`${Q.label}: ${ht(Q.value)}`).join(" | ")),Ae=e.computed(()=>Ge.value?he.value?ge.value.filter(Q=>Q.value>0):ge.value:[]),Pe=e.computed(()=>{if(!ne.counterAsPercentage)return`${f.value} / ${Ce.value}`;const Q=Number(Ce.value);if(!Number.isFinite(Q)||Q<=0)return"0%";const pe=Math.round(Number(f.value)/Q*100);return`${Math.min(Math.max(pe,0),100)}%`}),ut=e.computed(()=>f.value),U=e.computed(()=>Ce.value),Ue=e.reactive({visible:!1,x:0,content:""}),Qe=e.computed(()=>({left:`${Ue.x}px`})),Ve=Q=>{const pe=Q?.parentElement;return pe?pe.offsetLeft+pe.offsetWidth/2:0},Le=Q=>{if(he.value){const Ye=Math.max(0,Number(Q.value)||0);return{flex:`${Ye} 0 0`,minWidth:Ye>0?"6px":"0",backgroundColor:Q.color}}const pe=f.value;return{flex:`${Q.value>0?Q.value:pe>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:Q.color}},Xe=Q=>Number(Q?.value||0)>0&&Number(Q?.value||0)===H.value,G=Q=>{const pe=L(Q?.marker)?Q.marker:{},He=Q?.marker===!0||pe.enabled===!0,Ye=Xe(Q)&&I.value.maxSegment?.marker?.enabled===!0;if(!(He||Ye))return{enabled:!1};const kt=pe.backgroundColor??(Ye?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Ot=pe.borderColor??(Ye?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),xt=pe.color??(Ye?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),zt=pe.width??(Ye?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),J=pe.height??(Ye?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:kt,borderColor:Ot,color:xt,width:zt,height:J,icon:pe.icon??null,...pe}},Fe=Q=>{const pe=G(Q);return{backgroundColor:pe.backgroundColor??void 0,borderColor:pe.borderColor??void 0,color:pe.color??void 0}},xe=Q=>{const pe=G(Q);return{width:pe.width??void 0,height:pe.height??void 0}},ht=Q=>`${Q}${ne.valueLabel}`,ct=e.computed(()=>({flex:`${le.value} 0 0`,minWidth:le.value>0?"6px":"0",backgroundColor:ne.inactiveColor})),St=(Q,pe)=>{if(!Q||!pe?.currentTarget)return;const He=pe.currentTarget;if(ne.remainderTooltipSummary){Ue.x=Ve(He),Ue.content=be.value,Ue.visible=!!Ue.content;return}Ue.x=He.offsetLeft+He.offsetWidth/2,Ue.content=`${Q.label}: ${ht(Q.value)}`,Ue.visible=!0},At=Q=>{if(!le.value||!Q?.currentTarget)return;const pe=Q.currentTarget;if(ne.remainderTooltipSummary){Ue.x=Ve(pe),Ue.content=be.value,Ue.visible=!!Ue.content;return}Ue.x=pe.offsetLeft+pe.offsetWidth/2,oe.value&&(Ue.content=`${ne.remainderLabel}: ${ht(le.value)}`,Ue.visible=!0)},qt=()=>{Ue.visible=!1},It=e.computed(()=>({"--dss-step-bar-label-color":ne.labelColor??void 0,"--dss-step-bar-counter-color":ne.counterColor??void 0,"--dss-step-bar-active-color":ne.activeColor,"--dss-step-bar-inactive-color":ne.inactiveColor}));return(Q,pe)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(It.value)},[e.createElementVNode("div",D0,[e.createElementVNode("span",H0,[e.renderSlot(Q.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",R0,[e.renderSlot(Q.$slots,"counter",{counterDisplay:Pe.value},()=>[e.createTextVNode(e.toDisplayString(Pe.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",F0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":U.value,"aria-valuenow":ut.value,"aria-label":T.label},[Ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(He,Ye)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Ye}-${He.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Xe(He),"dss-step-bar__segment--marker-enabled":G(He).enabled}]),style:e.normalizeStyle(Le(He)),onMouseenter:Zt=>St(He,Zt),onMouseleave:qt},[G(He).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Fe(He)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(xe(He))},[e.renderSlot(Q.$slots,"segment-marker-icon",{segment:He,index:Ye,marker:G(He)},()=>[e.renderSlot(Q.$slots,"max-segment-icon",{segment:He,index:Ye,marker:G(He)},()=>[e.createTextVNode(e.toDisplayString(G(He).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,z0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ct.value),onMouseenter:pe[0]||(pe[0]=He=>At(He)),onMouseleave:qt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,He=>(e.openBlock(),e.createElementBlock("div",{key:He,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":He<=X.value}])},null,2))),128))],8,I0),Ue.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Qe.value)},e.toDisplayString(Ue.content),5)):e.createCommentVNode("",!0)])],4))}},O0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},W0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},q0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Z0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},U0={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Ql={chart:O0,table:W0,filter:q0,datepicker:Z0,textEditor:U0},X0={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},Y0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},j0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},K0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},G0={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Jl={chart:X0,table:Y0,filter:j0,datepicker:K0,textEditor:G0},Q0={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},J0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},e9={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},t9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},n9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:Q0,table:J0,filter:e9,datepicker:t9,textEditor:n9},Ho={en:Ql,fr:Jl,nl:eo};function ca(T){if(!T||!T.global)return;const ne=T.global.availableLocales||[];Object.keys(Ho).forEach(_=>{ne.includes(_)&&T.global.mergeLocaleMessage(_,Ho[_])})}const Ro={en:{textEditor:Ql.textEditor},fr:{textEditor:Jl.textEditor},nl:{textEditor:eo.textEditor}};function ua(T){if(!T||!T.global)return;const ne=T.global.availableLocales||[];Object.keys(Ro).forEach(_=>{ne.includes(_)&&T.global.mergeLocaleMessage(_,Ro[_])})}const Fo={en:{table:Ql.table},fr:{table:Jl.table},nl:{table:eo.table}};function da(T){if(!T||!T.global)return;const ne=T.global.availableLocales||[];Object.keys(Fo).forEach(_=>{ne.includes(_)&&T.global.mergeLocaleMessage(_,Fo[_])})}const Io={en:{datepicker:Ql.datepicker},fr:{datepicker:Jl.datepicker},nl:{datepicker:eo.datepicker}};function ma(T){if(!T||!T.global)return;const ne=T.global.availableLocales||[];Object.keys(Io).forEach(_=>{ne.includes(_)&&T.global.mergeLocaleMessage(_,Io[_])})}const zo={en:{filter:Ql.filter},fr:{filter:Jl.filter},nl:{filter:eo.filter}};function pa(T){if(!T||!T.global)return;const ne=T.global.availableLocales||[];Object.keys(zo).forEach(_=>{ne.includes(_)&&T.global.mergeLocaleMessage(_,zo[_])})}const l9={chart:Ho,textEditor:Ro,table:Fo,datepicker:Io,filter:zo};function o9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const a9={en:{...Ql},fr:{...Jl},nl:{...eo}};Gl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:a9});exports.DSSChart=lc;exports.DSSChartMessages=Ho;exports.DSSColorPicker=qm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Io;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=zo;exports.DSSLoader=l2;exports.DSSMessages=l9;exports.DSSModal=Jo;exports.DSSPillField=A0;exports.DSSSkeleton=o2;exports.DSSStepBar=P0;exports.DSSTable=Su;exports.DSSTableMessages=Fo;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=ca;exports.addDSSDatepickerTranslations=ma;exports.addDSSFilterTranslations=pa;exports.addDSSTableTranslations=da;exports.addDSSTextEditorTranslations=ua;exports.addDSSTranslations=o9;
|
|
117
|
+
`,document.body.appendChild(Qe),Ee=Qe}function We(G,he){Ee&&(Ee.style.left=`${G-ot}px`,Ee.style.top=`${he-vt}px`)}function we(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=pe.value.dragSourceBackground,G.style.borderColor=pe.value.dragSourceBorder,G.style.transform="scale(0.97)"}function ct(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function rt(G,he){return document.elementFromPoint(G,he)?.closest(".dss-dnd-column-body")??null}function Et(G,he){return!!document.elementFromPoint(G,he)?.closest("[data-dss-dnd-delete-zone]")}function Rt(G,he){if(P.value&&Et(G,he)){Ce.value=!0,be.value=null,Q.value=-1;return}Ce.value=!1;const _e=rt(G,he),je=_e?.getAttribute("data-column")??null;if(!je){be.value=null,Q.value=-1;return}be.value=je;const Qe=_e.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Lt=Qe.length;for(let tt=0;tt<Qe.length;tt++){const Tt=Qe[tt].getBoundingClientRect();if(he<Tt.top+Tt.height/2){Lt=tt;break}}Q.value=Lt}function Qt(G){G.preventDefault(),We(G.clientX,G.clientY),!de&&(de=requestAnimationFrame(()=>{de=null,Rt(G.clientX,G.clientY)}))}function It(G){window.removeEventListener("pointermove",Qt),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Ie?.releasePointerCapture?.(G.pointerId),ct(Ie),Ie=null;const he=P.value&&Et(G.clientX,G.clientY);if(f.value&&he)L("delete",{item:f.value});else{const je=rt(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(f.value&&je){const Qe=f.value[M.columnKey],Lt=je,Tt=(Se.value[Lt]||[]).filter(St=>St[M.itemKey]!==f.value[M.itemKey]),Xe=Math.max(0,Math.min(Q.value,Tt.length)),Be=Ge(Lt,Xe),Je=f.value[M.itemKey];L("move",{item:f.value,from:Qe,to:Lt,position:Be,index:Xe}),H&&clearTimeout(H),X.value={id:Je,from:Qe,to:Lt},H=setTimeout(()=>{X.value=null},3500)}}Ee&&(Ee.remove(),Ee=null),q!==null&&(document.body.style.cursor=q,q=""),Pt()}function ae(G,he){G.preventDefault();const _e=G.target.closest(".dss-dnd-item");if(!_e)return;const je=_e.getBoundingClientRect();ot=G.clientX-je.left,vt=G.clientY-je.top,q=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=he,Ie=_e,K(_e,G.clientX,G.clientY),requestAnimationFrame(()=>we(_e)),_e.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",Qt),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function me(){Ye&&(window.removeEventListener("pointermove",Pe),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re),Ye=null)}function Pe(G){if(!Ye||G.pointerId!==Ye.pointerId)return;const he=G.clientX-Ye.startX,_e=G.clientY-Ye.startY;if(Math.abs(he)>=qe||Math.abs(_e)>=qe){const je=Ye.item;me(),ae(G,je)}}function Re(G){!Ye||G.pointerId!==Ye.pointerId||me()}function Wt(G,he){me(),Ye={item:he,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",Pe),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re)}function kt(G,he){pe.value.useHandle||Wt(G,he)}function qt(G,he){Wt(G,he)}function Bt(){de&&(cancelAnimationFrame(de),de=null)}function Pt(){Bt(),f.value=null,be.value=null,Ce.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{Bt(),me(),H&&clearTimeout(H),Ee&&(Ee.remove(),Ee=null)}),(G,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(ft.value)},[P.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,_e=>(e.openBlock(),e.createElementBlock("div",{key:_e.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==_e.value},_e.class||""]]),style:e.normalizeStyle(ee(_e))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(G.$slots,"column-header",{column:_e,items:Se.value[_e.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(_e.title||_e.value),1),e.createElementVNode("span",r2,e.toDisplayString((Se.value[_e.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value[_e.value],je=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:je.key},[je.type==="indicator"?(e.openBlock(),e.createElementBlock("div",c2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":je.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:Qe=>kt(Qe,je.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Qe=>qt(Qe,je.item),["stop"])},[e.renderSlot(G.$slots,"handle",{},()=>[he[0]||(he[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,d2)):e.createCommentVNode("",!0),e.createElementVNode("div",m2,[e.renderSlot(G.$slots,"item",{item:je.item,column:_e,justDropped:X.value?.id===je.item[T.itemKey],droppedFrom:X.value?.id===je.item[T.itemKey]?X.value.from:null,droppedTo:X.value?.id===je.item[T.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(je.item[T.itemKey]),1)])])],42,u2))],64))),128)),(Se.value[_e.value]||[]).length===0&&be.value!=_e.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(G.$slots,"empty",{column:_e},()=>[he[1]||(he[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,i2)],6))),128))],6))}}),h2={name:"DSSConfetti"},y2=Object.assign(h2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(T){const oe=T,M=e.ref(null),L=e.ref(!1);let fe=[],P=null,A=null;function pe(Q,X){const de=[];for(let H=0;H<oe.count;H++)de.push(ft(Q));return de}function ft(Q,X){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:oe.colors[Math.floor(Math.random()*oe.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(Q,X,de,H){Q.clearRect(0,0,X,de);for(const Ee of fe)Q.save(),Q.globalAlpha=Ee.opacity*H,Q.beginPath(),Q.lineWidth=Ee.r,Q.strokeStyle=Ee.color,Q.moveTo(Ee.x+Ee.tilt+Ee.r/2,Ee.y),Q.lineTo(Ee.x+Ee.tilt,Ee.y+Ee.tilt+Ee.r/2),Q.stroke(),Q.restore()}function f(Q,X,de){const H=.3+de*.7;for(let Ee=0;Ee<fe.length;Ee++){const Ie=fe[Ee];Ie.tiltAngle+=Ie.tiltInc,Ie.y+=Ie.speed*H,Ie.x+=Math.sin(Ie.d)*.5*H,Ie.tilt=Math.sin(Ie.tiltAngle)*15,de>=.99&&Ie.y>X+20&&(fe[Ee]=ft(Q))}}function be(){L.value=!0,e.nextTick(()=>{const Q=M.value;if(!Q)return;const X=Q.getContext("2d"),de=Q.parentElement;if(!de)return;const H=de.getBoundingClientRect();Q.width=H.width,Q.height=H.height,fe=pe(Q.width,Q.height);const Ee=Date.now(),Ie=Ee+oe.duration,ot=()=>{const vt=Date.now(),q=vt-Ee;if(vt<Ie){let Ye=1;q>oe.fadeStart&&(Ye=1-(q-oe.fadeStart)/(oe.duration-oe.fadeStart)),ee(X,Q.width,Q.height,Ye),f(Q.width,Q.height,Ye),P=requestAnimationFrame(ot)}else Ce()};ot()})}function Ce(){P&&(cancelAnimationFrame(P),P=null),fe=[],L.value=!1}return e.watch(()=>oe.trigger,Q=>{Q&&(A&&clearTimeout(A),A=setTimeout(be,oe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),A&&clearTimeout(A)}),(Q,X)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),k2={class:"dss-filter-global-inner"},C2=["placeholder","value"],b2=["title"],w2={key:0,class:"dss-filter-funnel-badge"},x2={key:1,class:"dss-filter-sortby"},E2=["value"],S2=["value"],V2=["disabled","title"],N2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_2={class:"dss-filter-panel"},$2={key:0,class:"dss-filter-empty"},L2={class:"dss-filter-row-prefix"},T2={class:"dss-filter-cell"},A2=["onClick"],D2={class:"dss-filter-trigger-text"},H2=["placeholder"],R2={class:"dss-filter-popup-list"},F2=["onClick"],I2={key:0,class:"dss-filter-popup-empty"},z2={key:0,class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},W2={class:"dss-filter-popup-list"},q2=["onClick"],Z2={key:1,class:"dss-filter-cell dss-filter-cell--value"},U2=["placeholder","onUpdate:modelValue"],X2={key:1,class:"dss-filter-date-wrap"},Y2=["placeholder","onUpdate:modelValue"],j2=["placeholder","value","onInput","step"],K2={key:4,class:"dss-filter-between"},G2=["placeholder","value","onInput","step"],Q2={class:"dss-filter-between-sep"},J2=["placeholder","value","onInput","step"],e0={key:5,class:"dss-filter-multiselect"},t0=["onClick"],n0={class:"dss-filter-trigger-text"},l0=["placeholder"],o0={class:"dss-filter-popup-list dss-filter-popup-list--check"},a0=["onClick"],s0=["checked"],r0={key:0,class:"dss-filter-popup-empty"},i0=["onClick"],c0={class:"dss-filter-foot"},u0={class:"dss-filter-cell"},d0=["placeholder"],m0={class:"dss-filter-popup-list"},p0=["onClick"],f0={key:0,class:"dss-filter-popup-divider"},v0=["onClick"],g0=["placeholder"],h0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:0,class:"dss-filter-popup-empty"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={name:"DSSFilter"},S0=Object.assign(E0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{expose:oe,emit:M}){const{t:L}=Gl.useI18n(),fe=T,P=M,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({...A,...fe.options})),ft={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),Ce=e.ref([]),Q=e.ref(null),X=e.ref(!1),de=e.ref(null),H=e.ref(""),Ee=e.ref(null),Ie=e.ref(""),ot=e.ref("asc");let vt=1;function q(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function Ye(V,w){const S=w.filter(Z=>Z!=null&&Z!=="NULL");if(S.length===0)return null;if(S.every(Z=>Array.isArray(Z))){const Z=S.flatMap(Ze=>Ze).filter(Ze=>Ze!=null);return Z.length===0?null:typeof Z.find(Ze=>Ze!=null)=="object"?"arraySelect":"arrayText"}return S.every(Z=>typeof Z=="boolean")?"boolean":S.every(Z=>typeof Z=="number")?new Set(S).size<=pe.value.maxUniqueForEnum?"select":"range":S.every(Z=>typeof Z=="string")?new Set(S).size<=pe.value.maxUniqueForSelect?"select":"text":S.some(Z=>typeof Z=="object"&&!Array.isArray(Z))?null:"text"}const qe=e.computed(()=>{if(!fe.data?.length)return[];const V=new Set;for(const J of fe.data)if(J&&typeof J=="object")for(const Ze of Object.keys(J))V.add(Ze);const w=new Set(fe.exclude),S=[];for(const J of V){if(w.has(J))continue;const Ze=fe.config[J]||{},gt=fe.data.map($t=>$t?.[J]),nt=Ze.type||Ye(J,gt);if(!nt)continue;const xe=Ze.filterMode||"contain",Nt=xe==="date"?"date":xe==="string"?"text":nt,zt={key:J,label:Ze.label||Vt(J),type:Nt,filterMode:xe};if(nt==="select"){const $t=gt.filter(it=>it!=null&&it!=="NULL");zt.uniqueValues=[...new Set($t)].sort((it,Ct)=>typeof it=="number"&&typeof Ct=="number"?it-Ct:String(it).localeCompare(String(Ct)))}else if(nt==="range"||nt==="int"){const $t=gt.filter(it=>typeof it=="number");zt.min=Math.min(...$t),zt.max=Math.max(...$t)}else if(nt==="arraySelect"){const $t=Ze.displayKey||q(gt.flatMap(it=>Array.isArray(it)?it:[]));if(zt.displayKey=$t,Array.isArray(Ze.uniqueValues)&&Ze.uniqueValues.length>0)zt.uniqueValues=Ze.uniqueValues.map(it=>String(it));else{const it=gt.flatMap(Ct=>Array.isArray(Ct)?Ct:[]).filter(Ct=>Ct!=null).map(Ct=>$t&&typeof Ct=="object"?Ct[$t]:String(Ct)).filter(Ct=>Ct!=null&&Ct!=="");zt.uniqueValues=[...new Set(it)].sort((Ct,Jn)=>String(Ct).localeCompare(String(Jn)))}}S.push(zt)}const Z=fe.config._order;return Z&&S.sort((J,Ze)=>{const gt=Z.indexOf(J.key),nt=Z.indexOf(Ze.key);return gt===-1&&nt===-1?0:gt===-1?1:nt===-1?-1:gt-nt}),S}),Se=e.computed(()=>{const V={};for(const w of qe.value)V[w.key]=w;return V}),$e=e.computed(()=>Array.isArray(fe.config.groups)&&fe.config.groups.length>0),Ge=e.computed(()=>{if(!$e.value)return[];const V=new Set(qe.value.map(w=>w.key));return fe.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),K=e.computed(()=>{if(!$e.value)return[];const V=new Set(fe.config.groups.flatMap(w=>w.keys));return qe.value.filter(w=>!V.has(w.key))}),We=e.computed(()=>{if(!Ee.value)return[];const V=new Set(Ee.value.keys),w=qe.value.filter(Z=>V.has(Z.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Z=>Z.label.toLowerCase().includes(S))}),we=e.computed(()=>{if(!H.value)return qe.value;const V=H.value.toLowerCase();return qe.value.filter(w=>w.label.toLowerCase().includes(V))}),ct=e.computed(()=>qe.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),rt=e.computed(()=>Ie.value?ot.value==="asc"?"Ascending":"Descending":"No sort selected");function Et(V){Q.value===V?Rt():(Q.value=V,H.value="",Ee.value=null)}function Rt(){Q.value=null,H.value="",Ee.value=null}function Qt(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Rt(),X.value&&de.value&&!de.value.contains(V.target)&&(w||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Qt));function It(V){return Se.value[V]?.label||Vt(V)}function ae(V){return Se.value[V.key]?.filterMode||"contain"}function me(V){return L(`filter.operators.${V}`)}function Pe(V){const w=Se.value[V.key];return(ft[w?.type]||ft.text).map(S=>({...S,label:L(`filter.operators.${S.value}`)}))}function Re(V){return ee.has(V)}function Wt(V){const w=Se.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function kt(V){return ft[V]?.[0]?.value||"contains"}function qt(V,w){return ee.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function Bt(V){return Se.value[V.key]?.uniqueValues||[]}function Pt(V){const w=Bt(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Z=>String(Z).toLowerCase().includes(S))}function G(V){const w=V.value;return!w||w.length===0?L("filter.select"):w.length<=2?w.join(", "):L("filter.selectedCount",{count:w.length})}function he(V){const w=Se.value[V],S=w?.filterMode||"contain",Z=w?.type||"text",J=S==="string"?"contains":kt(Z);Ce.value.push(e.reactive({id:vt++,key:V,operator:J,value:qt(Z,J)})),Rt()}function _e(V){Ce.value=Ce.value.filter(w=>w.id!==V)}function je(V,w){const Z=Se.value[w]?.type||"text";V.key=w,V.operator=kt(Z),V.value=qt(Z,V.operator),Rt()}function Qe(V,w){const S=Wt(V);V.operator=w;const Z=Wt(V);if(S!==Z||ee.has(w)){const J=Se.value[V.key];V.value=qt(J?.type||"text",w)}Rt()}function Lt(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function tt(V,w,S){const Z=S.target.value,J=Z===""?null:Number(Z);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(J)?null:J}}function Tt(V,w){const S=V.value||[],Z=S.indexOf(w);V.value=Z>=0?S.filter(J=>J!==w):[...S,w]}function Xe(){Ce.value=[],be.value="",Rt()}function Be(V){be.value=V.target.value}function Je(V){Ie.value=V.target.value}function St(){ot.value=ot.value==="asc"?"desc":"asc"}const le=e.computed(()=>{if(!fe.data)return[];let V=fe.data;if(be.value){const w=be.value.toLowerCase();V=V.filter(S=>{for(const Z of Object.keys(S)){const J=S[Z];if(typeof J=="string"&&J.toLowerCase().includes(w)||typeof J=="number"&&String(J).includes(w)||Array.isArray(J)&&J.some(Ze=>Ze!=null&&(typeof Ze=="string"?Ze.toLowerCase().includes(w):typeof Ze=="object"?Object.values(Ze).some(gt=>typeof gt=="string"&>.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of Ce.value){if(!ge(w))continue;const S=Se.value[w.key];S&&(V=V.filter(Z=>ke(Z,w,S)))}if(fe.showSortBy&&Ie.value){const w=Ie.value,S=ot.value==="asc"?1:-1;V=[...V].sort((Z,J)=>U(Z?.[w],J?.[w])*S)}return V});function U(V,w){const S=Y(V),Z=Y(w);return S==null&&Z==null?0:S==null?1:Z==null?-1:typeof S=="number"&&typeof Z=="number"?S-Z:String(S).localeCompare(String(Z),void 0,{numeric:!0,sensitivity:"base"})}function Y(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function ge(V){return ee.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function ke(V,w,S){const Z=V?.[w.key],J=w.value,Ze=w.operator;if(Ze==="is_empty")return Jt(Z);if(Ze==="is_not_empty")return!Jt(Z);const gt=S.type;if(gt==="text"||gt==="arrayText"){const nt=gt==="arrayText"&&Array.isArray(Z)?Z.filter(zt=>zt!=null).map(String).join(" "):Z!=null?String(Z):"",xe=String(J).toLowerCase(),Nt=nt.toLowerCase();switch(Ze){case"contains":return Nt.includes(xe);case"not_contains":return!Nt.includes(xe);case"equals":return Nt===xe;case"not_equals":return Nt!==xe;case"starts_with":return Nt.startsWith(xe);case"ends_with":return Nt.endsWith(xe);default:return!0}}if(gt==="select")switch(Ze){case"is_any_of":return J.includes(Z);case"is_none_of":return!J.includes(Z);default:return!0}if(gt==="range"||gt==="int"){const nt=typeof Z=="number"?Z:Number(Z);if(typeof nt!="number"||isNaN(nt))return!1;if(Ze==="between"){const Nt=J?.min!=null?Number(J.min):null,zt=J?.max!=null?Number(J.max):null,$t=Nt!=null&&!isNaN(Nt)?Nt:null,it=zt!=null&&!isNaN(zt)?zt:null;return($t==null||nt>=$t)&&(it==null||nt<=it)}const xe=typeof J=="number"&&!isNaN(J)?J:Number(J);if(Ze==="contains"||Ze==="not_contains"){const Nt=String(nt),zt=String(J??"").toLowerCase(),$t=Nt.toLowerCase().includes(zt);return Ze==="contains"?$t:!$t}if(typeof xe!="number"||isNaN(xe))return!1;switch(Ze){case"eq":return nt===xe;case"neq":return nt!==xe;case"gt":return nt>xe;case"gte":return nt>=xe;case"lt":return nt<xe;case"lte":return nt<=xe;default:return!0}}if(gt==="arraySelect"){if(!Array.isArray(Z))return!1;const nt=Z.filter(xe=>xe!=null).map(xe=>S.displayKey&&typeof xe=="object"?xe[S.displayKey]:String(xe));switch(Ze){case"contains_any":return nt.some(xe=>J.includes(xe));case"contains_all":return J.every(xe=>nt.includes(xe));case"not_contains_any":return!nt.some(xe=>J.includes(xe));default:return!0}}if(gt==="date"){const nt=Le(J);if(!nt||isNaN(nt.getTime()))return!1;const xe=Le(Z);if(!xe||isNaN(xe.getTime()))return!1;const Nt=xt(xe),zt=xt(nt);switch(Ze){case"eq":return Nt===zt;case"before":return Nt<zt;case"after":return Nt>zt;default:return!0}}if(gt==="boolean"){const nt=Z===!0||Z==="true"||Z===1,xe=Z===!1||Z==="false"||Z===0;switch(Ze){case"is_true":return nt;case"is_false":return xe;default:return!0}}return!0}function Le(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function xt(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),Z=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${Z}`}function Jt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(le,V=>P("update:modelValue",V),{immediate:!0}),e.watch(()=>fe.data,()=>{Ce.value=[],be.value="",X.value=!1,Ie.value="",ot.value="asc",Rt()});function Vt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Ut(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const Z of Object.keys(w))S[Z]=V(w[Z]);return S}return w};return{globalSearch:be.value,rows:Ce.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:Se.value[w.key]?.type,defFilterMode:Se.value[w.key]?.filterMode})),filteredCount:le.value?.length??0}}return oe({getDebugState:Ut}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":pe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:de},[e.createElementVNode("div",k2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:be.value,onInput:Be},null,40,C2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":fe.showSortBy}]),onClick:w[1]||(w[1]=S=>X.value=!X.value),type:"button",title:X.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,b2),fe.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ie.value,onChange:Je},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:St,disabled:!Ie.value,title:rt.value},[Ie.value?ot.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",$2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(S,Z)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Z===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",T2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(It(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),Q.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=J=>H.value=J),placeholder:e.unref(L)("filter.searchAttributes")},null,8,H2),[[e.vModelText,H.value]]),e.createElementVNode("ul",R2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,J=>(e.openBlock(),e.createElementBlock("li",{key:J.key,class:"dss-filter-popup-item",onClick:Ze=>je(S,J.key)},e.toDisplayString(J.label),9,F2))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",I2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),ae(S)==="contain"||ae(S)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(me(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),Q.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===J.value}]),onClick:Ze=>Qe(S,J.value)},e.toDisplayString(J.label),11,q2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Re(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[ae(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":J=>S.value=J},null,8,U2)),[[e.vModelText,S.value]]):ae(S)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:S.value,"onUpdate:modelValue":J=>S.value=J},null,8,["modelValue","onUpdate:modelValue"])])):Wt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":J=>S.value=J},null,8,Y2)),[[e.vModelText,S.value]]):Wt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:S.value,onInput:J=>Lt(S,J),step:Se.value[S.key]?.type==="int"?1:void 0},null,40,j2)):Wt(S)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:S.value?.min,onInput:J=>tt(S,"min",J),step:Se.value[S.key]?.type==="int"?1:void 0},null,40,G2),e.createElementVNode("span",Q2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:S.value?.max,onInput:J=>tt(S,"max",J),step:Se.value[S.key]?.type==="int"?1:void 0},null,40,J2)])):Wt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(G(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),Q.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[Bt(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=J=>H.value=J),placeholder:e.unref(L)("filter.search")},null,8,l0)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",o0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J,class:"dss-filter-popup-item",onClick:Ze=>Tt(S,J)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(J),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(J),1)],8,a0))),128)),Pt(S).length===0?(e.openBlock(),e.createElementBlock("li",r0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:J=>_e(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>Et("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[$e.value&&!Ee.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,d0),[[e.vModelText,H.value]]),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Z=>Ee.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p0))),128)),K.value.length>0?(e.openBlock(),e.createElementBlock("li",f0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.label),9,v0))),128))])],64)):Ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>Ee.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ee.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,g0),[[e.vModelText,H.value]]),e.createElementVNode("ul",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.label),9,y0))),128)),We.value.length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,C0),[[e.vModelText,H.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.label),9,w0))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Xe},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V0={class:"dss-pill-field__pills"},N0=["data-value"],B0=["disabled"],M0={class:"dss-pill-field__pill-text"},_0={key:0,class:"dss-pill-field__pill-actions"},$0=["onClick"],L0=["onClick"],T0=["placeholder","disabled"],A0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{emit:oe}){const M=T,L=oe,fe=e.ref(""),P=e.ref([...M.modelValue]),A=e.ref(null);let pe=null;const ft=e.ref(null),ee=e.ref(""),f=e.ref(null),be=e.ref(null),Ce=e.computed(()=>{if(!be.value)return;const{width:$e,height:Ge}=be.value;return{minWidth:`${$e}px`,height:`${Ge}px`}});function Q($e,Ge){ft.value===Ge&&(f.value=$e)}function X(){ft.value=null,ee.value="",be.value=null,f.value=null}const de=e.computed(()=>new Set(P.value.map($e=>$e.trim()).filter(Boolean)));function H($e){A.value=$e,pe&&clearTimeout(pe),pe=setTimeout(()=>{A.value=null,pe=null},900)}function Ee($e){const Ge=$e.trim();return Ge?de.value.has(Ge)?(H(Ge),!1):(P.value=[...P.value,Ge],L("update:modelValue",[...P.value]),!0):!1}function Ie($e){const Ge=$e.split(/\r?\n/g).map(ct=>ct.trim()).filter(Boolean);if(!Ge.length)return;const K=new Set(P.value.map(ct=>ct.trim()).filter(Boolean)),We=[...P.value];let we=null;for(const ct of Ge){if(K.has(ct)){we??=ct;continue}K.add(ct),We.push(ct)}We.length!==P.value.length&&(P.value=We,L("update:modelValue",[...P.value])),we&&H(we)}function ot($e){M.disabled||(ft.value===$e&&X(),P.value=P.value.filter((Ge,K)=>K!==$e),L("update:modelValue",[...P.value]))}async function vt($e,Ge){if(M.disabled)return;const K=Ge.currentTarget.closest(".dss-pill-field__pill");K&&(be.value={width:K.offsetWidth,height:K.offsetHeight}),ft.value=$e,ee.value=P.value[$e]??"",await e.nextTick();const We=f.value;if(!We)return;We.focus();const we=We.value.length;We.setSelectionRange(we,we)}function q(){X()}function Ye(){if(M.disabled||ft.value===null)return;const $e=ft.value,Ge=P.value[$e]??"",K=ee.value.trim();if(X(),K!==Ge&&de.value.has(K)){H(K);return}if(!K){P.value=P.value.filter((we,ct)=>ct!==$e),L("update:modelValue",[...P.value]);return}const We=P.value.map((we,ct)=>ct===$e?K:we);P.value=We,L("update:modelValue",[...P.value])}function qe($e){$e.preventDefault(),!M.disabled&&(Ee(fe.value),fe.value="")}function Se($e){if(M.disabled)return;const Ge=$e.clipboardData?.getData("text")??"";!Ge.includes(`
|
|
118
|
+
`)&&!Ge.includes("\r")||($e.preventDefault(),Ie(Ge),fe.value="")}return e.watch(()=>M.modelValue,$e=>{P.value=Array.isArray($e)?[...$e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),($e,Ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":$e.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(K,We)=>(e.openBlock(),e.createElementBlock("span",{key:K,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===K,"dss-pill-field__pill--editing":ft.value===We}]),style:e.normalizeStyle(ft.value===We&&be.value?Ce.value:void 0)},[ft.value===We?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:we=>Q(we,We),"onUpdate:modelValue":Ge[0]||(Ge[0]=we=>ee.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:$e.disabled,onKeydown:[e.withKeys(Ye,["enter"]),e.withKeys(q,["esc"])],onBlur:Ye},null,40,B0),[[e.vModelText,ee.value]])],8,N0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",M0,e.toDisplayString(K),1),$e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",_0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>vt(We,we)},[...Ge[2]||(Ge[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,$0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:we=>ot(We)}," × ",8,L0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ge[1]||(Ge[1]=K=>fe.value=K),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":$e.placeholder,disabled:$e.disabled,onPaste:Se,onKeydown:e.withKeys(qe,["enter"])},null,40,T0),[[e.vModelText,fe.value]])])],2))}}),D0={class:"dss-step-bar__header"},H0={class:"dss-step-bar__label"},R0={key:0,class:"dss-step-bar__counter"},F0={class:"dss-step-bar__track-wrapper"},I0=["aria-valuemax","aria-valuenow","aria-label"],z0=["onMouseenter"],P0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:T=>["input","desc","asc"].includes(T)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(T){const oe=T,M={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=ae=>ae&&typeof ae=="object"&&!Array.isArray(ae),fe=(ae,me)=>{const Pe=Object.assign({},ae);return!L(ae)||!L(me)||Object.keys(me).forEach(Re=>{if(L(me[Re])){Re in ae?Pe[Re]=fe(ae[Re],me[Re]):Object.assign(Pe,{[Re]:me[Re]});return}Object.assign(Pe,{[Re]:me[Re]})}),Pe},P=e.computed(()=>fe(M,oe.options)),A=e.computed(()=>Math.max(1,Number(oe.steps)||1)),pe=e.computed(()=>Math.min(A.value,Math.max(0,Number(oe.currentStep)||0))),ft=e.computed(()=>Array.isArray(oe.segments)&&oe.segments.length>0),ee=e.computed(()=>{if(!ft.value)return[];const ae=oe.segments.map((me,Pe)=>{const Re=Number(me?.value);return{label:me?.label||`Step ${Pe+1}`,value:Number.isFinite(Re)&&Re>0?Re:0,color:me?.color||oe.activeColor,marker:me?.marker}});return oe.segmentOrder==="desc"?[...ae].sort((me,Pe)=>Pe.value-me.value):oe.segmentOrder==="asc"?[...ae].sort((me,Pe)=>me.value-Pe.value):ae}),f=e.computed(()=>ft.value?ee.value.reduce((ae,me)=>ae+me.value,0):pe.value),be=e.computed(()=>ft.value?Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0?Number(oe.totalValue):Math.max(1,f.value):A.value),Ce=e.computed(()=>ft.value&&Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0),Q=e.computed(()=>Ce.value?Math.max(0,Number(oe.totalValue)-f.value):0),X=e.computed(()=>typeof oe.remainderLabel=="string"&&oe.remainderLabel.trim().length>0),de=e.computed(()=>Q.value>0),H=e.computed(()=>ee.value.reduce((ae,me)=>Math.max(ae,Number(me.value)||0),0)),Ee=e.computed(()=>ee.value.filter(ae=>ae.value>0).map(ae=>`${ae.label}: ${ct(ae.value)}`).join(" | ")),Ie=e.computed(()=>ft.value?Ce.value?ee.value.filter(ae=>ae.value>0):ee.value:[]),ot=e.computed(()=>{if(!oe.counterAsPercentage)return`${f.value} / ${be.value}`;const ae=Number(be.value);if(!Number.isFinite(ae)||ae<=0)return"0%";const me=Math.round(Number(f.value)/ae*100);return`${Math.min(Math.max(me,0),100)}%`}),vt=e.computed(()=>f.value),q=e.computed(()=>be.value),Ye=e.reactive({visible:!1,x:0,content:""}),qe=e.computed(()=>({left:`${Ye.x}px`})),Se=ae=>{const me=ae?.parentElement;return me?me.offsetLeft+me.offsetWidth/2:0},$e=ae=>{if(Ce.value){const Re=Math.max(0,Number(ae.value)||0);return{flex:`${Re} 0 0`,minWidth:Re>0?"6px":"0",backgroundColor:ae.color}}const me=f.value;return{flex:`${ae.value>0?ae.value:me>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:ae.color}},Ge=ae=>Number(ae?.value||0)>0&&Number(ae?.value||0)===H.value,K=ae=>{const me=L(ae?.marker)?ae.marker:{},Pe=ae?.marker===!0||me.enabled===!0,Re=Ge(ae)&&P.value.maxSegment?.marker?.enabled===!0;if(!(Pe||Re))return{enabled:!1};const kt=me.backgroundColor??(Re?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),qt=me.borderColor??(Re?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),Bt=me.color??(Re?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Pt=me.width??(Re?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),G=me.height??(Re?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:kt,borderColor:qt,color:Bt,width:Pt,height:G,icon:me.icon??null,...me}},We=ae=>{const me=K(ae);return{backgroundColor:me.backgroundColor??void 0,borderColor:me.borderColor??void 0,color:me.color??void 0}},we=ae=>{const me=K(ae);return{width:me.width??void 0,height:me.height??void 0}},ct=ae=>`${ae}${oe.valueLabel}`,rt=e.computed(()=>({flex:`${Q.value} 0 0`,minWidth:Q.value>0?"6px":"0",backgroundColor:oe.inactiveColor})),Et=(ae,me)=>{if(!ae||!me?.currentTarget)return;const Pe=me.currentTarget;if(oe.remainderTooltipSummary){Ye.x=Se(Pe),Ye.content=Ee.value,Ye.visible=!!Ye.content;return}Ye.x=Pe.offsetLeft+Pe.offsetWidth/2,Ye.content=`${ae.label}: ${ct(ae.value)}`,Ye.visible=!0},Rt=ae=>{if(!Q.value||!ae?.currentTarget)return;const me=ae.currentTarget;if(oe.remainderTooltipSummary){Ye.x=Se(me),Ye.content=Ee.value,Ye.visible=!!Ye.content;return}Ye.x=me.offsetLeft+me.offsetWidth/2,X.value&&(Ye.content=`${oe.remainderLabel}: ${ct(Q.value)}`,Ye.visible=!0)},Qt=()=>{Ye.visible=!1},It=e.computed(()=>({"--dss-step-bar-label-color":oe.labelColor??void 0,"--dss-step-bar-counter-color":oe.counterColor??void 0,"--dss-step-bar-active-color":oe.activeColor,"--dss-step-bar-inactive-color":oe.inactiveColor}));return(ae,me)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(It.value)},[e.createElementVNode("div",D0,[e.createElementVNode("span",H0,[e.renderSlot(ae.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",R0,[e.renderSlot(ae.$slots,"counter",{counterDisplay:ot.value},()=>[e.createTextVNode(e.toDisplayString(ot.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",F0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":q.value,"aria-valuenow":vt.value,"aria-label":T.label},[ft.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(Pe,Re)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Re}-${Pe.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Ge(Pe),"dss-step-bar__segment--marker-enabled":K(Pe).enabled}]),style:e.normalizeStyle($e(Pe)),onMouseenter:Wt=>Et(Pe,Wt),onMouseleave:Qt},[K(Pe).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(We(Pe)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(we(Pe))},[e.renderSlot(ae.$slots,"segment-marker-icon",{segment:Pe,index:Re,marker:K(Pe)},()=>[e.renderSlot(ae.$slots,"max-segment-icon",{segment:Pe,index:Re,marker:K(Pe)},()=>[e.createTextVNode(e.toDisplayString(K(Pe).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,z0))),128)),de.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(rt.value),onMouseenter:me[0]||(me[0]=Pe=>Rt(Pe)),onMouseleave:Qt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,Pe=>(e.openBlock(),e.createElementBlock("div",{key:Pe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":Pe<=pe.value}])},null,2))),128))],8,I0),Ye.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(qe.value)},e.toDisplayString(Ye.content),5)):e.createCommentVNode("",!0)])],4))}},O0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},W0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},q0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Z0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},U0={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Ql={chart:O0,table:W0,filter:q0,datepicker:Z0,textEditor:U0},X0={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},Y0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},j0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},K0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},G0={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Jl={chart:X0,table:Y0,filter:j0,datepicker:K0,textEditor:G0},Q0={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},J0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},e9={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},t9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},n9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:Q0,table:J0,filter:e9,datepicker:t9,textEditor:n9},Ho={en:Ql,fr:Jl,nl:eo};function ca(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Ho).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Ho[M])})}const Ro={en:{textEditor:Ql.textEditor},fr:{textEditor:Jl.textEditor},nl:{textEditor:eo.textEditor}};function ua(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Ro).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Ro[M])})}const Fo={en:{table:Ql.table},fr:{table:Jl.table},nl:{table:eo.table}};function da(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Fo).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Fo[M])})}const Io={en:{datepicker:Ql.datepicker},fr:{datepicker:Jl.datepicker},nl:{datepicker:eo.datepicker}};function ma(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Io).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Io[M])})}const zo={en:{filter:Ql.filter},fr:{filter:Jl.filter},nl:{filter:eo.filter}};function pa(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(zo).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,zo[M])})}const l9={chart:Ho,textEditor:Ro,table:Fo,datepicker:Io,filter:zo};function o9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const a9={en:{...Ql},fr:{...Jl},nl:{...eo}};Gl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:a9});exports.DSSChart=lc;exports.DSSChartMessages=Ho;exports.DSSColorPicker=qm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Io;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=zo;exports.DSSLoader=l2;exports.DSSMessages=l9;exports.DSSModal=Jo;exports.DSSPillField=A0;exports.DSSSkeleton=o2;exports.DSSStepBar=P0;exports.DSSTable=Su;exports.DSSTableMessages=Fo;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=ca;exports.addDSSDatepickerTranslations=ma;exports.addDSSFilterTranslations=pa;exports.addDSSTableTranslations=da;exports.addDSSTextEditorTranslations=ua;exports.addDSSTranslations=o9;
|