dsp-semactic 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),co=require("vue-i18n"),$a={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},La=["value"],Ta=["placeholder","value","disabled"],Aa=["placeholder","value"],Da=["placeholder","value"],Ha=["aria-selected","onClick"],Ra={class:"dss-datepicker__list-item-label"},Fa={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},Ia={key:1,class:"dss-datepicker__list-empty"},za={key:1,class:"dss-datepicker__double-wrap"},Pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Oa=["disabled","onClick"],Wa={class:"dss-datepicker__double-calendars"},qa={class:"dss-datepicker__double-calendar"},Za={class:"dss-datepicker__calendar-header"},Ua=["aria-label"],Xa={class:"dss-datepicker__month-year-row"},Ya=["aria-label"],ja={class:"dss-datepicker__weekdays"},Ka={class:"dss-datepicker__grid"},Ga=["disabled","onClick","onMouseenter"],Qa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ja={class:"dss-datepicker__double-calendar"},es={class:"dss-datepicker__calendar-header"},ts=["aria-label"],ns={class:"dss-datepicker__month-year-row"},ls=["aria-label"],os={class:"dss-datepicker__weekdays"},as={class:"dss-datepicker__grid"},ss=["disabled","onClick","onMouseenter"],rs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},is={class:"dss-datepicker__calendar-header"},cs=["aria-label"],us={class:"dss-datepicker__month-year-row"},ds=["aria-label"],ms={class:"dss-datepicker__weekdays"},ps={class:"dss-datepicker__grid"},fs=["disabled","onClick","onMouseenter"],vs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},gs={class:"dss-datepicker__calendar-header"},hs={class:"dss-datepicker__month-year-row"},ys={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ks={class:"dss-datepicker__months-grid"},Cs=["onClick"],bs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ws={class:"dss-datepicker__month-year"},xs={class:"dss-datepicker__years-grid"},Es=["data-year","onClick"],ua=27,ql=8,la={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},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(E,{emit:ne}){const $=E,V=ne,{t:ce,locale:I}=co.useI18n(),_=e.ref(!1),pe=e.ref("days"),st=new Date,te=e.computed(()=>$.minDate instanceof Date?$.minDate:st),v=e.ref(te.value.getMonth()),Ce=e.ref(te.value.getFullYear()),ke=e.ref(te.value.getMonth()),Q=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),me=e.ref(te.value.getFullYear()),F=e.ref("start"),ue=e.ref(null),Me=e.ref(null);function tt(){const A=te.value,z=A.getMonth(),L=A.getFullYear(),le=z===11?0:z+1,Te=z===11?L+1:L;return{left:{month:z,year:L},right:{month:le,year:Te}}}const mt=e.ref(null),Z=e.ref(null),Ae=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(null),Ye=e.ref(null),ie=e.ref(null),Je=new Date().getFullYear(),we=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),et=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),ct=e.computed(()=>$.mode==="listFromAvailable"),vt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const A=$.modelValue;return A instanceof Date?A:null}),ut=e.computed(()=>{if(!et.value)return{start:null,end:null};const A=$.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function Ft(A){if(!A||!(A instanceof Date))return"";const z=A.getDate(),L=A.getMonth()+1,le=A.getFullYear(),Te=ft=>String(ft).padStart(2,"0");return`${Te(z)}/${Te(L)}/${le}`}const It=e.computed(()=>Ft(vt.value)),bt=e.computed(()=>{const{start:A,end:z}=ut.value;if(!A&&!z)return"";const L=!z||A&&A<=z?A:z,le=!A||z&&z>=A?z:A;return Xt(L,le)?Ft(L):`${Ft(L)} - ${Ft(le)}`}),wt=e.computed(()=>{if($.mode!=="readonly")return"—";const A=$.modelValue;if(A instanceof Date)return Ft(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const z=A.start instanceof Date?A.start:null,L=A.end instanceof Date?A.end:null;if(!z&&!L)return"—";const le=!L||z&&z<=L?z:L,Te=!z||L&&L>=z?L:z;return Xt(le,Te)?Ft(le):`${Ft(le)} - ${Ft(Te)}`}return"—"});e.computed(()=>{const A=new Date(Ce.value,v.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const Jt=e.computed(()=>Me.value==="left"?ke.value:Me.value==="right"?X.value:v.value),pt=e.computed(()=>Me.value==="left"?Q.value:Me.value==="right"?me.value:Ce.value),jt=e.computed(()=>{const A=new Date(Ce.value,v.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),kt=e.computed(()=>{const A=new Date(pt.value,Jt.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),tn=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(z,L)=>A.format(new Date(2024,L,1)))}),U=e.computed(()=>{const z=(Me.value?pt.value:Ce.value)-Math.floor(ua/2);return Array.from({length:ua},(L,le)=>z+le)}),ye=e.computed(()=>{const A=U.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""});function P(A){return A===7?0:A}function K(A){try{const z=new Intl.Locale(A);if(z.weekInfo?.firstDay!=null)return P(z.weekInfo.firstDay)}catch{}return 1}function Se(A){const z=new Date(2024,0,1),L=(z.getDay()-A+7)%7,le=new Date(z);return le.setDate(z.getDate()-L),le}const Re=e.computed(()=>K(I.value)),Ze=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{weekday:"short"}),z=Se(Re.value),L=[];for(let le=0;le<7;le++){const Te=new Date(z);Te.setDate(z.getDate()+le),L.push(A.format(Te).slice(0,2))}return L});function xt(A,z,L){const le=new Date(A,z,1),Te=new Date(A,z+1,0),ft=(le.getDay()-L+7)%7,dt=Te.getDate(),ot=[];for(let at=0;at<ft;at++)ot.push(null);for(let at=1;at<=dt;at++)ot.push(new Date(A,z,at));return ot}const Ke=e.computed(()=>xt(Ce.value,v.value,Re.value)),zt=e.computed(()=>xt(Q.value,ke.value,Re.value)),qe=e.computed(()=>xt(me.value,X.value,Re.value));e.computed(()=>{const A=new Date(Q.value,ke.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const ze=e.computed(()=>{const A=new Date(Q.value,ke.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),Lt=e.computed(()=>{const A=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),$t=e.computed(()=>$.availableDates&&$.availableDates.length>0),oe=e.computed(()=>$t.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"}]),Y=e.ref({top:0,left:0}),j=e.ref("left");let de=null;function be(){_.value&&e.nextTick(()=>{_.value&&(de!==null&&window.cancelAnimationFrame(de),de=window.requestAnimationFrame(()=>{de=null,je()}))})}function je(){if(!Ee.value||!_.value)return;const A=Ee.value.getBoundingClientRect(),z=window.innerWidth||document.documentElement.clientWidth,L=window.innerHeight||document.documentElement.clientHeight;let le=A.left,Te=A.bottom+4;const ft=_e.value;if(ft){const dt=ft.offsetWidth,ot=ft.offsetHeight;j.value==="right"||le+dt>z-ql?(j.value="right",le=A.right-dt):j.value="left";const vn=Math.max(ql,z-dt-ql);if(le=Math.min(Math.max(le,ql),vn),Te+ot>L-ql){const bn=A.top-4-ot;bn>=ql?Te=bn:Te=Math.max(ql,L-ot-ql)}}Y.value={top:Te,left:le}}const Tt=e.computed(()=>!Ee.value||!_.value?{}:{position:"fixed",left:`${Y.value.left}px`,top:`${Y.value.top}px`,zIndex:1002});function Xt(A,z){return!A||!z?!1:A.getFullYear()===z.getFullYear()&&A.getMonth()===z.getMonth()&&A.getDate()===z.getDate()}function nt(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function sn(A){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(z=>z instanceof Date&&Xt(z,A))}function N(A){const z=nt(A);return!($.minDate instanceof Date&&z<nt($.minDate)||$.maxDate instanceof Date&&z>nt($.maxDate))}function b(A){const z=new Date(A);return new Date(z.getFullYear(),z.getMonth(),z.getDate())}function B(A){return A.filter(z=>N(z))}function G(A,z){if(!(A instanceof Date)||!(z instanceof Date))return null;let L=nt(A),le=nt(z);if(L>le&&([L,le]=[le,L]),$.minDate instanceof Date){const Te=nt($.minDate);L=Math.max(L,Te),le=Math.max(le,Te)}if($.maxDate instanceof Date){const Te=nt($.maxDate);L=Math.min(L,Te),le=Math.min(le,Te)}return L>le?null:{start:b(L),end:b(le)}}function ae(A){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(z=>z instanceof Date&&Xt(z,A))}function De(A){return ae(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?sn(A):N(A)}function Ct(A){const z=vt.value,L=ut.value,le=nt(A),Te=et.value&&L.start&&L.end&&le>nt(L.start)&&le<nt(L.end),ft=et.value&&L.start&&Xt(A,L.start),dt=et.value&&L.end&&Xt(A,L.end),ot=ft&&dt,at=we.value&&z&&Xt(A,z)||ft||dt;let vn=!1;if(et.value&&L.start&&!L.end&&ue.value){const bn=nt(L.start),Wt=nt(ue.value),gn=Math.min(bn,Wt),Kt=Math.max(bn,Wt);vn=le>gn&&le<Kt}return{"dss-datepicker__day--selected":at&&!ot,"dss-datepicker__day--range-start":ft&&!ot,"dss-datepicker__day--range-end":dt&&!ot,"dss-datepicker__day--range-single":ot,"dss-datepicker__day--in-range":Te&&!ft&&!dt,"dss-datepicker__day--in-range-preview":vn&&!ft&&!dt&&!Te,"dss-datepicker__day--disabled":!De(A)}}function lt(A){if(!et.value)return;const z=ut.value;if(!z.start||z.end){ue.value=null;return}if(!De(A)){ue.value=null;return}ue.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function Ie(){ue.value=null}function Et(){if(!$.doubleCalendar||!et.value)return;const A=ut.value,{start:z,end:L}=A;if(z&&L){const ft=z<=L?z:L,dt=z<=L?L:z,ot=ft.getMonth(),at=ft.getFullYear(),vn=dt.getMonth(),bn=dt.getFullYear();if(ot!==vn||at!==bn){const Wt=ke.value===ot&&Q.value===at,gn=X.value===vn&&me.value===bn;if(Wt&&gn)return;ke.value=ot,Q.value=at,X.value=vn,me.value=bn}else{const Wt=ot===0?11:ot-1,gn=ot===0?at-1:at;ke.value===Wt&&Q.value===gn&&X.value===ot&&me.value===at||(ke.value=ot,Q.value=at,ot===11?(X.value=0,me.value=at+1):(X.value=ot+1,me.value=at))}return}const le=z||L;if(le){const ft=le.getMonth(),dt=le.getFullYear(),ot=ke.value===ft&&Q.value===dt,at=X.value===ft&&me.value===dt;if(ot||at)return;ke.value=ft,Q.value=dt,ft===11?(X.value=0,me.value=dt+1):(X.value=ft+1,me.value=dt);return}const Te=tt();ke.value=Te.left.month,Q.value=Te.left.year,X.value=Te.right.month,me.value=Te.right.year}const Bt=e.computed(()=>new Intl.DateTimeFormat(I.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ct.value)return[];const A=($.availableDates||[]).filter(L=>L instanceof Date&&!Number.isNaN(L.getTime())).filter(L=>!ae(L)&&N(L)).map(L=>new Date(L.getFullYear(),L.getMonth(),L.getDate()));A.sort((L,le)=>le.getTime()-L.getTime());const z=vt.value;return A.map(L=>({date:L,ts:L.getTime(),label:Bt.value.format(L),selected:!!(z&&Xt(L,z))}))});function rt(){if(_.value){rn();return}Ee.value=We.value?.closest(".dss-datepicker__input-wrap"),j.value="left",_.value=!0,be(),e.nextTick(()=>{ie.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function At(A){if(!(A instanceof Date))return;const z=new Date(A.getFullYear(),A.getMonth(),A.getDate());V("update:modelValue",z),rn()}function Nt(A="start"){if($.mode==="readonly")return;F.value=A;const z=vt.value,L=ut.value;if(we.value&&z)v.value=z.getMonth(),Ce.value=z.getFullYear();else if(et.value)if($.doubleCalendar)Et();else{const le=A==="start"&&L.start?L.start:L.end||L.start;le&&(v.value=le.getMonth(),Ce.value=le.getFullYear())}Ee.value=we.value?mt.value?.closest(".dss-datepicker__input-wrap"):Z.value,pe.value="days",Me.value=null,j.value="left",_.value=!0,be()}function rn(){pe.value="days",Me.value=null,ue.value=null,_.value=!1}function Vn(A,z){Me.value=A,pe.value=z}function Zn(){pe.value="days",Me.value=null}function en(A){const z=new Date,L=z.getFullYear(),le=z.getMonth(),Te=z.getDate();let ft,dt;if($t.value){const ot=B([...$.availableDates].filter(at=>at instanceof Date).map(at=>new Date(at.getFullYear(),at.getMonth(),at.getDate()))).sort((at,vn)=>at.getTime()-vn.getTime());if(ot.length===0)return null;if(A==="all")ft=ot[0],dt=ot[ot.length-1];else{const at=parseInt(A.replace("last",""),10);if(at<2||at>5)return null;const vn=ot.slice(-at);if(vn.length===0)return null;ft=vn[0],dt=vn[vn.length-1]}}else{const ot=new Date(L,le,Te);switch(A){case"today":ft=ot,dt=ot;break;case"lastWeek":ft=new Date(L,le,Te-6),dt=ot;break;case"last15Days":ft=new Date(L,le,Te-14),dt=ot;break;case"last30Days":ft=new Date(L,le,Te-29),dt=ot;break;case"thisMonth":ft=new Date(L,le,1),dt=ot;break;case"last3Months":ft=new Date(L,le-3,1),dt=new Date(L,le,0);break;case"last6Months":ft=new Date(L,le-6,1),dt=new Date(L,le,0);break;case"last12Months":ft=new Date(L,le-12,1),dt=new Date(L,le,0);break;case"lastYear":ft=new Date(L-1,0,1),dt=new Date(L-1,11,31);break;default:return null}}return{start:ft,end:dt}}function pn(A){const z=en(A);return z?G(z.start,z.end):null}function ll(A){return pn(A)!==null}function vl(A){const z=pn(A);z&&(V("update:modelValue",z),Et())}function il(A){Me.value==="left"?ke.value=A:Me.value==="right"?X.value=A:v.value=A,Zn()}function _n(A){Me.value==="left"?Q.value=A:Me.value==="right"?me.value=A:Ce.value=A,Zn()}function gl(){v.value===0?(v.value=11,Ce.value--):v.value--}function $n(){v.value===11?(v.value=0,Ce.value++):v.value++}function Vl(){ke.value===0?(ke.value=11,Q.value--):ke.value--}function Rl(){ke.value===11?(ke.value=0,Q.value++):ke.value++}function hl(){X.value===0?(X.value=11,me.value--):X.value--}function An(){X.value===11?(X.value=0,me.value++):X.value++}function Un(A){if(!De(A))return;const z=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(we.value){V("update:modelValue",z),rn();return}const L=ut.value;if(!L.start&&!L.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(L.start&&L.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(F.value==="start"){let le=z,Te=L.end;le&&Te&&le>Te&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="end"}else{let le=L.start,Te=z;le&&Te&&Te<le&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="start"}}e.watch(ut,()=>{$.doubleCalendar&&et.value&&_.value&&Et()},{deep:!0});let Xn=null,Hn=null,zn=null;function Nl(){Xn&&(document.removeEventListener("keydown",Xn),Xn=null),Hn&&(window.removeEventListener("resize",Hn),Hn=null),zn&&(window.removeEventListener("scroll",zn,!0),zn=null)}return e.watch(pe,A=>{A==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${pt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[_.value,pe.value,v.value,Ce.value,ke.value,Q.value,X.value,me.value,Me.value,$.doubleCalendar,$.quickSelect],()=>{be()}),e.watch(_,A=>{Nl(),A&&(Xn=z=>{z.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Zn():rn())},Hn=()=>{je()},zn=()=>{je()},document.addEventListener("keydown",Xn),window.addEventListener("resize",Hn),window.addEventListener("scroll",zn,!0))}),e.onBeforeUnmount(()=>{de!==null&&(window.cancelAnimationFrame(de),de=null),Nl()}),(A,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",$a,[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:wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,La)])):we.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:z[0]||(z[0]=L=>Nt("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:mt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectDate"),value:It.value,readonly:"",disabled:E.mode==="readonly"},null,8,Ta)])):ct.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":_.value}]),onClick:rt},[z[13]||(z[13]=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:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectFromList"),value:It.value,readonly:""},null,8,Aa),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":_.value}]),"aria-hidden":"true"},[...z[12]||(z[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):et.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:z[1]||(z[1]=L=>Nt("start"))},[z[14]||(z[14]=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:Ae,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectRange"),value:bt.value,readonly:""},null,8,Da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(rn,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&et.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&et.value&&pe.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ct.value}]),onClick:z[9]||(z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Tt.value)},[ct.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,L=>(e.openBlock(),e.createElementBlock("li",{key:L.ts,role:"option","aria-selected":L.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":L.selected}]),onClick:le=>At(L.date)},[e.createElementVNode("span",Ra,e.toDisplayString(L.label),1),L.selected?(e.openBlock(),e.createElementBlock("svg",Fa,[...z[15]||(z[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,Ha))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):pe.value==="days"&&E.doubleCalendar&&et.value?(e.openBlock(),e.createElementBlock("div",za,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!ll(L.id),onClick:le=>vl(L.id)},e.toDisplayString(e.unref(ce)(L.labelKey)),9,Oa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Wa,[e.createElementVNode("div",qa,[e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Vl}," ‹ ",8,Ua),e.createElementVNode("div",Xa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[2]||(z[2]=L=>Vn("left","months"))},e.toDisplayString(ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[3]||(z[3]=L=>Vn("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Rl}," › ",8,Ya)]),e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,Ga)):(e.openBlock(),e.createElementBlock("span",Qa))],64))),128))])]),e.createElementVNode("div",Ja,[e.createElementVNode("div",es,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:hl}," ‹ ",8,ts),e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[4]||(z[4]=L=>Vn("right","months"))},e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[5]||(z[5]=L=>Vn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:An}," › ",8,ls)]),e.createElementVNode("div",os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,ss)):(e.openBlock(),e.createElementBlock("span",rs))],64))),128))])])])])):pe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:gl}," ‹ ",8,cs),e.createElementVNode("div",us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[6]||(z[6]=L=>pe.value="months")},e.toDisplayString(jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[7]||(z[7]=L=>pe.value="years")},e.toDisplayString(Ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:$n}," › ",8,ds)]),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(L,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(L)]),disabled:!De(L),onClick:Te=>Un(L),onMouseenter:Te=>lt(L),onMouseleave:Ie},e.toDisplayString(L.getDate()),43,fs)):(e.openBlock(),e.createElementBlock("span",vs))],64))),128))])],64)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("span",ys,e.toDisplayString(kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[8]||(z[8]=L=>pe.value="years")},e.toDisplayString(pt.value),1)])]),e.createElementVNode("div",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(L,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===Jt.value}]),onClick:Te=>il(le)},e.toDisplayString(L),11,Cs))),128))])],64)):pe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",bs,[e.createElementVNode("span",ws,e.toDisplayString(ye.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":L===pt.value,"dss-datepicker__year-cell--current":L===e.unref(Je)}]),"data-year":L,onClick:le=>_n(L)},e.toDisplayString(L),11,Es))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ss=["data-chart-type"],Vs={class:"dss-chart-header-titles"},Ns={key:0,class:"dss-chart-title"},Bs={key:1,class:"dss-chart-subtitle"},Ms=["onClick","onMouseenter"],_s={class:"dss-legend-text"},$s=["onClick","onMouseenter"],Ls={class:"dss-legend-text"},Ts=["title"],As=["src"],Ds={class:"dss-chart-area-wrapper"},Hs={key:0,class:"dss-chart-z-axis-label"},Rs=["width","height","data-smooth","data-animated"],Fs=["id"],Is=["y","width","height"],zs=["id"],Ps=["d"],Os=["id"],Ws=["d"],qs={key:0},Zs=["clip-path"],Us=["x1","x2","y1","y2"],Xs={class:"dss-axes"},Ys=["x1","x2","y1","y2"],js=["x1","x2","y1","y2"],Ks=["x1","x2","y1","y2"],Gs={class:"dss-axis-labels"},Qs=["x","y"],Js=["x","y"],er=["x","y"],tr=["x","y"],nr=["y","transform"],lr=["x","y","transform"],or={key:1,class:"dss-flag-markers"},ar=["clip-path"],sr=["x1","x2","y1","y2","onMouseover"],rr=["x1","x2","y1","y2","onMouseover"],ir=["x1","x2","y1","y2","onMouseover"],cr=["cx","cy","onMouseover"],ur=["cx","cy","fill","onMouseover"],dr=["x","y"],mr=["clip-path"],pr={key:0},fr=["d","onMouseover"],vr=["x","y","width","height","fill","onMouseover"],gr={class:"dss-line-chart"},hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:1},br=["d","stroke","stroke-width","stroke-dasharray"],wr=["d","stroke","stroke-width","stroke-dasharray"],xr=["d","stroke","stroke-width","opacity"],Er=["cx","cy","r","fill","onMouseover"],Sr={key:2},Vr=["id"],Nr=["x","y","width","height"],Br=["d","fill","fill-opacity","mask"],Mr=["d","stroke","stroke-width"],_r=["d","fill","onMouseover"],$r=["x","y","width","height","onMouseover"],Lr=["clip-path"],Tr=["x1","x2","y1","y2","stroke"],Ar=["cx","cy","r","fill"],Dr={key:1,class:"dss-bubble-chart"},Hr={key:0,class:"dss-bubble-group"},Rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Fr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ir=["transform"],zr=["cx","cy","r"],Pr=["data-chart-type","clip-path"],Or=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Wr={key:1,class:"dss-radial-segment-data-labels"},qr=["x","y"],Zr=["x","y","font-size","fill"],Ur=["x1","y1","x2","y2","stroke"],Xr=["x1","y1","x2","y2","stroke"],Yr=["x","y","text-anchor","font-size"],jr=["transform"],Kr={key:0,class:"dss-spider-grid"},Gr=["cx","cy","r"],Qr={class:"dss-spider-grid-labels"},Jr=["x","y"],ei=["x","y"],ti=["x1","x2","y1","y2"],ni={class:"dss-spider-labels"},li=["x","y","text-anchor","dominant-baseline"],oi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ai=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],si={class:"dss-chart-logos"},ri=["cx","cy","r","fill"],ii=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ci=["onClick","onMouseenter"],ui=["src"],di={class:"dss-marker-tooltip-category"},mi={key:0,class:"dss-marker-tooltip-description"},pi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},fi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},vi={class:"dss-tooltip-series-name"},gi={class:"dss-tooltip-series-value"},hi={key:1,class:"dss-tooltip-section"},yi={key:0,class:"dss-tooltip-title"},ki={class:"dss-bubble-tooltip-data"},Ci={key:2,class:"dss-tooltip-section"},bi={class:"dss-tooltip-title"},wi={class:"dss-tooltip-value"},xi={key:0,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-group-header"},Vi={class:"dss-tooltip-item-content"},Ni={class:"dss-tooltip-item-text"},Bi={key:1,class:"dss-tooltip-section"},Mi={class:"dss-tooltip-section-title"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-title"},Li={key:0,class:"dss-tooltip-item-description"},Ti={class:"dss-tooltip-section"},Ai={class:"dss-tooltip-title"},Di={key:0,class:"dss-bubble-tooltip-data"},Hi={class:"dss-tooltip-series-name"},Ri={class:"dss-tooltip-series-value"},Fi={key:0,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-group-header"},Pi={class:"dss-tooltip-item-content"},Oi={class:"dss-tooltip-item-text"},Wi={key:1,class:"dss-tooltip-section"},qi={class:"dss-tooltip-section-title"},Zi={class:"dss-tooltip-item-content"},Ui={class:"dss-tooltip-item-title"},Xi={key:0,class:"dss-tooltip-item-description"},Yi=["onClick","onMouseenter"],ji={class:"dss-legend-text"},Ki={key:1,class:"dss-context-menu-separator"},Gi={key:0,class:"dss-context-menu-separator"},Qi={key:0,class:"dss-context-menu-separator"},Ji=["onClick"],ec=["innerHTML"],tc={key:0,class:"dss-context-menu-icon"},nc={class:"dss-marker-modal-header"},lc={class:"dss-marker-modal-body"},oc={class:"dss-form-group"},ac={class:"dss-form-group"},sc={for:"dss-marker-description"},rc={key:0,class:"dss-form-text-display"},ic=["placeholder"],cc={class:"dss-marker-modal-footer"},uc={class:"modal-footer-left"},dc={class:"dss-modal-footer-right"},mc=["disabled"],pc={name:"DSSChart"},fc=Object.assign(pc,{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:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:ne}){const{t:$,locale:V}=co.useI18n(),ce=ne,I=e.ref(null),_=e.ref(null),pe=e.ref(null),st=e.ref(0),te=e.ref(0);let v=null,Ce=null;const ke=20,Q=e.computed(()=>{if(te.value,st.value,!I.value||!_.value)return 0;try{const t=I.value.getBoundingClientRect();return _.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${X.value})`),F=E,ue={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,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},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 Me(t,a){const n=Object.assign({},t);return mt(t)&&mt(a)&&Object.keys(a).forEach(r=>{mt(a[r])?r in t?n[r]=Me(t[r],a[r]):Object.assign(n,{[r]:a[r]}):Object.assign(n,{[r]:a[r]})}),n}const tt=()=>{let t=20,a=0,n=0;if(ct.value&&(t+=30),vt.value&&(t+=25),P.value&&F.series.length>0){const r=F.series.filter((p,g)=>!Ht.value.has(g)).length;if(K.value==="top"||K.value==="bottom"){if(Se.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(r/g)*25+10}else a=r*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Me(ue,F.options)),Ae=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=Z.value;return Ae.value?st.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),_e=e.ref(ke),Ye=e.computed(()=>{if(We.value){const t=Ye.value;return t??Math.max(0,(te.value||400)-_e.value*5)}}),ie=e.computed(()=>{const t=Z.value;if(we.value==="mini-radial")return Ee.value;if(We.value){const a=Ye.value;return a??Math.max(0,(te.value||400)-_e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Je=e.computed(()=>{if(We.value&&we.value==="semi-radial"&&Ye.value!=null)return _e.value+ie.value+"px";if(We.value)return"100%";if(Sn.value)return _e.value+ie.value+"px";if(P.value&&K.value==="bottom"){const t=tt();return ie.value+(t.legendHeight||35)+"px"}return ie.value+(P.value?20:0)+"px"}),we=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),et=e.computed(()=>{const t=F.series.map(a=>a.type||we.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),vt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ut=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Ft=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),bt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),wt=e.computed(()=>{const t=bt.value;return t&&t.title&&t.title.text?t.title.text:""}),Jt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.min;return typeof a=="number"||a===Dn?a:Dn}),pt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.max;return typeof a=="number"||a===Dn?a:Dn}),jt=e.computed(()=>{const t=bt.value;if(!t)return Dn;const a=t.min;return typeof a=="number"||a===Dn?a:Dn}),kt=e.computed(()=>{const t=bt.value;if(!t)return Dn;const a=t.max;return typeof a=="number"||a===Dn?a:Dn}),tn=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),U=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ye=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),P=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),K=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Se=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Re=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ze=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),xt=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ke=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),zt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),qe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),ze=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Lt=e.computed(()=>{if(!Sn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),$t=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),oe=e.computed(()=>{const{maxX:t}=Vt.value;return t===0}),Y=(t,a)=>oe.value&&a===0?5:a,j=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},de=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),be=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),je=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Tt=e.computed(()=>{const t=Z.value;return be.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Xt=e.computed(()=>{const t=Z.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),nt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),sn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),N=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),B=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),G=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ae=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),De=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ct=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),lt=e.computed(()=>Z.value?.spider?.gridSteps||5),Ie=e.computed(()=>{const t=[],a=lt.value;for(let n=1;n<=a;n++)t.push(it.value/a*n);return t}),Et=t=>{const a=Bt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=Ie.value[t];return Math.round(n/it.value*100)+"%"},Bt=e.computed(()=>Z.value?.spider?.gridLabels||null),St=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),rt=e.computed(()=>{const t=Z.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),At=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Nt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Un.value}),rn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Vn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Zn=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),en=t=>{const a=Zn.value;if(t==null)return"";const n=String(t);return a?n+a:n},pn=e.computed(()=>!se.value.isZooming);e.computed(()=>on.value.map(t=>{if(t.categoryIndex!==void 0&&(En.value||Yt.value)){const a=ln(t.categoryIndex),n=Q.value+O.value.bottom-Vn.value/2;return{...t,x:a,y:n}}return t}));function ll(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,w]=t.split("-"),W=Number(w?.length===2?`20${w}`:w);n=new Date(W,Number(C)-1,Number(g))}else return 0;let r=0,p=1/0;return a.forEach((g,C)=>{const[w,W,M]=g.split("-"),H=Number(M?.length===2?`20${M}`:M),T=new Date(H,Number(W)-1,Number(w)),ee=Math.abs(T-n);ee<p&&(p=ee,r=C)}),r}const vl=e.computed(()=>{const t=F.markers.map(n=>{const r=ll(n.marker_date,F.categories),p=ln(r),g=Q.value+O.value.bottom-Vn.value/2;return{...n,x:p,y:g,categoryIndex:r,source:"props"}}),a=on.value.map(n=>{if(n.categoryIndex!==void 0&&(En.value||Yt.value)){const r=ln(n.categoryIndex),p=Q.value+O.value.bottom-Vn.value/2;return{...n,x:r,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),il=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),_n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),gl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),$n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Vl=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let a,n;const r=String(gl.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Rl=e.computed(()=>{const{width:t,height:a}=Vl.value,n=$n.value;let r,p;const g=O.value.left,C=O.value.right,w=O.value.top,W=O.value.bottom,M=O.value.width,H=O.value.height;switch(n){case"center":r=g+(M-t)/2,p=w+(H-a)/2;break;case"top-left":r=g+15,p=w+5;break;case"top-right":r=C-t-15,p=w+5;break;case"bottom-left":r=g+15,p=W-a-5;break;case"bottom-right":default:r=C-t-15,p=W-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),hl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),An=t=>{const a=hl(t),n=kl(t),r=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return r.length>0&&g.push({type:$("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.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"}))}},Un=e.computed(()=>{const t=F.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"),so=require("vue-i18n"),os={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},as=["value"],ss=["placeholder","value","disabled"],rs=["placeholder","value"],is=["placeholder","value"],cs=["aria-selected","onClick"],us={class:"dss-datepicker__list-item-label"},ds={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},ms={key:1,class:"dss-datepicker__list-empty"},ps={key:1,class:"dss-datepicker__double-wrap"},vs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fs=["disabled","onClick"],hs={class:"dss-datepicker__double-calendars"},gs={class:"dss-datepicker__double-calendar"},ys={class:"dss-datepicker__calendar-header"},ks=["aria-label"],Cs={class:"dss-datepicker__month-year-row"},bs=["aria-label"],ws={class:"dss-datepicker__weekdays"},xs={class:"dss-datepicker__grid"},Es=["disabled","onClick","onMouseenter"],Ss={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Vs={class:"dss-datepicker__double-calendar"},Ns={class:"dss-datepicker__calendar-header"},Bs=["aria-label"],Ms={class:"dss-datepicker__month-year-row"},_s=["aria-label"],$s={class:"dss-datepicker__weekdays"},Ls={class:"dss-datepicker__grid"},Ts=["disabled","onClick","onMouseenter"],As={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ds={class:"dss-datepicker__calendar-header"},Hs=["aria-label"],Rs={class:"dss-datepicker__month-year-row"},Fs=["aria-label"],Is={class:"dss-datepicker__weekdays"},zs={class:"dss-datepicker__grid"},Ps=["disabled","onClick","onMouseenter"],Os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ws={class:"dss-datepicker__calendar-header"},qs={class:"dss-datepicker__month-year-row"},Zs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Us={class:"dss-datepicker__months-grid"},Xs=["onClick"],Ys={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},js={class:"dss-datepicker__month-year"},Ks={class:"dss-datepicker__years-grid"},Gs=["data-year","onClick"],Ea=27,In=8,ca={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},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(E,{emit:le}){const _=E,B=le,{t:de,locale:P}=so.useI18n(),T=e.ref(!1),he=e.ref("days"),st=new Date,te=e.computed(()=>_.minDate instanceof Date?_.minDate:st),f=e.ref(te.value.getMonth()),we=e.ref(te.value.getFullYear()),Ce=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),fe=e.ref(te.value.getFullYear()),R=e.ref("start"),me=e.ref(null),_e=e.ref(null);function Je(){const $=te.value,O=$.getMonth(),D=$.getFullYear(),ne=O===11?0:O+1,Ae=O===11?D+1:D;return{left:{month:O,year:D},right:{month:ne,year:Ae}}}const pt=e.ref(null),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(null),Ye=e.ref(null),ie=e.ref(null),Ge=new Date().getFullYear(),be=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),Qe=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),ct=e.computed(()=>_.mode==="listFromAvailable"),gt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const $=_.modelValue;return $ instanceof Date?$:null}),ut=e.computed(()=>{if(!Qe.value)return{start:null,end:null};const $=_.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function qt($){if(!$||!($ instanceof Date))return"";const O=$.getDate(),D=$.getMonth()+1,ne=$.getFullYear(),Ae=it=>String(it).padStart(2,"0");return`${Ae(O)}/${Ae(D)}/${ne}`}const Zt=e.computed(()=>qt(gt.value)),kt=e.computed(()=>{const{start:$,end:O}=ut.value;if(!$&&!O)return"";const D=!O||$&&$<=O?$:O,ne=!$||O&&O>=$?O:$;return jt(D,ne)?qt(D):`${qt(D)} - ${qt(ne)}`}),xt=e.computed(()=>{if(_.mode!=="readonly")return"—";const $=_.modelValue;if($ instanceof Date)return qt($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const O=$.start instanceof Date?$.start:null,D=$.end instanceof Date?$.end:null;if(!O&&!D)return"—";const ne=!D||O&&O<=D?O:D,Ae=!O||D&&D>=O?D:O;return jt(ne,Ae)?qt(ne):`${qt(ne)} - ${qt(Ae)}`}return"—"});e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Yt=e.computed(()=>_e.value==="left"?Ce.value:_e.value==="right"?X.value:f.value),rt=e.computed(()=>_e.value==="left"?J.value:_e.value==="right"?fe.value:we.value),Jt=e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),yt=e.computed(()=>{const $=new Date(rt.value,Yt.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),ol=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(O,D)=>$.format(new Date(2024,D,1)))}),U=e.computed(()=>{const O=(_e.value?rt.value:we.value)-Math.floor(Ea/2);return Array.from({length:Ea},(D,ne)=>O+ne)}),ke=e.computed(()=>{const $=U.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""});function W($){return $===7?0:$}function G($){try{const O=new Intl.Locale($);if(O.weekInfo?.firstDay!=null)return W(O.weekInfo.firstDay)}catch{}return 1}function Ne($){const O=new Date(2024,0,1),D=(O.getDay()-$+7)%7,ne=new Date(O);return ne.setDate(O.getDate()-D),ne}const Ie=e.computed(()=>G(P.value)),Ue=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{weekday:"short"}),O=Ne(Ie.value),D=[];for(let ne=0;ne<7;ne++){const Ae=new Date(O);Ae.setDate(O.getDate()+ne),D.push($.format(Ae).slice(0,2))}return D});function Et($,O,D){const ne=new Date($,O,1),Ae=new Date($,O+1,0),it=(ne.getDay()-D+7)%7,vt=Ae.getDate(),tt=[];for(let lt=0;lt<it;lt++)tt.push(null);for(let lt=1;lt<=vt;lt++)tt.push(new Date($,O,lt));return tt}const Ke=e.computed(()=>Et(we.value,f.value,Ie.value)),Ut=e.computed(()=>Et(J.value,Ce.value,Ie.value)),qe=e.computed(()=>Et(fe.value,X.value,Ie.value));e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Pe=e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),Ht=e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),$t=e.computed(()=>_.availableDates&&_.availableDates.length>0),oe=e.computed(()=>$t.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"}]),Y=e.ref({top:0,left:0}),j=e.ref("left");let pe=null;function xe(){T.value&&e.nextTick(()=>{T.value&&(pe!==null&&window.cancelAnimationFrame(pe),pe=window.requestAnimationFrame(()=>{pe=null,je()}))})}function je(){if(!Se.value||!T.value)return;const $=Se.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,D=window.innerHeight||document.documentElement.clientHeight;let ne=$.left,Ae=$.bottom+4;const it=Le.value;if(it){const vt=it.offsetWidth,tt=it.offsetHeight;j.value==="right"||ne+vt>O-In?(j.value="right",ne=$.right-vt):j.value="left";const kl=Math.max(In,O-vt-In);if(ne=Math.min(Math.max(ne,In),kl),Ae+tt>D-In){const Sl=$.top-4-tt;Sl>=In?Ae=Sl:Ae=Math.max(In,D-tt-In)}}Y.value={top:Ae,left:ne}}const Rt=e.computed(()=>!Se.value||!T.value?{}:{position:"fixed",left:`${Y.value.left}px`,top:`${Y.value.top}px`,zIndex:1002});function jt($,O){return!$||!O?!1:$.getFullYear()===O.getFullYear()&&$.getMonth()===O.getMonth()&&$.getDate()===O.getDate()}function et($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function pl($){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(O=>O instanceof Date&&jt(O,$))}function M($){const O=et($);return!(_.minDate instanceof Date&&O<et(_.minDate)||_.maxDate instanceof Date&&O>et(_.maxDate))}function w($){const O=new Date($);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function A($){return $.filter(O=>M(O))}function se($,O){if(!($ instanceof Date)||!(O instanceof Date))return null;let D=et($),ne=et(O);if(D>ne&&([D,ne]=[ne,D]),_.minDate instanceof Date){const Ae=et(_.minDate);D=Math.max(D,Ae),ne=Math.max(ne,Ae)}if(_.maxDate instanceof Date){const Ae=et(_.maxDate);D=Math.min(D,Ae),ne=Math.min(ne,Ae)}return D>ne?null:{start:w(D),end:w(ne)}}function ae($){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(O=>O instanceof Date&&jt(O,$))}function He($){return ae($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?pl($):M($)}function Ct($){const O=gt.value,D=ut.value,ne=et($),Ae=Qe.value&&D.start&&D.end&&ne>et(D.start)&&ne<et(D.end),it=Qe.value&&D.start&&jt($,D.start),vt=Qe.value&&D.end&&jt($,D.end),tt=it&&vt,lt=be.value&&O&&jt($,O)||it||vt;let kl=!1;if(Qe.value&&D.start&&!D.end&&me.value){const Sl=et(D.start),Tt=et(me.value),wl=Math.min(Sl,Tt),el=Math.max(Sl,Tt);kl=ne>wl&&ne<el}return{"dss-datepicker__day--selected":lt&&!tt,"dss-datepicker__day--range-start":it&&!tt,"dss-datepicker__day--range-end":vt&&!tt,"dss-datepicker__day--range-single":tt,"dss-datepicker__day--in-range":Ae&&!it&&!vt,"dss-datepicker__day--in-range-preview":kl&&!it&&!vt&&!Ae,"dss-datepicker__day--disabled":!He($)}}function nt($){if(!Qe.value)return;const O=ut.value;if(!O.start||O.end){me.value=null;return}if(!He($)){me.value=null;return}me.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Re(){me.value=null}function bt(){if(!_.doubleCalendar||!Qe.value)return;const $=ut.value,{start:O,end:D}=$;if(O&&D){const it=O<=D?O:D,vt=O<=D?D:O,tt=it.getMonth(),lt=it.getFullYear(),kl=vt.getMonth(),Sl=vt.getFullYear();if(tt!==kl||lt!==Sl){const Tt=Ce.value===tt&&J.value===lt,wl=X.value===kl&&fe.value===Sl;if(Tt&&wl)return;Ce.value=tt,J.value=lt,X.value=kl,fe.value=Sl}else{const Tt=tt===0?11:tt-1,wl=tt===0?lt-1:lt;Ce.value===Tt&&J.value===wl&&X.value===tt&&fe.value===lt||(Ce.value=tt,J.value=lt,tt===11?(X.value=0,fe.value=lt+1):(X.value=tt+1,fe.value=lt))}return}const ne=O||D;if(ne){const it=ne.getMonth(),vt=ne.getFullYear(),tt=Ce.value===it&&J.value===vt,lt=X.value===it&&fe.value===vt;if(tt||lt)return;Ce.value=it,J.value=vt,it===11?(X.value=0,fe.value=vt+1):(X.value=it+1,fe.value=vt);return}const Ae=Je();Ce.value=Ae.left.month,J.value=Ae.left.year,X.value=Ae.right.month,fe.value=Ae.right.year}const _t=e.computed(()=>new Intl.DateTimeFormat(P.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ct.value)return[];const $=(_.availableDates||[]).filter(D=>D instanceof Date&&!Number.isNaN(D.getTime())).filter(D=>!ae(D)&&M(D)).map(D=>new Date(D.getFullYear(),D.getMonth(),D.getDate()));$.sort((D,ne)=>ne.getTime()-D.getTime());const O=gt.value;return $.map(D=>({date:D,ts:D.getTime(),label:_t.value.format(D),selected:!!(O&&jt(D,O))}))});function Lt(){if(T.value){Kt();return}Se.value=We.value?.closest(".dss-datepicker__input-wrap"),j.value="left",T.value=!0,xe(),e.nextTick(()=>{ie.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function zt($){if(!($ instanceof Date))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());B("update:modelValue",O),Kt()}function Bt($="start"){if(_.mode==="readonly")return;R.value=$;const O=gt.value,D=ut.value;if(be.value&&O)f.value=O.getMonth(),we.value=O.getFullYear();else if(Qe.value)if(_.doubleCalendar)bt();else{const ne=$==="start"&&D.start?D.start:D.end||D.start;ne&&(f.value=ne.getMonth(),we.value=ne.getFullYear())}Se.value=be.value?pt.value?.closest(".dss-datepicker__input-wrap"):Z.value,he.value="days",_e.value=null,j.value="left",T.value=!0,xe()}function Kt(){he.value="days",_e.value=null,me.value=null,T.value=!1}function ql($,O){_e.value=$,he.value=O}function jl(){he.value="days",_e.value=null}function El($){const O=new Date,D=O.getFullYear(),ne=O.getMonth(),Ae=O.getDate();let it,vt;if($t.value){const tt=A([..._.availableDates].filter(lt=>lt instanceof Date).map(lt=>new Date(lt.getFullYear(),lt.getMonth(),lt.getDate()))).sort((lt,kl)=>lt.getTime()-kl.getTime());if(tt.length===0)return null;if($==="all")it=tt[0],vt=tt[tt.length-1];else{const lt=parseInt($.replace("last",""),10);if(lt<2||lt>5)return null;const kl=tt.slice(-lt);if(kl.length===0)return null;it=kl[0],vt=kl[kl.length-1]}}else{const tt=new Date(D,ne,Ae);switch($){case"today":it=tt,vt=tt;break;case"lastWeek":it=new Date(D,ne,Ae-6),vt=tt;break;case"last15Days":it=new Date(D,ne,Ae-14),vt=tt;break;case"last30Days":it=new Date(D,ne,Ae-29),vt=tt;break;case"thisMonth":it=new Date(D,ne,1),vt=tt;break;case"last3Months":it=new Date(D,ne-3,1),vt=new Date(D,ne,0);break;case"last6Months":it=new Date(D,ne-6,1),vt=new Date(D,ne,0);break;case"last12Months":it=new Date(D,ne-12,1),vt=new Date(D,ne,0);break;case"lastYear":it=new Date(D-1,0,1),vt=new Date(D-1,11,31);break;default:return null}}return{start:it,end:vt}}function il($){const O=El($);return O?se(O.start,O.end):null}function vl($){return il($)!==null}function dn($){const O=il($);O&&(B("update:modelValue",O),bt())}function wn($){_e.value==="left"?Ce.value=$:_e.value==="right"?X.value=$:f.value=$,jl()}function Dl($){_e.value==="left"?J.value=$:_e.value==="right"?fe.value=$:we.value=$,jl()}function mn(){f.value===0?(f.value=11,we.value--):f.value--}function $l(){f.value===11?(f.value=0,we.value++):f.value++}function zn(){Ce.value===0?(Ce.value=11,J.value--):Ce.value--}function Dn(){Ce.value===11?(Ce.value=0,J.value++):Ce.value++}function on(){X.value===0?(X.value=11,fe.value--):X.value--}function bl(){X.value===11?(X.value=0,fe.value++):X.value++}function Fl($){if(!He($))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());if(be.value){B("update:modelValue",O),Kt();return}const D=ut.value;if(!D.start&&!D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(D.start&&D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(R.value==="start"){let ne=O,Ae=D.end;ne&&Ae&&ne>Ae&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="end"}else{let ne=D.start,Ae=O;ne&&Ae&&Ae<ne&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="start"}}e.watch(ut,()=>{_.doubleCalendar&&Qe.value&&T.value&&bt()},{deep:!0});let Kl=null,Hl=null,Ml=null;function pn(){Kl&&(document.removeEventListener("keydown",Kl),Kl=null),Hl&&(window.removeEventListener("resize",Hl),Hl=null),Ml&&(window.removeEventListener("scroll",Ml,!0),Ml=null)}return e.watch(he,$=>{$==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${rt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,he.value,f.value,we.value,Ce.value,J.value,X.value,fe.value,_e.value,_.doubleCalendar,_.quickSelect],()=>{xe()}),e.watch(T,$=>{pn(),$&&(Kl=O=>{O.key==="Escape"&&(he.value==="years"||he.value==="months"?jl():Kt())},Hl=()=>{je()},Ml=()=>{je()},document.addEventListener("keydown",Kl),window.addEventListener("resize",Hl),window.addEventListener("scroll",Ml,!0))}),e.onBeforeUnmount(()=>{pe!==null&&(window.cancelAnimationFrame(pe),pe=null),pn()}),($,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",os,[O[10]||(O[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:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,as)])):be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=D=>Bt("start"))},[O[11]||(O[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:pt,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectDate"),value:Zt.value,readonly:"",disabled:E.mode==="readonly"},null,8,ss)])):ct.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":T.value}]),onClick:Lt},[O[13]||(O[13]=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:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectFromList"),value:Zt.value,readonly:""},null,8,rs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":T.value}]),"aria-hidden":"true"},[...O[12]||(O[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):Qe.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:O[1]||(O[1]=D=>Bt("start"))},[O[14]||(O[14]=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:Fe,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectRange"),value:kt.value,readonly:""},null,8,is)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Kt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Qe.value&&he.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Qe.value&&he.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ct.value}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Rt.value)},[ct.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.ts,role:"option","aria-selected":D.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":D.selected}]),onClick:ne=>zt(D.date)},[e.createElementVNode("span",us,e.toDisplayString(D.label),1),D.selected?(e.openBlock(),e.createElementBlock("svg",ds,[...O[15]||(O[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,cs))),128))],512)):(e.openBlock(),e.createElementBlock("div",ms,e.toDisplayString(e.unref(de)("datepicker.noAvailableDates")),1))],64)):he.value==="days"&&E.doubleCalendar&&Qe.value?(e.openBlock(),e.createElementBlock("div",ps,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!vl(D.id),onClick:ne=>dn(D.id)},e.toDisplayString(e.unref(de)(D.labelKey)),9,fs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",hs,[e.createElementVNode("div",gs,[e.createElementVNode("div",ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:zn}," ‹ ",8,ks),e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=D=>ql("left","months"))},e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=D=>ql("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Dn}," › ",8,bs)]),e.createElementVNode("div",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Es)):(e.openBlock(),e.createElementBlock("span",Ss))],64))),128))])]),e.createElementVNode("div",Vs,[e.createElementVNode("div",Ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:on}," ‹ ",8,Bs),e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=D=>ql("right","months"))},e.toDisplayString(Ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=D=>ql("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:bl}," › ",8,_s)]),e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ts)):(e.openBlock(),e.createElementBlock("span",As))],64))),128))])])])])):he.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ds,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:mn}," ‹ ",8,Hs),e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=D=>he.value="months")},e.toDisplayString(Jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=D=>he.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:$l}," › ",8,Fs)]),e.createElementVNode("div",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ps)):(e.openBlock(),e.createElementBlock("span",Os))],64))),128))])],64)):he.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ws,[e.createElementVNode("div",qs,[e.createElementVNode("span",Zs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=D=>he.value="years")},e.toDisplayString(rt.value),1)])]),e.createElementVNode("div",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(D,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Yt.value}]),onClick:Ae=>wn(ne)},e.toDisplayString(D),11,Xs))),128))])],64)):he.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ys,[e.createElementVNode("span",js,e.toDisplayString(ke.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":D===rt.value,"dss-datepicker__year-cell--current":D===e.unref(Ge)}]),"data-year":D,onClick:ne=>Dl(D)},e.toDisplayString(D),11,Gs))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Qs=["data-chart-type"],Js={class:"dss-chart-header-titles"},er={key:0,class:"dss-chart-title"},tr={key:1,class:"dss-chart-subtitle"},lr=["onClick","onMouseenter"],nr={class:"dss-legend-text"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["title"],rr=["src"],ir={class:"dss-chart-area-wrapper"},cr={key:0,class:"dss-chart-z-axis-label"},ur=["width","height","data-smooth","data-animated"],dr=["id"],mr=["y","width","height"],pr=["id"],vr=["d"],fr=["id"],hr=["d"],gr={key:0},yr=["clip-path"],kr=["x1","x2","y1","y2"],Cr=["clip-path"],br=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],xr={class:"dss-axes"},Er=["x1","x2","y1","y2"],Sr=["x1","x2","y1","y2"],Vr=["x1","x2","y1","y2"],Nr={class:"dss-axis-labels"},Br=["x","y"],Mr=["x","y"],_r=["x","y"],$r=["x","y"],Lr=["y","transform"],Tr=["x","y","transform"],Ar={key:2,class:"dss-flag-markers"},Dr=["clip-path"],Hr=["x1","x2","y1","y2","onMouseover"],Rr=["x1","x2","y1","y2","onMouseover"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["cx","cy","onMouseover"],zr=["cx","cy","fill","onMouseover"],Pr=["x","y"],Or=["clip-path"],Wr={key:0},qr=["d","onMouseover"],Zr=["x","y","width","height","fill","onMouseover"],Ur={class:"dss-line-chart"},Xr=["d","stroke","stroke-width","stroke-dasharray"],Yr=["d","stroke","stroke-width","opacity"],jr=["cx","cy","r","fill","onMouseover"],Kr={key:1},Gr=["d","stroke","stroke-width","stroke-dasharray"],Qr=["d","stroke","stroke-width","stroke-dasharray"],Jr=["d","stroke","stroke-width","opacity"],ei=["cx","cy","r","fill","onMouseover"],ti={key:2},li=["id"],ni=["x","y","width","height"],oi=["d","fill","fill-opacity","mask"],ai=["d","stroke","stroke-width"],si={key:3,class:"dss-stepbar-chart"},ri=["id"],ii=["d"],ci=["clip-path"],ui=["x","y","width","height","fill","onMouseover"],di=["d","fill","onMouseover"],mi=["x","y","width","height","onMouseover"],pi=["clip-path"],vi=["x1","x2","y1","y2","stroke"],fi=["cx","cy","r","fill"],hi={key:1,class:"dss-bubble-chart"},gi={key:0,class:"dss-bubble-group"},yi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],ki=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ci=["transform"],bi=["cx","cy","r"],wi=["data-chart-type","clip-path"],xi=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Ei={key:1,class:"dss-radial-segment-data-labels"},Si=["x","y"],Vi=["x","y","font-size","fill"],Ni=["x1","y1","x2","y2","stroke"],Bi=["x1","y1","x2","y2","stroke"],Mi=["x","y","text-anchor","font-size"],_i=["transform"],$i={key:0,class:"dss-spider-grid"},Li=["cx","cy","r"],Ti={class:"dss-spider-grid-labels"},Ai=["x","y"],Di=["x","y"],Hi=["x1","x2","y1","y2"],Ri={class:"dss-spider-labels"},Fi=["x","y","text-anchor","dominant-baseline"],Ii=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],zi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Pi={class:"dss-chart-logos"},Oi=["cx","cy","r","fill"],Wi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],qi=["onClick","onMouseenter"],Zi=["src"],Ui={class:"dss-marker-tooltip-category"},Xi={key:0,class:"dss-marker-tooltip-description"},Yi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},ji={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ki={class:"dss-tooltip-series-name"},Gi={class:"dss-tooltip-series-value"},Qi={key:1,class:"dss-tooltip-section"},Ji={key:0,class:"dss-tooltip-title"},ec={class:"dss-bubble-tooltip-data"},tc={key:2,class:"dss-tooltip-section"},lc={class:"dss-tooltip-title"},nc={class:"dss-tooltip-value"},oc={key:0,class:"dss-tooltip-section"},ac={class:"dss-tooltip-section-title"},sc={class:"dss-tooltip-group-header"},rc={class:"dss-tooltip-item-content"},ic={class:"dss-tooltip-item-text"},cc={key:1,class:"dss-tooltip-section"},uc={class:"dss-tooltip-section-title"},dc={class:"dss-tooltip-item-content"},mc={class:"dss-tooltip-item-title"},pc={key:0,class:"dss-tooltip-item-description"},vc={class:"dss-tooltip-section"},fc={class:"dss-tooltip-title"},hc={key:0,class:"dss-bubble-tooltip-data"},gc={class:"dss-tooltip-series-name"},yc={class:"dss-tooltip-series-value"},kc={key:0,class:"dss-tooltip-section"},Cc={class:"dss-tooltip-section-title"},bc={class:"dss-tooltip-group-header"},wc={class:"dss-tooltip-item-content"},xc={class:"dss-tooltip-item-text"},Ec={key:1,class:"dss-tooltip-section"},Sc={class:"dss-tooltip-section-title"},Vc={class:"dss-tooltip-item-content"},Nc={class:"dss-tooltip-item-title"},Bc={key:0,class:"dss-tooltip-item-description"},Mc=["onClick","onMouseenter"],_c={class:"dss-legend-text"},$c={key:1,class:"dss-context-menu-separator"},Lc={key:0,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Ac=["onClick"],Dc=["innerHTML"],Hc={key:0,class:"dss-context-menu-icon"},Rc={class:"dss-marker-modal-header"},Fc={class:"dss-marker-modal-body"},Ic={class:"dss-form-group"},zc={class:"dss-form-group"},Pc={for:"dss-marker-description"},Oc={key:0,class:"dss-form-text-display"},Wc=["placeholder"],qc={class:"dss-marker-modal-footer"},Zc={class:"modal-footer-left"},Uc={class:"dss-modal-footer-right"},Xc=["disabled"],Yc={name:"DSSChart"},jc=Object.assign(Yc,{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:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=le,P=e.ref(null),T=e.ref(null),he=e.ref(null),st=e.ref(0),te=e.ref(0);let f=null,we=null;const Ce=20,J=e.computed(()=>{if(te.value,st.value,!P.value||!T.value)return 0;try{const t=P.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${R.chartId}`),fe=e.computed(()=>`url(#${X.value})`),R=E,me={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},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},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,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},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 _e(t,o){const l=Object.assign({},t);return pt(t)&&pt(o)&&Object.keys(o).forEach(r=>{pt(o[r])?r in t?l[r]=_e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const Je=()=>{let t=20,o=0,l=0;if(ct.value&&(t+=30),gt.value&&(t+=25),W.value&&R.series.length>0){const r=R.series.filter((m,v)=>!wt.value.has(v)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const v=Math.floor(Se.value/100);o=Math.ceil(r/v)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>_e(me,R.options)),Fe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Se=e.computed(()=>{const t=Z.value;return Fe.value?st.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(Ce),Ye=e.computed(()=>{if(We.value){const t=Ye.value;return t??Math.max(0,(te.value||400)-Le.value*5)}}),ie=e.computed(()=>{const t=Z.value;if(be.value==="mini-radial")return Se.value;if(We.value){const o=Ye.value;return o??Math.max(0,(te.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ge=e.computed(()=>{if(We.value&&be.value==="semi-radial"&&Ye.value!=null)return Le.value+ie.value+"px";if(We.value)return"100%";if(cl.value)return Le.value+ie.value+"px";if(W.value&&G.value==="bottom"){const t=Je();return ie.value+(t.legendHeight||35)+"px"}return ie.value+(W.value?20:0)+"px"}),be=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Qe=e.computed(()=>{const t=R.series.map(o=>o.type||be.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),gt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ut=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),qt=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Zt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),kt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),xt=e.computed(()=>{const t=kt.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.min;return typeof o=="number"||o===Q?o:Q}),rt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.max;return typeof o=="number"||o===Q?o:Q}),Jt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.min;return typeof o=="number"||o===Q?o:Q}),yt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.max;return typeof o=="number"||o===Q?o:Q}),ol=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),U=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ke=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ie=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ue=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ke=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ut=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),qe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Pe=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ht=e.computed(()=>{if(!cl.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),$t=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),oe=e.computed(()=>{const{maxX:t}=ge.value;return t===0}),Y=(t,o)=>oe.value&&o===0?5:o,j=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},pe=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),je=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Rt=e.computed(()=>{const t=Z.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=Z.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>Z.value?.stepbar||{}),pl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),w=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),se=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),ae=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),He=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Ct=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),nt=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Re=e.computed(()=>et.value?.axisBars||{}),bt=e.computed(()=>Re.value?.show!==!1),_t=e.computed(()=>Re.value?.showVertical===!0),St=e.computed(()=>Re.value?.color||"#d6d6d6"),Lt=e.computed(()=>{const t=Number(Re.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),zt=e.computed(()=>{const t=Number(Re.value?.width);return Number.isFinite(t)&&t>0?t:1}),Bt=e.computed(()=>Re.value?.dashArray||"3,4"),Kt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),ql=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),jl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),El=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),il=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),vl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),dn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),wn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Dl=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),mn=e.computed(()=>Z.value?.spider?.gridSteps||5),$l=e.computed(()=>{const t=[],o=mn.value;for(let l=1;l<=o;l++)t.push(Vt.value/o*l);return t}),zn=t=>{const o=Dn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=$l.value[t];return Math.round(l/Vt.value*100)+"%"},Dn=e.computed(()=>Z.value?.spider?.gridLabels||null),on=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),bl=e.computed(()=>{const t=Z.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Fl=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:wl.value}),Hl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ml=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),pn=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),$=t=>{const o=pn.value;if(t==null)return"";const l=String(t);return o?l+o:l},O=e.computed(()=>!ce.value.isZooming);e.computed(()=>tl.value.map(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=ht(t.categoryIndex),l=J.value+I.value.bottom-Ml.value/2;return{...t,x:o,y:l}}return t}));function D(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,C,b]=t.split("-"),F=Number(b?.length===2?`20${b}`:b);l=new Date(F,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,F,N]=v.split("-"),L=Number(N?.length===2?`20${N}`:N),S=new Date(L,Number(F)-1,Number(b)),K=Math.abs(S-l);K<m&&(m=K,r=C)}),r}const ne=e.computed(()=>{const t=R.markers.map(l=>{const r=D(l.marker_date,R.categories),m=ht(r),v=J.value+I.value.bottom-Ml.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=tl.value.map(l=>{if(l.categoryIndex!==void 0&&(Nl.value||Gt.value)){const r=ht(l.categoryIndex),m=J.value+I.value.bottom-Ml.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Ae=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),it=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),vt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),tt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),lt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let o,l;const r=String(vt.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),kl=e.computed(()=>{const{width:t,height:o}=lt.value,l=tt.value;let r,m;const v=I.value.left,C=I.value.right,b=I.value.top,F=I.value.bottom,N=I.value.width,L=I.value.height;switch(l){case"center":r=v+(N-t)/2,m=b+(L-o)/2;break;case"top-left":r=v+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=v+15,m=F-o-5;break;case"bottom-right":default:r=C-t-15,m=F-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Sl=t=>!R.flags||!R.flags.length?[]:R.flags.filter(o=>o.categoryIndex===t),Tt=t=>{const o=Sl(t),l=hn(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),v=[];return r.length>0&&v.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&v.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},wl=e.computed(()=>{const t=R.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)}`}),Xn=e.computed(()=>{const t=F.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),el=e.computed(()=>{const t=R.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)}`}),Hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),zn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Nl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),A=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),z=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),L=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),le=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),Te=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return Xl.value?!0:bl.value&&a&&(a.show===!0||a.enabled===!0)}),ft=e.computed(()=>{if(!Te.value||!Ut.value.length)return"";if(Xl.value){const r=Ut.value[1]??Ut.value[0];return en(r?.value??0)}const n=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Ut.value[0]?.value??0:Ut.value.reduce((r,p)=>r+(p.value??0),0);return en(n)}),dt=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),ot=e.computed(()=>({x:Pt.value,y:Xl.value?Dt.value:Dt.value-dt.value/2})),at=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),vn=e.computed(()=>{if(!L.value||!Sn.value||!Ut.value.length)return[];const t=le.value*Math.PI/180,a=(Zt.value+it.value)/2;return Ut.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Pt.value+Math.cos(n.midAngle)*a,C=Dt.value+Math.sin(n.midAngle)*a;return{value:en(n.value),x:g,y:C,show:p,color:n.color,contrastColor:k(n.color)}})}),bn=e.computed(()=>{if(!F.flags||!F.flags.length)return[];const t=new Map;return F.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 r=ln(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:r,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
- `)}})}),Wt=e.ref({show:!1,x:0,y:0,content:"",count:0}),gn=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Kt=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ln=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),Ht=e.ref(new Set),he=e.ref(null),Mt=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ue=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=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}),on=e.ref([]),Fe=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 rn.value&&t.push(...Object.keys(rn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=Vt.value;return Array.from({length:t+1},(a,n)=>$("chart.fallback.item",{number:n+1}))}return F.categories});const ol=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),cn=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),yl=e.computed(()=>Fe.value.editingMarkerId!==null),Nn=e.computed(()=>Fe.value.readonly),Gt=t=>{Ht.value.has(t)||(Jo.value=!0,he.value=t)},Fl=()=>{Jo.value=!1,he.value=null},un=t=>{if(xo.value||Fo.value){Ue.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top,g=Yt.value?r>=O.value.left-50&&r<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:r>=O.value.left&&r<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(Mt.value=g,Yt.value){if(!Ze.value||!g||se.value.isDragging||se.value.isZooming){Ue.value.show=!1;return}if(dn.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-p,2))<=ve.radius+3))Ue.value.show=!1;else{const ve=dn.value.filter(xe=>!xe||xe.isHidden?!1:Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-p,2))<=250);if(ve.length>0){let xe=ve[0],Ve=Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-p,2));ve.forEach(Oe=>{const Le=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-p,2));Le<Ve&&(Ve=Le,xe=Oe)});const ge=30,Qe=dn.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-xe.x)<=ge).sort((Oe,Le)=>Oe.y-Le.y);Ue.value={show:!0,x:xe.x,categoryIndex:Math.round(xe.originalX),data:(()=>{const Oe=gn.value,Le=Kt.value,$e=[];return Qe.forEach(He=>{Oe.forEach(_t=>{const Ot=Le[_t]||_t,tl=Ao(_t,He);tl&&$e.push({seriesName:He.seriesName,label:He.label,value:`${Ot}: ${tl}`,color:He.color,y:He.y})})}),$e})()}}else Ue.value.show=!1}return}if(se.value.isDragging&&se.value.scale>1&&En.value&&Ke.value){Ue.value.show=!1;const Xe=t.clientX-se.value.lastMouseX,{minX:ve,maxX:xe}=Vt.value,Ve=xe-ve||1,Qe=Xe*.8;se.value.offsetX+=Qe;const Oe=Ve/se.value.scale,Le=Ve-Oe,$e=0,He=-Le/Ve*O.value.width,_t=$e;se.value.offsetX=Math.max(He,Math.min(_t,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY;return}if(!Ze.value||!En.value||se.value.isDragging||se.value.isZooming||!g){Ue.value.show=!1;return}const{minX:C,maxX:w}=Vt.value,W=w-C||1,M=W/se.value.scale,H=C-se.value.offsetX/O.value.width*W,T=(r-O.value.left)/O.value.width,ee=H+T*M,Ne=Math.round(ee);if(Ne>=0&&Ne<=w){const Xe=ln(Ne),ve=Jn.value.map((xe,Ve)=>{const ge=F.series.findIndex(Oe=>Oe===xe),Qe=xe.data[Ne];return{seriesName:xe.name,value:Qe!==void 0?Qe:null,color:f(ge),y:Qe!==void 0?qn(xe,Qe):null}}).filter(xe=>xe.value!==null);Ue.value={show:!0,x:Xe,categoryIndex:Ne,data:ve}}},Pn=()=>{Ue.value.show=!1,Mt.value=!1,Fo.value=!1,xo.value||(Wt.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(()=>{he.value=null,gt.value.show=!1},150)},Zl=t=>{if(t.preventDefault(),t.stopPropagation(),!St.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,r=t.clientY-a.top;if(Sn.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,C=O.value.top,w=O.value.bottom+80;n>=p&&n<=g&&r>=C&&r<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const W=Math.max(O.value.left,Math.min(n,O.value.right))-O.value.left,H=O.value.width/c.value.length,T=Math.floor(W/H);T>=0&&T<c.value.length&&(ht.value.categoryIndex=T)}))},Yn=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}ht.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Bn=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gl=t=>t.style||{},cl=t=>t.type&&rn.value[t.type]?rn.value[t.type]:t.customIcon?t.customIcon:Nt.value,Ul=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",kl=t=>on.value.length?on.value.filter(a=>a.categoryIndex===t):[],Ql=t=>{if(!En.value&&!Yt.value)return{x:0,y:0};const a=ln(t),n=Q.value+O.value.bottom-Vn.value/2;return{x:a,y:n}},Mn=()=>{on.value.forEach(t=>{if(t.categoryIndex!==void 0&&(En.value||Yt.value)){const a=Ql(t.categoryIndex);t.x=a.x,t.y=a.y}})},ul=()=>{if(Fe.value.description&&Fe.value.description.length&&Fe.value.date){if(yl.value){const t=on.value.findIndex(a=>a.id===Fe.value.editingMarkerId);t!==-1?(on.value[t].description=Fe.value.description||"",on.value[t].color=Fe.value.color||"",on.value[t].type=Fe.value.type||"default",ce("update-marker",on.value[t])):ce("update-marker",{id:Fe.value.editingMarkerId,description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ll(Fe.value.date,F.categories||[]);if(Yt.value){const{maxX:C}=Vt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else En.value&&(a=Math.max(0,Math.min(a,Vt.value.maxX)));const n=ln(a),r=Q.value+O.value.bottom-Vn.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default",categoryIndex:a,x:n,y:r,marker_date:p||null};Fe.value.categoryIndex=a,on.value.push(g),ce("add-marker",g)}xn(),h()}},xn=()=>{Fe.value.show=!1,Fe.value.title="",Fe.value.description="",Fe.value.color="#FF6B6B",Fe.value.type="default",Fe.value.editingMarkerId=null,Fe.value.readonly=!1,Fe.value.categoryIndex=null,Fe.value.fromButton=!1,Fe.value.date=null},hn=()=>{yl.value&&(jn(Fe.value.editingMarkerId),xn())},jn=t=>{const a=on.value.findIndex(n=>n.id===t);a!==-1&&(on.value.splice(a,1),h()),ce("delete-marker",t)},y=t=>{if(Fe.value.show=!0,Fe.value.title=t?.title??t?.comment??"",Fe.value.description=t?.description??t?.comment??"",Fe.value.color=t?.color??"",Fe.value.type=t?.type??"default",Fe.value.editingMarkerId=t?.id??t?.marker_id??null,Fe.value.readonly=t?.readonly??!1,Fe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;g&&n&&p?Fe.value.date=new Date(p,C,g):Fe.value.date=null}else Fe.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(on.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${F.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(on.value=n.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),on.value=[]}},q=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}`},fe=()=>{const t=Ue.value.show,a=gt.value.show;return Ue.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Ge=t=>{Ue.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},qt=async(t,a=32,n=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),W=w.getContext("2d");w.width=a,w.height=n,W.fillStyle="#fafafa",W.fillRect(0,0,a,n),W.drawImage(g,0,0,a,n);const M=w.toDataURL("image/png");r(M)}catch(w){console.warn("Canvas conversion failed:",w),r(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),r(t)},g.src=t}),yn=async()=>{try{const t=fe();setTimeout(async()=>{try{const a=_.value;if(!a){console.error("Chart SVG element not found"),Ge(t);return}const n=tt(),r=Ee.value,p=ie.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(ge=>ge.remove());const w=g.querySelectorAll("image"),W=Array.from(w).map(async ge=>{const Qe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Qe&&!Qe.startsWith("data:"))try{const Oe=await qt(Qe,32,32);ge.setAttribute("xlink:href",Oe),ge.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(W);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let T="",ee=30;if(ct.value&&(T+=`
46
- <text x="24" y="${ee}"
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Vl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),an=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const al=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),At=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Pn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),xn=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Zl=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),vn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Gl.value?!0:Cn.value&&o&&(o.show===!0||o.enabled===!0)}),fn=e.computed(()=>{if(!vn.value||!Ln.value.length)return"";if(Gl.value){const r=Ln.value[1]??Ln.value[0];return $(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Ln.value[0]?.value??0:Ln.value.reduce((r,m)=>r+(m.value??0),0);return $(l)}),Hn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),En=e.computed(()=>({x:Dt.value,y:Gl.value?Pt.value:Pt.value-Hn.value/2})),en=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),ul=e.computed(()=>{if(!xn.value||!cl.value||!Ln.value.length)return[];const t=Zl.value*Math.PI/180,o=(hl.value+Vt.value)/2;return Ln.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Dt.value+Math.cos(l.midAngle)*o,C=Pt.value+Math.sin(l.midAngle)*o;return{value:$(l.value),x:v,y:C,show:m,color:l.color,contrastColor:cn(l.color)}})}),On=e.computed(()=>{if(!R.flags||!R.flags.length)return[];const t=new Map;return R.flags.forEach(o=>{const l=o.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(o)}),Array.from(t.entries()).map(([o,l])=>{const r=ht(o),m=l.filter(C=>C.manual),v=l.filter(C=>!C.manual);return{categoryIndex:parseInt(o),x:r,flags:l,manualCount:m.length,autoCount:v.length,totalCount:l.length,hasManual:m.length>0,hasAuto:v.length>0,texts:l.map(C=>C.text).join(`
45
+ `)}})}),Il=e.ref({show:!1,x:0,y:0,content:"",count:0}),ll=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Wn=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),dl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),wt=e.ref(new Set),$e=e.ref(null),Sn=e.ref(!1),dt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),sl=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ot=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),mt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ce=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tl=e.ref([]),Oe=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 Hl.value&&t.push(...Object.keys(Hl.value)),t}),e.computed(()=>{if(!R.categories||R.categories.length===0){const{maxX:t}=ge.value;return Array.from({length:t+1},(o,l)=>_("chart.fallback.item",{number:l+1}))}return R.categories});const Ll=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),sn=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[R.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),Tl=e.computed(()=>Oe.value.editingMarkerId!==null),nl=e.computed(()=>Oe.value.readonly),zl=t=>{wt.value.has(t)||(oa.value=!0,$e.value=t)},y=()=>{oa.value=!1,$e.value=null},g=t=>{if(wo.value||zo.value){ot.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=Gt.value?r>=I.value.left-50&&r<=I.value.right+50&&m>=I.value.top-50&&m<=I.value.bottom+100:r>=I.value.left&&r<=I.value.right&&m>=I.value.top&&m<=I.value.bottom;if(Sn.value=v,Gt.value){if(!Ue.value||!v||ce.value.isDragging||ce.value.isZooming){ot.value.show=!1;return}if(Fo.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-r,2)+Math.pow(re.y-m,2))<=re.radius+3))ot.value.show=!1;else{const re=Fo.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(re.length>0){let ye=re[0],Ee=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));re.forEach(ze=>{const Te=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-m,2));Te<Ee&&(Ee=Te,ye=ze)});const ve=30,Xe=Fo.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-ye.x)<=ve).sort((ze,Te)=>ze.y-Te.y);ot.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const ze=ll.value,Te=Wn.value,Ve=[];return Xe.forEach(De=>{ze.forEach(Nt=>{const It=Te[Nt]||Nt,Rl=ha(Nt,De);Rl&&Ve.push({seriesName:De.seriesName,label:De.label,value:`${It}: ${Rl}`,color:De.color,y:De.y})})}),Ve})()}}else ot.value.show=!1}return}if(ce.value.isDragging&&ce.value.scale>1&&Nl.value&&Ke.value){ot.value.show=!1;const Ze=t.clientX-ce.value.lastMouseX,{minX:re,maxX:ye}=ge.value,Ee=ye-re||1,Xe=Ze*.8;ce.value.offsetX+=Xe;const ze=Ee/ce.value.scale,Te=Ee-ze,Ve=0,De=-Te/Ee*I.value.width,Nt=Ve;ce.value.offsetX=Math.max(De,Math.min(Nt,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY;return}if(!Ue.value||!Nl.value||ce.value.isDragging||ce.value.isZooming||!v){ot.value.show=!1;return}const{minX:C,maxX:b}=ge.value,F=b-C||1,N=F/ce.value.scale,L=C-ce.value.offsetX/I.value.width*F,S=(r-I.value.left)/I.value.width,K=L+S*N,Be=Math.round(K);if(Be>=0&&Be<=b){const Ze=ht(Be),re=Ql.value.map((ye,Ee)=>{const ve=R.series.findIndex(ze=>ze===ye),Xe=ye.data[Be];return{seriesName:ye.name,value:Xe!==void 0?Xe:null,color:Qt(ve),y:Xe!==void 0?Ot(ye,Xe):null}}).filter(ye=>ye.value!==null);ot.value={show:!0,x:Ze,categoryIndex:Be,data:re}}},x=()=>{ot.value.show=!1,Sn.value=!1,zo.value=!1,wo.value||(Il.value.show=!1),ce.value.isDragging&&(ce.value.isDragging=!1),ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1,setTimeout(()=>{$e.value=null,dt.value.show=!1},150)},q=t=>{if(t.preventDefault(),t.stopPropagation(),!on.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(cl.value){mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null});return}const m=Math.max(0,I.value.left-20),v=I.value.right,C=I.value.top,b=I.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null;const F=Math.max(I.value.left,Math.min(l,I.value.right))-I.value.left,L=I.value.width/bo.value.length,S=Math.floor(F/L);S>=0&&S<bo.value.length&&(mt.value.categoryIndex=S)}))},ue=t=>{if(!(t&&t.button===2)){if(mt.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}mt.value.show=!1}},at=t=>{if(typeof t.template=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:mt.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Xt=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Cl=t=>t.style||{},Pl=t=>t.type&&Hl.value[t.type]?Hl.value[t.type]:t.customIcon?t.customIcon:Kl.value,Ul=t=>t==null?"":R.categories&&R.categories[t]?R.categories[t]:"",hn=t=>tl.value.length?tl.value.filter(o=>o.categoryIndex===t):[],uo=t=>{if(!Nl.value&&!Gt.value)return{x:0,y:0};const o=ht(t),l=J.value+I.value.bottom-Ml.value/2;return{x:o,y:l}},So=()=>{tl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=uo(t.categoryIndex);t.x=o.x,t.y=o.y}})},Vo=()=>{if(Oe.value.description&&Oe.value.description.length&&Oe.value.date){if(Tl.value){const t=tl.value.findIndex(o=>o.id===Oe.value.editingMarkerId);t!==-1?(tl.value[t].description=Oe.value.description||"",tl.value[t].color=Oe.value.color||"",tl.value[t].type=Oe.value.type||"default",de("update-marker",tl.value[t])):de("update-marker",{id:Oe.value.editingMarkerId,description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=D(Oe.value.date,R.categories||[]);if(Gt.value){const{maxX:C}=ge.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else Nl.value&&(o=Math.max(0,Math.min(o,ge.value.maxX)));const l=ht(o),r=J.value+I.value.bottom-Ml.value/2,m=Array.isArray(R.categories)?R.categories[o]:null,v={id:t,title:"",description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Oe.value.categoryIndex=o,tl.value.push(v),de("add-marker",v)}Vn(),po()}},Vn=()=>{Oe.value.show=!1,Oe.value.title="",Oe.value.description="",Oe.value.color="#FF6B6B",Oe.value.type="default",Oe.value.editingMarkerId=null,Oe.value.readonly=!1,Oe.value.categoryIndex=null,Oe.value.fromButton=!1,Oe.value.date=null},Xo=()=>{Tl.value&&(Yo(Oe.value.editingMarkerId),Vn())},Yo=t=>{const o=tl.value.findIndex(l=>l.id===t);o!==-1&&(tl.value.splice(o,1),po()),de("delete-marker",t)},mo=t=>{if(Oe.value.show=!0,Oe.value.title=t?.title??t?.comment??"",Oe.value.description=t?.description??t?.comment??"",Oe.value.color=t?.color??"",Oe.value.type=t?.type??"default",Oe.value.editingMarkerId=t?.id??t?.marker_id??null,Oe.value.readonly=t?.readonly??!1,Oe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;v&&l&&m?Oe.value.date=new Date(m,C,v):Oe.value.date=null}else Oe.value.date=null},po=()=>{try{const t=`dss-chart-markers-${R.chartId}`;localStorage.setItem(t,JSON.stringify(tl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},jo=()=>{try{const t=`dss-chart-markers-${R.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(tl.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tl.value=[]}},qn=t=>{const o=ct.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},vo=()=>{const t=ot.value.show,o=dt.value.show;return ot.value.show=!1,dt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},gn=t=>{ot.value.show=t.originalCrosshair,dt.value.show=t.originalTooltip},No=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const v=new Image;v.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),F=b.getContext("2d");b.width=o,b.height=l,F.fillStyle="#fafafa",F.fillRect(0,0,o,l),F.drawImage(v,0,0,o,l);const N=b.toDataURL("image/png");r(N)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},v.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},v.src=t}),Ko=async()=>{try{const t=vo();setTimeout(async()=>{try{const o=T.value;if(!o){console.error("Chart SVG element not found"),gn(t);return}const l=Je(),r=Se.value,m=ie.value+l.height,v=o.cloneNode(!0);v.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=v.querySelectorAll("image"),F=Array.from(b).map(async ve=>{const Xe=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const ze=await No(Xe,32,32);ve.setAttribute("xlink:href",ze),ve.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(F);const L=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",K=30;if(ct.value&&(S+=`
46
+ <text x="24" y="${K}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
51
  ${ct.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,ee+=30),vt.value&&(T+=`
53
- <text x="24" y="${ee}"
52
+ </text>`,K+=30),gt.value&&(S+=`
53
+ <text x="24" y="${K}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${vt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,ee+=25),P.value&&F.series.length>0){let ge=r-200,Qe=ct.value||vt.value?35:25;const Oe=Math.floor((r-250)/120);let Le=0;F.series.forEach(($e,He)=>{if(!Ht.value.has(He)){const _t=f(He),Ot=$e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");T+=`<circle cx="${ge+6}" cy="${Qe-4}" r="6" fill="${_t}"/>`,T+=`<text x="${ge+18}" y="${Qe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ot}</text>`,Le++,Le%Oe===0?(ge=r-200,Qe+=20):ge+=Math.min(120,Ot.length*8+35)}})}let Ne="";if(il.value)try{const{width:ge,height:Qe}=Vl.value,Oe=$n.value,Le=O.value.left,$e=O.value.right,He=O.value.top,_t=O.value.bottom,Ot=O.value.width,tl=O.value.height;let Cn,nl;switch(Oe){case"center":Cn=Le+(Ot-ge)/2,nl=He+(tl-Qe)/2;break;case"top-left":Cn=Le+15,nl=He+5;break;case"top-right":Cn=$e-ge-5,nl=He+5;break;case"bottom-left":Cn=Le+15,nl=_t-Qe-5;break;case"bottom-right":default:Cn=$e-ge-5,nl=_t-Qe-5;break}Ne=`
59
- <g opacity="${_n.value}">
60
- <g transform="translate(${Cn}, ${nl}) scale(${ge/499})">
57
+ ${gt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,K+=25),W.value&&R.series.length>0){let ve=r-200,Xe=ct.value||gt.value?35:25;const ze=Math.floor((r-250)/120);let Te=0;R.series.forEach((Ve,De)=>{if(!wt.value.has(De)){const Nt=Qt(De),It=Ve.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");S+=`<circle cx="${ve+6}" cy="${Xe-4}" r="6" fill="${Nt}"/>`,S+=`<text x="${ve+18}" y="${Xe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${It}</text>`,Te++,Te%ze===0?(ve=r-200,Xe+=20):ve+=Math.min(120,It.length*8+35)}})}let Be="";if(Ae.value)try{const{width:ve,height:Xe}=lt.value,ze=tt.value,Te=I.value.left,Ve=I.value.right,De=I.value.top,Nt=I.value.bottom,It=I.value.width,Rl=I.value.height;let ml,Wl;switch(ze){case"center":ml=Te+(It-ve)/2,Wl=De+(Rl-Xe)/2;break;case"top-left":ml=Te+15,Wl=De+5;break;case"top-right":ml=Ve-ve-5,Wl=De+5;break;case"bottom-left":ml=Te+15,Wl=Nt-Xe-5;break;case"bottom-right":default:ml=Ve-ve-5,Wl=Nt-Xe-5;break}Be=`
59
+ <g opacity="${it.value}">
60
+ <g transform="translate(${ml}, ${Wl}) 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,8 +72,8 @@
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(ge){console.warn("Watermark processing failed, skipping watermark in SVG:",ge),Ne=""}const Xe=`<?xml version="1.0" encoding="UTF-8"?>
76
- <svg width="${r}" height="${p}"
75
+ </g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),Be=""}const Ze=`<?xml version="1.0" encoding="UTF-8"?>
76
+ <svg width="${r}" height="${m}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
79
79
  <defs>
@@ -84,35 +84,37 @@
84
84
  </style>
85
85
  </defs>
86
86
  <rect width="100%" height="100%" fill="#fafafa"/>
87
- ${T}
88
- <g transform="translate(0, ${n.height})">
89
- ${H}
90
- ${Ne}
87
+ ${S}
88
+ <g transform="translate(0, ${l.height})">
89
+ ${L}
90
+ ${Be}
91
91
  </g>
92
- </svg>`,ve=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ve=document.createElement("a");Ve.href=xe,Ve.download=q("svg"),document.body.appendChild(Ve),Ve.click(),document.body.removeChild(Ve),URL.revokeObjectURL(xe),Ge(t),Yn()}catch(a){console.error("Error downloading SVG:",a),Ge(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Fn=async()=>{try{const t=fe();I.value&&I.value.offsetHeight,await new Promise(ge=>setTimeout(ge,300));const a=tt(),n=Ee.value,r=ie.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=r*C,p.style.width=n+"px",p.style.height=r+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,r);let w=30;if(ct.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(ct.value,24,w),w+=30),vt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(vt.value,24,w),w+=25),P.value&&F.series.length>0){let ge=n-200,Qe=ct.value||vt.value?35:25;const Oe=Math.floor((n-250)/120);let Le=0;g.font="12px Arial, sans-serif",F.series.forEach(($e,He)=>{if(!Ht.value.has(He)){const _t=f(He);g.beginPath(),g.arc(ge+6,Qe-4,6,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.fillStyle="#333",g.fillText($e.name,ge+18,Qe),Le++,Le%Oe===0?(ge=n-200,Qe+=20):ge+=Math.min(120,$e.name.length*8+35)}})}const M=_.value.cloneNode(!0),H=M.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),T=M.querySelectorAll(".dss-crosshair"),ee=M.querySelectorAll('[class*="tooltip"]');H.forEach(ge=>ge.remove()),T.forEach(ge=>ge.remove()),ee.forEach(ge=>ge.remove()),M.querySelectorAll("image").forEach((ge,Qe)=>{const Oe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Oe&&!Oe.startsWith("data:")){const Le=Ro.value[Qe],$e=Le?f(Le.seriesIndex):"#3B82F6",He=ge.getAttribute("x")||0,_t=ge.getAttribute("y")||0,Ot=ge.getAttribute("width")||32,tl=ge.getAttribute("height")||32,Cn=document.createElementNS("http://www.w3.org/2000/svg","circle");Cn.setAttribute("cx",parseFloat(He)+parseFloat(Ot)/2),Cn.setAttribute("cy",parseFloat(_t)+parseFloat(tl)/2),Cn.setAttribute("r",Math.min(parseFloat(Ot),parseFloat(tl))/2-1),Cn.setAttribute("fill",$e),Cn.setAttribute("stroke","#fafafa"),Cn.setAttribute("stroke-width","2"),ge.parentNode.replaceChild(Cn,ge)}});const Xe=new XMLSerializer().serializeToString(M),ve=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ve=new Image;return new Promise((ge,Qe)=>{Ve.onload=async()=>{try{if(g.drawImage(Ve,0,a.height),Ro.value.forEach(Oe=>{const Le=Oe.x,$e=Oe.y+a.height,He=(Oe.width||32)/2,_t=f(Oe.seriesIndex);g.save(),g.beginPath(),g.arc(Le,$e,He-1,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),il.value){const Oe=new Image,Le=()=>{const{width:He,height:_t}=Vl.value,Ot=$n.value,tl=O.value.left,Cn=O.value.right,nl=O.value.top,zo=O.value.bottom,Ma=O.value.width,_a=O.value.height;let ro,io;switch(Ot){case"center":ro=tl+(Ma-He)/2,io=nl+a.height+(_a-_t)/2;break;case"top-left":ro=tl+15,io=nl+a.height+10;break;case"top-right":ro=Cn-He-5,io=nl+a.height+10;break;case"bottom-left":ro=tl+15,io=zo+a.height-_t-5;break;case"bottom-right":default:ro=Cn-He-5,io=zo+a.height-_t-5;break}g.globalAlpha=_n.value,g.drawImage(Oe,ro,io,He,_t),g.globalAlpha=1,$e()},$e=()=>{p.toBlob(He=>{const _t=URL.createObjectURL(He),Ot=document.createElement("a");Ot.href=_t,Ot.download=q("png"),document.body.appendChild(Ot),Ot.click(),document.body.removeChild(Ot),URL.revokeObjectURL(_t),URL.revokeObjectURL(xe),Ge(t),Yn(),ge()},"image/png")};Oe.onload=Le,Oe.onerror=$e,Oe.src=Xn.value}else p.toBlob(Oe=>{const Le=URL.createObjectURL(Oe),$e=document.createElement("a");$e.href=Le,$e.download=q("png"),document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Le),URL.revokeObjectURL(xe),Ge(t),Yn(),ge()},"image/png")}catch(Oe){URL.revokeObjectURL(xe),Ge(t),Qe(Oe)}},Ve.onerror=()=>{URL.revokeObjectURL(xe),Ge(t),Qe(new Error("Failed to load SVG image"))},Ve.src=xe})}catch(t){console.error("Error downloading PNG:",t)}},On=()=>{try{let t="";ct.value&&(t+=`# ${$("chart.csv.chartTitle")}: ${ct.value}
93
- `),vt.value&&(t+=`# ${$("chart.csv.chartSubtitle")}: ${vt.value}
94
- `),t+=`# ${$("chart.csv.generated")}: ${new Date().toLocaleString()}
92
+ </svg>`,re=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Ee=document.createElement("a");Ee.href=ye,Ee.download=qn("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(ye),gn(t),ue()}catch(o){console.error("Error downloading SVG:",o),gn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Go=async()=>{try{const t=vo();P.value&&P.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const o=Je(),l=Se.value,r=ie.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),C=2;m.width=l*C,m.height=r*C,m.style.width=l+"px",m.style.height=r+"px",v.scale(C,C),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let b=30;if(ct.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(ct.value,24,b),b+=30),gt.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(gt.value,24,b),b+=25),W.value&&R.series.length>0){let ve=l-200,Xe=ct.value||gt.value?35:25;const ze=Math.floor((l-250)/120);let Te=0;v.font="12px Arial, sans-serif",R.series.forEach((Ve,De)=>{if(!wt.value.has(De)){const Nt=Qt(De);v.beginPath(),v.arc(ve+6,Xe-4,6,0,2*Math.PI),v.fillStyle=Nt,v.fill(),v.fillStyle="#333",v.fillText(Ve.name,ve+18,Xe),Te++,Te%ze===0?(ve=l-200,Xe+=20):ve+=Math.min(120,Ve.name.length*8+35)}})}const N=T.value.cloneNode(!0),L=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),S=N.querySelectorAll(".dss-crosshair"),K=N.querySelectorAll('[class*="tooltip"]');L.forEach(ve=>ve.remove()),S.forEach(ve=>ve.remove()),K.forEach(ve=>ve.remove()),N.querySelectorAll("image").forEach((ve,Xe)=>{const ze=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(ze&&!ze.startsWith("data:")){const Te=Io.value[Xe],Ve=Te?Qt(Te.seriesIndex):"#3B82F6",De=ve.getAttribute("x")||0,Nt=ve.getAttribute("y")||0,It=ve.getAttribute("width")||32,Rl=ve.getAttribute("height")||32,ml=document.createElementNS("http://www.w3.org/2000/svg","circle");ml.setAttribute("cx",parseFloat(De)+parseFloat(It)/2),ml.setAttribute("cy",parseFloat(Nt)+parseFloat(Rl)/2),ml.setAttribute("r",Math.min(parseFloat(It),parseFloat(Rl))/2-1),ml.setAttribute("fill",Ve),ml.setAttribute("stroke","#fafafa"),ml.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(ml,ve)}});const Ze=new XMLSerializer().serializeToString(N),re=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Ee=new Image;return new Promise((ve,Xe)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),Io.value.forEach(ze=>{const Te=ze.x,Ve=ze.y+o.height,De=(ze.width||32)/2,Nt=Qt(ze.seriesIndex);v.save(),v.beginPath(),v.arc(Te,Ve,De-1,0,2*Math.PI),v.fillStyle=Nt,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Ae.value){const ze=new Image,Te=()=>{const{width:De,height:Nt}=lt.value,It=tt.value,Rl=I.value.left,ml=I.value.right,Wl=I.value.top,jn=I.value.bottom,ra=I.value.width,ns=I.value.height;let oo,ao;switch(It){case"center":oo=Rl+(ra-De)/2,ao=Wl+o.height+(ns-Nt)/2;break;case"top-left":oo=Rl+15,ao=Wl+o.height+10;break;case"top-right":oo=ml-De-5,ao=Wl+o.height+10;break;case"bottom-left":oo=Rl+15,ao=jn+o.height-Nt-5;break;case"bottom-right":default:oo=ml-De-5,ao=jn+o.height-Nt-5;break}v.globalAlpha=it.value,v.drawImage(ze,oo,ao,De,Nt),v.globalAlpha=1,Ve()},Ve=()=>{m.toBlob(De=>{const Nt=URL.createObjectURL(De),It=document.createElement("a");It.href=Nt,It.download=qn("png"),document.body.appendChild(It),It.click(),document.body.removeChild(It),URL.revokeObjectURL(Nt),URL.revokeObjectURL(ye),gn(t),ue(),ve()},"image/png")};ze.onload=Te,ze.onerror=Ve,ze.src=el.value}else m.toBlob(ze=>{const Te=URL.createObjectURL(ze),Ve=document.createElement("a");Ve.href=Te,Ve.download=qn("png"),document.body.appendChild(Ve),Ve.click(),document.body.removeChild(Ve),URL.revokeObjectURL(Te),URL.revokeObjectURL(ye),gn(t),ue(),ve()},"image/png")}catch(ze){URL.revokeObjectURL(ye),gn(t),Xe(ze)}},Ee.onerror=()=>{URL.revokeObjectURL(ye),gn(t),Xe(new Error("Failed to load SVG image"))},Ee.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},Qo=()=>{try{let t="";if(ct.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${ct.value}
93
+ `),gt.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${gt.value}
94
+ `),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,t+="Category",F.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
97
- `;const a=Math.max(...F.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let W='"'+(F.categories[g]||$("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';F.series.forEach(M=>{const H=M.data&&M.data[g]!==void 0?M.data[g]:"";W+=","+H}),t+=W+`
98
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(n),p=document.createElement("a");p.href=r,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),Yn()}catch(t){console.error("Error downloading CSV:",t)}},Cl=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(a,n)}Yn()},fo=()=>{xn(),Fe.value.show=!0,Fe.value.categoryIndex=ht.value.categoryIndex,Fe.value.fromButton=!1,Yn()},Uo=()=>{xn(),Fe.value.show=!0,Fe.value.categoryIndex=0,Fe.value.fromButton=!0},vo=t=>{if(ht.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(ht.value.show=!1)}},go=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},Vo=t=>{if(!En.value||!Ke.value)return;t.preventDefault(),t.stopPropagation(),se.value.isZooming=!0,Ue.value.show=!1,se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top;if(r<O.value.left-50||r>O.value.right+50||p<O.value.top-50||p>O.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:w,maxX:W}=Vt.value,M=W-w||1,H=M/se.value.scale,T=w-se.value.offsetX/O.value.width*M,ee=(r-O.value.left)/O.value.width,Ne=T+ee*H;se.value.scale=C;const Xe=M/se.value.scale,ve=Ne-ee*Xe;se.value.offsetX=-(ve-w)/M*O.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)},Xo=t=>{if(!En.value||!Ke.value||se.value.scale<=1)return;Ue.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()},ho=()=>{se.value.isDragging=!1},Jl=()=>{!En.value||!Ke.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)},Yo=()=>!En.value||!Mt.value||!Ke.value?"default":se.value.isDragging?"grabbing":se.value.scale>1?"grab":"dss-crosshair",yo=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 r=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-r.x)/6*je.value,W=p.y+(g.y-r.y)/6*je.value,M=g.x-(C.x-p.x)/6*je.value,H=g.y-(C.y-p.y)/6*je.value;a+=` C ${w} ${W} ${M} ${H} ${g.x} ${g.y}`}return a},Tn=e.computed(()=>{const a=Z.value?.chart?.padding,n=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let g=p+(Ft.value?30:0)+60;if(wn.value){const T={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??T.left,top:r.top??T.top,right:r.right??T.right,bottom:r.bottom??T.bottom}:T}if(Sn.value){const T=!P.value,ee=Hn.value,Ne=ee?Nl.value+A.value+Math.max(24,zn.value+16):0,Xe=T?12:p;let ve=0;ct.value&&(ve+=T?8:15),vt.value&&(ve+=T?6:10);const xe=tt();let Ve=Xe+(T?4:16)+(ee?Ne:0),ge=Xe+(ee?Ne:0);P.value&&K.value==="left"?Ve+=xe.legendWidth||150:P.value&&K.value==="right"&&(ge+=xe.legendWidth||150);const Oe=we.value==="semi-radial"?ee?Ne:8:ee?Ne:T?8:p+80,Le=ee?14:0,$e=Xe+ve+Le,He={left:Ve,top:$e,right:ge,bottom:Oe};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??He.left,top:r.top??He.top,right:r.right??He.right,bottom:r.bottom??He.bottom}:He}let C=0;ct.value&&(C+=15),vt.value&&(C+=10);const w=tt();let W=p+16+(It.value?30:0),M=p+(wt.value?30:0);P.value&&K.value==="left"?W+=w.legendWidth||150:P.value&&K.value==="right"&&(M+=w.legendWidth||150),Ll.value&&(M+=44);const H={left:W,top:p+C,right:M,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),O=e.computed(()=>({left:Tn.value.left,top:Tn.value.top,right:Ee.value-Tn.value.right,bottom:ie.value-Tn.value.bottom,width:Ee.value-(Tn.value.left+Tn.value.right),height:ie.value-(Tn.value.top+Tn.value.bottom)})),En=e.computed(()=>["line","area","bar"].includes(we.value)||et.value),Kn=e.computed(()=>et.value),Xl=e.computed(()=>we.value==="mini-radial"),Sn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),wn=e.computed(()=>we.value==="spider"),Yt=e.computed(()=>we.value==="bubble"),nn=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||Kn.value)),Gn=t=>{const{minY:a,maxY:n}=Vt.value,r=n-a||1;return O.value.left+(t-a)/r*O.value.width},Ml=t=>{const{maxX:a}=Vt.value,n=a+1,p=O.value.height/n;return O.value.top+(t+.5)*p},Pt=e.computed(()=>Sn.value?Tn.value.left+(Ee.value-Tn.value.left-Tn.value.right)/2:Ee.value/2),Dt=e.computed(()=>wn.value?ie.value/2-40:Sn.value?Tn.value.top+(ie.value-Tn.value.top-Tn.value.bottom)/2:ie.value/2),it=e.computed(()=>{if(wn.value){const t=O.value.width-80,a=O.value.height-80;return Math.min(t,a)/2}return Math.min(O.value.width,O.value.height)/2}),Zt=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return it.value*n}),_l=e.computed(()=>{const t=Z.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Sn.value||wn.value)?1:1+a/100}),Il=e.computed(()=>{const t=_l.value;if(t===1||t<=0)return;const a=Pt.value,n=Dt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Qt=e.ref(0),eo=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),bl=e.computed(()=>we.value==="semi-radial"),dl=e.computed(()=>bl.value&&nt.value&&!Hl.value),al=e.computed(()=>bl.value&&nt.value&&!Hl.value&&sn.value==="fill"),zl=e.computed(()=>{const t=dl.value?Qt.value:1,a=Pt.value,n=Dt.value,r=Zt.value,p=it.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),W=n+p*Math.sin(g),M=a+p*Math.cos(C),H=n+p*Math.sin(C),T=a+r*Math.cos(C),ee=n+r*Math.sin(C),Ne=a+r*Math.cos(g),Xe=n+r*Math.sin(g),ve=t>.5?1:0;return`M ${a} ${n} L ${w} ${W} A ${p} ${p} 0 ${ve} 1 ${M} ${H} L ${T} ${ee} A ${r} ${r} 0 ${ve} 1 ${Ne} ${Xe} Z`}),wl=e.computed(()=>{if(!(!bl.value||!dl.value)&&!al.value)return`url(#${eo.value})`}),Pl=t=>{if(!(!al.value||t!==0))return`url(#${eo.value})`},$l=e.ref(0),No=e.computed(()=>`radial-reveal-clip-${F.chartId}`),In=e.computed(()=>we.value==="radial"),Bo=e.computed(()=>{const t=In.value?$l.value:1,a=Pt.value,n=Dt.value,r=Math.max(it.value*1.5,Ee.value,ie.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const T=a-r,ee=a+r;return`M ${T} ${n} A ${r} ${r} 0 0 1 ${ee} ${n} A ${r} ${r} 0 0 1 ${T} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+r*Math.cos(p),w=n+r*Math.sin(p),W=a+r*Math.cos(g),M=n+r*Math.sin(g),H=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${r} ${r} 0 ${H} 1 ${W} ${M} Z`}),Yl=e.computed(()=>{if(wl.value)return wl.value;if(In.value)return`url(#${No.value})`});let Ol=null;const jo=()=>{if(!dl.value)return;Qt.value=0;const t=N.value,a=performance.now(),n=r=>{const p=r-a,g=Math.min(1,p/t);Qt.value=ea(B.value,g),g<1&&(Ol=requestAnimationFrame(n))};Ol=requestAnimationFrame(n)},Mo=e.computed(()=>Z.value?.bubbles?.minSize||8),to=e.computed(()=>Z.value?.bubbles?.maxSize||50),no=e.computed(()=>Z.value?.bubbles?.opacity||.7),lo=(t,a)=>{const n=[15,20,25,18,22],r=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},Ko=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},_o=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Qn=e.computed(()=>F.series),Jn=e.computed(()=>F.series.filter((t,a)=>!Ht.value.has(a))),ko=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},oo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Wn=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ao=e.computed(()=>{const a=Z.value?.spider?.comparison||{};return{fillOpacity:typeof a.fillOpacity=="number"?a.fillOpacity:0,strokeDasharray:a.strokeDasharray||"6,4",usePrimaryColor:a.usePrimaryColor!==!1,bubbleSize:typeof a.bubbleSize=="number"?a.bubbleSize:0}}),jl=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?ao.value.bubbleSize:$t.value,ml=(t,a)=>Wn(t)&&ao.value.usePrimaryColor?f(0):f(a),xl=(t,a)=>wn.value&&Wn(t)?ml(t,a):f(a),Co=e.computed(()=>Jn.value.filter(t=>ko(t)==="primary")),$o=e.computed(()=>Jn.value.filter(t=>ko(t)==="secondary")),Ll=e.computed(()=>!nn.value&&!!bt.value&&$o.value.length>0),Dn="auto",Kl=(t,a,n,r=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(M=>{M?.data?.length&&M.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(g=Math.min(g,H),C=Math.max(C,H))})}),g===1/0)return{minY:r,maxY:p};let w;if(a===Dn){const M=C-g,H=M>0?M*.1:1;w=Math.max(0,g-H)}else if(typeof a=="number")w=a;else{const M=C-g,H=M>0?M*.1:1;w=Math.max(0,g-H)}let W;if(n===Dn){const M=C-g,H=M>0?M*.1:2;W=C+H}else if(typeof n=="number")W=n;else{const M=C-g,H=M>0?M*.1:2;W=C+H}return{minY:w,maxY:W}},Vt=e.computed(()=>{if(Yt.value)return Tl();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Jn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=Kl(Co.value.length?Co.value:Jn.value,Jt.value,pt.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Lo=e.computed(()=>Ll.value?Kl($o.value,jt.value,kt.value,Vt.value.minY,Vt.value.maxY):{minY:Vt.value.minY,maxY:Vt.value.maxY}),Tl=()=>{if(!Jn.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,r=-1/0,p=1/0,g=-1/0,C=!1;if(Jn.value.forEach((Ne,Xe)=>{Ne?.data?.length&&Ne.data.forEach((ve,xe)=>{let Ve,ge,Qe;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ve=typeof ve.x=="number"?ve.x:xe,ge=typeof ve.y=="number"?ve.y:0,Qe=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ve=typeof ve[0]=="number"?ve[0]:xe,ge=typeof ve[1]=="number"?ve[1]:0,Qe=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ve=xe,ge=ve,Qe=lo(Xe,xe);else return;isFinite(Ve)&&isFinite(ge)&&isFinite(Qe)&&(t=Math.min(t,Ve),a=Math.max(a,Ve),n=Math.min(n,ge),r=Math.max(r,ge),p=Math.min(p,Qe),g=Math.max(g,Qe),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,F.categories?.length-1||8)),n===r&&(n=Math.max(0,n-10),r=n+20);const w=a-t,W=r-n;let M,H,T,ee;return tn.value!==null?M=tn.value:M=t-w*.1,U.value!==null?H=U.value:H=a+w*.1,Jt.value!==null&&typeof Jt.value=="number"?T=Jt.value:T=Math.max(0,n-W*.1),pt.value!==null&&typeof pt.value=="number"?ee=pt.value:ee=r+W*.1,{minX:M,maxX:H,minY:T,maxY:ee,minSize:p,maxSize:g}},ln=t=>{if(Yt.value){const{minX:w,maxX:W}=Vt.value,M=W-w||1;return O.value.left+(t-w)/M*O.value.width}const{minX:a,maxX:n}=Vt.value,r=n-a;if(n===0||r===0)return O.value.left+O.value.width/2;const p=r/se.value.scale,g=a-se.value.offsetX/O.value.width*r,C=(t-g)/p;return O.value.left+C*O.value.width},Al=t=>{const{minY:a,maxY:n}=Vt.value,r=n-a||1;return O.value.bottom-(t-a)/r*O.value.height},bo=t=>{const{minY:a,maxY:n}=Lo.value,r=n-a||1;return O.value.bottom-(t-a)/r*O.value.height},qn=(t,a)=>Ll.value&&ko(t)==="secondary"?bo(a):Al(a),o=t=>{if(!Yt.value)return $t.value||4;const{maxSize:a}=Vt.value,n=Math.max(1,a),r=Math.min(1,Math.max(0,t/n));return Mo.value+r*(to.value-Mo.value)},l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);l.canvas||(l.canvas=document.createElement("canvas"));const r=l.canvas.getContext("2d");return r?(r.font=`${a}px ${n}`,r.measureText(t).width):t.length*(a*.62)},s=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||l(t,n)<=a)return t;const r="..";if(l(r,n)>=a)return r;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${r}`;if(l(C,n)<=a)return C;g-=1}return r},i=e.computed(()=>u.value.map(t=>({y:t.y}))),c=e.computed(()=>{if(Yt.value)return d();if(we.value==="bar"){if(nn.value){const $e=[],{minY:He,maxY:_t}=Vt.value,Ot=5,tl=_t-He||1;for(let Cn=0;Cn<=Ot;Cn++){const nl=He+tl*(Cn/Ot),zo=Gn(nl);$e.push({x:zo,y:O.value.bottom+20,text:en(Math.round(nl))})}return $e}const xe=[],{maxX:Ve}=Vt.value,ge=Ve+1,Qe=5,Le=(O.value.width-Qe*2)/ge;for(let $e=0;$e<=Ve;$e++){const He=O.value.left+Qe+($e+.5)*Le;xe.push({x:He,y:O.value.bottom+20,text:s(F.categories[$e]||$("chart.fallback.item",{number:$e+1}),Math.max(Le-8,24))})}return xe}const t=[],{minX:a,maxX:n}=Vt.value,r=tn.value!==null?tn.value:a,p=U.value!==null?U.value:n,g=p-r||1,C=g/se.value.scale,w=r-se.value.offsetX/O.value.width*g,W=w+C,M=Math.max(0,Math.floor(w-2)),H=Math.min(p,Math.ceil(W+2)),T=H-M,ee=O.value.width,Xe=Math.floor(ee/60);let ve=1;T>Xe&&(ve=Math.ceil(T/Xe));for(let xe=M;xe<=H;xe+=ve)if(xe>=0&&xe<=p){const Ve=ln(xe);Ve>=O.value.left-100&&Ve<=O.value.right+100&&t.push({x:Ve,y:O.value.bottom+20,text:F.categories[xe]||`Item ${xe+1}`})}return t}),d=()=>{const t=[],{minX:a,maxX:n}=Vt.value,r=n-a||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const C=a+r*g/p,w=ln(C);if(w>=O.value.left-10&&w<=O.value.right+10){const W=Math.round(C),M=F.categories?.[W];t.push({x:w,y:O.value.bottom+20,text:M||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},u=e.computed(()=>{if(nn.value){const p=[],{maxX:g}=Vt.value;for(let C=0;C<=g;C++)p.push({x:O.value.left-10,y:Ml(C),text:s(F.categories[C]||`Item ${C+1}`,Math.max(O.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Vt.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:O.value.left-10,y:Al(g),text:en(C)})}return t}),m=e.computed(()=>{if(!Ll.value||nn.value)return[];const t=[],{minY:a,maxY:n}=Lo.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:O.value.right+10,y:bo(g),text:en(C)})}return t}),f=t=>{const a=Xt.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]},k=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,r=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,r=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,r=Number(w[2])/255,p=Number(w[3])/255;else{const W=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let M=W[1];M.length===3&&(M=M[0]+M[0]+M[1]+M[1]+M[2]+M[2]),n=parseInt(M.slice(0,2),16)/255,r=parseInt(M.slice(2,4),16)/255,p=parseInt(M.slice(4,6),16)/255}else if(typeof document<"u"){const M=document.createElement("span");M.style.color=a,M.style.display="none",document.body.appendChild(M);const H=getComputedStyle(M).color;document.body.removeChild(M);const T=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(T)n=Number(T[1])/255,r=Number(T[2])/255,p=Number(T[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},D=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)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const g=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),w=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${g}, ${C}, ${w}, ${r[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))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),W=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,W].map(M=>M.toString(16).padStart(2,"0")).join("")}`}return a},R=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?D(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??D(a):D(a)},S=t=>{let a=0;for(let n=1;n<t.length;n++){const r=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(r*r+p*p)}return a},re=e.computed(()=>we.value==="line"||Kn.value?(Kn.value?F.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(T=>T===a),p=[];let g=[];a.data.forEach((T,ee)=>{T==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:nn.value?Gn(T):ln(ee),y:nn.value?Ml(ee):qn(a,T),index:ee})}),g.length>0&&p.push(g);let C="";p.forEach(T=>{if(T.length>0){let ee="";be.value?ee=yo(T):ee=`M ${T[0].x} ${T[0].y}`+T.slice(1).map(Ne=>` L ${Ne.x} ${Ne.y}`).join(""),C+=(C?" ":"")+ee}});const w=p.reduce((T,ee)=>T+S(ee),0),W=Ht.value.has(r),M=he.value===r,H=he.value!==null&&he.value!==r;return{path:C,color:f(r),strokeDasharray:oo(a),pathLength:w,seriesIndex:r,animationDelay:n*G.value,isHighlighted:M,isDimmed:H,isHidden:W}}):[]),J=e.computed(()=>{if(!(we.value==="line"||Kn.value))return[];const t=Kn.value?F.series.filter(n=>(n.type||we.value)==="line"):Qn.value,a=[];return t.forEach((n,r)=>{const p=F.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,W=0;for(let M=g+1;M<n.data.length;M++){const H=n.data[M];if(H==null)W++;else{w=M;break}}if(W>0&&w!==-1){const M=n.data[w],H=nn.value?Gn(C):ln(g),T=nn.value?Ml(g):qn(n,C),ee=nn.value?Gn(M):ln(w),Ne=nn.value?Ml(w):qn(n,M),Xe=Ht.value.has(p),ve=he.value===p,xe=he.value!==null&&he.value!==p;a.push({path:`M ${H} ${T} L ${ee} ${Ne}`,color:f(p),seriesIndex:p,animationDelay:r*G.value,isHighlighted:ve,isDimmed:xe,isHidden:Xe,gapSize:W}),g=w-1}}}}),a}),Pe=e.computed(()=>we.value==="line"||Kn.value?!nt.value||Hl.value||Rt.value.hasAnimated?[]:(Kn.value?F.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(W=>W===a);let p="",g=null;a.data.forEach((W,M)=>{if(W!=null){const H={x:nn.value?Gn(W):ln(M),y:nn.value?Ml(M):qn(a,W)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=a.data.findIndex((T,ee)=>ee>M&&T!==null&&T!==void 0);if(H!==-1){const T={x:nn.value?Gn(a.data[H]):ln(H),y:nn.value?Ml(H):qn(a,a.data[H])};p+=` L ${T.x} ${T.y}`,g=T}}});const C=a.data.map((W,M)=>W==null?null:{x:nn.value?Gn(W):ln(M),y:nn.value?Ml(M):qn(a,W)}).filter(W=>W!==null),w=S(C);return{path:p,pathLength:w,color:f(r),strokeDasharray:oo(a),animationDelay:n*G.value,seriesIndex:r}}):[]),Be=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Qn.value.forEach((a,n)=>{const r=he.value===n,p=he.value!==null&&he.value!==n,g=Ht.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:ln(w),y:qn(a,C),color:f(n),value:C,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(G.value/8),isHighlighted:r,isDimmed:p,isHidden:g})})}),t}),yt=e.computed(()=>{if(!Kn.value)return[];const t=[];return F.series.filter(n=>(n.type||we.value)==="line").forEach((n,r)=>{const p=F.series.findIndex(W=>W===n),g=he.value===p,C=he.value!==null&&he.value!==p,w=Ht.value.has(p);n.data.forEach((W,M)=>{W!=null&&t.push({x:ln(M),y:qn(n,W),color:f(p),value:W,label:F.categories[M]||M.toString(),seriesName:n.name,categoryIndex:M,dataIndex:M,animationDelay:(r*n.data.length+M)*(G.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),dn=e.computed(()=>{if(!Yt.value)return[];const t=[];return Qn.value.forEach((a,n)=>{if(!a?.data?.length)return;const r=he.value,p=r!==null&&r===n,g=r!==null&&r!==n,C=Ht.value.has(n);a.data.forEach((w,W)=>{let M,H,T,ee,Ne;if(typeof w=="object"&&w!==null&&!Array.isArray(w))M=typeof w.x=="number"?w.x:W,H=typeof w.y=="number"?w.y:0,T=typeof w.size=="number"?w.size:20,ee=w.label||F.categories?.[W]||`Point ${W+1}`,Ne=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)M=typeof w[0]=="number"?w[0]:W,H=typeof w[1]=="number"?w[1]:0,T=typeof w[2]=="number"?w[2]:20,ee=w[3]||F.categories?.[W]||`Point ${W+1}`,Ne=w[4];else if(typeof w=="number")M=W,H=w,T=lo(n,W),ee=F.categories?.[W]||`Point ${W+1}`;else return;!isFinite(M)||!isFinite(H)||!isFinite(T)||t.push({x:ln(M),y:Al(H),radius:o(T),originalX:M,originalY:H,originalSize:T,color:f(n),seriesName:a.name||`Series ${n+1}`,label:ee,imageUrl:Ne,seriesIndex:n,dataIndex:W,categoryIndex:Math.round(M),isHighlighted:p,isDimmed:g,isHidden:C,opacity:no.value})})}),t}),mn=e.computed(()=>we.value!=="area"?[]:Qn.value.map((t,a)=>{const n=[];let r=[];if(t.data.forEach((T,ee)=>{T==null?r.length>0&&(n.push([...r]),r=[]):r.push({x:ln(ee),y:qn(t,T),index:ee})}),r.length>0&&n.push(r),n.length===0)return{linePath:"",areaPath:"",color:f(a),isHidden:Ht.value.has(a)};const p=O.value.bottom+1;let g="",C="";n.forEach((T,ee)=>{if(T.length===0)return;let Ne=`M ${T[0].x} ${T[0].y}`;be.value&&T.length>1?Ne=yo(T):T.slice(1).forEach(ve=>{Ne+=` L ${ve.x} ${ve.y}`}),g+=(g?" ":"")+Ne;let Xe=`M ${T[0].x} ${p}`;if(Xe+=` L ${T[0].x} ${T[0].y}`,be.value&&T.length>1){const ve=yo(T),xe=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));xe?Xe+=" "+xe:T.slice(1).forEach(Ve=>{Xe+=` L ${Ve.x} ${Ve.y}`})}else T.slice(1).forEach(ve=>{Xe+=` L ${ve.x} ${ve.y}`});Xe+=` L ${T[T.length-1].x} ${p} Z`,C+=(C?" ":"")+Xe});const w=he.value===a,W=he.value!==null&&he.value!==a,M=Ht.value.has(a),H=n.reduce((T,ee)=>T+S(ee),0);return{linePath:g,areaPath:C,color:f(a),pathLength:H,isHighlighted:w,isDimmed:W,isHidden:M}})),an=e.computed(()=>{if(!(["bar"].includes(we.value)||Kn.value))return[];const t=[],{maxX:a}=Vt.value,n=Kn.value?F.series.filter(p=>(p.type||we.value)==="bar"):Qn.value,r=n.length;if(nn.value){const p=a+1,C=O.value.height/p,w=C*(2/3),W=Math.min(4,w/r*.15),M=w-(r-1)*W,H=Math.max(4,M/r);n.forEach((T,ee)=>{const Ne=F.series.findIndex(Ve=>Ve===T),Xe=he.value===Ne,ve=he.value!==null&&he.value!==Ne,xe=Ht.value.has(Ne);T.data.forEach((Ve,ge)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=O.value.top+(ge+.5)*C-w/2+ee*(H+W),$e=O.value.left,He=Math.abs(Gn(Ve)-O.value.left);let _t="";if(be.value&&He>0){const Ot=Math.min(Tt.value,H/2,He/2);_t=[`M ${$e} ${Le}`,`L ${$e+He-Ot} ${Le}`,`Q ${$e+He} ${Le} ${$e+He} ${Le+Ot}`,`L ${$e+He} ${Le+H-Ot}`,`Q ${$e+He} ${Le+H} ${$e+He-Ot} ${Le+H}`,`L ${$e} ${Le+H}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:He,height:H,color:f(r===1?ge:Ne),value:Ve,label:F.categories[ge]||ge.toString(),seriesName:T.name,animationDelay:(ee*n.length+ge)*(G.value/4),isHighlighted:Xe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:be.value&&He>0})})})}else{const p=a+1,C=O.value.width/p,w=C*.8,W=w/r,M=W*.05,H=W-M;n.forEach((T,ee)=>{const Ne=F.series.findIndex(Ve=>Ve===T),Xe=he.value===Ne,ve=he.value!==null&&he.value!==Ne,xe=Ht.value.has(Ne);T.data.forEach((Ve,ge)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=O.value.left+(ge+.5)*C-w/2+ee*W+M/2,$e=Al(Math.max(0,Ve)),He=Math.abs(Al(0)-Al(Ve));let _t="";if(be.value&&He>0){const Ot=Math.min(Tt.value,H/2,He/2);_t=[`M ${Le} ${$e+He}`,`L ${Le} ${$e+Ot}`,`Q ${Le} ${$e} ${Le+Ot} ${$e}`,`L ${Le+H-Ot} ${$e}`,`Q ${Le+H} ${$e} ${Le+H} ${$e+Ot}`,`L ${Le+H} ${$e+He}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:H,height:He,color:f(r===1?ge:Ne),value:Ve,label:F.categories[ge]||ge.toString(),seriesName:T.name,animationDelay:(ee*n.length+ge)*(G.value/4),isHighlighted:Xe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:be.value&&He>0})})})}return t}),Ut=e.computed(()=>{if(!Sn.value)return[];const t=Qn.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!Ht.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,r=[],p=(C,w,W,M,H,T)=>{const ee=C+(w-C)/2,Ne=w-C,Xe=Pt.value+Math.cos(C)*Zt.value,ve=Dt.value+Math.sin(C)*Zt.value,xe=Pt.value+Math.cos(w)*Zt.value,Ve=Dt.value+Math.sin(w)*Zt.value,ge=Pt.value+Math.cos(w)*it.value,Qe=Dt.value+Math.sin(w)*it.value,Oe=Pt.value+Math.cos(C)*it.value,Le=Dt.value+Math.sin(C)*it.value,$e=Ne>Math.PI?1:0,He=[`M ${Xe} ${ve}`,`A ${Zt.value} ${Zt.value} 0 ${$e} 1 ${xe} ${Ve}`,`L ${ge} ${Qe}`,`A ${it.value} ${it.value} 0 ${$e} 0 ${Oe} ${Le}`,"Z"].join(" "),_t=T||f(W);return{path:He,color:_t,strokeWidth:Lt.value,strokeColor:R(r.length,_t),value:H,seriesName:M,opacity:.8,isHighlighted:he.value===W,isDimmed:he.value!==null&&he.value!==W,isHidden:!1,startAngle:C,endAngle:w,midAngle:ee}};if(Xl.value){const{series:C,originalIndex:w}=t[0],W=Number(C?.data?.[0]??0),M=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,H=Z.value,T=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),Ne=(M<=0?T:M)/100*n,Xe=Number(H?.miniRadial?.thresholds?.low??33),ve=Number(H?.miniRadial?.thresholds?.medium??66),xe=H?.miniRadial?.colors?.low||"#E53E3E",Ve=H?.miniRadial?.colors?.medium||"#ED8936",ge=H?.miniRadial?.colors?.high||"#38A169",Qe=M<=Xe?xe:M<=ve?Ve:ge,Oe=H?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(p(a,a+n-.001,w+1,"Track",100,Oe)),r.push(p(a,a+Ne,w,Le,M,Qe)),r}if(t.length===1){const{series:C,originalIndex:w}=t[0],W=C.data[0]||0,M=a,H=a+n-.001,T=M+n/2,ee=Pt.value+Math.cos(M)*Zt.value,Ne=Dt.value+Math.sin(M)*Zt.value,Xe=Pt.value+Math.cos(H)*Zt.value,ve=Dt.value+Math.sin(H)*Zt.value,xe=Pt.value+Math.cos(H)*it.value,Ve=Dt.value+Math.sin(H)*it.value,ge=Pt.value+Math.cos(M)*it.value,Qe=Dt.value+Math.sin(M)*it.value,Oe=1,Le=[`M ${ee} ${Ne}`,`A ${Zt.value} ${Zt.value} 0 ${Oe} 1 ${Xe} ${ve}`,`L ${xe} ${Ve}`,`A ${it.value} ${it.value} 0 ${Oe} 0 ${ge} ${Qe}`,"Z"].join(" "),$e=f(w);return r.push({path:Le,color:$e,strokeWidth:Lt.value,strokeColor:R(0,$e),value:W,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:H,midAngle:T}),r}if(al.value&&t.length===2){const C=t[0],w=t[1],W=Math.min(100,Math.max(0,C.series.data[0]||0)),M=W/100*n;return r.push(p(a,a+M,C.originalIndex,C.series.name,W)),r.push(p(a,a+n,w.originalIndex,w.series.name,100)),r}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const W=C.data[0]||0,M=W/g*n,H=a,T=a+M,ee=H+M/2,Ne=Pt.value+Math.cos(H)*Zt.value,Xe=Dt.value+Math.sin(H)*Zt.value,ve=Pt.value+Math.cos(T)*Zt.value,xe=Dt.value+Math.sin(T)*Zt.value,Ve=Pt.value+Math.cos(T)*it.value,ge=Dt.value+Math.sin(T)*it.value,Qe=Pt.value+Math.cos(H)*it.value,Oe=Dt.value+Math.sin(H)*it.value,Le=M>Math.PI?1:0,$e=[`M ${Ne} ${Xe}`,`A ${Zt.value} ${Zt.value} 0 ${Le} 1 ${ve} ${xe}`,`L ${Ve} ${ge}`,`A ${it.value} ${it.value} 0 ${Le} 0 ${Qe} ${Oe}`,"Z"].join(" "),He=f(w);r.push({path:$e,color:He,strokeWidth:Lt.value,strokeColor:R(r.length,He),value:W,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:he.value!==null&&he.value!==w,isHidden:!1,startAngle:H,endAngle:T,midAngle:ee}),a=T}),r)}),kn=e.computed(()=>{const t=Ut.value;return al.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),fn=e.computed(()=>{if(!Hn.value||!Sn.value)return[];const t=zn.value,a=Nl.value,n=A.value,r=z.value,p=15,g=t*1.3,C=.55,w=(T,ee)=>{const Ne=Pt.value+Math.cos(T.midAngle)*it.value,Xe=Dt.value+Math.sin(T.midAngle)*it.value,ve=Pt.value+Math.cos(T.midAngle)*(it.value+a),xe=Dt.value+Math.sin(T.midAngle)*(it.value+a),ge=ve+n*(ee?1:-1),Qe=ee?ve+p:ve-p,Oe=xe-r,Le=`${T.seriesName}: ${en(T.value)}`,$e=Le.length*t*C;return{pointerStartX:Ne,pointerStartY:Xe,pointerEndX:ve,pointerEndY:xe,horizontalEndX:ge,horizontalEndY:xe,textX:Qe,textY:Oe,text:Le,textWidth:$e,textAnchor:ee?"start":"end",isRightSide:ee,pointerLineLength:Math.hypot(ve-Ne,xe-Xe),horizontalLineLength:Math.hypot(ge-ve,0)}},W=(T,ee)=>{const Ne=Math.abs(T.textY-ee.textY)<g,Xe=T.isRightSide?T.textX:T.textX-T.textWidth,ve=T.isRightSide?T.textX+T.textWidth:T.textX,xe=ee.isRightSide?ee.textX:ee.textX-ee.textWidth,Ve=ee.isRightSide?ee.textX+ee.textWidth:ee.textX,ge=Xe<Ve&&xe<ve;return Ne&&ge},M=Ut.value.filter(T=>!T.isHidden),H=[];for(let T=0;T<M.length;T++){const ee=M[T];let Ne=Math.cos(ee.midAngle)>=0;if(T>0){const ve=H[T-1],xe=w(ee,Ne);W(ve,xe)&&(Ne=!Ne)}const Xe=w(ee,Ne);H.push({...Xe,color:ee.color,isHighlighted:ee.isHighlighted,isDimmed:ee.isDimmed})}return H}),sl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||no.value||.7;return he.value===null||he.value===void 0?a:he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},El=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):a*.7:a},pl=(t,a)=>{if(t)try{if(he.value===t.seriesIndex?he.value=null:he.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},To=(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(" ")},wo=(t,a)=>{if(!t||(a.stopPropagation(),Fo.value=!0,he.value=t.seriesIndex,Ue.value.show=!1,!Re.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120;p+C>Ee.value&&(p=a.clientX-r.left-C-10),g+w>r.height&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);const W=gn.value,M=Kt.value,H=W.map(T=>{const ee=M[T]||T,Ne=Ao(T,t);return Ne?{seriesName:t.seriesName,label:t.label,value:`${ee}: ${Ne}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},Ao=(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 r=Ln.value[t];if(typeof r=="function")return r(n,a);if(typeof n=="number"){const p=n.toFixed(1);return Zn.value?p+Zn.value:p}return n?.toString()||""},Do=()=>{if(!Yt.value||!Ue.value.data||Ue.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Ue.value.data.forEach(n=>{if(n.seriesName&&n.label){const r=`${n.seriesName} - ${n.label}`;a.has(r)||(t.push(r),a.add(r))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Go=(t,a)=>{t&&(Fo.value=!1,he.value=null,gt.value.show=!1,gt.value.bubbleData=[])},Ho=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect(),p=Ul(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-r.left+15,w=a.clientY-r.top-10;const W=200,M=g?80:50;C+W>Ee.value&&(C=a.clientX-r.left-W-15),w+M>ie.value&&(w=a.clientY-r.top-M-10),C<0&&(C=10),w<0&&(w=10),Rn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},so=()=>{Rn.value.show=!1},Dl=e.computed(()=>F.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),fl=e.computed(()=>{let t=0;return Jn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),rl=e.computed(()=>{const t=[],a=Dl.value;for(let n=0;n<a;n++){const r=n*2*Math.PI/a-Math.PI/2,p=Pt.value+Math.cos(r)*it.value,g=Dt.value+Math.sin(r)*it.value;t.push({x:p,y:g,angle:r,index:n})}return t}),el=e.computed(()=>{const t=[],a=Dl.value;return rl.value.forEach((n,r)=>{const p=it.value+15,g=r*2*Math.PI/a-Math.PI/2,C=Pt.value+Math.cos(g)*p,w=Dt.value+Math.sin(g)*p+5;let W="middle",M="middle";Math.abs(Math.cos(g))>.5&&(W=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(M=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:F.categories[r]||`Axis ${r+1}`,anchor:W,baseline:M})}),t}),oa=e.ref(new Set),ha=(t,a,n)=>{const r=`current-${n}`,p=oa.value.has(r),g=a.fillOpacity??Ct.value;return!p&&he.value===null?g:a.isHighlighted||p?a.isComparison?g:g+.15:a.isDimmed?g*.3:g},aa=e.computed(()=>{if(!wn.value)return[];const t=[],a=Dl.value;return Qn.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const g=Wn(r.series)?0:1,C=Wn(p.series)?0:1;return g-C}).forEach(({series:r,seriesIndex:p})=>{const g=Wn(r),C=[],w=[],W=[],M=he.value===p,H=he.value!==null&&he.value!==p,T=Ht.value.has(p);for(let ee=0;ee<a;ee++){const Ne=r.data[ee]||0,ve=Ne/fl.value*it.value,xe=ee*2*Math.PI/a-Math.PI/2,Ve=Pt.value+Math.cos(xe)*ve,ge=Dt.value+Math.sin(xe)*ve;C.push(`${Ve},${ge}`),w.push({x:Ve,y:ge}),W.push({x:Ve,y:ge,value:Ne,label:F.categories[ee]||`Axis ${ee+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:w,dataPoints:W,color:ml(r,p),fillOpacity:g?ao.value.fillOpacity:Ct.value,strokeDasharray:g?oo(r)||ao.value.strokeDasharray:null,pointRadius:jl(r,g),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:M,isDimmed:H,isHidden:T,isComparison:g,seriesIndex:p})}),t}),ya=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const g=a[r].x,C=a[r].y,w=a[p].x,W=a[p].y;C>t.y!=W>t.y&&t.x<(w-g)*(t.y-C)/(W-C)+g&&(n=!n)}return n},ka=t=>{if(!wn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),r=_.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,g=t.clientY-r.top,C=aa.value.filter(w=>w.isHidden?!1:ya({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,he.value=C[0].seriesIndex;const w=t.clientX-n.left+10,W=t.clientY-n.top-10,M=C.length>1?460:260,H=70+Dl.value*20;let T=w,ee=W;T+M>Ee.value&&(T=t.clientX-n.left-M-10),ee+H>ie.value&&(ee=t.clientY-n.top-H-10),T<0&&(T=10),ee<0&&(ee=10);const Ne=C.map(Xe=>({seriesName:Xe.seriesName,color:Xe.color,points:Xe.dataPoints.map(ve=>({label:ve.label,value:en(ve.value)}))}));gt.value={show:!0,x:T,y:ee,title:"",value:"",bubbleData:[],spiderAreas:Ne}}else Sl()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((a,n)=>{const r=F.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||Ht.value.has(a.seriesIndex))return null;let p,g;if(En.value){let w=-1,W=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){w=H,W=r.data[H];break}if(w===-1||W===null)return null;const M=r.data.map((H,T)=>H==null?null:{x:ln(T),y:qn(r,H),index:T}).filter(H=>H!==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 H=Rt.value.currentFrame/Rt.value.totalFrames,T=ea(t.animations.easing,Math.min(H,1)),ee=Ba(M,T);p=ee.x+(a.offsetX||0),g=ee.y+(a.offsetY||0)}else p=M[0].x+(a.offsetX||0),g=M[0].y+(a.offsetY||0);else p=ln(w)+(a.offsetX||0),g=Al(W)+(a.offsetY||0)}else if(Sn.value||wn.value){const w=Math.PI*2/t.logos.length*n;p=Pt.value+Math.cos(w)*(it.value+30)+(a.offsetX||0),g=Dt.value+Math.sin(w)*(it.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),Ca=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")},ba=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Qo=t=>{Ht.value.has(t)?Ht.value.delete(t):Ht.value.add(t)},wa=e.computed(()=>{if(!gt.value.show&&!(Ze.value&&Ue.value.show&&!se.value.isZooming))return{display:"none"};let t,a;if(Ze.value&&Ue.value.show&&!se.value.isZooming){t=Ue.value.x+15,a=O.value.top;const n=Yt.value?200:150;t+n>Ee.value&&(t=Ue.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"}}),Wl=(t,a)=>{if(!Re.value||xo.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120,W=Ee.value,M=ie.value;p+C>W&&(p=a.clientX-r.left-C-10),g+w>M&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));const T=(nn.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:T,value:en(t.value)||"",categoryIndex:H,spiderAreas:[]}},Jo=e.ref(!1),Fo=e.ref(!1),Sl=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],Ue.value.show=!1,Jo.value||(he.value=null)},xo=e.ref(!1),Eo=(t,a)=>{xo.value=!0,gt.value.show=!1,Ue.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,g=a.clientY-r.top-10;const C=250;p+C>Ee.value&&(p=a.clientX-r.left-C-15),p<0&&(p=10),g<0&&(g=10),Wt.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},So=()=>{xo.value=!1,Wt.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ea=(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(()=>De.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),sa=()=>{if(!nt.value||Hl.value){Rt.value.hasAnimated=!0,In.value&&($l.value=1);return}In.value&&($l.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(N.value/16.67);const t=()=>{const a=Rt.value.currentFrame/Rt.value.totalFrames,n=ea(B.value,Math.min(a,1));xa(n),In.value&&($l.value=n),a<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):Ea()};Rt.value.animationId=requestAnimationFrame(t)},xa=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},Ea=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,In.value&&($l.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},ta=e.computed(()=>!Sn.value||Rt.value.hasAnimated?!0:In.value?$l.value>=1:bl.value?Qt.value>=1:!0),ra=e.computed(()=>Hn.value&&ta.value),Io=e.ref(!1);e.watch(ra,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const Sa=e.computed(()=>{if(!nt.value||Hl.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${N.value}ms`,t["--dss-animation-easing"]=Va(B.value),t["--dss-stagger-delay"]=`${G.value}ms`,t}),Va=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Na=()=>{if(!nt.value||Hl.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${sn.value}`),Rt.value.hasAnimated||(Sn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):Sn.value||t.push(`dss-animate-${sn.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{ae.value&&a&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>sa(),b.value)}))},{deep:!0}),e.watch(()=>se.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Mn()},50)}),e.watch(()=>[se.value.scale,se.value.offsetX],()=>{!se.value.isZooming&&!se.value.isDragging&&Mn()},{flush:"post"}),e.watch([zt,qe],([t,a])=>{se.value.minScale=t,se.value.maxScale=a,(se.value.scale<t||se.value.scale>a)&&Jl()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",go)}):document.removeEventListener("click",go)}),e.onMounted(()=>{he.value=null,In.value&&(!nt.value||Hl.value)&&($l.value=1),x(),I.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(Ce&&cancelAnimationFrame(Ce),Ce=requestAnimationFrame(()=>{Ce=null;const{width:n,height:r}=a.contentRect;st.value=Math.round(n),te.value=Math.round(r),pe.value&&(_e.value=pe.value.offsetHeight||ke)}))}),v.observe(I.value)),nt.value&&!Hl.value?we.value==="semi-radial"?setTimeout(()=>jo(),b.value):setTimeout(()=>sa(),b.value):(Rt.value.hasAnimated=!0,we.value==="semi-radial"&&(Qt.value=1)),document.addEventListener("mousemove",ia),document.addEventListener("mouseup",ca),document.addEventListener("click",vo)}),e.onUnmounted(()=>{Ce&&cancelAnimationFrame(Ce),v&&I.value&&(v.unobserve(I.value),v.disconnect(),v=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),Ol&&(cancelAnimationFrame(Ol),Ol=null),se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout),document.removeEventListener("mousemove",ia),document.removeEventListener("mouseup",ca),document.removeEventListener("click",vo),document.removeEventListener("click",go)});const ia=t=>{if(se.value.isDragging&&se.value.scale>1&&En.value){Ue.value.show=!1;const a=t.clientX-se.value.lastMouseX,{minX:n,maxX:r}=Vt.value,p=r-n||1,C=a*.8;se.value.offsetX+=C;const w=p/se.value.scale,W=p-w,M=0,H=-W/p*O.value.width,T=M;se.value.offsetX=Math.max(H,Math.min(T,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY}},ca=()=>{se.value.isDragging&&(se.value.isDragging=!1,setTimeout(()=>{!se.value.isDragging&&se.value.isZooming},100))},Ba=(t,a)=>{const n=t.filter(w=>w!=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 r=0;const p=[];for(let w=1;w<n.length;w++){const W=n[w].x-n[w-1].x,M=n[w].y-n[w-1].y,H=Math.sqrt(W*W+M*M);p.push(H),r+=H}const g=r*a;let C=0;for(let w=0;w<p.length;w++){const W=C+p[w];if(g<=W){const M=(g-C)/p[w],H=n[w],T=n[w+1];return{x:H.x+(T.x-H.x)*M,y:H.y+(T.y-H.y)*M}}C=W}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",[Na(),{"dss-chart-fill-width":Ae.value,"dss-chart-fill-height":We.value,"dss-chart-compact":Sn.value&&!P.value}]]),style:e.normalizeStyle({width:Ae.value?"100%":Ee.value+"px",height:Je.value,...Ae.value||We.value?{overflow:Sn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Sa.value,cursor:Yo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:I,onWheel:Vo,onMousedown:Xo,onMousemove:un,onMouseup:ho,onMouseleave:Pn,onDblclick:Jl,onContextmenu:e.withModifiers(Zl,["prevent"]),onClick:e.withModifiers(Yn,["left"]),onWheelCapture:Vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:pe},[e.createElementVNode("div",Vs,[ct.value?(e.openBlock(),e.createElementBlock("div",Ns,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(vt.value),1)):e.createCommentVNode("",!0)]),P.value&&K.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Se.value==="horizontal","dss-legend-vertical":Se.value==="vertical","dss-legend-top":K.value==="top","dss-legend-bottom":K.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",_s,e.toDisplayString(n.name),1)],46,Ms))),128))],2)):e.createCommentVNode("",!0),P.value&&(K.value==="left"||K.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":K.value==="left","dss-legend-right":K.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",Ls,e.toDisplayString(n.name),1)],46,$s))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&St.value&&rt.value.addMarker&&(En.value||Yt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Uo,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Nt.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,As),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,Ts)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[Yt.value&&ut.value?(e.openBlock(),e.createElementBlock("div",Hs,"Bubble size: "+e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:ie.value,class:"dss-chart-svg","data-smooth":be.value,"data-animated":nt.value,ref_key:"svgEl",ref:_},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:Ee.value,height:O.value.height*4},null,8,Is)],8,Fs),bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:eo.value},[e.createElementVNode("path",{d:zl.value},null,8,Ps)],8,zs)):e.createCommentVNode("",!0),In.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:No.value},[e.createElementVNode("path",{d:Bo.value},null,8,Ws)],8,Os)):e.createCommentVNode("",!0)]),En.value||Yt.value?(e.openBlock(),e.createElementBlock("g",qs,[ye.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(i.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:O.value.left,x2:O.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,Us))),128))],8,Zs)):e.createCommentVNode("",!0),e.createElementVNode("g",Xs,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ys),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,js),Ll.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:O.value.right,x2:O.value.right,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ks)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(n.text),13,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,Js))),128)),Ll.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,er))),128)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Ft.value),9,tr)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(It.value),9,nr)):e.createCommentVNode("",!0),Ll.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ee.value-15}, ${O.value.top+O.value.height/2})`},e.toDisplayString(wt.value),9,lr)):e.createCommentVNode("",!0)]),bn.value.length>0?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.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:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,sr)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,rr)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ir)):e.createCommentVNode("",!0)],8,ar),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,cr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,O.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:r=>Eo(n,r),onMouseleave:So},null,40,ur),e.createElementVNode("text",{x:n.x,y:Math.max(15,O.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,dr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Kn.value?(e.openBlock(),e.createElementBlock("g",pr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[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=>Wl(n,p),onMouseleave:Sl},null,46,fr)):(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=>Wl(n,p),onMouseleave:Sl},null,46,vr))],64))),128))],2),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.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,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.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,yr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(yt.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:n.x,cy:n.y,r:j(n.isHighlighted?Y(n,$t.value)+2:Y(n,$t.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=>Wl(n,p),onMouseleave:Sl},null,46,kr))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:n.path,stroke:n.color,"stroke-width":ze.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,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.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,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.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,xr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Be.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:n.x,cy:n.y,r:j(n.isHighlighted?Y(n,$t.value)+2:Y(n,$t.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=>Wl(n,p),onMouseleave:Sl},null,46,Er))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Nr)],8,Vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?de.value+.2:de.value,mask:`url(#area-mask-${r}-${E.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,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.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:`${r*G.value}ms`})},null,14,Mr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":nn.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[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=>Wl(n,p),onMouseleave:Sl},null,46,_r)):(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=>Wl(n,p),onMouseleave:Sl},null,46,$r))],64))),128))],2)):e.createCommentVNode("",!0)],8,mr),Ze.value&&Ue.value.show&&!se.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:Ue.value.x,x2:Ue.value.x,y1:O.value.top,y2:O.value.bottom,stroke:xt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Tr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Ue.value.x,cy:n.y,r:j($t.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ar))),128))],8,Lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Yt.value?(e.openBlock(),e.createElementBlock("g",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[n?(e.openBlock(),e.createElementBlock("g",Hr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:j(n.radius),fill:n.color,"fill-opacity":sl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(To(n,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,42,Rr),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-${r} ${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:El(n)}),onLoad:p=>Ko(r),onError:p=>_o(r),onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,46,Fr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Il.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Pt.value,cy:Dt.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":Yl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${r}`,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":Pl(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=>Wl(n.segment,p),onMouseleave:Sl},null,42,Or))),128))],8,Pr),L.value&&ta.value?(e.openBlock(),e.createElementBlock("g",Wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,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,qr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Te.value&&(ta.value||bl.value||Xl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ot.value.x,y:ot.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":dt.value,fill:at.value,class:"dss-radial-data-center"},e.toDisplayString(ft.value),9,Zr)):e.createCommentVNode("",!0),ra.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.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,Ur),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,Xr),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,Yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ir)):e.createCommentVNode("",!0),wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Il.value},[ye.value?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Pt.value,cy:Dt.value,r:j(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Gr))),128)),e.createElementVNode("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Pt.value-16,y:Dt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Jr),e.createElementVNode("text",{x:Pt.value,y:Dt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Et(r)),9,ei)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Pt.value,x2:n.x,y1:Dt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,ti))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:n.x+Math.cos(r*2*Math.PI/Dl.value-Math.PI/2)*16,y:n.y+Math.sin(r*2*Math.PI/Dl.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:`${r*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,li))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ka,onMouseleave:Sl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ha("current",n,r),stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.value,"stroke-dasharray":n.strokeDasharray||void 0,"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:`${r*G.value}ms`,transition:"all 0.2s ease"})},null,14,oi),n.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${g}`,cx:p.x,cy:p.y,r:j(n.isHighlighted?n.pointRadius+1:n.pointRadius),fill:n.isComparison?"none":n.color,stroke:n.isComparison?n.color:"none","stroke-width":n.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${r*G.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Wl(p,C),onMouseleave:Sl},null,46,ai))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,jr)):e.createCommentVNode("",!0),e.createElementVNode("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:n.x,cy:n.y,r:j(n.width/2),fill:f(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ri))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Ca(r),onError:p=>ba(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,ii))),128))])],8,Rs))]),il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ee.value+"px",height:ie.value+"px",backgroundImage:`url('${Xn.value}')`,backgroundRepeat:"no-repeat",...Rl.value,opacity:_n.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,r)=>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:Vn.value+"px",height:Vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>Ho(n,p),onMouseleave:so},[e.createElementVNode("img",{src:cl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ui)],44,ci)),[[e.vShow,pn.value]])),128)),Rn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Rn.value.x+"px",top:Rn.value.y+"px"})},[e.createElementVNode("div",di,e.toDisplayString(Rn.value.categoryValue),1),Rn.value.description?(e.openBlock(),e.createElementBlock("div",mi,e.toDisplayString(Rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Re.value&&(gt.value.show||Ze.value&&Ue.value.show&&!se.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ze.value&&Ue.value.show&&!se.value.isZooming,"dss-spider-tooltip":wn.value&&gt.value.spiderAreas&&gt.value.spiderAreas.length>0}]),style:e.normalizeStyle(wa.value)},[!Ze.value||!Ue.value.show||se.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[wn.value&&gt.value.spiderAreas&&gt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",fi,[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-${r}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",vi,e.toDisplayString(p.label),1),e.createElementVNode("span",gi,e.toDisplayString(p.value),1)]))),128))]))),128))])):Yt.value&&gt.value.bubbleData&&gt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",hi,[gt.value.title?(e.openBlock(),e.createElementBlock("div",yi,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ci,[e.createElementVNode("div",bi,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",wi,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[An(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Si,[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-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Bi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Mi,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Li,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",Ti,[e.createElementVNode("div",Ai,e.toDisplayString(Yt.value?Do():E.categories[Ue.value.categoryIndex]||`Category ${Ue.value.categoryIndex+1}`),1),Yt.value?(e.openBlock(),e.createElementBlock("div",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ue.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Hi,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Ri,e.toDisplayString(en(n.value)),1)]))),128))]),An(Ue.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Ue.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",zi,[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-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pi,[e.createElementVNode("div",Oi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(Ue.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Wi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qi,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Ue.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Zi,[e.createElementVNode("div",Ui,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),En.value&&Ke.value&&se.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jl},[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,Ss),P.value&&K.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Se.value==="horizontal","dss-legend-vertical":Se.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(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&Wn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&Wn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",ji,e.toDisplayString(n.name),1)],46,Yi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[rt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),rt.value.addMarker&&(rt.value.downloadSvg||rt.value.downloadPng||rt.value.downloadCsv||At.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ki)):e.createCommentVNode("",!0),rt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:yn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),rt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),rt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:On},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),At.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[rt.value.downloadSvg||rt.value.downloadPng||rt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[n.separator?(e.openBlock(),e.createElementBlock("div",Qi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Bn(n)),style:e.normalizeStyle(Gl(n)),onClick:p=>Cl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(n),class:"dss-custom-menu-content"},null,8,ec)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Ji)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:xn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nc,[e.createElementVNode("h3",null,e.toDisplayString(Nn.value?e.unref($)("chart.modalMarker.viewMarker"):yl.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:xn},"×")]),e.createElementVNode("div",lc,[e.createElementVNode("div",oc,[e.createVNode(la,{id:"dss-marker-date",mode:"single",modelValue:Fe.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>Fe.value.date=n),"min-date":ol.value,"max-date":cn.value,disabled:Nn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ac,[e.createElementVNode("label",sc,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),Nn.value?(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(Fe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>Fe.value.description=n),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ic)),[[e.vModelText,Fe.value.description]])])]),e.createElementVNode("div",cc,[e.createElementVNode("div",uc,[yl.value&&!Nn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:hn},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:xn},e.toDisplayString(Nn.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),Nn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ul,disabled:!(Fe.value.description&&Fe.value.description.length)},e.toDisplayString(yl.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,mc))])])])])):e.createCommentVNode("",!0)],64))}}),vc={class:"dss-modal-title"},gc={class:"dss-modal-actions"},na={__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(E,{emit:ne}){const $=E,V=ne,ce=e.ref(null),I=e.ref(null),_=e.computed(()=>{const X={"max-width":$.width};return $.height!=="auto"&&(X.height=$.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function st(){V("close-modal")}function te(){$.backDrop&&!ce.value&&V("close-modal")}function v(X){X.target.tagName==="INPUT"&&(ce.value=X.target.tagName)}function Ce(){setTimeout(()=>{ce.value=null},300)}function ke(){const X=document.body,me=document.documentElement;I.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${I.value.scrollY}px`,X.style.width="100%",X.style.left="0",me.style.overflow="hidden"}function Q(){if(!I.value)return;const X=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:ue,bodyTop:Me,bodyWidth:tt,htmlOverflow:mt,scrollY:Z}=I.value;X.style.overflow=F||"",X.style.position=ue||"",X.style.top=Me||"",X.style.width=tt||"",X.style.left="",me.style.overflow=mt||"",window.scrollTo(0,Z||0)}return e.watch(()=>$.showModal,X=>{if(X)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",Ce))},100);else{Q(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",Ce))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&Q()}),(X,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:te},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(_.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":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",vc,[e.renderSlot(X.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:st,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},hc={key:0,class:"dss-table-toolbar"},yc={class:"dss-table-toolbar-left"},kc=["aria-expanded"],Cc={class:"dss-pagination-select-dropdown",role:"listbox"},bc={class:"dss-table-column-visibility-label"},wc={class:"dss-table-checkbox-wrapper"},xc=["checked","onChange"],Ec={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Sc={class:"dss-table-column-visibility-text"},Vc={class:"dss-table-toolbar-right"},Nc=["placeholder","aria-label"],Bc=["aria-label"],Mc=["aria-label","aria-expanded"],_c={key:1,class:"dss-table-toolbar-extra"},$c={class:"dss-table-thead"},Lc={key:0,class:"dss-table-th dss-table-selection-column"},Tc={key:0,class:"dss-table-checkbox-wrapper"},Ac=["checked","indeterminate"],Dc={key:0,class:"dss-table-checkbox__indeterminate"},Hc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Rc=["aria-label"],Fc=["onClick"],Ic={class:"dss-table-th-content"},zc={class:"dss-table-th-text"},Pc={key:0},Oc={key:1},Wc={key:2},qc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Zc={class:"dss-table-tbody"},Uc=["onClick"],Xc={class:"dss-table-checkbox-wrapper"},Yc=["type","name","checked","disabled","onChange"],jc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Kc={key:1,class:"dss-table-checkbox__dot"},Gc=["onClick"],Qc=["aria-expanded","aria-label"],Jc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},eu={key:0,class:"dss-table-expansion-row"},tu=["colspan"],nu=["colspan"],lu={key:1,class:"dss-table-pagination"},ou={class:"dss-table-pagination-left"},au={key:0},su={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},ru={class:"dss-table-pagination-center"},iu={key:0,class:"dss-pagination-controls"},cu=["disabled","title"],uu=["disabled","title"],du=["aria-label","onKeydown"],mu={class:"dss-pagination-of"},pu=["disabled","title"],fu=["disabled","title"],vu={class:"dss-table-pagination-right"},gu={class:"dss-pagination-rows-label"},hu=["aria-expanded"],yu=["aria-selected","onClick"],ku={key:0,class:"dss-table-filter-row"},Cu=["value","placeholder"],bu=["min","max","value"],wu=["min","max","value"],xu={class:"dss-table-filter-double-range-values"},Eu={key:2,class:"dss-table-filter-daterange"},Su={class:"dss-table-filter-daterange-row"},Vu={class:"dss-table-filter-daterange-label"},Nu=["value"],Bu={class:"dss-table-filter-daterange-row"},Mu={class:"dss-table-filter-daterange-label"},_u=["value"],$u=["value","placeholder"],Lu={class:"dss-table-filter-list"},Tu=["checked","onChange"],Au={class:"dss-table-filter-actions"},Du={name:"DSSTable"},Hu=Object.assign(Du,{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:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:ne}){const{t:$,locale:V}=co.useI18n(),ce=E,I=ne,_={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(y,h){const x=Object.assign({},y);return st(y)&&st(h)&&Object.keys(h).forEach(q=>{st(h[q])?q in y?x[q]=pe(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function st(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>pe(_,ce.options)),v=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),Ce=e.computed(()=>te.value.table.height),ke=e.computed(()=>te.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:ke.value})),X=e.computed(()=>te.value.table.expandable===!0),me=e.computed(()=>te.value.table.expandableRowData??null),F=e.computed(()=>te.value.table.expandableRowCondition??null),ue=e.computed(()=>te.value.table.truncated===!0),Me=e.computed(()=>te.value.table.striped),tt=e.computed(()=>te.value.table.bordered),mt=e.computed(()=>te.value.table.hoverable),Z=e.computed(()=>te.value.table.size),Ae=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const We=e.computed(()=>te.value.selection.enabled),Ee=e.computed(()=>te.value.selection.mode),_e=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ie=e.computed(()=>te.value.sorting.mode),Je=e.computed(()=>te.value.pagination.enabled),we=e.computed(()=>te.value.pagination.rows),et=e.computed(()=>te.value.pagination.rowsPerPageOptions),ct=e.computed(()=>te.value.pagination.showCounter!==!1),vt=e.computed(()=>te.value.pagination.showControlsGroup),ut=e.computed(()=>vt.value===!1?!1:te.value.pagination.showControls!==!1),Ft=e.computed(()=>vt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>Je.value&&(ct.value||ut.value||Ft.value)),bt=e.computed(()=>te.value.scrollable),wt=e.computed(()=>te.value.emptyMessage||$("table.emptyMessage")),Jt=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),pt=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),jt=e.computed(()=>te.value.toolbar?.search!==!1),kt=e.computed(()=>Jt.value||pt.value||jt.value||tn.value),tn=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),U=e.ref(""),ye=e.ref(!1),P=e.ref(null);let K=null;function Se(){ye.value?(K&&(clearTimeout(K),K=null),ye.value=!1,U.value="",I("search",""),P.value?.blur()):(ye.value=!0,K=setTimeout(()=>{K=null,P.value?.focus()},80))}function Re(){U.value||(ye.value=!1)}function Ze(){U.value="",I("search",""),P.value?.focus()}const xt=e.computed(()=>({"dss-table-striped":Me.value,"dss-table-bordered":tt.value,"dss-table-hoverable":mt.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":ue.value})),Ke=(y,h)=>y?.field??y?.key??h,zt=e.ref(new Set);function qe(){const y=new Set;return ce.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ke(h,x))}),y}function ze(){const y=new Set;return ce.columns.forEach((h,x)=>{y.add(Ke(h,x))}),y}function Lt(y){if(!Array.isArray(y))return null;const h=ze(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function $t(){zt.value=qe()}const oe=e.computed(()=>{const y=Lt(ce.columnVisibility);return y===null?null:new Set(y)}),Y=e.computed(()=>oe.value??zt.value),j=e.computed(()=>ce.columns.filter((y,h)=>Y.value.has(Ke(y,h)))),de=y=>{const h=ce.columns.findIndex(x=>x===y);return Ke(y,h>=0?h:0)},be=(y,h)=>Y.value.has(Ke(y,h));function je(y){I("update:columnVisibility",Array.from(y))}function Tt(y,h){const x=Ke(y,h),q=new Set(Y.value);q.has(x)?q.delete(x):q.add(x),oe.value===null&&(zt.value=q),je(q)}const Xt=e.ref(null),nt=e.ref(!1);function sn(y){Xt.value&&!Xt.value.contains(y.target)&&(nt.value=!1)}const N=e.computed(()=>j.value.length+(We.value?1:0)+(X.value?1:0)),b=(y,h)=>y?.id??y?.key??h,B=e.ref(new Set),G=e.ref(null),ae=(y,h)=>B.value.has(b(y,h)),De=(y,h)=>{if(!X.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=xn(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,h,x)=>{if(x&&x.stopPropagation(),!De(y,h))return;const q=b(y,h),fe=new Set(B.value);fe.has(q)?(fe.delete(q),I("row-collapse",{data:y,index:h})):(fe.add(q),I("row-expand",{data:y,index:h})),B.value=fe},lt=(y,h)=>{if(!ue.value)return;const x=b(y,h);G.value!==x&&(G.value=x)},Ie=e.ref(null),Et=e.ref(0),Bt=e.ref([]),St=y=>{if(ie.value==="single")return Ie.value===y.field?Et.value:0;{const h=Bt.value.find(x=>x.field===y.field);return h?h.order:0}},rt=y=>{const h=St(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},At=e.ref({}),Nt=e.ref(null),rn=e.ref(null),Vn=220,Zn=e.ref(null),en=e.computed(()=>j.value.find(y=>de(y)===Nt.value)??null),pn=e.computed(()=>{if(!en.value||en.value.filter!=="range")return null;const y=en.value,h=Nt.value,{min:x,max:q}=Nl(y),fe=y.filterMin??x,Ge=y.filterMax??q,qt=_n(h),yn=qt.min??fe,Fn=qt.max??Ge,On=Ge-fe,Cl=On===0?0:(yn-fe)/On*100,fo=On===0?100:(Fn-fe)/On*100;return{rangeMin:fe,rangeMax:Ge,currentMin:yn,currentMax:Fn,minPct:Cl,maxPct:fo}}),ll=e.ref(null),vl=e.ref("max");function il(y){const h=ll.value,x=pn.value;if(!h||!x)return;const q=h.getBoundingClientRect(),Ge=(y.clientX-q.left)/q.width*100,qt=(x.minPct+x.maxPct)/2;vl.value=Ge<qt?"min":"max"}function _n(y){return At.value[y]??{}}function gl(y,h){At.value={...At.value,[y]:h}}function $n(y){const h=At.value[y];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 Vl(y){const h={...At.value};delete h[y],At.value=h,Nt.value=null,rn.value=null}function Rl(){if(!Nt.value){rn.value=null;return}const y=Zn.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Nt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}const hl=e.computed(()=>{const y=String(U.value??"").trim().toLowerCase();return y?ce.data.filter(h=>j.value.some(x=>Un(ul(h,x)).some(fe=>String(fe).toLowerCase().includes(y)))):ce.data}),An=e.computed(()=>{let y=[...hl.value];const h=(U.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ce.columns.some(q=>{if(!q||!q.field)return!1;const fe=ul(x,q);return String(fe??"").toLowerCase().includes(h)}))),j.value.forEach(x=>{const q=de(x),fe=At.value[q];if(!fe)return;const Ge=x.field;if(Ge){if(fe.type==="string"&&fe.value?.trim()){const qt=fe.value.trim().toLowerCase();y=y.filter(yn=>{const Fn=ul(yn,x);return String(Fn??"").toLowerCase().includes(qt)})}else if(fe.type==="range")y=y.filter(qt=>{const yn=xn(qt,Ge),Fn=Number(yn);return!(Number.isNaN(Fn)||fe.min!=null&&Fn<fe.min||fe.max!=null&&Fn>fe.max)});else if(fe.type==="dateRange"){const qt=fe.from?new Date(fe.from).getTime():null,yn=fe.to?new Date(fe.to).getTime():null;y=y.filter(Fn=>{const On=xn(Fn,Ge),Cl=On?new Date(On).getTime():NaN;return!(Number.isNaN(Cl)||qt!=null&&Cl<qt||yn!=null&&Cl>yn)})}else if(fe.type==="list"&&fe.selected?.length){const qt=new Set(fe.selected);y=y.filter(yn=>Un(ul(yn,x)).some(On=>qt.has(On)))}}}),y});function Un(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Un);if(typeof y=="object"){const h=y?.label??y?.name??y?.value??y?.title;return[h!=null?String(h):String(y)]}return[String(y)]}function Xn(y){const h=new Set;return ce.data.forEach(x=>{Un(ul(x,y)).forEach(fe=>h.add(fe))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function Hn(y,h){if(Nt.value===y){Nt.value=null,rn.value=null;return}if(Nt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}else Rl()}function zn(y,h){gl(y,{type:"string",value:h})}function Nl(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ce.data.forEach(fe=>{const Ge=xn(fe,h),qt=Number(Ge);Number.isNaN(qt)||(x=Math.min(x,qt),q=Math.max(q,qt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function A(y,h,x){const q={..._n(y),type:"range"},fe=x===""?null:Number(x),Ge=fe===null||Number.isNaN(fe)?null:fe;q[h]=Ge,Ge!=null&&(h==="min"&&q.max!=null&&Ge>q.max&&(q.max=Ge),h==="max"&&q.min!=null&&Ge<q.min&&(q.min=Ge)),gl(y,q)}function z(y,h,x){const q={..._n(y),type:"dateRange"};q[h]=x||"",gl(y,q)}const L=e.reactive({});function le(y,h){L[y]=h}function Te(y){const h=de(y),x=(L[h]??"").trim().toLowerCase(),q=Xn(y);return x?q.filter(fe=>String(fe).toLowerCase().includes(x)):q}function ft(y,h){return(_n(y).selected??[]).includes(h!=null?String(h):"")}function dt(y,h){const q=[..._n(y).selected??[]],fe=h!=null?String(h):"",Ge=q.indexOf(fe);Ge>=0?q.splice(Ge,1):q.push(fe),gl(y,{type:"list",selected:q})}function ot(y){Nt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Nt.value=null,rn.value=null)}function at(){Rl(),Kt.value&&Ue()}const vn=y=>{if(!(y.sortable===!1||!Ye.value))if(ie.value==="single")Ie.value===y.field?Et.value=Et.value===1?-1:Et.value===-1?0:1:(Ie.value=y.field,Et.value=1),Et.value===0&&(Ie.value=null),I("sort",{field:Ie.value,order:Et.value});else{const h=Bt.value.findIndex(x=>x.field===y.field);h>=0?Bt.value[h].order===1?Bt.value[h].order=-1:Bt.value.splice(h,1):Bt.value.push({field:y.field,order:1}),I("sort",{multiSortMeta:Bt.value})}},bn=e.computed(()=>{if(!Ye.value)return An.value;let y=[...An.value];return ie.value==="single"&&Ie.value&&Et.value!==0?y.sort((h,x)=>{const q=xn(h,Ie.value),fe=xn(x,Ie.value);return q===fe?0:q==null?1:fe==null?-1:(q<fe?-1:q>fe?1:0)*Et.value}):ie.value==="multiple"&&Bt.value.length>0&&y.sort((h,x)=>{for(const q of Bt.value){const fe=xn(h,q.field),Ge=xn(x,q.field);if(fe===Ge)continue;if(fe==null)return 1;if(Ge==null)return-1;const qt=fe<Ge?-1:fe>Ge?1:0;if(qt!==0)return qt*q.order}return 0}),y}),Wt=e.ref(0),gn=e.ref(we.value),Kt=e.ref(!1),Ln=e.ref(null),Ht=e.ref(null),he=e.ref("bottom"),Mt=e.ref(null),gt=y=>{gn.value=y,Kt.value=!1,Wt.value=0,I("page",{page:0,rows:gn.value})};function Rn(y){Ln.value&&!Ln.value.contains(y.target)&&(Kt.value=!1)}function Ue(){const y=Ln.value,h=Ht.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),fe=x.offsetHeight||0,qt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,yn=q.top;he.value=qt<fe+8&&yn>qt?"top":"bottom",Mt.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ht=e.computed(()=>bn.value.length),se=e.computed(()=>Math.ceil(ht.value/gn.value)),on=e.computed(()=>Math.max(se.value,1)),Fe=e.computed(()=>ht.value===0?0:cn.value+1),ol=e.computed(()=>yl.value),cn=e.computed(()=>Je.value?Wt.value*gn.value:0),yl=e.computed(()=>Je.value?Math.min((Wt.value+1)*gn.value,ht.value):ht.value),Nn=e.computed(()=>{if(!Je.value)return bn.value;const y=cn.value,h=yl.value;return bn.value.slice(y,h)}),Gt=e.ref(new Set),Fl=e.computed(()=>bn.value.filter((y,h)=>Gt.value.has(b(y,h)))),un=(y,h)=>{const x=_e.value;return typeof x!="function"?!0:!!x(y,h)},Pn=e.computed(()=>bn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>un(y,h))),Zl=e.computed(()=>{const y=Pn.value;return y.length===0?!1:y.every(({row:h,index:x})=>Gt.value.has(b(h,x)))}),Yn=e.computed(()=>{const y=Pn.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>Gt.value.has(b(x,q))).length;return h>0&&h<y.length}),Bl=(y,h)=>Gt.value.has(b(y,h)),Bn=()=>{if(Zl.value)Gt.value=new Set,I("unselect-all");else{const y=new Set;Pn.value.forEach(({row:h,index:x})=>y.add(b(h,x))),Gt.value=y,I("select-all",Fl.value)}},Gl=(y,h)=>{if(!un(y,h))return;const x=b(y,h),q=new Set(Gt.value),fe=q.has(x);Ee.value==="single"?fe?(q.delete(x),I("row-unselect",y)):(q.clear(),q.add(x),I("row-select",y)):fe?(q.delete(x),I("row-unselect",y)):(q.add(x),I("row-select",y)),Gt.value=q},cl=e.ref("1"),Ul=()=>{const y=Number.parseInt(String(cl.value),10);if(!Number.isFinite(y)){cl.value=String(Wt.value+1);return}const h=Math.min(on.value,Math.max(1,y));h!==Wt.value+1?kl(h-1):cl.value=String(h)},kl=y=>{y<0||y>=se.value||(Wt.value=y,I("page",{page:y,rows:gn.value}))},Ql=(y,h,x)=>{I("row-click",{data:y,index:h,originalEvent:x}),lt(y,cn.value+h)},Mn=(y,h)=>{const x=cn.value+h;return{"dss-table-row-selected":Bl(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":G.value===b(y,x)}},ul=(y,h)=>h.field?xn(y,h.field):"",xn=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),hn=y=>{const h=y.align??Ae.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},jn=y=>{const h={};return y.width&&(h.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(h.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(h.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),h};return e.watch(()=>ce.locale,y=>{y&&y!==V.value&&(V.value=y)},{immediate:!0}),e.watch(we,y=>{gn.value=y,Wt.value=0}),e.watch(Kt,async y=>{y&&(await e.nextTick(),Ue())}),e.watch(Wt,y=>{cl.value=String(y+1)},{immediate:!0}),e.watch(U,y=>{I("search",y??"")}),e.watch(()=>ce.columns,()=>{if(oe.value===null){$t();return}const y=Lt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&I("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Rn),document.addEventListener("click",sn),document.addEventListener("click",ot),window.addEventListener("resize",at),window.addEventListener("scroll",at,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Rn),document.removeEventListener("click",sn),document.removeEventListener("click",ot),window.removeEventListener("resize",at),window.removeEventListener("scroll",at,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Zn,style:e.normalizeStyle({width:v.value+"px",height:Ce.value?Ce.value+"px":"auto"})},[kt.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",yc,[Jt.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),pt.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),tn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Xt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":nt.value}]),onClick:h[2]||(h[2]=x=>nt.value=!nt.value),"aria-expanded":nt.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,kc),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(E.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",bc,[e.createElementVNode("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:be(x,q),onChange:fe=>Tt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),be(x,q)?(e.openBlock(),e.createElementBlock("span",Ec,[...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",Sc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,nt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Vc,[jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ye.value||U.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:P,"onUpdate:modelValue":h[4]||(h[4]=x=>U.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=>ye.value=!0),onBlur:Re},null,40,Nc),[[e.vModelText,U.value]]),U.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:Ze},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Bc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":ye.value||!!U.value,onMousedown:e.withModifiers(Se,["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,Mc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",_c,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":bt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",xt.value])},[e.createElementVNode("thead",$c,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",Lc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Tc,[e.createElementVNode("input",{type:"checkbox",checked:Zl.value,indeterminate:Yn.value,onChange:Bn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ac),Yn.value?(e.openBlock(),e.createElementBlock("span",Dc)):Zl.value?(e.openBlock(),e.createElementBlock("span",Hc,[...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($)("table.expandRowAriaLabel")},null,8,Rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:de(x),class:e.normalizeClass(["dss-table-th",hn(x)]),style:e.normalizeStyle(jn(x)),onClick:fe=>vn(x)},[e.createElementVNode("div",Ic,[e.createElementVNode("span",zc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",rt(x)])},[St(x)===0?(e.openBlock(),e.createElementBlock("span",Pc,[...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)])])):St(x)===1?(e.openBlock(),e.createElementBlock("span",Oc,[...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)])])):St(x)===-1?(e.openBlock(),e.createElementBlock("span",Wc,[...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":Nt.value===de(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":$n(de(x))}]),"data-filter-column-key":de(x),"aria-expanded":Nt.value===de(x),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:fe=>Hn(de(x),fe)},[...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,qc)],2)):e.createCommentVNode("",!0)])],14,Fc))),128))])]),e.createElementVNode("tbody",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,cn.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Mn(x,q)]),style:e.normalizeStyle(Q.value),onClick:fe=>Ql(x,q,fe)},[We.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",Xc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:Bl(x,cn.value+q),disabled:!un(x,cn.value+q),onChange:fe=>Gl(x,cn.value+q),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!un(x,cn.value+q)}])},null,42,Yc),Ee.value==="multiple"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",jc,[...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)])])):Ee.value==="single"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",Kc)):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(fe=>Ct(x,cn.value+q,fe),["stop"])},[De(x,cn.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,cn.value+q),"aria-label":ae(x,cn.value+q)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(x,cn.value+q)}]),"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,Qc)):(e.openBlock(),e.createElementBlock("span",Jc))],8,Gc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(fe,Ge)=>(e.openBlock(),e.createElementBlock("td",{key:de(fe),class:e.normalizeClass(["dss-table-td",hn(fe)]),style:e.normalizeStyle(jn(fe))},[e.renderSlot(y.$slots,`cell-${fe.field}`,{data:x,column:fe,rowIndex:q,isExpanded:G.value===b(x,cn.value+q)},()=>[e.createTextVNode(e.toDisplayString(ul(x,fe)),1)])],6))),128))],14,Uc),X.value&&De(x,cn.value+q)&&ae(x,cn.value+q)?(e.openBlock(),e.createElementBlock("tr",eu,[e.createElementVNode("td",{colspan:N.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,tu)])):e.createCommentVNode("",!0)],64))),128)),Nn.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:N.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,nu)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",ou,[ct.value?(e.openBlock(),e.createElementBlock("span",au,e.toDisplayString(e.unref($)("table.showingRange",{start:Fe.value,end:ol.value,total:ht.value})),1)):(e.openBlock(),e.createElementBlock("span",su," "))]),e.createElementVNode("div",ru,[ut.value?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value===0,onClick:h[8]||(h[8]=x=>kl(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,cu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value===0,onClick:h[9]||(h[9]=x=>kl(Wt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,uu),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($)("table.currentPageAriaLabel"),onBlur:Ul,onKeydown:e.withKeys(e.withModifiers(Ul,["prevent"]),["enter"])},null,40,du),[[e.vModelText,cl.value]]),e.createElementVNode("span",mu,e.toDisplayString(e.unref($)("table.ofPages",{total:on.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value>=se.value-1,onClick:h[11]||(h[11]=x=>kl(Wt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,pu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Wt.value>=se.value-1,onClick:h[12]||(h[12]=x=>kl(se.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,fu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",vu,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ln},[e.createElementVNode("span",gu,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Kt.value}]),onClick:h[13]||(h[13]=x=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ht},[e.createTextVNode(e.toDisplayString(gn.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,hu),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":he.value==="top"}]),style:e.normalizeStyle(Mt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===gn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===gn.value}]),onClick:q=>gt(x)},e.toDisplayString(x),11,yu))),128))],6),[[e.vShow,Kt.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(rn.value?{top:rn.value.top+"px",left:rn.value.left+"px",width:Vn+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[en.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[en.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("input",{type:"text",value:_n(Nt.value).value??"",onInput:h[14]||(h[14]=x=>zn(Nt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,Cu)])):en.value.filter==="range"&&pn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pn.value.minPct+"%","--range-max-pct":pn.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ll,class:"dss-table-filter-double-range-track",onMousemove:il,onMouseenter:il},[e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMin,onInput:h[15]||(h[15]=x=>A(Nt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:vl.value==="min"?2:1})},null,44,bu),e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMax,onInput:h[16]||(h[16]=x=>A(Nt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:vl.value==="max"?2:1})},null,44,wu)],544),e.createElementVNode("div",xu,e.toDisplayString(pn.value.currentMin)+" – "+e.toDisplayString(pn.value.currentMax),1)],4)):en.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("div",Su,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:_n(Nt.value).from??"",onInput:h[17]||(h[17]=x=>z(Nt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Nu)]),e.createElementVNode("div",Bu,[e.createElementVNode("label",Mu,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:_n(Nt.value).to??"",onInput:h[18]||(h[18]=x=>z(Nt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,_u)])])):en.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:L[Nt.value]??"",onInput:h[19]||(h[19]=x=>le(Nt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,$u),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(en.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:ft(Nt.value,x),onChange:q=>dt(Nt.value,x)},null,40,Tu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Au,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Vl(Nt.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Nt.value&&en.value&&rn.value]])]),_:1})]))],64))}}),Ru="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",Fu="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",Iu="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",zu="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",Pu="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",Ou="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",Wu={class:"dss-toolbar-left"},qu=["title"],Zu=["title"],Uu={class:"dss-toolbar-dropdown-wrapper"},Xu=["title"],Yu=["src"],ju=["src"],Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},td=["src"],nd=["src"],ld=["src"],od=["src"],ad=["src"],sd=["src"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd=["title"],md=["title"],pd=["title"],fd=["title"],vd=["title"],gd={key:2,class:"dss-toolbar-separator"},hd=["title"],yd={key:4,class:"dss-toolbar-separator"},kd={key:5,class:"dss-toolbar-dropdown-wrapper"},Cd=["title"],bd={class:"dss-toolbar-dropdown-ai"},wd={class:"dss-toolbar-right"},xd={key:0,class:"dss-toolbar-custom-group"},Ed={key:1,class:"dss-toolbar-separator"},Sd={class:"dss-link-modal-content"},Vd={class:"dss-link-modal-field"},Nd={class:"dss-link-modal-label"},Bd=["placeholder"],Md={class:"dss-link-modal-field"},_d={class:"dss-link-modal-label"},$d=["placeholder"],Ld={class:"dss-image-modal-tabs"},Td={key:0,class:"dss-image-tab-content"},Ad={class:"dss-link-modal-content"},Dd={class:"dss-link-modal-field"},Hd={key:0,class:"dss-link-modal-label"},Rd=["src"],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={key:1,class:"dss-image-tab-content"},Yd={class:"dss-link-modal-content"},jd={class:"dss-link-modal-field"},Kd={class:"dss-link-modal-label"},Gd=["placeholder"],Qd={class:"dss-link-modal-field"},Jd={class:"dss-link-modal-label"},e1=["placeholder"],t1={class:"dss-link-modal-field"},n1={class:"dss-link-modal-label"},l1=["placeholder"],o1={class:"dss-link-modal-field"},a1={class:"dss-link-modal-label"},s1=["placeholder"],r1={class:"dss-text-editor-title-input-container"},i1={key:0,class:"dss-text-editor-title-preview"},c1={key:0},u1={key:1,class:"dss-text-editor-preview-placeholder"},d1=["value","placeholder","disabled"],m1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},p1={class:"dss-text-editor-description-input-container"},f1={key:0,class:"dss-text-editor-description-preview"},v1={key:0},g1={key:1,class:"dss-text-editor-preview-placeholder"},h1=["value","placeholder","disabled"],y1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},k1=["data-comment-id","onMouseenter"],C1=["onClick"],b1=["src","alt"],w1={key:1},x1=["onClick"],E1=["src","alt"],S1={key:1},V1=["data-has-second-user","onClick"],N1={class:"editor-comment-marker-count"},B1={key:7,class:"dss-text-editor-textarea-wrapper"},M1=["value","placeholder","rows","disabled"],_1={class:"dss-text-editor-footer"},$1={class:"dss-text-editor-footer-content"},L1={class:"dss-text-editor-footer-stat"},T1={class:"dss-text-editor-footer-stat"},A1={key:8,class:"dss-text-editor-content-wrapper"},D1={key:0,class:"dss-comment-overlay-body"},H1={class:"dss-comment-selection-wrapper"},R1=["innerHTML"],F1={class:"dss-comment-messages-wrapper"},I1={key:0,class:"dss-comment-avatar-wrapper"},z1={class:"dss-comment-avatar"},P1=["src","alt"],O1={key:1},W1={class:"dss-comment-header"},q1={class:"dss-comment-header-text"},Z1={class:"dss-comment-author"},U1={key:0,class:"dss-comment-date"},X1=["onClick","title"],Y1={class:"dss-comment-overlay-inner"},j1=["placeholder","onKeydown"],K1={class:"dss-text-editor-footer"},G1={class:"dss-text-editor-footer-content"},Q1={class:"dss-text-editor-footer-stat"},J1={class:"dss-text-editor-footer-stat"},em=["title"],tm=["title"],nm={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:""},lm={class:"dss-image-popup-content"},om={key:0,class:"dss-image-popup-no-alt-icon"},am=["title"],sm=["title"],rm={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:""},im={class:"dss-toolbar-left"},cm=["title"],um=["title"],dm={class:"dss-toolbar-dropdown-wrapper"},mm=["title"],pm=["src"],fm=["src"],vm=["src"],gm=["src"],hm=["src"],ym=["src"],km={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"],bm=["title"],wm=["title"],xm=["title"],Em=["title"],Sm=["title"],Vm=["title"],Nm=["title"],Bm=["title"],Mm={key:2,class:"dss-toolbar-separator"},_m=["title"],$m={key:4,class:"dss-toolbar-separator"},Lm={key:5,class:"dss-toolbar-dropdown-wrapper"},Tm=["title"],Am={class:"dss-toolbar-dropdown-ai"},Dm={key:0,class:"dss-toolbar-right"},Hm={key:0,class:"dss-toolbar-separator"},Rm={key:0,class:"dss-toolbar-custom-group"},Fm={key:1,class:"dss-toolbar-separator"},Im={name:"DSSTextEditor"},zm=Object.assign(Im,{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:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==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(E,{expose:ne,emit:$}){const{t:V,locale:ce}=co.useI18n(),I={h1:Ru,h2:Fu,h3:Iu,h4:zu,h5:Pu,h6:Ou},_=E,pe=$,st=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
96
+ `,rn.value){t+=`Category,Segment,Value
97
+ `,V.value.forEach(F=>{F.segments.forEach(N=>{const L=String(F.label||"").replace(/"/g,'""'),S=String(N.label||"").replace(/"/g,'""');t+=`"${L}","${S}",${N.value}
98
+ `})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(v),b=document.createElement("a");b.href=C,b.download=qn("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),ue();return}t+="Category",R.series.forEach(v=>{const C=v.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
99
+ `;const o=Math.max(...R.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let F='"'+(R.categories[v]||_("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';R.series.forEach(N=>{const L=N.data&&N.data[v]!==void 0?N.data[v]:"";F+=","+L}),t+=F+`
100
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=qn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),ue()}catch(t){console.error("Error downloading CSV:",t)}},Bo=t=>{if(typeof t.action=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:clampedCategoryIndex||mt.value.categoryIndex};t.action(o,l)}ue()},Rn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=mt.value.categoryIndex,Oe.value.fromButton=!1,ue()},Kn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=0,Oe.value.fromButton=!0},Zn=t=>{if(mt.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(mt.value.show=!1)}},fo=t=>{mt.value.show&&!t.target.closest(".context-menu")&&(mt.value.show=!1)},Mo=t=>{if(!Nl.value||!Ke.value)return;t.preventDefault(),t.stopPropagation(),ce.value.isZooming=!0,ot.value.show=!1,ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<I.value.left-50||r>I.value.right+50||m<I.value.top-50||m>I.value.bottom+100){ce.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(ce.value.minScale,Math.min(ce.value.maxScale,ce.value.scale*v));if(C!==ce.value.scale){const{minX:b,maxX:F}=ge.value,N=F-b||1,L=N/ce.value.scale,S=b-ce.value.offsetX/I.value.width*N,K=(r-I.value.left)/I.value.width,Be=S+K*L;ce.value.scale=C;const Ze=N/ce.value.scale,re=Be-K*Ze;ce.value.offsetX=-(re-b)/N*I.value.width,ce.value.scale<=1.01&&(ce.value.scale=1,ce.value.offsetX=0)}ce.value.zoomTimeout=setTimeout(()=>{ce.value.isZooming=!1,ce.value.zoomTimeout=null},300)},_o=t=>{if(!Nl.value||!Ke.value||ce.value.scale<=1)return;ot.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ce.value.isDragging=!0,ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY,t.preventDefault()},yn=()=>{ce.value.isDragging=!1},tn=()=>{!Nl.value||!Ke.value||(ce.value.scale=1,ce.value.offsetX=0,ce.value.isDragging=!1,ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1)},Nn=()=>!Nl.value||!Sn.value||!Ke.value?"default":ce.value.isDragging?"grabbing":ce.value.scale>1?"grab":"dss-crosshair",Bn=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 o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],v=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(v.x-r.x)/6*je.value,F=m.y+(v.y-r.y)/6*je.value,N=v.x-(C.x-m.x)/6*je.value,L=v.y-(C.y-m.y)/6*je.value;o+=` C ${b} ${F} ${N} ${L} ${v.x} ${v.y}`}return o},Mt=e.computed(()=>{const o=Z.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(qt.value?30:0)+60;if(rl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(cl.value){const S=!W.value,K=Vl.value,Be=K?al.value+At.value+Math.max(24,an.value+16):0,Ze=S?12:m;let re=0;ct.value&&(re+=S?8:15),gt.value&&(re+=S?6:10);const ye=Je();let Ee=Ze+(S?4:16)+(K?Be:0),ve=Ze+(K?Be:0);W.value&&G.value==="left"?Ee+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const ze=be.value==="semi-radial"?K?Be:8:K?Be:S?8:m+80,Te=K?14:0,Ve=Ze+re+Te,De={left:Ee,top:Ve,right:ve,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??De.left,top:r.top??De.top,right:r.right??De.right,bottom:r.bottom??De.bottom}:De}let C=0;ct.value&&(C+=15),gt.value&&(C+=10);const b=Je();let F=m+16+(Zt.value?30:0),N=m+(xt.value?30:0);W.value&&G.value==="left"?F+=b.legendWidth||150:W.value&&G.value==="right"&&(N+=b.legendWidth||150),h.value&&(N+=44);const L={left:F,top:m+C,right:N,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??L.left,top:r.top??L.top,right:r.right??L.right,bottom:r.bottom??L.bottom}:L}),I=e.computed(()=>({left:Mt.value.left,top:Mt.value.top,right:Se.value-Mt.value.right,bottom:ie.value-Mt.value.bottom,width:Se.value-(Mt.value.left+Mt.value.right),height:ie.value-(Mt.value.top+Mt.value.bottom)})),Nl=e.computed(()=>["line","area","bar","stepbar"].includes(be.value)||Qe.value),Bl=e.computed(()=>Qe.value),Gl=e.computed(()=>be.value==="mini-radial"),cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),rl=e.computed(()=>be.value==="spider"),Gt=e.computed(()=>be.value==="bubble"),rn=e.computed(()=>be.value==="stepbar"),fl=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Bl.value)),Xl=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.left+(t-o)/r*I.value.width},kn=t=>{const{maxX:o}=ge.value,l=o+1,m=I.value.height/l;return I.value.top+(t+.5)*m},Dt=e.computed(()=>cl.value?Mt.value.left+(Se.value-Mt.value.left-Mt.value.right)/2:Se.value/2),Pt=e.computed(()=>rl.value?ie.value/2-40:cl.value?Mt.value.top+(ie.value-Mt.value.top-Mt.value.bottom)/2:ie.value/2),Vt=e.computed(()=>{if(rl.value){const t=I.value.width-80,o=I.value.height-80;return Math.min(t,o)/2}return Math.min(I.value.width,I.value.height)/2}),hl=e.computed(()=>{const t=Z.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return Vt.value*l}),Gn=e.computed(()=>{const t=Z.value,o=typeof R.innerSize=="number"?R.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(cl.value||rl.value)?1:1+o/100}),Qn=e.computed(()=>{const t=Gn.value;if(t===1||t<=0)return;const o=Dt.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Mn=e.ref(0),ho=e.computed(()=>`semi-radial-fill-clip-${R.chartId}`),Cn=e.computed(()=>be.value==="semi-radial"),Un=e.computed(()=>Cn.value&&Kt.value&&!An.value),Xn=e.computed(()=>Cn.value&&Kt.value&&!An.value&&ql.value==="fill"),Jo=e.computed(()=>{const t=Un.value?Mn.value:1,o=Dt.value,l=Pt.value,r=hl.value,m=Vt.value,v=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(v),F=l+m*Math.sin(v),N=o+m*Math.cos(C),L=l+m*Math.sin(C),S=o+r*Math.cos(C),K=l+r*Math.sin(C),Be=o+r*Math.cos(v),Ze=l+r*Math.sin(v),re=t>.5?1:0;return`M ${o} ${l} L ${b} ${F} A ${m} ${m} 0 ${re} 1 ${N} ${L} L ${S} ${K} A ${r} ${r} 0 ${re} 1 ${Be} ${Ze} Z`}),go=e.computed(()=>{if(!(!Cn.value||!Un.value)&&!Xn.value)return`url(#${ho.value})`}),$o=t=>{if(!(!Xn.value||t!==0))return`url(#${ho.value})`},_n=e.ref(0),Fn=e.computed(()=>`radial-reveal-clip-${R.chartId}`),_l=e.computed(()=>be.value==="radial"),yo=e.computed(()=>{const t=_l.value?_n.value:1,o=Dt.value,l=Pt.value,r=Math.max(Vt.value*1.5,Se.value,ie.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,K=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${K} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),F=o+r*Math.cos(v),N=l+r*Math.sin(v),L=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${L} 1 ${F} ${N} Z`}),Lo=e.computed(()=>{if(go.value)return go.value;if(_l.value)return`url(#${Fn.value})`});let Yn=null;const ea=()=>{if(!Un.value)return;Mn.value=0;const t=jl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);Mn.value=aa(il.value,v),v<1&&(Yn=requestAnimationFrame(l))};Yn=requestAnimationFrame(l)},To=e.computed(()=>Z.value?.bubbles?.minSize||8),Jn=e.computed(()=>Z.value?.bubbles?.maxSize||50),Yl=e.computed(()=>Z.value?.bubbles?.opacity||.7),Ao=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},$n=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},ko=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},ln=e.computed(()=>R.series),Ql=e.computed(()=>R.series.filter((t,o)=>!wt.value.has(o))),eo=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},a=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,n=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,s=e.computed(()=>{const o=Z.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),i=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?s.value.bubbleSize:$t.value,c=(t,o)=>n(t)&&s.value.usePrimaryColor?Qt(0):Qt(o),d=(t,o)=>rl.value&&n(t)?c(t,o):Qt(o),u=e.computed(()=>Ql.value.filter(t=>eo(t)==="primary")),p=e.computed(()=>Ql.value.filter(t=>eo(t)==="secondary")),h=e.computed(()=>!fl.value&&!!kt.value&&p.value.length>0),k=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},H=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=k(C?m.value:m,0);return b<=0?null:{key:`${l}-${v}-${C&&m.label||v}`,label:C?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:b,color:C?m.color||Qt(v):Qt(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return pl.value==="asc"?r.sort((m,v)=>m.value-v.value):pl.value==="desc"?r.sort((m,v)=>v.value-m.value):r},z=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),v=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:Qt(r)}],C=H(v,l,r),b=C.reduce((S,K)=>S+K.value,0),F=k(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),N=Math.max(F,b,1);w.value&&N>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:N-b,color:se.value,marker:null,isRemainder:!0});const L=C.filter(S=>!S.isRemainder).reduce((S,K)=>!S||K.value>S.value?K:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||R.categories?.[o]||_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??R.categories?.[o]??_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:N,usedValue:b,segments:C,maxSegmentKey:L?.key||null,seriesName:l?.name||"",seriesIndex:r}},V=e.computed(()=>{if(!rn.value)return[];const t=[];return ln.value.forEach((o,l)=>{wt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=z(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Q="auto",ee=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(L=>{typeof L=="number"&&Number.isFinite(L)&&(v=Math.min(v,L),C=Math.max(C,L))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===Q){const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}else if(typeof o=="number")b=o;else{const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}let F;if(l===Q){const N=C-v,L=N>0?N*.1:2;F=C+L}else if(typeof l=="number")F=l;else{const N=C-v,L=N>0?N*.1:2;F=C+L}return{minY:b,maxY:F}},ge=e.computed(()=>{if(Gt.value)return xl();if(rn.value)return Me();if(!Ql.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Ql.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),R.categories.length>0&&(t=Math.max(t,R.categories.length-1));const o=ee(u.value.length?u.value:Ql.value,Yt.value,rt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Me=()=>{const t=V.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof rt.value=="number"?rt.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},ft=e.computed(()=>h.value?ee(p.value,Jt.value,yt.value,ge.value.minY,ge.value.maxY):{minY:ge.value.minY,maxY:ge.value.maxY}),xl=()=>{if(!Ql.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,v=-1/0,C=!1;if(Ql.value.forEach((Be,Ze)=>{Be?.data?.length&&Be.data.forEach((re,ye)=>{let Ee,ve,Xe;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Ee=typeof re.x=="number"?re.x:ye,ve=typeof re.y=="number"?re.y:0,Xe=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Ee=typeof re[0]=="number"?re[0]:ye,ve=typeof re[1]=="number"?re[1]:0,Xe=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Ee=ye,ve=re,Xe=Ao(Ze,ye);else return;isFinite(Ee)&&isFinite(ve)&&isFinite(Xe)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Xe),v=Math.max(v,Xe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,R.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,F=r-l;let N,L,S,K;return ol.value!==null?N=ol.value:N=t-b*.1,U.value!==null?L=U.value:L=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-F*.1),rt.value!==null&&typeof rt.value=="number"?K=rt.value:K=r+F*.1,{minX:N,maxX:L,minY:S,maxY:K,minSize:m,maxSize:v}},ht=t=>{if(Gt.value){const{minX:b,maxX:F}=ge.value,N=F-b||1;return I.value.left+(t-b)/N*I.value.width}const{minX:o,maxX:l}=ge.value,r=l-o;if(l===0||r===0)return I.value.left+I.value.width/2;const m=r/ce.value.scale,v=o-ce.value.offsetX/I.value.width*r,C=(t-v)/m;return I.value.left+C*I.value.width},Ft=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},gl=t=>{const{minY:o,maxY:l}=ft.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},Ot=(t,o)=>h.value&&eo(t)==="secondary"?gl(o):Ft(o),yl=t=>{if(!Gt.value)return $t.value||4;const{maxSize:o}=ge.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return To.value+r*(Jn.value-To.value)},Al=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Al.canvas||(Al.canvas=document.createElement("canvas"));const r=Al.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},nn=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Al(t,l)<=o)return t;const r="..";if(Al(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(Al(C,l)<=o)return C;v-=1}return r},bn=e.computed(()=>to.value.map(t=>({y:t.y}))),Co=e.computed(()=>!rn.value||!bt.value?[]:to.value.map(t=>({y:t.y}))),Do=e.computed(()=>!rn.value||!bt.value||!_t.value?[]:la.value.map(t=>({x:t.centerX}))),bo=e.computed(()=>{if(Gt.value)return Ho();if(rn.value)return ua();if(be.value==="bar"){if(fl.value){const Ve=[],{minY:De,maxY:Nt}=ge.value,It=5,Rl=Nt-De||1;for(let ml=0;ml<=It;ml++){const Wl=De+Rl*(ml/It),jn=Xl(Wl);Ve.push({x:jn,y:I.value.bottom+20,text:$(Math.round(Wl))})}return Ve}const ye=[],{maxX:Ee}=ge.value,ve=Ee+1,Xe=5,Te=(I.value.width-Xe*2)/ve;for(let Ve=0;Ve<=Ee;Ve++){const De=I.value.left+Xe+(Ve+.5)*Te;ye.push({x:De,y:I.value.bottom+20,text:nn(R.categories[Ve]||_("chart.fallback.item",{number:Ve+1}),Math.max(Te-8,24))})}return ye}const t=[],{minX:o,maxX:l}=ge.value,r=ol.value!==null?ol.value:o,m=U.value!==null?U.value:l,v=m-r||1,C=v/ce.value.scale,b=r-ce.value.offsetX/I.value.width*v,F=b+C,N=Math.max(0,Math.floor(b-2)),L=Math.min(m,Math.ceil(F+2)),S=L-N,K=I.value.width,Ze=Math.floor(K/60);let re=1;S>Ze&&(re=Math.ceil(S/Ze));for(let ye=N;ye<=L;ye+=re)if(ye>=0&&ye<=m){const Ee=ht(ye);Ee>=I.value.left-100&&Ee<=I.value.right+100&&t.push({x:Ee,y:I.value.bottom+20,text:R.categories[ye]||`Item ${ye+1}`})}return t}),Ho=()=>{const t=[],{minX:o,maxX:l}=ge.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=ht(C);if(b>=I.value.left-10&&b<=I.value.right+10){const F=Math.round(C),N=R.categories?.[F];t.push({x:b,y:I.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},ua=()=>la.value.map(o=>({x:o.centerX,y:I.value.bottom+20,text:nn(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),to=e.computed(()=>{if(fl.value){const m=[],{maxX:v}=ge.value;for(let C=0;C<=v;C++)m.push({x:I.value.left-10,y:kn(C),text:nn(R.categories[C]||`Item ${C+1}`,Math.max(I.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=ge.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.left-10,y:Ft(v),text:$(C)})}return t}),lo=e.computed(()=>{if(!h.value||fl.value)return[];const t=[],{minY:o,maxY:l}=ft.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.right+10,y:gl(v),text:$(C)})}return t}),Qt=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},cn=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const v=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(v)l=Number(v[1])/255,r=Number(v[2])/255,m=Number(v[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const F=o.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]),l=parseInt(N.slice(0,2),16)/255,r=parseInt(N.slice(2,4),16)/255,m=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=o,N.style.display="none",document.body.appendChild(N);const L=getComputedStyle(N).color;document.body.removeChild(N);const S=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Jl=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const v=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const v=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let v=m[1];v.length===3&&(v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),F=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,F].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return o},Ol=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?Jl(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Jl(o):Jl(o)},Ro=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},da=e.computed(()=>be.value==="line"||Bl.value?(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(S=>S===o),m=[];let v=[];o.data.forEach((S,K)=>{S==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:fl.value?Xl(S):ht(K),y:fl.value?kn(K):Ot(o,S),index:K})}),v.length>0&&m.push(v);let C="";m.forEach(S=>{if(S.length>0){let K="";xe.value?K=Bn(S):K=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),C+=(C?" ":"")+K}});const b=m.reduce((S,K)=>S+Ro(K),0),F=wt.value.has(r),N=$e.value===r,L=$e.value!==null&&$e.value!==r;return{path:C,color:Qt(r),strokeDasharray:a(o),pathLength:b,seriesIndex:r,animationDelay:l*vl.value,isHighlighted:N,isDimmed:L,isHidden:F}}):[]),ma=e.computed(()=>{if(!(be.value==="line"||Bl.value))return[];const t=Bl.value?R.series.filter(l=>(l.type||be.value)==="line"):ln.value,o=[];return t.forEach((l,r)=>{const m=R.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const C=l.data[v];if(C!=null){let b=-1,F=0;for(let N=v+1;N<l.data.length;N++){const L=l.data[N];if(L==null)F++;else{b=N;break}}if(F>0&&b!==-1){const N=l.data[b],L=fl.value?Xl(C):ht(v),S=fl.value?kn(v):Ot(l,C),K=fl.value?Xl(N):ht(b),Be=fl.value?kn(b):Ot(l,N),Ze=wt.value.has(m),re=$e.value===m,ye=$e.value!==null&&$e.value!==m;o.push({path:`M ${L} ${S} L ${K} ${Be}`,color:Qt(m),seriesIndex:m,animationDelay:r*vl.value,isHighlighted:re,isDimmed:ye,isHidden:Ze,gapSize:F}),v=b-1}}}}),o}),$a=e.computed(()=>be.value==="line"||Bl.value?!Kt.value||An.value||Wt.value.hasAnimated?[]:(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(F=>F===o);let m="",v=null;o.data.forEach((F,N)=>{if(F!=null){const L={x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)};v===null?m+=`M ${L.x} ${L.y}`:m+=` L ${L.x} ${L.y}`,v=L}else if(v!==null){const L=o.data.findIndex((S,K)=>K>N&&S!==null&&S!==void 0);if(L!==-1){const S={x:fl.value?Xl(o.data[L]):ht(L),y:fl.value?kn(L):Ot(o,o.data[L])};m+=` L ${S.x} ${S.y}`,v=S}}});const C=o.data.map((F,N)=>F==null?null:{x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)}).filter(F=>F!==null),b=Ro(C);return{path:m,pathLength:b,color:Qt(r),strokeDasharray:a(o),animationDelay:l*vl.value,seriesIndex:r}}):[]),La=e.computed(()=>{if(be.value!=="line")return[];const t=[];return ln.value.forEach((o,l)=>{const r=$e.value===l,m=$e.value!==null&&$e.value!==l,v=wt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:ht(b),y:Ot(o,C),color:Qt(l),value:C,label:R.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(vl.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ta=e.computed(()=>{if(!Bl.value)return[];const t=[];return R.series.filter(l=>(l.type||be.value)==="line").forEach((l,r)=>{const m=R.series.findIndex(F=>F===l),v=$e.value===m,C=$e.value!==null&&$e.value!==m,b=wt.value.has(m);l.data.forEach((F,N)=>{F!=null&&t.push({x:ht(N),y:Ot(l,F),color:Qt(m),value:F,label:R.categories[N]||N.toString(),seriesName:l.name,categoryIndex:N,dataIndex:N,animationDelay:(r*l.data.length+N)*(vl.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Fo=e.computed(()=>{if(!Gt.value)return[];const t=[];return ln.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=$e.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=wt.value.has(l);o.data.forEach((b,F)=>{let N,L,S,K,Be;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:F,L=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,K=b.label||R.categories?.[F]||`Point ${F+1}`,Be=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:F,L=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,K=b[3]||R.categories?.[F]||`Point ${F+1}`,Be=b[4];else if(typeof b=="number")N=F,L=b,S=Ao(l,F),K=R.categories?.[F]||`Point ${F+1}`;else return;!isFinite(N)||!isFinite(L)||!isFinite(S)||t.push({x:ht(N),y:Ft(L),radius:yl(S),originalX:N,originalY:L,originalSize:S,color:Qt(l),seriesName:o.name||`Series ${l+1}`,label:K,imageUrl:Be,seriesIndex:l,dataIndex:F,categoryIndex:Math.round(N),isHighlighted:m,isDimmed:v,isHidden:C,opacity:Yl.value})})}),t}),ta=e.computed(()=>be.value!=="area"?[]:ln.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,K)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:ht(K),y:Ot(t,S),index:K})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Qt(o),isHidden:wt.value.has(o)};const m=I.value.bottom+1;let v="",C="";l.forEach((S,K)=>{if(S.length===0)return;let Be=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?Be=Bn(S):S.slice(1).forEach(re=>{Be+=` L ${re.x} ${re.y}`}),v+=(v?" ":"")+Be;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const re=Bn(S),ye=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Ee=>{Ze+=` L ${Ee.x} ${Ee.y}`})}else S.slice(1).forEach(re=>{Ze+=` L ${re.x} ${re.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=$e.value===o,F=$e.value!==null&&$e.value!==o,N=wt.value.has(o),L=l.reduce((S,K)=>S+Ro(K),0);return{linePath:v,areaPath:C,color:Qt(o),pathLength:L,isHighlighted:b,isDimmed:F,isHidden:N}})),la=e.computed(()=>{if(!rn.value)return[];const t=V.value,o=t.length;if(!o)return[];const l=Math.max(I.value.width,0),r=o>0?l/o:l,m=Math.max(He.value,Ct.value),v=Math.min(ae.value,m),C=Math.max(4,Math.min(m,Math.max(He.value,v),Math.max(4,r*.62)));return t.map((b,F)=>{const N=I.value.left+(F+.5)*r,L=N-C/2;let S=0;const K=$e.value===b.seriesIndex,Be=$e.value!==null&&$e.value!==b.seriesIndex,Ze=wt.value.has(b.seriesIndex),re=Ft(b.totalValue),ye=Ft(0),Ee=Math.max(0,ye-re),ve=Math.min(nt.value,C/2,Ee/2),Xe=`stepbar-column-clip-${R.chartId}-${b.key}`,ze=ve>0&&Ee>0?[`M ${L} ${re+ve}`,`Q ${L} ${re} ${L+ve} ${re}`,`L ${L+C-ve} ${re}`,`Q ${L+C} ${re} ${L+C} ${re+ve}`,`L ${L+C} ${ye}`,`L ${L} ${ye}`,"Z"].join(" "):`M ${L} ${re} H ${L+C} V ${ye} H ${L} Z`,Te=b.segments.map((Ve,De)=>{const Nt=S,It=S+Ve.value;S=It;const Rl=Ft(It),ml=Ft(Nt),Wl=Math.max(0,ml-Rl),jn=De>0?1:0,ra=(F*b.segments.length+De)*(vl.value/5);return{key:`${b.key}-${Ve.key}`,x:L,y:Rl-jn,width:C,height:Wl+jn,color:Ve.color,value:Ve.value,label:b.label,axisLabel:b.axisLabel,yLabel:b.yLabel,segmentLabel:Ve.label,seriesName:Ve.label,tooltipTitle:`${Ve.label} - ${b.label}`,categoryIndex:F,dataIndex:F,animationDelay:ra,isHighlighted:K,isDimmed:Be,isHidden:Ze,isRemainder:Ve.isRemainder}});return{key:b.key,label:b.label,axisLabel:b.axisLabel,centerX:N,categoryWidth:r,clipPathId:Xe,clipPathRef:`url(#${Xe})`,clipPath:ze,segments:Te}})}),pa=e.computed(()=>{if(!(["bar"].includes(be.value)||Bl.value))return[];const t=[],{maxX:o}=ge.value,l=Bl.value?R.series.filter(m=>(m.type||be.value)==="bar"):ln.value,r=l.length;if(fl.value){const m=o+1,C=I.value.height/m,b=C*(2/3),F=Math.min(4,b/r*.15),N=b-(r-1)*F,L=Math.max(4,N/r);l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.top+(ve+.5)*C-b/2+K*(L+F),Ve=I.value.left,De=Math.abs(Xl(Ee)-I.value.left);let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Ve} ${Te}`,`L ${Ve+De-It} ${Te}`,`Q ${Ve+De} ${Te} ${Ve+De} ${Te+It}`,`L ${Ve+De} ${Te+L-It}`,`Q ${Ve+De} ${Te+L} ${Ve+De-It} ${Te+L}`,`L ${Ve} ${Te+L}`,"Z"].join(" ")}t.push({x:Ve,y:Te,width:De,height:L,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}else{const m=o+1,C=I.value.width/m,b=C*.8,F=b/r,N=F*.05,L=F-N;l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.left+(ve+.5)*C-b/2+K*F+N/2,Ve=Ft(Math.max(0,Ee)),De=Math.abs(Ft(0)-Ft(Ee));let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Te} ${Ve+De}`,`L ${Te} ${Ve+It}`,`Q ${Te} ${Ve} ${Te+It} ${Ve}`,`L ${Te+L-It} ${Ve}`,`Q ${Te+L} ${Ve} ${Te+L} ${Ve+It}`,`L ${Te+L} ${Ve+De}`,"Z"].join(" ")}t.push({x:Te,y:Ve,width:L,height:De,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}return t}),Ln=e.computed(()=>{if(!cl.value)return[];const t=ln.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!wt.value.has(C));if(t.length===0)return[];let o=be.value==="semi-radial"?Math.PI:-Math.PI/2;const l=be.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,F,N,L,S)=>{const K=C+(b-C)/2,Be=b-C,Ze=Dt.value+Math.cos(C)*hl.value,re=Pt.value+Math.sin(C)*hl.value,ye=Dt.value+Math.cos(b)*hl.value,Ee=Pt.value+Math.sin(b)*hl.value,ve=Dt.value+Math.cos(b)*Vt.value,Xe=Pt.value+Math.sin(b)*Vt.value,ze=Dt.value+Math.cos(C)*Vt.value,Te=Pt.value+Math.sin(C)*Vt.value,Ve=Be>Math.PI?1:0,De=[`M ${Ze} ${re}`,`A ${hl.value} ${hl.value} 0 ${Ve} 1 ${ye} ${Ee}`,`L ${ve} ${Xe}`,`A ${Vt.value} ${Vt.value} 0 ${Ve} 0 ${ze} ${Te}`,"Z"].join(" "),Nt=S||Qt(F);return{path:De,color:Nt,strokeWidth:Ht.value,strokeColor:Ol(r.length,Nt),value:L,seriesName:N,opacity:.8,isHighlighted:$e.value===F,isDimmed:$e.value!==null&&$e.value!==F,isHidden:!1,startAngle:C,endAngle:b,midAngle:K}};if(Gl.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,L=Z.value,S=Math.min(Math.max(Number(L?.miniRadial?.minVisiblePercent??1),0),100),Be=(N<=0?S:N)/100*l,Ze=Number(L?.miniRadial?.thresholds?.low??33),re=Number(L?.miniRadial?.thresholds?.medium??66),ye=L?.miniRadial?.colors?.low||"#E53E3E",Ee=L?.miniRadial?.colors?.medium||"#ED8936",ve=L?.miniRadial?.colors?.high||"#38A169",Xe=N<=Ze?ye:N<=re?Ee:ve,ze=L?.miniRadial?.trackColor||"#E5E7EB",Te=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,ze)),r.push(m(o,o+Be,b,Te,N,Xe)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],F=C.data[0]||0,N=o,L=o+l-.001,S=N+l/2,K=Dt.value+Math.cos(N)*hl.value,Be=Pt.value+Math.sin(N)*hl.value,Ze=Dt.value+Math.cos(L)*hl.value,re=Pt.value+Math.sin(L)*hl.value,ye=Dt.value+Math.cos(L)*Vt.value,Ee=Pt.value+Math.sin(L)*Vt.value,ve=Dt.value+Math.cos(N)*Vt.value,Xe=Pt.value+Math.sin(N)*Vt.value,ze=1,Te=[`M ${K} ${Be}`,`A ${hl.value} ${hl.value} 0 ${ze} 1 ${Ze} ${re}`,`L ${ye} ${Ee}`,`A ${Vt.value} ${Vt.value} 0 ${ze} 0 ${ve} ${Xe}`,"Z"].join(" "),Ve=Qt(b);return r.push({path:Te,color:Ve,strokeWidth:Ht.value,strokeColor:Ol(0,Ve),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:L,midAngle:S}),r}if(Xn.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*l;return r.push(m(o,o+N,C.originalIndex,C.series.name,F)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const v=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return v===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const F=C.data[0]||0,N=F/v*l,L=o,S=o+N,K=L+N/2,Be=Dt.value+Math.cos(L)*hl.value,Ze=Pt.value+Math.sin(L)*hl.value,re=Dt.value+Math.cos(S)*hl.value,ye=Pt.value+Math.sin(S)*hl.value,Ee=Dt.value+Math.cos(S)*Vt.value,ve=Pt.value+Math.sin(S)*Vt.value,Xe=Dt.value+Math.cos(L)*Vt.value,ze=Pt.value+Math.sin(L)*Vt.value,Te=N>Math.PI?1:0,Ve=[`M ${Be} ${Ze}`,`A ${hl.value} ${hl.value} 0 ${Te} 1 ${re} ${ye}`,`L ${Ee} ${ve}`,`A ${Vt.value} ${Vt.value} 0 ${Te} 0 ${Xe} ${ze}`,"Z"].join(" "),De=Qt(b);r.push({path:Ve,color:De,strokeWidth:Ht.value,strokeColor:Ol(r.length,De),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:$e.value!==null&&$e.value!==b,isHidden:!1,startAngle:L,endAngle:S,midAngle:K}),o=S}),r)}),Aa=e.computed(()=>{const t=Ln.value;return Xn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Da=e.computed(()=>{if(!Vl.value||!cl.value)return[];const t=an.value,o=al.value,l=At.value,r=Pn.value,m=15,v=t*1.3,C=.55,b=(S,K)=>{const Be=Dt.value+Math.cos(S.midAngle)*Vt.value,Ze=Pt.value+Math.sin(S.midAngle)*Vt.value,re=Dt.value+Math.cos(S.midAngle)*(Vt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(Vt.value+o),ve=re+l*(K?1:-1),Xe=K?re+m:re-m,ze=ye-r,Te=`${S.seriesName}: ${$(S.value)}`,Ve=Te.length*t*C;return{pointerStartX:Be,pointerStartY:Ze,pointerEndX:re,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Xe,textY:ze,text:Te,textWidth:Ve,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(re-Be,ye-Ze),horizontalLineLength:Math.hypot(ve-re,0)}},F=(S,K)=>{const Be=Math.abs(S.textY-K.textY)<v,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,re=S.isRightSide?S.textX+S.textWidth:S.textX,ye=K.isRightSide?K.textX:K.textX-K.textWidth,Ee=K.isRightSide?K.textX+K.textWidth:K.textX,ve=Ze<Ee&&ye<re;return Be&&ve},N=Ln.value.filter(S=>!S.isHidden),L=[];for(let S=0;S<N.length;S++){const K=N[S];let Be=Math.cos(K.midAngle)>=0;if(S>0){const re=L[S-1],ye=b(K,Be);F(re,ye)&&(Be=!Be)}const Ze=b(K,Be);L.push({...Ze,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return L}),Ha=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||Yl.value||.7;return $e.value===null||$e.value===void 0?o:$e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},Ra=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return $e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):o*.7:o},va=(t,o)=>{if(t)try{if($e.value===t.seriesIndex?$e.value=null:$e.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:R.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Fa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},fa=(t,o)=>{if(!t||(o.stopPropagation(),zo.value=!0,$e.value=t.seriesIndex,ot.value.show=!1,!Ie.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120;m+C>Se.value&&(m=o.clientX-r.left-C-10),v+b>r.height&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);const F=ll.value,N=Wn.value,L=F.map(S=>{const K=N[S]||S,Be=ha(S,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${K}: ${Be}`,color:t.color}:null}).filter(Boolean);dt.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderAreas:[]}},ha=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=dl.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return pn.value?m+pn.value:m}return l?.toString()||""},Ia=()=>{if(!Gt.value||!ot.value.data||ot.value.data.length===0)return"Bubbles";const t=[],o=new Set;return ot.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ga=(t,o)=>{t&&(zo.value=!1,$e.value=null,dt.value.show=!1,dt.value.bubbleData=[])},za=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=Ul(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const F=200,N=v?80:50;C+F>Se.value&&(C=o.clientX-r.left-F-15),b+N>ie.value&&(b=o.clientY-r.top-N-10),C<0&&(C=10),b<0&&(b=10),sl.value={show:!0,x:C,y:b,categoryValue:m,description:v}},Pa=()=>{sl.value.show=!1},no=e.computed(()=>R.categories.length||Math.max(...Ql.value.map(t=>t.data.length))),Oa=e.computed(()=>{let t=0;return Ql.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ya=e.computed(()=>{const t=[],o=no.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Dt.value+Math.cos(r)*Vt.value,v=Pt.value+Math.sin(r)*Vt.value;t.push({x:m,y:v,angle:r,index:l})}return t}),Wa=e.computed(()=>{const t=[],o=no.value;return ya.value.forEach((l,r)=>{const m=Vt.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Dt.value+Math.cos(v)*m,b=Pt.value+Math.sin(v)*m+5;let F="middle",N="middle";Math.abs(Math.cos(v))>.5&&(F=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(N=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:R.categories[r]||`Axis ${r+1}`,anchor:F,baseline:N})}),t}),qa=e.ref(new Set),Za=(t,o,l)=>{const r=`current-${l}`,m=qa.value.has(r),v=o.fillOpacity??Dl.value;return!m&&$e.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},ka=e.computed(()=>{if(!rl.value)return[];const t=[],o=no.value;return ln.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=n(r.series)?0:1,C=n(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=n(r),C=[],b=[],F=[],N=$e.value===m,L=$e.value!==null&&$e.value!==m,S=wt.value.has(m);for(let K=0;K<o;K++){const Be=r.data[K]||0,re=Be/Oa.value*Vt.value,ye=K*2*Math.PI/o-Math.PI/2,Ee=Dt.value+Math.cos(ye)*re,ve=Pt.value+Math.sin(ye)*re;C.push(`${Ee},${ve}`),b.push({x:Ee,y:ve}),F.push({x:Ee,y:ve,value:Be,label:R.categories[K]||`Axis ${K+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:F,color:c(r,m),fillOpacity:v?s.value.fillOpacity:Dl.value,strokeDasharray:v?a(r)||s.value.strokeDasharray:null,pointRadius:i(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:N,isDimmed:L,isHidden:S,isComparison:v,seriesIndex:m})}),t}),Ua=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const v=o[r].x,C=o[r].y,b=o[m].x,F=o[m].y;C>t.y!=F>t.y&&t.x<(b-v)*(t.y-C)/(F-C)+v&&(l=!l)}return l},Xa=t=>{if(!rl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=T.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=ka.value.filter(b=>b.isHidden?!1:Ua({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,$e.value=C[0].seriesIndex;const b=t.clientX-l.left+10,F=t.clientY-l.top-10,N=C.length>1?460:260,L=70+no.value*20;let S=b,K=F;S+N>Se.value&&(S=t.clientX-l.left-N-10),K+L>ie.value&&(K=t.clientY-l.top-L-10),S<0&&(S=10),K<0&&(K=10);const Be=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(re=>({label:re.label,value:$(re.value)}))}));dt.value={show:!0,x:S,y:K,title:"",value:"",bubbleData:[],spiderAreas:Be}}else un()},Io=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=R.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||wt.value.has(o.seriesIndex))return null;let m,v;if(Nl.value){let b=-1,F=null;for(let L=r.data.length-1;L>=0;L--)if(r.data[L]!==null&&r.data[L]!==void 0){b=L,F=r.data[L];break}if(b===-1||F===null)return null;const N=r.data.map((L,S)=>L==null?null:{x:ht(S),y:Ot(r,L),index:S}).filter(L=>L!==null);if(t.animations.enabled&&!An.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Wt.value.isAnimating||!Wt.value.hasAnimated))if(Wt.value.isAnimating){const L=Wt.value.currentFrame/Wt.value.totalFrames,S=aa(t.animations.easing,Math.min(L,1)),K=ls(N,S);m=K.x+(o.offsetX||0),v=K.y+(o.offsetY||0)}else m=N[0].x+(o.offsetX||0),v=N[0].y+(o.offsetY||0);else m=ht(b)+(o.offsetX||0),v=Ft(F)+(o.offsetY||0)}else if(cl.value||rl.value){const b=Math.PI*2/t.logos.length*l;m=Dt.value+Math.cos(b)*(Vt.value+30)+(o.offsetX||0),v=Pt.value+Math.sin(b)*(Vt.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ya=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},ja=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},na=t=>{wt.value.has(t)?wt.value.delete(t):wt.value.add(t)},Ka=e.computed(()=>{if(!dt.value.show&&!(Ue.value&&ot.value.show&&!ce.value.isZooming))return{display:"none"};let t,o;if(Ue.value&&ot.value.show&&!ce.value.isZooming){t=ot.value.x+15,o=I.value.top;const l=Gt.value?200:150;t+l>Se.value&&(t=ot.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=dt.value.x,o=dt.value.y;return{left:t+"px",top:o+"px"}}),Tn=(t,o)=>{if(!Ie.value||wo.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120,F=Se.value,N=ie.value;m+C>F&&(m=o.clientX-r.left-C-10),v+b>N&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&R.categories.includes(t.label)&&(L=R.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(fl.value||be.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),dt.value={show:!0,x:m,y:v,title:S,value:$(t.value)||"",categoryIndex:L,spiderAreas:[]}},oa=e.ref(!1),zo=e.ref(!1),un=()=>{dt.value.show=!1,dt.value.spiderAreas=[],dt.value.bubbleData=[],ot.value.show=!1,oa.value||($e.value=null)},wo=e.ref(!1),xo=(t,o)=>{wo.value=!0,dt.value.show=!1,ot.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,v=o.clientY-r.top-10;const C=250;m+C>Se.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Il.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Eo=()=>{wo.value=!1,Il.value.show=!1},Wt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),aa=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},An=e.computed(()=>wn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ca=()=>{if(!Kt.value||An.value){Wt.value.hasAnimated=!0,_l.value&&(_n.value=1);return}_l.value&&(_n.value=0),Wt.value.isAnimating=!0,Wt.value.currentFrame=0,Wt.value.totalFrames=Math.ceil(jl.value/16.67);const t=()=>{const o=Wt.value.currentFrame/Wt.value.totalFrames,l=aa(il.value,Math.min(o,1));Ga(l),_l.value&&(_n.value=l),o<1?(Wt.value.currentFrame++,Wt.value.animationId=requestAnimationFrame(t)):Qa()};Wt.value.animationId=requestAnimationFrame(t)},Ga=t=>{const o=P.value;o&&o.style.setProperty("--dss-animation-progress",t)},Qa=()=>{Wt.value.isAnimating=!1,Wt.value.hasAnimated=!0,_l.value&&(_n.value=1),Wt.value.animationId&&(cancelAnimationFrame(Wt.value.animationId),Wt.value.animationId=null)},sa=e.computed(()=>!cl.value||Wt.value.hasAnimated?!0:_l.value?_n.value>=1:Cn.value?Mn.value>=1:!0),ba=e.computed(()=>Vl.value&&sa.value),Po=e.ref(!1);e.watch(ba,t=>{t?(Po.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Po.value=!0})})):Po.value=!1},{immediate:!0});const Ja=e.computed(()=>{if(!Kt.value||An.value||Wt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${jl.value}ms`,t["--dss-animation-easing"]=es(il.value),t["--dss-stagger-delay"]=`${vl.value}ms`,t}),es=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ts=()=>{if(!Kt.value||An.value)return"";const t=["dss-chart-animated"];return Wt.value.hasAnimated||t.push(`dss-animate-${ql.value}`),Wt.value.hasAnimated||(cl.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):cl.value||t.push(`dss-animate-${ql.value}`)),Wt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>R.series,(t,o)=>{dn.value&&o&&Wt.value.hasAnimated&&(Wt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ca(),El.value)}))},{deep:!0}),e.watch(()=>ce.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{So()},50)}),e.watch(()=>[ce.value.scale,ce.value.offsetX],()=>{!ce.value.isZooming&&!ce.value.isDragging&&So()},{flush:"post"}),e.watch([Ut,qe],([t,o])=>{ce.value.minScale=t,ce.value.maxScale=o,(ce.value.scale<t||ce.value.scale>o)&&tn()},{immediate:!0}),e.watch(()=>R.locale,t=>{t&&t!==B.value&&(B.value=t)},{immediate:!0}),e.watch(()=>mt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",fo)}):document.removeEventListener("click",fo)}),e.onMounted(()=>{$e.value=null,_l.value&&(!Kt.value||An.value)&&(_n.value=1),jo(),P.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:l,height:r}=o.contentRect;st.value=Math.round(l),te.value=Math.round(r),he.value&&(Le.value=he.value.offsetHeight||Ce)}))}),f.observe(P.value)),Kt.value&&!An.value?be.value==="semi-radial"?setTimeout(()=>ea(),El.value):setTimeout(()=>Ca(),El.value):(Wt.value.hasAnimated=!0,be.value==="semi-radial"&&(Mn.value=1)),document.addEventListener("mousemove",wa),document.addEventListener("mouseup",xa),document.addEventListener("click",Zn)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&P.value&&(f.unobserve(P.value),f.disconnect(),f=null),Wt.value.animationId&&cancelAnimationFrame(Wt.value.animationId),Yn&&(cancelAnimationFrame(Yn),Yn=null),ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout),document.removeEventListener("mousemove",wa),document.removeEventListener("mouseup",xa),document.removeEventListener("click",Zn),document.removeEventListener("click",fo)});const wa=t=>{if(ce.value.isDragging&&ce.value.scale>1&&Nl.value){ot.value.show=!1;const o=t.clientX-ce.value.lastMouseX,{minX:l,maxX:r}=ge.value,m=r-l||1,C=o*.8;ce.value.offsetX+=C;const b=m/ce.value.scale,F=m-b,N=0,L=-F/m*I.value.width,S=N;ce.value.offsetX=Math.max(L,Math.min(S,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY}},xa=()=>{ce.value.isDragging&&(ce.value.isDragging=!1,setTimeout(()=>{!ce.value.isDragging&&ce.value.isZooming},100))},ls=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const F=l[b].x-l[b-1].x,N=l[b].y-l[b-1].y,L=Math.sqrt(F*F+N*N);m.push(L),r+=L}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const F=C+m[b];if(v<=F){const N=(v-C)/m[b],L=l[b],S=l[b+1];return{x:L.x+(S.x-L.x)*N,y:L.y+(S.y-L.y)*N}}C=F}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ts(),{"dss-chart-fill-width":Fe.value,"dss-chart-fill-height":We.value,"dss-chart-compact":cl.value&&!W.value}]]),style:e.normalizeStyle({width:Fe.value?"100%":Se.value+"px",height:Ge.value,...Fe.value||We.value?{overflow:cl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ja.value,cursor:Nn()}),"data-chart-type":be.value,ref_key:"containerEl",ref:P,onWheel:Mo,onMousedown:_o,onMousemove:g,onMouseup:yn,onMouseleave:x,onDblclick:tn,onContextmenu:e.withModifiers(q,["prevent"]),onClick:e.withModifiers(ue,["left"]),onWheelCapture:Mo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:he},[e.createElementVNode("div",Js,[ct.value?(e.openBlock(),e.createElementBlock("div",er,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),gt.value?(e.openBlock(),e.createElementBlock("div",tr,e.toDisplayString(gt.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",nr,e.toDisplayString(l.name),1)],46,lr))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&on.value&&bl.value.addMarker&&(Nl.value||Gt.value)&&!rn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Kn,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.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,rr),o[4]||(o[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,sr)):e.createCommentVNode("",!0),e.createElementVNode("div",ir,[Gt.value&&ut.value?(e.openBlock(),e.createElementBlock("div",cr,"Bubble size: "+e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Se.value,height:ie.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Kt.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:I.value.top,width:Se.value,height:I.value.height*4},null,8,mr)],8,dr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:ho.value},[e.createElementVNode("path",{d:Jo.value},null,8,vr)],8,pr)):e.createCommentVNode("",!0),_l.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Fn.value},[e.createElementVNode("path",{d:yo.value},null,8,hr)],8,fr)):e.createCommentVNode("",!0)]),Nl.value||Gt.value?(e.openBlock(),e.createElementBlock("g",gr,[ke.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,kr))),128))],8,yr)):e.createCommentVNode("",!0),rn.value&&Co.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value},null,8,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:I.value.top,y2:I.value.bottom,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value*.7},null,8,wr))),128))],8,Cr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Er),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Sr),h.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:I.value.right,x2:I.value.right,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Mr))),128)),h.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,_r))),128)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(qt.value),9,$r)):e.createCommentVNode("",!0),Zt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(Zt.value),9,Lr)):e.createCommentVNode("",!0),h.value&&xt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Se.value-15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Se.value-15}, ${I.value.top+I.value.height/2})`},e.toDisplayString(xt.value),9,Tr)):e.createCommentVNode("",!0)]),On.value.length>0?(e.openBlock(),e.createElementBlock("g",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":fe.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Hr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Rr)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Fr)):e.createCommentVNode("",!0)],8,Dr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Ir)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,I.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,zr),e.createElementVNode("text",{x:l.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Pr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":fe.value},[Bl.value?(e.openBlock(),e.createElementBlock("g",Wr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":fl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,qr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,Zr))],64))),128))],2),e.createElementVNode("g",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Yr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,jr))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($a.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Wt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Gr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Qr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Jr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(La.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,ei))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",ti,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,ni)],8,li))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?pe.value+.2:pe.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${r*vl.value}ms`})},null,14,ai))),128))])):be.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(la.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:l.clipPathId},[e.createElementVNode("path",{d:l.clipPath},null,8,ii)],8,ri)]),e.createElementVNode("g",{"clip-path":l.clipPathRef},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,fill:r.color,stroke:"none",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>Tn(r,m),onMouseleave:un},null,46,ui))),128))],8,ci)]))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":fl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,di)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,mi))],64))),128))],2)):e.createCommentVNode("",!0)],8,Or),Ue.value&&ot.value.show&&!ce.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":fe.value},[e.createElementVNode("line",{x1:ot.value.x,x2:ot.value.x,y1:I.value.top,y2:I.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,vi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:ot.value.x,cy:l.y,r:j($t.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,fi))),128))],8,pi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("g",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",gi,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:j(l.radius),fill:l.color,"fill-opacity":Ha(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Fa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,42,yi),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${r} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Ra(l)}),onLoad:m=>$n(r),onError:m=>ko(r),onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,46,ki)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Qn.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:Pt.value,r:Vt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,bi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":Lo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":$o(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>Tn(l.segment,m),onMouseleave:un},null,42,xi))),128))],8,wi),xn.value&&sa.value?(e.openBlock(),e.createElementBlock("g",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Si)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),vn.value&&(sa.value||Cn.value||Gl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:En.value.x,y:En.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Hn.value,fill:en.value,class:"dss-radial-data-center"},e.toDisplayString(fn.value),9,Vi)):e.createCommentVNode("",!0),ba.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Po.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Ni),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,Bi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":an.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Mi)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ci)):e.createCommentVNode("",!0),rl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Qn.value},[ke.value?(e.openBlock(),e.createElementBlock("g",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Dt.value,cy:Pt.value,r:j(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Li))),128)),e.createElementVNode("g",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Dt.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Ai),e.createElementVNode("text",{x:Dt.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(zn(r)),9,Di)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Dt.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Hi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/no.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/no.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Fi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Xa,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Za("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,"stroke-dasharray":l.strokeDasharray||void 0,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*vl.value}ms`,transition:"all 0.2s ease"})},null,14,Ii),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${v}`,cx:m.x,cy:m.y,r:j(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*vl.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Tn(m,C),onMouseleave:un},null,46,zi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,_i)):e.createCommentVNode("",!0),e.createElementVNode("g",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:j(l.width/2),fill:Qt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ya(r),onError:m=>ja(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,Wi))),128))])],8,ur))]),Ae.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:ie.value+"px",backgroundImage:`url('${el.value}')`,backgroundRepeat:"no-repeat",...kl.value,opacity:it.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:Ml.value+"px",height:Ml.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>mo(l),["stop"]),onMouseenter:m=>za(l,m),onMouseleave:Pa},[e.createElementVNode("img",{src:Pl(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Zi)],44,qi)),[[e.vShow,O.value]])),128)),sl.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:sl.value.x+"px",top:sl.value.y+"px"})},[e.createElementVNode("div",Ui,e.toDisplayString(sl.value.categoryValue),1),sl.value.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(sl.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value&&(dt.value.show||Ue.value&&ot.value.show&&!ce.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ue.value&&ot.value.show&&!ce.value.isZooming,"dss-spider-tooltip":rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ka.value)},[!Ue.value||!ot.value.show||ce.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",ji,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${v}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Ki,e.toDisplayString(m.label),1),e.createElementVNode("span",Gi,e.toDisplayString(m.value),1)]))),128))]))),128))])):Gt.value&&dt.value.bubbleData&&dt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Qi,[dt.value.title?(e.openBlock(),e.createElementBlock("div",Ji,e.toDisplayString(dt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("div",lc,e.toDisplayString(dt.value.title),1),e.createElementVNode("div",nc,e.toDisplayString(dt.value.value),1)])),dt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Tt(dt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",oc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ac,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",rc,[e.createElementVNode("div",ic,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(dt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",cc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",uc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",dc,[e.createElementVNode("div",mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",pc,e.toDisplayString(l.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",vc,[e.createElementVNode("div",fc,e.toDisplayString(Gt.value?Ia():E.categories[ot.value.categoryIndex]||`Category ${ot.value.categoryIndex+1}`),1),Gt.value?(e.openBlock(),e.createElementBlock("div",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",gc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",yc,e.toDisplayString($(l.value)),1)]))),128))]),Tt(ot.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",kc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Cc,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",bc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",wc,[e.createElementVNode("div",xc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(ot.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Sc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Vc,[e.createElementVNode("div",Nc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Bc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Nl.value&&Ke.value&&ce.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:tn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ce.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qs),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.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(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",_c,e.toDisplayString(l.name),1)],46,Mc))),128))],2)):e.createCommentVNode("",!0),mt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:mt.value.x+"px",top:mt.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[bl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),bl.value.addMarker&&(bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv||Fl.value.length>0)?(e.openBlock(),e.createElementBlock("div",$c)):e.createCommentVNode("",!0),bl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Ko},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),bl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Qo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Fl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Lc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Xt(l)),style:e.normalizeStyle(Cl(l)),onClick:m=>Bo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:at(l),class:"dss-custom-menu-content"},null,8,Dc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Hc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Ac)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Vn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Rc,[e.createElementVNode("h3",null,e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.viewMarker"):Tl.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Vn},"×")]),e.createElementVNode("div",Fc,[e.createElementVNode("div",Ic,[e.createVNode(ca,{id:"dss-marker-date",mode:"single",modelValue:Oe.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Oe.value.date=l),"min-date":Ll.value,"max-date":sn.value,disabled:nl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),nl.value?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(Oe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Oe.value.description=l),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Wc)),[[e.vModelText,Oe.value.description]])])]),e.createElementVNode("div",qc,[e.createElementVNode("div",Zc,[Tl.value&&!nl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Xo},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Uc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Vn},e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),nl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Vo,disabled:!(Oe.value.description&&Oe.value.description.length)},e.toDisplayString(Tl.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,Xc))])])])])):e.createCommentVNode("",!0)],64))}}),Kc={class:"dss-modal-title"},Gc={class:"dss-modal-actions"},ia={__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(E,{emit:le}){const _=E,B=le,de=e.ref(null),P=e.ref(null),T=e.computed(()=>{const X={"max-width":_.width};return _.height!=="auto"&&(X.height=_.height,X["min-height"]="0"),X}),he=e.computed(()=>({}));function st(){B("close-modal")}function te(){_.backDrop&&!de.value&&B("close-modal")}function f(X){X.target.tagName==="INPUT"&&(de.value=X.target.tagName)}function we(){setTimeout(()=>{de.value=null},300)}function Ce(){const X=document.body,fe=document.documentElement;P.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:fe.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",fe.style.overflow="hidden"}function J(){if(!P.value)return;const X=document.body,fe=document.documentElement,{bodyOverflow:R,bodyPosition:me,bodyTop:_e,bodyWidth:Je,htmlOverflow:pt,scrollY:Z}=P.value;X.style.overflow=R||"",X.style.position=me||"",X.style.top=_e||"",X.style.width=Je||"",X.style.left="",fe.style.overflow=pt||"",window.scrollTo(0,Z||0)}return e.watch(()=>_.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",we))},100);else{J(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&J()}),(X,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:te},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Kc,[e.renderSlot(X.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:st,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(he.value)},[e.renderSlot(X.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},Qc={key:0,class:"dss-table-toolbar"},Jc={class:"dss-table-toolbar-left"},eu=["aria-expanded"],tu={class:"dss-pagination-select-dropdown",role:"listbox"},lu={class:"dss-table-column-visibility-label"},nu={class:"dss-table-checkbox-wrapper"},ou=["checked","onChange"],au={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},su={class:"dss-table-column-visibility-text"},ru={class:"dss-table-toolbar-right"},iu=["placeholder","aria-label"],cu=["aria-label"],uu=["aria-label","aria-expanded"],du={key:1,class:"dss-table-toolbar-extra"},mu={class:"dss-table-thead"},pu={key:0,class:"dss-table-th dss-table-selection-column"},vu={key:0,class:"dss-table-checkbox-wrapper"},fu=["checked","indeterminate"],hu={key:0,class:"dss-table-checkbox__indeterminate"},gu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},yu=["aria-label"],ku=["onClick"],Cu={class:"dss-table-th-content"},bu={class:"dss-table-th-text"},wu={key:0},xu={key:1},Eu={key:2},Su=["data-filter-column-key","aria-expanded","aria-label","onClick"],Vu={class:"dss-table-tbody"},Nu=["onClick"],Bu={class:"dss-table-checkbox-wrapper"},Mu=["type","name","checked","disabled","onChange"],_u={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},$u={key:1,class:"dss-table-checkbox__dot"},Lu=["onClick"],Tu=["aria-expanded","aria-label"],Au={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Du={key:0,class:"dss-table-expansion-row"},Hu=["colspan"],Ru=["colspan"],Fu={key:1,class:"dss-table-pagination"},Iu={class:"dss-table-pagination-left"},zu={key:0},Pu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Ou={class:"dss-table-pagination-center"},Wu={key:0,class:"dss-pagination-controls"},qu=["disabled","title"],Zu=["disabled","title"],Uu=["aria-label","onKeydown"],Xu={class:"dss-pagination-of"},Yu=["disabled","title"],ju=["disabled","title"],Ku={class:"dss-table-pagination-right"},Gu={class:"dss-pagination-rows-label"},Qu=["aria-expanded"],Ju=["aria-selected","onClick"],ed={key:0,class:"dss-table-filter-row"},td=["value","placeholder"],ld=["min","max","value"],nd=["min","max","value"],od={class:"dss-table-filter-double-range-values"},ad={key:2,class:"dss-table-filter-daterange"},sd={class:"dss-table-filter-daterange-row"},rd={class:"dss-table-filter-daterange-label"},id=["value"],cd={class:"dss-table-filter-daterange-row"},ud={class:"dss-table-filter-daterange-label"},dd=["value"],md=["value","placeholder"],pd={class:"dss-table-filter-list"},vd=["checked","onChange"],fd={class:"dss-table-filter-actions"},hd={name:"DSSTable"},gd=Object.assign(hd,{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:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=E,P=le,T={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 he(y,g){const x=Object.assign({},y);return st(y)&&st(g)&&Object.keys(g).forEach(q=>{st(g[q])?q in y?x[q]=he(y[q],g[q]):Object.assign(x,{[q]:g[q]}):Object.assign(x,{[q]:g[q]})}),x}function st(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>he(T,de.options)),f=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>te.value.table.height),Ce=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:Ce.value})),X=e.computed(()=>te.value.table.expandable===!0),fe=e.computed(()=>te.value.table.expandableRowData??null),R=e.computed(()=>te.value.table.expandableRowCondition??null),me=e.computed(()=>te.value.table.truncated===!0),_e=e.computed(()=>te.value.table.striped),Je=e.computed(()=>te.value.table.bordered),pt=e.computed(()=>te.value.table.hoverable),Z=e.computed(()=>te.value.table.size),Fe=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const We=e.computed(()=>te.value.selection.enabled),Se=e.computed(()=>te.value.selection.mode),Le=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ie=e.computed(()=>te.value.sorting.mode),Ge=e.computed(()=>te.value.pagination.enabled),be=e.computed(()=>te.value.pagination.rows),Qe=e.computed(()=>te.value.pagination.rowsPerPageOptions),ct=e.computed(()=>te.value.pagination.showCounter!==!1),gt=e.computed(()=>te.value.pagination.showControlsGroup),ut=e.computed(()=>gt.value===!1?!1:te.value.pagination.showControls!==!1),qt=e.computed(()=>gt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),Zt=e.computed(()=>Ge.value&&(ct.value||ut.value||qt.value)),kt=e.computed(()=>te.value.scrollable),xt=e.computed(()=>te.value.emptyMessage||_("table.emptyMessage")),Yt=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),rt=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),Jt=e.computed(()=>te.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||rt.value||Jt.value||ol.value),ol=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),U=e.ref(""),ke=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ke.value?(G&&(clearTimeout(G),G=null),ke.value=!1,U.value="",P("search",""),W.value?.blur()):(ke.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Ie(){U.value||(ke.value=!1)}function Ue(){U.value="",P("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":_e.value,"dss-table-bordered":Je.value,"dss-table-hoverable":pt.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":me.value})),Ke=(y,g)=>y?.field??y?.key??g,Ut=e.ref(new Set);function qe(){const y=new Set;return de.columns.forEach((g,x)=>{g?.hidden!==!0&&y.add(Ke(g,x))}),y}function Pe(){const y=new Set;return de.columns.forEach((g,x)=>{y.add(Ke(g,x))}),y}function Ht(y){if(!Array.isArray(y))return null;const g=Pe(),x=[];return y.forEach(q=>{g.has(q)&&x.push(q)}),x}function $t(){Ut.value=qe()}const oe=e.computed(()=>{const y=Ht(de.columnVisibility);return y===null?null:new Set(y)}),Y=e.computed(()=>oe.value??Ut.value),j=e.computed(()=>de.columns.filter((y,g)=>Y.value.has(Ke(y,g)))),pe=y=>{const g=de.columns.findIndex(x=>x===y);return Ke(y,g>=0?g:0)},xe=(y,g)=>Y.value.has(Ke(y,g));function je(y){P("update:columnVisibility",Array.from(y))}function Rt(y,g){const x=Ke(y,g),q=new Set(Y.value);q.has(x)?q.delete(x):q.add(x),oe.value===null&&(Ut.value=q),je(q)}const jt=e.ref(null),et=e.ref(!1);function pl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>j.value.length+(We.value?1:0)+(X.value?1:0)),w=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),se=e.ref(null),ae=(y,g)=>A.value.has(w(y,g)),He=(y,g)=>{if(!X.value)return!1;if(typeof R.value=="function")return!!R.value(y,g);if(typeof fe.value=="string"&&fe.value.trim()){const x=Tl(y,fe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,g,x)=>{if(x&&x.stopPropagation(),!He(y,g))return;const q=w(y,g),ue=new Set(A.value);ue.has(q)?(ue.delete(q),P("row-collapse",{data:y,index:g})):(ue.add(q),P("row-expand",{data:y,index:g})),A.value=ue},nt=(y,g)=>{if(!me.value)return;const x=w(y,g);se.value!==x&&(se.value=x)},Re=e.ref(null),bt=e.ref(0),_t=e.ref([]),St=y=>{if(ie.value==="single")return Re.value===y.field?bt.value:0;{const g=_t.value.find(x=>x.field===y.field);return g?g.order:0}},Lt=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},zt=e.ref({}),Bt=e.ref(null),Kt=e.ref(null),ql=220,jl=e.ref(null),El=e.computed(()=>j.value.find(y=>pe(y)===Bt.value)??null),il=e.computed(()=>{if(!El.value||El.value.filter!=="range")return null;const y=El.value,g=Bt.value,{min:x,max:q}=pn(y),ue=y.filterMin??x,at=y.filterMax??q,Xt=Dl(g),Cl=Xt.min??ue,Pl=Xt.max??at,Ul=at-ue,hn=Ul===0?0:(Cl-ue)/Ul*100,uo=Ul===0?100:(Pl-ue)/Ul*100;return{rangeMin:ue,rangeMax:at,currentMin:Cl,currentMax:Pl,minPct:hn,maxPct:uo}}),vl=e.ref(null),dn=e.ref("max");function wn(y){const g=vl.value,x=il.value;if(!g||!x)return;const q=g.getBoundingClientRect(),at=(y.clientX-q.left)/q.width*100,Xt=(x.minPct+x.maxPct)/2;dn.value=at<Xt?"min":"max"}function Dl(y){return zt.value[y]??{}}function mn(y,g){zt.value={...zt.value,[y]:g}}function $l(y){const g=zt.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function zn(y){const g={...zt.value};delete g[y],zt.value=g,Bt.value=null,Kt.value=null}function Dn(){if(!Bt.value){Kt.value=null;return}const y=jl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!g)return;const x=g.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}const on=e.computed(()=>{const y=String(U.value??"").trim().toLowerCase();return y?de.data.filter(g=>j.value.some(x=>Fl(sn(g,x)).some(ue=>String(ue).toLowerCase().includes(y)))):de.data}),bl=e.computed(()=>{let y=[...on.value];const g=(U.value??"").trim().toLowerCase();return g&&(y=y.filter(x=>de.columns.some(q=>{if(!q||!q.field)return!1;const ue=sn(x,q);return String(ue??"").toLowerCase().includes(g)}))),j.value.forEach(x=>{const q=pe(x),ue=zt.value[q];if(!ue)return;const at=x.field;if(at){if(ue.type==="string"&&ue.value?.trim()){const Xt=ue.value.trim().toLowerCase();y=y.filter(Cl=>{const Pl=sn(Cl,x);return String(Pl??"").toLowerCase().includes(Xt)})}else if(ue.type==="range")y=y.filter(Xt=>{const Cl=Tl(Xt,at),Pl=Number(Cl);return!(Number.isNaN(Pl)||ue.min!=null&&Pl<ue.min||ue.max!=null&&Pl>ue.max)});else if(ue.type==="dateRange"){const Xt=ue.from?new Date(ue.from).getTime():null,Cl=ue.to?new Date(ue.to).getTime():null;y=y.filter(Pl=>{const Ul=Tl(Pl,at),hn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(hn)||Xt!=null&&hn<Xt||Cl!=null&&hn>Cl)})}else if(ue.type==="list"&&ue.selected?.length){const Xt=new Set(ue.selected);y=y.filter(Cl=>Fl(sn(Cl,x)).some(Ul=>Xt.has(Ul)))}}}),y});function Fl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Fl);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function Kl(y){const g=new Set;return de.data.forEach(x=>{Fl(sn(x,y)).forEach(ue=>g.add(ue))}),Array.from(g).sort((x,q)=>String(x).localeCompare(String(q)))}function Hl(y,g){if(Bt.value===y){Bt.value=null,Kt.value=null;return}if(Bt.value=y,g?.currentTarget){const x=g.currentTarget.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}else Dn()}function Ml(y,g){mn(y,{type:"string",value:g})}function pn(y){const g=y.field;if(!g)return{min:0,max:100};let x=1/0,q=-1/0;return de.data.forEach(ue=>{const at=Tl(ue,g),Xt=Number(at);Number.isNaN(Xt)||(x=Math.min(x,Xt),q=Math.max(q,Xt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function $(y,g,x){const q={...Dl(y),type:"range"},ue=x===""?null:Number(x),at=ue===null||Number.isNaN(ue)?null:ue;q[g]=at,at!=null&&(g==="min"&&q.max!=null&&at>q.max&&(q.max=at),g==="max"&&q.min!=null&&at<q.min&&(q.min=at)),mn(y,q)}function O(y,g,x){const q={...Dl(y),type:"dateRange"};q[g]=x||"",mn(y,q)}const D=e.reactive({});function ne(y,g){D[y]=g}function Ae(y){const g=pe(y),x=(D[g]??"").trim().toLowerCase(),q=Kl(y);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function it(y,g){return(Dl(y).selected??[]).includes(g!=null?String(g):"")}function vt(y,g){const q=[...Dl(y).selected??[]],ue=g!=null?String(g):"",at=q.indexOf(ue);at>=0?q.splice(at,1):q.push(ue),mn(y,{type:"list",selected:q})}function tt(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,Kt.value=null)}function lt(){Dn(),el.value&&Zl()}const kl=y=>{if(!(y.sortable===!1||!Ye.value))if(ie.value==="single")Re.value===y.field?bt.value=bt.value===1?-1:bt.value===-1?0:1:(Re.value=y.field,bt.value=1),bt.value===0&&(Re.value=null),P("sort",{field:Re.value,order:bt.value});else{const g=_t.value.findIndex(x=>x.field===y.field);g>=0?_t.value[g].order===1?_t.value[g].order=-1:_t.value.splice(g,1):_t.value.push({field:y.field,order:1}),P("sort",{multiSortMeta:_t.value})}},Sl=e.computed(()=>{if(!Ye.value)return bl.value;let y=[...bl.value];return ie.value==="single"&&Re.value&&bt.value!==0?y.sort((g,x)=>{const q=Tl(g,Re.value),ue=Tl(x,Re.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*bt.value}):ie.value==="multiple"&&_t.value.length>0&&y.sort((g,x)=>{for(const q of _t.value){const ue=Tl(g,q.field),at=Tl(x,q.field);if(ue===at)continue;if(ue==null)return 1;if(at==null)return-1;const Xt=ue<at?-1:ue>at?1:0;if(Xt!==0)return Xt*q.order}return 0}),y}),Tt=e.ref(0),wl=e.ref(be.value),el=e.ref(!1),Vl=e.ref(null),an=e.ref(null),al=e.ref("bottom"),At=e.ref(null),Pn=y=>{wl.value=y,el.value=!1,Tt.value=0,P("page",{page:0,rows:wl.value})};function xn(y){Vl.value&&!Vl.value.contains(y.target)&&(el.value=!1)}function Zl(){const y=Vl.value,g=an.value;if(!y||!g)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=g.getBoundingClientRect(),ue=x.offsetHeight||0,Xt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Cl=q.top;al.value=Xt<ue+8&&Cl>Xt?"top":"bottom",At.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>Sl.value.length),fn=e.computed(()=>Math.ceil(vn.value/wl.value)),Hn=e.computed(()=>Math.max(fn.value,1)),En=e.computed(()=>vn.value===0?0:ul.value+1),en=e.computed(()=>On.value),ul=e.computed(()=>Ge.value?Tt.value*wl.value:0),On=e.computed(()=>Ge.value?Math.min((Tt.value+1)*wl.value,vn.value):vn.value),Il=e.computed(()=>{if(!Ge.value)return Sl.value;const y=ul.value,g=On.value;return Sl.value.slice(y,g)}),ll=e.ref(new Set),Wn=e.computed(()=>Sl.value.filter((y,g)=>ll.value.has(w(y,g)))),dl=(y,g)=>{const x=Le.value;return typeof x!="function"?!0:!!x(y,g)},wt=e.computed(()=>Sl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>dl(y,g))),$e=e.computed(()=>{const y=wt.value;return y.length===0?!1:y.every(({row:g,index:x})=>ll.value.has(w(g,x)))}),Sn=e.computed(()=>{const y=wt.value;if(y.length===0)return!1;const g=y.filter(({row:x,index:q})=>ll.value.has(w(x,q))).length;return g>0&&g<y.length}),dt=(y,g)=>ll.value.has(w(y,g)),sl=()=>{if($e.value)ll.value=new Set,P("unselect-all");else{const y=new Set;wt.value.forEach(({row:g,index:x})=>y.add(w(g,x))),ll.value=y,P("select-all",Wn.value)}},ot=(y,g)=>{if(!dl(y,g))return;const x=w(y,g),q=new Set(ll.value),ue=q.has(x);Se.value==="single"?ue?(q.delete(x),P("row-unselect",y)):(q.clear(),q.add(x),P("row-select",y)):ue?(q.delete(x),P("row-unselect",y)):(q.add(x),P("row-select",y)),ll.value=q},mt=e.ref("1"),ce=()=>{const y=Number.parseInt(String(mt.value),10);if(!Number.isFinite(y)){mt.value=String(Tt.value+1);return}const g=Math.min(Hn.value,Math.max(1,y));g!==Tt.value+1?tl(g-1):mt.value=String(g)},tl=y=>{y<0||y>=fn.value||(Tt.value=y,P("page",{page:y,rows:wl.value}))},Oe=(y,g,x)=>{P("row-click",{data:y,index:g,originalEvent:x}),nt(y,ul.value+g)},Ll=(y,g)=>{const x=ul.value+g;return{"dss-table-row-selected":dt(y,x),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":me.value,"dss-table-row-truncated-expanded":se.value===w(y,x)}},sn=(y,g)=>g.field?Tl(y,g.field):"",Tl=(y,g)=>g.split(".").reduce((x,q)=>x&&x[q],y),nl=y=>{const g=y.align??Fe.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},zl=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>de.locale,y=>{y&&y!==B.value&&(B.value=y)},{immediate:!0}),e.watch(be,y=>{wl.value=y,Tt.value=0}),e.watch(el,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Tt,y=>{mt.value=String(y+1)},{immediate:!0}),e.watch(U,y=>{P("search",y??"")}),e.watch(()=>de.columns,()=>{if(oe.value===null){$t();return}const y=Ht(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&P("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",xn),document.addEventListener("click",pl),document.addEventListener("click",tt),window.addEventListener("resize",lt),window.addEventListener("scroll",lt,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",xn),document.removeEventListener("click",pl),document.removeEventListener("click",tt),window.removeEventListener("resize",lt),window.removeEventListener("scroll",lt,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:jl,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Jc,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=x=>P("download-pdf"))},[g[22]||(g[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),rt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=x=>P("download-excel"))},[g[23]||(g[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),ol.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=x=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,eu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",lu,[e.createElementVNode("span",nu,[e.createElementVNode("input",{type:"checkbox",checked:xe(x,q),onChange:ue=>Rt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ou),xe(x,q)?(e.openBlock(),e.createElementBlock("span",au,[...g[25]||(g[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",su,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",ru,[Jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ke.value||U.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=x=>U.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=x=>ke.value=!0),onBlur:Ie},null,40,iu),[[e.vModelText,U.value]]),U.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ue},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,cu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":ke.value||!!U.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[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,uu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":kt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",mu,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",pu,[Se.value==="multiple"?(e.openBlock(),e.createElementBlock("span",vu,[e.createElementVNode("input",{type:"checkbox",checked:$e.value,indeterminate:Sn.value,onChange:sl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,fu),Sn.value?(e.openBlock(),e.createElementBlock("span",hu)):$e.value?(e.openBlock(),e.createElementBlock("span",gu,[...g[28]||(g[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(_)("table.expandRowAriaLabel")},null,8,yu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:pe(x),class:e.normalizeClass(["dss-table-th",nl(x)]),style:e.normalizeStyle(zl(x)),onClick:ue=>kl(x)},[e.createElementVNode("div",Cu,[e.createElementVNode("span",bu,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Lt(x)])},[St(x)===0?(e.openBlock(),e.createElementBlock("span",wu,[...g[29]||(g[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)])])):St(x)===1?(e.openBlock(),e.createElementBlock("span",xu,[...g[30]||(g[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)])])):St(x)===-1?(e.openBlock(),e.createElementBlock("span",Eu,[...g[31]||(g[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":Bt.value===pe(x)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$l(pe(x))}]),"data-filter-column-key":pe(x),"aria-expanded":Bt.value===pe(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>Hl(pe(x),ue)},[...g[32]||(g[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,Su)],2)):e.createCommentVNode("",!0)])],14,ku))),128))])]),e.createElementVNode("tbody",Vu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,ul.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Ll(x,q)]),style:e.normalizeStyle(J.value),onClick:ue=>Oe(x,q,ue)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Bu,[e.createElementVNode("input",{type:Se.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:dt(x,ul.value+q),disabled:!dl(x,ul.value+q),onChange:ue=>ot(x,ul.value+q),class:e.normalizeClass(["dss-table-checkbox",Se.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!dl(x,ul.value+q)}])},null,42,Mu),Se.value==="multiple"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",_u,[...g[33]||(g[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"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",$u)):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=>Ct(x,ul.value+q,ue),["stop"])},[He(x,ul.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,ul.value+q),"aria-label":ae(x,ul.value+q)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(x,ul.value+q)}]),"aria-hidden":"true"},[...g[34]||(g[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,Tu)):(e.openBlock(),e.createElementBlock("span",Au))],8,Lu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(ue,at)=>(e.openBlock(),e.createElementBlock("td",{key:pe(ue),class:e.normalizeClass(["dss-table-td",nl(ue)]),style:e.normalizeStyle(zl(ue))},[e.renderSlot(y.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:se.value===w(x,ul.value+q)},()=>[e.createTextVNode(e.toDisplayString(sn(x,ue)),1)])],6))),128))],14,Nu),X.value&&He(x,ul.value+q)&&ae(x,ul.value+q)?(e.openBlock(),e.createElementBlock("tr",Du,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Hu)])):e.createCommentVNode("",!0)],64))),128)),Il.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(xt.value),1)])],8,Ru)],4))])],2)],2),Zt.value?(e.openBlock(),e.createElementBlock("div",Fu,[e.createElementVNode("div",Iu,[ct.value?(e.openBlock(),e.createElementBlock("span",zu,e.toDisplayString(e.unref(_)("table.showingRange",{start:En.value,end:en.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Pu," "))]),e.createElementVNode("div",Ou,[ut.value?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[8]||(g[8]=x=>tl(0)),title:e.unref(_)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,qu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[9]||(g[9]=x=>tl(Tt.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Zu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>mt.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:ce,onKeydown:e.withKeys(e.withModifiers(ce,["prevent"]),["enter"])},null,40,Uu),[[e.vModelText,mt.value]]),e.createElementVNode("span",Xu,e.toDisplayString(e.unref(_)("table.ofPages",{total:Hn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[11]||(g[11]=x=>tl(Tt.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,Yu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[12]||(g[12]=x=>tl(fn.value-1)),title:e.unref(_)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ju)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ku,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Vl},[e.createElementVNode("span",Gu,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":el.value}]),onClick:g[13]||(g[13]=x=>el.value=!el.value),"aria-expanded":el.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:an},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Qu),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":al.value==="top"}]),style:e.normalizeStyle(At.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===wl.value}]),onClick:q=>Pn(x)},e.toDisplayString(x),11,Ju))),128))],6),[[e.vShow,el.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(Kt.value?{top:Kt.value.top+"px",left:Kt.value.left+"px",width:ql+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[El.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[El.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ed,[e.createElementVNode("input",{type:"text",value:Dl(Bt.value).value??"",onInput:g[14]||(g[14]=x=>Ml(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,td)])):El.value.filter==="range"&&il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":il.value.minPct+"%","--range-max-pct":il.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vl,class:"dss-table-filter-double-range-track",onMousemove:wn,onMouseenter:wn},[e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMin,onInput:g[15]||(g[15]=x=>$(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:dn.value==="min"?2:1})},null,44,ld),e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMax,onInput:g[16]||(g[16]=x=>$(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:dn.value==="max"?2:1})},null,44,nd)],544),e.createElementVNode("div",od,e.toDisplayString(il.value.currentMin)+" – "+e.toDisplayString(il.value.currentMax),1)],4)):El.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).from??"",onInput:g[17]||(g[17]=x=>O(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,id)]),e.createElementVNode("div",cd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).to??"",onInput:g[18]||(g[18]=x=>O(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,dd)])])):El.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[Bt.value]??"",onInput:g[19]||(g[19]=x=>ne(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,md),e.createElementVNode("div",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae(El.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:it(Bt.value,x),onChange:q=>vt(Bt.value,x)},null,40,vd),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",fd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=x=>zn(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&El.value&&Kt.value]])]),_:1})]))],64))}}),yd="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",kd="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",Cd="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",bd="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",wd="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",xd="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",Ed={class:"dss-toolbar-left"},Sd=["title"],Vd=["title"],Nd={class:"dss-toolbar-dropdown-wrapper"},Bd=["title"],Md=["src"],_d=["src"],$d=["src"],Ld=["src"],Td=["src"],Ad=["src"],Dd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Hd=["src"],Rd=["src"],Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["title"],Wd=["title"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd={key:2,class:"dss-toolbar-separator"},Qd=["title"],Jd={key:4,class:"dss-toolbar-separator"},e1={key:5,class:"dss-toolbar-dropdown-wrapper"},t1=["title"],l1={class:"dss-toolbar-dropdown-ai"},n1={class:"dss-toolbar-right"},o1={key:0,class:"dss-toolbar-custom-group"},a1={key:1,class:"dss-toolbar-separator"},s1={class:"dss-link-modal-content"},r1={class:"dss-link-modal-field"},i1={class:"dss-link-modal-label"},c1=["placeholder"],u1={class:"dss-link-modal-field"},d1={class:"dss-link-modal-label"},m1=["placeholder"],p1={class:"dss-image-modal-tabs"},v1={key:0,class:"dss-image-tab-content"},f1={class:"dss-link-modal-content"},h1={class:"dss-link-modal-field"},g1={key:0,class:"dss-link-modal-label"},y1=["src"],k1={class:"dss-link-modal-field"},C1={class:"dss-link-modal-label"},b1=["placeholder"],w1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},E1=["placeholder"],S1={class:"dss-link-modal-field"},V1={class:"dss-link-modal-label"},N1=["placeholder"],B1={key:1,class:"dss-image-tab-content"},M1={class:"dss-link-modal-content"},_1={class:"dss-link-modal-field"},$1={class:"dss-link-modal-label"},L1=["placeholder"],T1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},D1=["placeholder"],H1={class:"dss-link-modal-field"},R1={class:"dss-link-modal-label"},F1=["placeholder"],I1={class:"dss-link-modal-field"},z1={class:"dss-link-modal-label"},P1=["placeholder"],O1={class:"dss-text-editor-title-input-container"},W1={key:0,class:"dss-text-editor-title-preview"},q1={key:0},Z1={key:1,class:"dss-text-editor-preview-placeholder"},U1=["value","placeholder","disabled"],X1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Y1={class:"dss-text-editor-description-input-container"},j1={key:0,class:"dss-text-editor-description-preview"},K1={key:0},G1={key:1,class:"dss-text-editor-preview-placeholder"},Q1=["value","placeholder","disabled"],J1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},em=["data-comment-id","onMouseenter"],tm=["onClick"],lm=["src","alt"],nm={key:1},om=["onClick"],am=["src","alt"],sm={key:1},rm=["data-has-second-user","onClick"],im={class:"editor-comment-marker-count"},cm={key:7,class:"dss-text-editor-textarea-wrapper"},um=["value","placeholder","rows","disabled"],dm={class:"dss-text-editor-footer"},mm={class:"dss-text-editor-footer-content"},pm={class:"dss-text-editor-footer-stat"},vm={class:"dss-text-editor-footer-stat"},fm={key:8,class:"dss-text-editor-content-wrapper"},hm={key:0,class:"dss-comment-overlay-body"},gm={class:"dss-comment-selection-wrapper"},ym=["innerHTML"],km={class:"dss-comment-messages-wrapper"},Cm={key:0,class:"dss-comment-avatar-wrapper"},bm={class:"dss-comment-avatar"},wm=["src","alt"],xm={key:1},Em={class:"dss-comment-header"},Sm={class:"dss-comment-header-text"},Vm={class:"dss-comment-author"},Nm={key:0,class:"dss-comment-date"},Bm=["onClick","title"],Mm={class:"dss-comment-overlay-inner"},_m=["placeholder","onKeydown"],$m={class:"dss-text-editor-footer"},Lm={class:"dss-text-editor-footer-content"},Tm={class:"dss-text-editor-footer-stat"},Am={class:"dss-text-editor-footer-stat"},Dm=["title"],Hm=["title"],Rm={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:""},Fm={class:"dss-image-popup-content"},Im={key:0,class:"dss-image-popup-no-alt-icon"},zm=["title"],Pm=["title"],Om={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:""},Wm={class:"dss-toolbar-left"},qm=["title"],Zm=["title"],Um={class:"dss-toolbar-dropdown-wrapper"},Xm=["title"],Ym=["src"],jm=["src"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},t2=["title"],l2=["title"],n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2={key:2,class:"dss-toolbar-separator"},d2=["title"],m2={key:4,class:"dss-toolbar-separator"},p2={key:5,class:"dss-toolbar-dropdown-wrapper"},v2=["title"],f2={class:"dss-toolbar-dropdown-ai"},h2={key:0,class:"dss-toolbar-right"},g2={key:0,class:"dss-toolbar-separator"},y2={key:0,class:"dss-toolbar-custom-group"},k2={key:1,class:"dss-toolbar-separator"},C2={name:"DSSTextEditor"},b2=Object.assign(C2,{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:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==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(E,{expose:le,emit:_}){const{t:B,locale:de}=so.useI18n(),P={h1:yd,h2:kd,h3:Cd,h4:bd,h5:wd,h6:xd},T=E,he=_,st=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
101
  <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>`,v=e.ref(null),Ce=e.ref(null),ke=e.ref(!1),Q=e.ref(!1),X=e.ref(!1),me=e.ref(""),F=e.ref({}),ue=e.ref(!1),Me=e.ref(!1),tt=e.ref(""),mt=e.ref(""),Z=e.ref(null),Ae=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(""),Ye=e.ref(!1),ie=e.ref({}),Je=e.ref(!1),we=e.ref({}),et=e.ref(null),ct=e.ref(null),vt=e.ref(!1),ut=e.ref(""),Ft=e.ref(null),It=e.ref(""),bt=e.ref(""),wt=e.ref(""),Jt=e.ref(null),pt=e.ref(null),jt=e.ref(null),kt=e.ref(null),tn=e.ref(null),U=e.ref(!1),ye=e.ref(""),P=e.ref({}),K=e.ref(!1),Se=e.ref("upload"),Re=e.ref(""),Ze=e.ref(null),xt=e.ref(null),Ke=e.ref([]),zt=e.ref([]),qe=e.ref(null),ze=e.ref(!1),Lt=e.ref(""),$t=e.ref(""),oe=e.ref(""),Y=e.ref(""),j=e.ref(""),de=e.ref(""),be=e.ref(null),je=e.ref(null),Tt=e.ref(null),Xt=e.ref(!1),nt=e.ref(null),sn=e.ref(!1),N=e.ref(!1),b=e.ref(null),B=e.ref("p"),G=e.ref(!1),ae=e.ref([]),De=e.ref(null),Ct=e.ref(null),lt=e.ref(null),Ie=e.ref(!1),Et=e.ref(0),Bt=100,St=e.ref(null),rt=e.computed(()=>!!_.commentUser),At=e.computed(()=>({"dss-text-editor-no-border":!_.border,"dss-text-editor-rounded":_.rounded,"dss-text-editor-full-height":_.fullHeight,"dss-comment-overlay-open":rt.value&&hn.value!==null})),Nt=e.computed(()=>({})),rn=e.computed(()=>!_.fixedHeight||_.fullHeight?{}:{height:`${1.6*14*_.rows+24+2}px`,resize:"none",overflowY:"auto"}),Vn=e.computed(()=>!_.fixedHeight||_.fullHeight?{}:{height:`${1.6*14*_.rows+32}px`,overflowY:"auto"}),Zn=e.computed(()=>_.richText&&zt.value.length>0),en=e.computed(()=>{if(!_.modelValue)return"";if(_.richText){let o=_.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return _.modelValue}),pn=e.computed(()=>{const o=en.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ll=e.computed(()=>en.value.length),vl=e.computed(()=>kt.value!==null&&Se.value==="upload"&&It.value&&It.value.startsWith("data:")),il=e.computed(()=>_.titlePlaceholder||V("textEditor.placeholders.title")),_n=e.computed(()=>_.descriptionPlaceholder||V("textEditor.placeholders.description")),gl=e.computed(()=>_.placeholder||V("textEditor.placeholders.startTyping")),$n=o=>st&&st[o]!==void 0,Vl=o=>{for(let l=o+1;l<_.customToolbarSlots.length;l++)if($n(_.customToolbarSlots[l]))return!0;return!1},Rl=o=>{for(let l=o+1;l<_.customToolbarSlots.length;l++){const s=_.customToolbarSlots[l];if($n(s)&&hl(s))return!0}return!1},hl=o=>_.customToolbarFloatingMap.hasOwnProperty(o)?_.customToolbarFloatingMap[o]===!0:!0,An=e.computed(()=>_.customToolbarSlots.some(o=>$n(o)&&hl(o))),Un=e.computed(()=>$n("title-slot")),Xn=e.computed(()=>$n("description-slot")),Hn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},zn=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},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=l.nextNode();for(;i;)s.push(i),i=l.nextNode();s.forEach(c=>c.remove())},A=o=>{try{const l=String(o.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${i} ${c}`}catch{return""}},z=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=V("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},L=o=>{const l=o.target.value;pe("update:modelValue",l),pe("change",l)},le=()=>{if(!be.value)return;const o=be.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,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")},Te=()=>{sn.value=!0,le()},ft=()=>{sn.value=!1,dt()},dt=()=>{if(!be.value)return;const o=be.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")},ot=o=>{const s=o.target.value;sn.value&&le(),pe("update:title",s),pe("title-change",s),Tt.value="title",_.richText&&(ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he()},500))},at=()=>{if(!je.value)return;const o=je.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,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")},vn=()=>{N.value=!0,at()},bn=()=>{N.value=!1,Wt()},Wt=()=>{if(!je.value)return;const o=je.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")},gn=o=>{const s=o.target.value;N.value&&at(),pe("update:description",s),pe("description-change",s),Tt.value="description",_.richText&&(ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he()},500))},Kt=()=>{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(v.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Ln=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(s)}catch{v.value.focus()}},Ht=()=>{if(!v.value)return;v.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},i=s(v.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);o.removeAllRanges(),o.addRange(l)},he=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,s=_.title||"",i=_.description||"";if(!o&&l===Lt.value&&s===oe.value&&i===Y.value)return;const c={content:$t.value||Lt.value,title:j.value!==void 0?j.value:oe.value,description:de.value!==void 0?de.value:Y.value},d=Ke.value.length>0?Ke.value[Ke.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&&(Ke.value.push(c),Ke.value.length>50&&Ke.value.shift(),zt.value=[]),Lt.value=l,oe.value=s,Y.value=i,$t.value=l,j.value=s,de.value=i},Mt=o=>{if(!v.value)return;gt(),v.value&&Nl(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=Kt(),Rn()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),Q.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=Hn(i);pe("update:modelValue",c),pe("change",c),Tt.value="editor",ze.value||($t.value=Lt.value,j.value=oe.value,de.value=Y.value),qe.value&&clearTimeout(qe.value),ze.value=!0,qe.value=setTimeout(()=>{ze.value=!1,he(),lo(),_o()},500),e.nextTick(()=>{l&&Ln(l),gt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(k=>{try{if(f&&b.value?.command===k){ie.value[k]=b.value.state;return}if(k==="bold")if(m){const D=m.commonAncestorContainer,R=D.nodeType===3?D.parentElement:D;let S=!1;if(R&&((R.tagName==="STRONG"||R.tagName==="B"||R.closest&&R.closest("strong, b"))&&(S=!0),!S&&R.style&&parseInt(R.style.fontWeight)>=600&&(S=!0),!S))try{const re=window.getComputedStyle(R);parseInt(re.fontWeight)>=600&&(S=!0)}catch{}ie.value[k]=S}else ie.value.hasOwnProperty(k)||(ie.value[k]=!1);else if(k==="italic")if(m){const D=m.commonAncestorContainer,R=D.nodeType===3?D.parentElement:D,S=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));ie.value[k]=!!S}else{const D=document.queryCommandState(k);ie.value[k]=D}else{const D=document.queryCommandState(k);ie.value[k]=D}}catch{}}),Mn(),Ue(),ol(),Qt(),it(),Vt("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>_o(k),0),(k===" "||k===`
101
- `||/[.,;:!?]/.test(k))&&setTimeout(()=>{lo()},100)}Q.value=!1})},gt=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){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 f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},Rn=()=>{if(!v.value)return;const o=v.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 i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}i||(i=document.createElement("p"),o.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(l.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,d)),i.appendChild(d)}})},Ue=()=>{if(v.value&&!Xt.value){Xt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),D=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||D||D)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=i.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),i.parentNode.insertBefore(m,i),m.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=te,m.appendChild(k)}else if(f&&m.children.length===1){const k=m.parentNode;k.insertBefore(i,m),k.removeChild(m)}})}finally{Xt.value=!1}}},ht=o=>{lo(),pe("blur",o),Il()},se=()=>{if(_.disabled||!_.richText||!v.value)return;un(),qe.value&&(clearTimeout(qe.value),qe.value=null),ze.value&&(he(),ze.value=!1);const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(Ke.value.length===0){o&&be.value?be.value.focus():l&&je.value?je.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Mt()});return}const i={content:v.value.innerHTML,title:_.title||"",description:_.description||""};zt.value.push(i);const c=Ke.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||"";v.value.innerHTML=d,Lt.value=d,oe.value=u,Y.value=m,$t.value=d,j.value=u,de.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);pe("update:modelValue",f),pe("update:title",u),pe("update:description",m),pe("change",f),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(be.value){be.value.focus();const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}}else if(l){if(je.value){je.value.focus();const k=m.length;je.value.setSelectionRange(k,k)}}else if(s)Ht();else if(be.value&&document.activeElement===be.value){const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}else if(je.value&&document.activeElement===je.value){const k=m.length;je.value.setSelectionRange(k,k)}else v.value&&Ht()},10)})})}},on=()=>{if(_.disabled||!_.richText||!v.value)return;un();const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(zt.value.length===0){o&&be.value?be.value.focus():l&&je.value?je.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Mt()});return}const i={content:v.value.innerHTML,title:_.title||"",description:_.description||""};Ke.value.push(i);const c=zt.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||"";v.value.innerHTML=d,Lt.value=d,oe.value=u,Y.value=m,$t.value=d,j.value=u,de.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);pe("update:modelValue",f),pe("update:title",u),pe("update:description",m),pe("change",f),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(be.value){be.value.focus();const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}}else if(l){if(je.value){je.value.focus();const k=m.length;je.value.setSelectionRange(k,k)}}else if(s)Ht();else if(be.value&&document.activeElement===be.value){const k=u.length;be.value.setSelectionRange&&be.value.setSelectionRange(k,k),le()}else if(je.value&&document.activeElement===je.value){const k=m.length;je.value.setSelectionRange(k,k)}else v.value&&Ht()},10)})})}},Fe=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},ol=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},cn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.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 i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.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(()=>{ol()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ol()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{ol()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ol()})}return!0},yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.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 i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.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(()=>{Fe()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);f.appendChild(k),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Fe()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Fe()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Fe()})}return!0},Nn=(o,l=null)=>{if(_.disabled||!_.richText||!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_l(d)&&(i=Kt())}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 f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=yl();ie.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("bold");ie.value.bold=m})),Mt(),Bn(),Qt()});return}if(o==="italic"){const d=cn();ie.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("italic");ie.value.italic=m})),Mt(),ol(),Bn(),Qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(i&&Ln(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Gt("bold");ie.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Gt("italic");ie.value.italic=u});else{const u=document.queryCommandState(o);ie.value[o]=u}else{const u=document.queryCommandState(o);ie.value[o]=u}}catch{ie.value.hasOwnProperty(o)?ie.value[o]=!ie.value[o]:ie.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),k=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const k=f.getAttribute("href");(!k||k===""||k==="#")&&f.setAttribute("href",l)})}Mt(),Bn(),Qt()})},Gt=(o,l=null)=>{if(_.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.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 i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(f);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;f=!0;let S=D.parentElement;for(;S&&S!==v.value;){if(S.tagName==="STRONG"||S.tagName==="B"){u=!0;break}if(S.style&&parseInt(S.style.fontWeight)>=600){u=!0;break}S=S.parentElement}}else if(D.nodeType===1){const R=D;if(R.tagName==="STRONG"||R.tagName==="B"){u=!0;break}if(R.style&&parseInt(R.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ie.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;f=!0;let S=D.parentElement;for(;S&&S!==v.value;){if(S.tagName==="EM"||S.tagName==="I"){u=!0;break}if(S.style&&S.style.fontStyle==="italic"){u=!0;break}S=S.parentElement}}else if(D.nodeType===1){const R=D;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ie.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&ie.value.hasOwnProperty(o)?ie.value[o]:(ie.value[o]=d,d)}return ie.value.hasOwnProperty(o)?ie.value[o]:!1}catch{return ie.value.hasOwnProperty(o)?ie.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fl=o=>{_.disabled||!_.richText||(Ce.value=Ce.value===o?null:o,o==="askAi"&&(ct.value=null))},un=()=>{Ce.value=null,Ze.value=null},Pn=o=>{Nn("formatBlock",o),un()},Zl=o=>{if(!o||!v.value)return o;const l=Pe=>{let Be=Pe.nodeType===Node.TEXT_NODE?Pe.parentElement:Pe;for(;Be&&Be!==v.value;){const yt=Be.tagName;if(yt==="P"){const dn=Be.parentElement;if(dn===v.value||dn.tagName==="BLOCKQUOTE")return Be}if(yt==="BLOCKQUOTE")break;Be=Be.parentElement}return null},s=l(o.startContainer),i=l(o.endContainer);if(!s||!i)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Pe=>{const Be=Pe.tagName;if(Be==="P"){const yt=Pe.parentElement;if(yt===v.value||yt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Be==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),f=c.indexOf(i);if(m===-1||f===-1)return o;const k=Math.min(m,f),D=Math.max(m,f),R=c.slice(k,D+1);if(R.length===0)return o;const S=R[0],re=R[R.length-1],J=document.createRange();return J.setStartBefore(S),J.setEndAfter(re),J},Yn=()=>{if(_.disabled||!_.richText||!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&_l(l)&&(l=Zl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&_l(l)&&(s=Kt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,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 f=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:S=>S.parentNode===u&&S.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let D;for(;D=k.nextNode();)f.push(D);if(f.forEach(S=>{const re=document.createElement("p");S.parentNode.insertBefore(re,S),re.appendChild(S)}),u.querySelectorAll("p, div").forEach(S=>{S.textContent.trim()===""&&!S.querySelector("img")&&(S.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const S=document.createElement("p");S.innerHTML="<br>",u.appendChild(S)}}e.nextTick(()=>{s&&Ln(s),Zt(),Mt(),Qt()})},Bl=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=D=>{if(!D)return!1;const R=D.textContent||"",re=(D.innerHTML||"").trim();return R.trim()===""||re===""||re==="<br>"||re==="<br/>"||re==="<p></p>"||re==="<p><br></p>"||re==="<p><br/></p>"||re==="<p> </p>"||re==="<p><br> </p>"||re==="<div></div>"||re==="<div><br></div>"||re==="<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&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const D=i.lastChild;if(D.nodeType===1&&D.tagName==="BR")D.remove();else if(D.nodeType===3)if((D.textContent||"").trim()==="")D.remove();else break;else break}if(i.children.length>0)for(let D=i.children.length-1;D>=0;D--){const R=i.children[D];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=i.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(i.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(f,i.nextSibling):i.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const k=document.createRange();k.selectNodeContents(f),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{Zt(),Mt()})},Bn=()=>{if(!v.value){ke.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},Gl=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Kt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),tt.value="",mt.value=s,_e.value="",We.value=null,Me.value=!0,un(),e.nextTick(()=>{Z.value&&Z.value.focus()})},cl=()=>{if(!v.value)return;ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he();const o=window.getSelection();let l=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&We.value&&(l=We.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}We.value=null}else Nn("unlink");ke.value=!1,un(),e.nextTick(()=>{Mt(),Bn()})},Ul=()=>{_.disabled||!_.richText||v.value&&(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),Mt(),Qt()}))},kl=()=>{_.disabled||!_.richText||v.value&&(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),un(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),Mt(),Qt()}))},Ql=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Mn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const i=Ql(s);i!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},ul=()=>{if(_.disabled||!_.richText||!v.value)return;un(),v.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(()=>{Mn(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=Ql(c);u.appendChild(s),m!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Mn();const f=document.createRange();f.selectNodeContents(s),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{Mt(),Qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Mt(),Qt()})},xn=()=>{if(_.disabled||!_.richText||!v.value)return;un(),v.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(()=>{Mn(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Mn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Mt(),Qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Mt(),Qt()})},hn=e.ref(null),jn=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const fe=e.ref(null);e.ref("");const Ge=e.ref([]),qt=e.ref(!1),yn=e.ref(!1),Fn=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},On=()=>{if(!_.commentUser||_.disabled||!_.richText||!v.value)return;if(hn.value!==null){hn.value=null,h.value="",q.value="",fe.value=null,Ge.value=[],Tl(!0);return}un(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!_l(l))return;q.value=Fn(l)||"",fe.value=Kt();const s=l.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);y.value={top:`${m}px`,bottom:"auto"},hn.value=Date.now(),e.nextTick(()=>{if(h.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const f=i.querySelector(".dss-comment-overlay");if(f&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const D=i.getBoundingClientRect(),R=f.getBoundingClientRect(),S=k.getBoundingClientRect(),re=R.bottom-D.top,J=S.top-D.top,Pe=8;if(re>J-Pe){const Be=S.height;y.value={bottom:`${Be+Pe}px`,top:"auto"}}else y.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!h.value.trim())return;const o=h.value.trim(),l=new Date,s={text:o,selectionText:q.value,selectionRange:fe.value,commentId:hn.value,user:_.commentUser||null,createdAt:l.toISOString()};Ge.value=[...Ge.value,s],pe("comment-submitted",s),Vo(s),fe.value&&!Uo(fe.value)&&go(hn.value,fe.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Vt("sendComment")})},fo=(o,l)=>{if(!(!_.commentUser||!o.user||o.user.id!==_.commentUser.id)){if(Ge.value=Ge.value.filter((s,i)=>i!==l),hn.value!==null&&v.value){const s=String(hn.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Ge.value.length>0){const c=[],d=new Set;Ge.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?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(Ge.value.length))}else i&&Ge.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(pe("comment-deleted",{comment:o,index:l,commentId:hn.value}),_.comments&&Array.isArray(_.comments)){const s=_.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));pe("update:comments",s)}e.nextTick(()=>{Vt("deleteComment")})}},Uo=o=>{if(!o||!v.value)return!1;try{const l=vo(o);if(!l)return!1;const s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},vo=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.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--;)i.push(c.childNodes[m])}return d?l:null}catch{return null}},go=(o,l)=>{if(!(!o||!l||!v.value))try{const s=vo(l);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;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,f=s.endContainer,k=s.startOffset,D=s.endOffset,R=m.nodeType===3?m.parentNode:m,S=f.nodeType===3?f.parentNode:f;if(R===S&&k===0&&D===(f.nodeType===3?f.length:S.childNodes.length)&&(R.tagName==="P"||R.tagName==="DIV"||R.tagName==="H1"||R.tagName==="H2"||R.tagName==="H3"||R.tagName==="H4"||R.tagName==="H5"||R.tagName==="H6")){const J=s.extractContents();d.appendChild(J),s.insertNode(d)}else s.surroundContents(d)}catch{const f=s.extractContents();d.appendChild(f),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Vt("wrapSelectionWithCommentMarker"),Mt()})}catch{}},Vo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(_.comments)?[..._.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=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(i>=0){const d=l[i];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(f=>f.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)}qt.value=!0,pe("update:comments",l)},Xo=(o,l=[])=>{if(!_.commentUser||_.disabled||!_.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;un(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",fe.value=Kt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const D=m.getBoundingClientRect(),R=u.bottom-D.top,re=Math.max(R+8,0);y.value={top:`${re}px`,bottom:"auto"}}const f=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(f&&_.comments&&Array.isArray(_.comments)){const D=_.comments.find(R=>String(R.conversation_id)===String(f));if(D&&D.conversation&&Array.isArray(D.conversation)){const R=D.conversation.map(S=>({id:S.id||S.commentary_id,commentary_id:S.id||S.commentary_id,conversation_id:D.id||D.conversation_id,text:S.text,user:S.user,createdAt:S.created_at||S.createdAt,updated_at:S.updated_at||S.updatedAt}));k.push(...R)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((D,R)=>{const S=Pe=>{if(!Pe)return 0;const Be=new Date(Pe).getTime();return isNaN(Be)?0:Be},re=S(D.createdAt),J=S(R.createdAt);return re===J?0:re-J}),Ge.value=k,Tl(!0),hn.value=f||null,i&&(jn.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const D=x.value;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,D.focus()}if(m){const D=m.querySelector(".dss-comment-overlay");if(D){const R=m.querySelector(".dss-text-editor-footer");if(R){const S=m.getBoundingClientRect(),re=D.getBoundingClientRect(),J=R.getBoundingClientRect(),Pe=re.bottom-S.top,Be=J.top-S.top,yt=8;if(Pe>Be-yt){const dn=J.height;y.value={bottom:`${dn+yt}px`,top:"auto"}}}}}Vt("openCommentOverlayForSelector")})},ho=e.ref(null),Jl=e.ref(0),Yo=o=>{if(!(_.disabled||!_.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.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(()=>{Bl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;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,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let i=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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=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"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",S=c.textContent?.trim()||"";(!f||!k||R.length>S.length)&&(c=null,i=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(()=>{Mt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?xn():ul();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=f=>{if(!f)return!1;let k=f.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const D=f.parentElement;return D&&D!==v.value?m(D):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const k=f.closest("p, div");if(k&&k!==v.value){o.preventDefault(),o.stopPropagation();let D=null;const R=s.startOffset;R<u.length&&(D=u.splitText(R));const S=document.createElement("p");if(D?S.appendChild(D):S.innerHTML="<br>",u.length===0){const J=u.parentElement;J&&(J.removeChild(u),J.childNodes.length===0&&J.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(S,k.nextSibling):k.parentNode.appendChild(S);const re=document.createRange();D?re.setStart(D,0):re.setStart(S,0),re.collapse(!0),l.removeAllRanges(),l.addRange(re),e.nextTick(()=>{Mt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const m=J=>{if(!J)return!1;const Pe=J.textContent||"",yt=(J.innerHTML||"").trim(),dn=yt.replace(/<br\s*\/?>/gi,"").trim();return Pe.trim()===""||yt===""||dn===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},f=c.lastChild,k=f&&f.nodeType===1&&f.tagName==="BR",D=s.startContainer,R=D.nodeType===3?D.parentElement:D,S=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&S){o.preventDefault(),setTimeout(()=>{Bl()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-Jl.value;if(ho.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.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(),ul();return}}}}ho.value=" ",Jl.value=l}else ho.value=o.key}},yo=o=>{if(_.disabled||!_.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,"")),he();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let m=i.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 f=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(R=>{if(k>0){const S=f.createElement("p");S.innerHTML=R.innerHTML,R.parentNode.replaceChild(S,R)}else k++}),c){const R=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],S=Array.from(f.body.children).filter(re=>R.includes(re.tagName));if(S.length===1){const re=S[0].tagName,J=c.tagName,Pe=c.textContent.trim()===""&&!c.querySelector("img");let Be=!1;if(["H1","H2","H3","H4","H5","H6"].includes(J)?Be=!0:Pe||(re===J||re==="P")&&(Be=!0),Be)return S[0].innerHTML.trim()}}return f.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);Mt()},Tn=o=>{if(Ce.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&un()}if(Je.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Il()}if(ct.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&bl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ze.value=null),!v.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);G.value=!i.collapsed&&_l(i)}else G.value=!1}if(hn.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,f=o.clientY;i=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(hn.value=null,h.value="",q.value="",fe.value=null,Ge.value=[],Tl(!0))}},O=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),xt.value&&(clearTimeout(xt.value),xt.value=null),Ze.value=l},En=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}xt.value&&clearTimeout(xt.value),xt.value=setTimeout(()=>{Ze.value=null,xt.value=null},150)},Kn=o=>{Ze.value=null};let Xl=0;const Sn=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,i)=>{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(k=>k.tagName==="BUTTON"||k.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-${++Xl}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let f=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(D=>{(D.tagName==="BUTTON"||D.tagName==="DIV")&&!D.classList.contains("dss-toolbar-dropdown-item")&&D.classList.add("dss-toolbar-dropdown-item")}))}})},wn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Sn(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=f=>{const k=c.getAttribute("data-submenu-id");k&&O(f,k)},m=En;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=k=>{const D=c.getAttribute("data-submenu-id");D&&O(k,D)},m=En;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Kn)})})})};let Yt=null;const nn=()=>{if(Ze.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ze.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ze.value}"]`);o&&l&&qn(o,l)}if(Je.value&&Qt(),_.richText){if(Yt!==null)return;Yt=setTimeout(()=>{Yt=null,Vt("handleWindowResize")},150)}},Gn=()=>{if(!_.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Ml=()=>{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 i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.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",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{sn.value?le():dt(),N.value?at():Wt()})}),e.nextTick(()=>{Ml()}),_.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Tn),window.addEventListener("resize",nn);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,nn()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,nn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{wn(),Gn()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!_.disabled&&m.preventDefault();const D=f.closest(".dss-image-no-alt-icon"),R=f.closest(".dss-image-wrapper");if(D||R&&f===R){m.preventDefault(),m.stopPropagation();const S=window.getSelection(),re=document.createRange();re.setStartAfter(R),re.collapse(!0),S.removeAllRanges(),S.addRange(re)}else R&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const S=window.getSelection();if(S.rangeCount>0){const J=S.getRangeAt(0).commonAncestorContainer,Pe=J.nodeType===3?J.parentElement:J;if(R.contains(Pe)&&Pe!==R.querySelector("img")){const Be=document.createRange();Be.setStartAfter(R),Be.collapse(!0),S.removeAllRanges(),S.addRange(Be)}}else{const re=document.createRange();re.setStartAfter(R),re.collapse(!0),S.addRange(re)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,k=f.closest(".dss-image-no-alt-icon"),D=f.closest(".dss-image-wrapper");if(k||D&&f.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),S=document.createRange();D&&(S.setStartAfter(D),S.collapse(!0),R.removeAllRanges(),R.addRange(S))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const R=k.getAttribute("alt")||k.alt||"";if(R){const S=k.getAttribute("src")||k.src||"",re=S.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),J=R===S||R===re;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||J||J)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Ue()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,k=f.tagName==="IMG"?f:f.closest("img"),D=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(nt.value=D||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{nt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{nt.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!nt.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=nt.value,k=f.classList?.contains("dss-image-wrapper"),D=k?f.querySelector("img"):f,R=k?f:D?.closest(".dss-image-wrapper");if(!D||!v.value.contains(D)){nt.value=null;return}let S=null;const re=m.clientX,J=m.clientY;if(document.caretRangeFromPoint)S=document.caretRangeFromPoint(re,J);else{const an=window.getSelection();an.rangeCount>0?S=an.getRangeAt(0).cloneRange():(S=document.createRange(),S.selectNodeContents(v.value),S.collapse(!1))}if(!S){nt.value=null;return}const Pe=S.commonAncestorContainer,Be=Pe.nodeType===3?Pe.parentElement:Pe;if(Be?.closest(".dss-image-wrapper")===R||R&&R.contains(Be)){nt.value=null;return}if(R&&(Be===R||R.contains(Be))){nt.value=null;return}const dn=D.getAttribute("src");let mn=null;R?mn=R.cloneNode(!0):mn=D.cloneNode(!0);try{let an=S.startContainer;if(an.nodeType===3&&(an=an.parentElement),R&&(an===R||R.contains(an))){const fn=document.createRange();fn.setStartAfter(R),fn.collapse(!0),S=fn}S.insertNode(mn);const Ut=document.createRange();Ut.setStartAfter(mn),Ut.collapse(!0);const kn=window.getSelection();kn.removeAllRanges(),kn.addRange(Ut)}catch{if(v.value.childNodes.length===0){const Ut=document.createElement("p");Ut.appendChild(mn),v.value.appendChild(Ut)}else{const Ut=v.value.lastChild;if(Ut&&Ut.nodeType===1)Ut.appendChild(mn);else{const kn=document.createElement("p");kn.appendChild(mn),v.value.appendChild(kn)}}}R?R.remove():D.remove(),nt.value=null,e.nextTick(()=>{const an=v.value.querySelectorAll("img");let Ut=!1;an.forEach(kn=>{if(kn.getAttribute("src")===dn)if(!Ut)Ut=!0;else{const fn=kn.closest(".dss-image-wrapper");fn?fn.remove():kn.remove()}}),Ue(),Mt()})}),v.value.addEventListener("dragend",m=>{nt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const D=k.querySelectorAll&&k.querySelectorAll("img");D&&D.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Ue(),Gn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Gn()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),_.modelValue){const m=zn(_.modelValue);v.value.innerHTML=m,Rn()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=_.title||"",k=_.description||"";Lt.value=m,oe.value=f,Y.value=k,j.value=f,de.value=k,Mn(),Ue(),ol(),it(),bo(),xl()}),Bn(),Zt(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Tn),window.removeEventListener("resize",nn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Yt!==null&&(clearTimeout(Yt),Yt=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),qe.value&&clearTimeout(qe.value),xt.value&&clearTimeout(xt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),De.value&&De.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),lt.value!==null&&(clearTimeout(lt.value),lt.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),Tl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:s,handler:i}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Pt=o=>{const l=o.target,s=l.closest("a");if(s&&!_.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&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(i.contains(m)&&m!==i.querySelector("img")){const f=document.createRange();f.setStartAfter(i),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}Ue(),Bn(),Zt(),Qt(),it()}):e.nextTick(()=>{Ue(),Bn(),Zt(),Qt(),it()})},Dt=()=>{gt();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);G.value=!s.collapsed&&_l(s),!s.collapsed&&b.value&&(b.value=null)}else G.value=!1;if(Ue(),Bn(),Zt(),Qt(),it(),o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),G.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.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 f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}ie.value[s]=m}else{const d=document.queryCommandState(s);ie.value[s]=d}}}catch{}})},it=()=>{if(!_.richText||_.disabled||!v.value){B.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){B.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){B.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){B.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?B.value=d:B.value="p"}catch{B.value="p"}},Zt=()=>{if(!v.value){Ye.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}Ye.value=l}catch{Ye.value=!1}},_l=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?v.value.contains(s):!1},Il=()=>{Je.value=!1},Qt=()=>{if(!_.floatingToolbar||!_.richText||_.disabled){Je.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Je.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!_l(l)){Je.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Je.value=!1;return}const i=v.value;if(!i){Je.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Je.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let f=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let D=0;et.value&&(D=et.value.getBoundingClientRect().width);const R=(D||320)/2;let S=c.left+R,re=c.right-R;if(re<S){const J=c.left+c.width/2;S=J,re=J}if(k>0){const J=R+u,Pe=k-R-u;if(S=Math.max(S,J),re=Math.min(re,Pe),re<S){const Be=k/2;S=Be,re=Be}}f<S?f=S:f>re&&(f=re),we.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},Je.value=!0},eo=o=>{_.disabled||!_.richText||(ct.value=ct.value===o?null:o,o==="askAi"&&(Ce.value=null))},bl=()=>{ct.value=null,Ze.value=null},dl=o=>{Pn(o),bl()};let al=null,zl=null,wl=null,Pl=null;const $l=o=>{if(_.disabled||!_.richText){In(),Yl();return}const l=o.target,s=l.closest("a"),i=l.closest("img");if(al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),s&&s!==zl){Yl(),zl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,me.value=c,X.value=!0,ue.value=!0,Bo(s)}else!s&&zl?(zl=null,al=setTimeout(()=>{ue.value||In()},150)):s&&s===zl&&Bo(s);if(i&&i!==Pl){In(),Pl=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),kt.value=i,ye.value=c.trim()||V("textEditor.image.noAlt"),U.value=!0,K.value=!0,Ol(i)}else!i&&Pl?(Pl=null,wl=setTimeout(()=>{K.value||Yl()},150)):i&&i===Pl&&Ol(i)},No=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(zl=null,Pl=null,al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),In(),Yl())},In=()=>{ue.value=!1,setTimeout(()=>{ue.value||(X.value=!1,me.value="",Me.value||(We.value=null))},100)},Bo=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Yl=()=>{K.value=!1,setTimeout(()=>{K.value||(U.value=!1,ye.value="",vt.value||(kt.value=null))},100)},Ol=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;P.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},jo=()=>{if(!me.value||!We.value)return;let l=We.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Mo=()=>{if(We.value){const o=We.value.textContent||"",l=We.value.getAttribute("href")||"",s=We.value;tt.value=l,mt.value=o,_e.value=o,ue.value=!1,X.value=!1,me.value="",We.value=s,Me.value=!0}else if(ke.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,mt.value=c,_e.value=c,We.value=i,Me.value=!0}}}else{Ee.value=Kt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),tt.value="",mt.value=l,_e.value="",We.value=null,Me.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},to=()=>{Me.value=!1,tt.value="",mt.value="",_e.value="",We.value=null,Ee.value=null},no=()=>{if(!tt.value.trim()){to();return}if(ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he(),mt.value.trim()||(mt.value=tt.value.trim()),We.value&&v.value&&v.value.contains(We.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=We.value;if(l.setAttribute("href",tt.value.trim()),mt.value.trim()!==_e.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=mt.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),Mt()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&Ln(Ee.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const i=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const s=l.startContainer,i=s.nodeType===3,c=i&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
102
- `){const R=document.createTextNode(" ");l.insertNode(R),l.setStartAfter(R)}}l.insertNode(d);const f=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(f),l.setStartAfter(f),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(i&&l.startOffset>0){const m=s.textContent.substring(0,l.startOffset),f=m[m.length-1];if(f&&f!==" "&&f!==" "&&f!==`
103
- `){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Mt()}e.nextTick(()=>{Bn(),to()})},lo=()=>{if(!v.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Kt());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,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],k=f.textContent;s.lastIndex=0;const D=[...k.matchAll(s)];if(D.length===0)continue;const R=D.filter(J=>{const Pe=J[0],Be=J.index;if(Be>0&&k[Be-1]==="@"||Be+Pe.length<k.length&&k[Be+Pe.length]==="@")return!1;const yt=f.parentElement;return!(yt&&yt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const J=R[0][0],Pe=J.startsWith("http://")||J.startsWith("https://")?J:`https://${J}`,Be=document.createElement("a");Be.href=Pe,Be.textContent=J,Be.style.color="#60afdf",Be.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(Be,f),u=!0);continue}let S=0;const re=document.createDocumentFragment();if(R.forEach(J=>{const Pe=J.index,Be=J[0];if(Pe>S){const mn=k.substring(S,Pe);mn&&re.appendChild(document.createTextNode(mn))}const yt=Be.startsWith("http://")||Be.startsWith("https://")?Be:`https://${Be}`,dn=document.createElement("a");dn.href=yt,dn.textContent=Be,dn.style.color="#60afdf",dn.style.textDecoration="underline",re.appendChild(dn),S=Pe+Be.length}),S<k.length){const J=k.substring(S);J&&re.appendChild(document.createTextNode(J))}f.parentNode&&re.childNodes.length>0&&(f.parentNode.replaceChild(re,f),u=!0)}u&&l&&e.nextTick(()=>{Ln(l),Bn()})},Ko=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.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 i;for(;i=l.nextNode();)s.push(i);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 f=0;const k=document.createDocumentFragment();m.forEach(D=>{const R=D.index,S=D[0].startsWith("<u>")?"u":"ins",re=D[1]||D[2]||"";R>f&&k.appendChild(document.createTextNode(u.substring(f,R)));const J=document.createElement(S);J.textContent=re,k.appendChild(J),f=R+D[0].length}),f<u.length&&k.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},_o=o=>{if(!v.value||Q.value)return;if(!o){Ko();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let mn="",an=0,Ut=!1;const kn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:sl=>sl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let fn=0;for(;kn.nextNode();){const sl=kn.currentNode,El=sl.textContent||"",pl=fn;if(fn+=El.length,sl===i.startContainer){mn+=El.substring(0,i.startOffset),an=pl+i.startOffset,Ut=!0;break}mn+=El}return Ut||(an=mn.length),{textBeforeCursor:mn,cursorCharOffset:an}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],D=m[1],R=u.length-k.length,re=(mn=>{let an=0;const Ut=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:fn=>fn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let kn;for(;kn=Ut.nextNode();){const fn=(kn.textContent||"").length;if(an+fn>=mn)return{node:kn,offset:mn-an};an+=fn}return null})(R);if(!re)return;const J=document.createRange();J.setStart(re.node,re.offset),J.setEnd(i.endContainer,i.endOffset);const Pe=document.createElement(f);Pe.textContent=D,J.deleteContents(),J.insertNode(Pe);const Be=window.getSelection(),yt=document.createRange();yt.setStartAfter(Pe),yt.collapse(!0),Be.removeAllRanges(),Be.addRange(yt);const dn=Kt();e.nextTick(()=>{Mt(),dn&&Ln(dn)})},Qn=()=>{v.value&&(tn.value=Kt(),ut.value="",It.value="",Re.value="",bt.value="",wt.value="",Ft.value=null,kt.value=null,Se.value="upload",vt.value=!0,un(),e.nextTick(()=>{Jt.value&&Jt.value.focus(),pt.value&&(pt.value.value="")}))},Jn=o=>{const l=o.target?.files?.[0];if(!l){Ft.value=null,It.value="";return}Ft.value=l;const s=new FileReader;s.onload=i=>{It.value=i.target?.result||""},s.readAsDataURL(l)},ko=()=>{pt.value&&pt.value.click()},oo=()=>{bt.value&&(wt.value="")},Wn=()=>{wt.value&&(bt.value="")},ao=()=>{let o=kt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";kt.value=o,ut.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Re.value=s,It.value="",Se.value="url"):(It.value=s,Re.value="",Se.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";bt.value=c.endsWith("px")?c.replace("px",""):c,wt.value=d.endsWith("px")?d.replace("px",""):d,tn.value=null}else{Qn();return}vt.value=!0,K.value=!1,U.value=!1,e.nextTick(()=>{Se.value==="url"&&jt.value?(jt.value.focus(),jt.value.select()):Jt.value&&(Jt.value.focus(),Jt.value.select()),pt.value&&(pt.value.value="")})},jl=()=>{vt.value=!1,ut.value="",It.value="",Re.value="",bt.value="",wt.value="",Ft.value=null,kt.value=null,tn.value=null,Se.value="upload"},ml=()=>{const o=(ut.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),ze.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),he(),ze.value=!1):he();const s=Se.value==="url"?Re.value.trim():It.value;if(kt.value&&v.value&&v.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),bt.value?(kt.value.style.width=`${bt.value}px`,kt.value.setAttribute("width",bt.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),wt.value?(kt.value.style.height=`${wt.value}px`,kt.value.setAttribute("height",wt.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),i.addRange(c)}Mt()}else{if(!s){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),jl();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(tn.value&&(Ln(tn.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){jl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=s,f.setAttribute("alt",o),f.setAttribute("data-alt",o),bt.value&&(f.style.width=`${bt.value}px`,f.setAttribute("width",bt.value)),wt.value&&(f.style.height=`${wt.value}px`,f.setAttribute("height",wt.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const R=document.createElement("p");v.value.appendChild(R),R.appendChild(f)}else{const R=v.value.lastChild;if(R&&R.nodeType===1)R.appendChild(f);else{const S=document.createElement("p");v.value.appendChild(S),S.appendChild(f)}}const D=document.createRange();D.setStartAfter(f),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}kt.value=f,Mt()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),Bn(),Qt(),jl()})};e.watch(()=>_.modelValue,o=>{if(_.richText&&v.value&&!Q.value){const l=zn(o||""),i=v.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=Kt();v.value.innerHTML=l,e.nextTick(()=>{Rn();const u=v.value.innerHTML||"",m=_.title||"",f=_.description||"";Lt.value=u,oe.value=m,Y.value=f,$t.value=u,j.value=m,de.value=f,Ke.value=[],zt.value=[],qe.value&&(clearTimeout(qe.value),qe.value=null),ze.value=!1,d&&Ln(d),Mn(),Ue(),ol(),Bn(),Qt(),it(),Vt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>_.richText,o=>{o?(Qt(),e.nextTick(()=>{bo()})):(Il(),ae.value=[],De.value&&(De.value.disconnect(),De.value=null)),it()}),e.watch(()=>_.floatingToolbar,o=>{o?Qt():Il()}),e.watch(()=>_.disabled,o=>{o&&Il(),it()}),e.watch(()=>_.description,()=>{e.nextTick(()=>{N.value?at():Wt()})}),e.watch(()=>_.title,()=>{e.nextTick(()=>{sn.value?le():dt()})}),e.watch(()=>_.customToolbarSlots,()=>{e.nextTick(()=>{Gn()})},{deep:!0}),e.watch(()=>_.comments,(o,l)=>{if(_.commentUser){if(qt.value){qt.value=!1;return}yn.value||_.richText&&v.value&&e.nextTick(()=>{xl()})}},{deep:!0,immediate:!1});const xl=()=>{if(_.commentUser&&!yn.value&&!(!_.comments||!Array.isArray(_.comments)||_.comments.length===0)&&!(!_.richText||!v.value)){yn.value=!0;try{const o=new Set,l=_.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=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 f=String(m);if(d.has(f))return;const k=v.value.querySelector(`[data-comment="${f}"]`);if(k){Kl(k,u),d.add(f);return}try{const D=Dn(u.selection_range,u.selection_text);if(D&&!D.collapsed){const R=D.commonAncestorContainer,S=R.nodeType===3?R.parentElement:R;if(S){const Pe=S.closest("[data-comment], [data-fake-comment]");if(Pe){const Be=Pe.getAttribute("data-comment")||Pe.getAttribute("data-fake-comment");if(String(Be)===String(m)){Pe.setAttribute("data-comment",f),Pe.removeAttribute("data-fake-comment"),Kl(Pe,u),d.add(f);return}else return}}const re=v.value.querySelector(`[data-comment="${f}"]`);if(re){Kl(re,u),d.add(f);return}const J=document.createElement("span");J.setAttribute("data-comment",f),Kl(J,u);try{D.surroundContents(J),c++,d.add(f)}catch{try{const Be=document.createRange();Be.setStart(D.startContainer,D.startOffset),Be.setEnd(D.endContainer,D.endOffset),Co(Be),Be.surroundContents(J),c++,d.add(f)}catch{try{const yt=D.extractContents();J.appendChild(yt),D.insertNode(J),c++,d.add(f)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{Vt("restoreCommentsFromModel"),Mt(),yn.value=!1})}catch{yn.value=!1}}},Co=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,i=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(i===0&&!$o(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&i>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&&!Ll(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},$o=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},Ll=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},Dn=(o,l)=>{if(!o||!v.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Co(s):null}}catch{return null}return null},Kl=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],i=new Set,c=[],d=m=>{m&&m.id&&!i.has(m.id)&&(i.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")},Vt=(o="unknown")=>{if(!_.commentUser||!_.richText||!v.value){ae.value=[];return}Date.now()-Et.value<Bt&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,Et.value=Date.now(),Ie.value)return;Ie.value=!0;const s={},i=v.value;if(!i){Ie.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ie.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(S=>{const re=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");re&&S.tagName==="SPAN"&&(m.has(re)||(u.push(S),m.add(re)))}),d.forEach(S=>{const re=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");!re||m.has(re)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(S.tagName)?S.querySelector(`span[data-comment="${re}"], span[data-fake-comment="${re}"]`)||(u.push(S),m.add(re)):S.tagName!=="SPAN"&&(u.push(S),m.add(re)))});const f=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((S,re)=>{let J=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");if(!J)return;if(typeof J=="string"&&J.startsWith("comment-")){const fl=S.textContent?.trim(),rl=_.comments?.find(el=>(typeof el.conversation_id=="string"&&el.conversation_id.startsWith("comment-")?null:el.conversation_id)&&el.selection_text?.trim()===fl);rl?(J=String(rl.conversation_id),S.setAttribute("data-comment",J),S.removeAttribute("data-fake-comment")):(J=String(Date.now()),S.setAttribute("data-comment",J),S.removeAttribute("data-fake-comment"))}const Pe=S.getBoundingClientRect(),Be=window.getComputedStyle(S),yt=parseFloat(Be.lineHeight)||parseFloat(Be.fontSize)*1.2,an=Pe.top-k.top+yt/2-15,kn=k.top-f.top+an;let fn=null,sl=null,El=0;const pl=[],To=new Set;if(J&&_.comments){const fl=_.comments.find(rl=>String(rl.conversation_id||rl.id)===String(J));if(fl){const rl=fl.conversation||[];rl.length>0?(rl.forEach(el=>{el.user&&el.user.id&&!To.has(el.user.id)&&(To.add(el.user.id),pl.push(el.user))}),El=rl.length):(El=0,fn=null,sl=null),pl.length>0?fn=pl[0]:fn=null,pl.length>1?sl=pl[1]:sl=null}}const wo=Pe.top+yt/2-15,Ao=wo+30,Do=5,Ho=Ao>k.top+Do&&wo<k.bottom-Do?1:0;ae.value.find(fl=>fl.id===J);let so=S;if(!so&&J&&v.value){const fl=String(J);so=v.value.querySelector(`[data-comment="${fl}"], [data-fake-comment="${fl}"]`)}const Dl=pl.length;s[J]?(s[J].top=kn,s[J].opacity=Ho,s[J].element=so,s[J].firstUser=fn,s[J].secondUser=sl,s[J].totalCount=El,s[J].uniqueUserCount=Dl):s[J]={id:J,top:kn,opacity:Ho,element:so,firstUser:fn,secondUser:sl,totalCount:El,uniqueUserCount:Dl}});const D=Object.values(s).map(S=>{const re=Math.max(0,(S.uniqueUserCount??0)-2);if(!S.element&&S.id&&v.value){const Pe=String(S.id);S.element=v.value.querySelector(`[data-comment="${Pe}"], [data-fake-comment="${Pe}"]`)}return{...S,firstUser:S.firstUser||null,secondUser:S.secondUser||null,totalCount:S.totalCount,additionalCount:re}});(ae.value.length!==D.length||D.some((S,re)=>{const J=ae.value[re];if(!J)return!0;const Pe=(J.firstUser?.id||null)!==(S.firstUser?.id||null),Be=(J.secondUser?.id||null)!==(S.secondUser?.id||null);return J.id!==S.id||Math.abs(J.top-S.top)>1||J.opacity!==S.opacity||J.totalCount!==S.totalCount||J.additionalCount!==S.additionalCount||Pe||Be||J.element!==S.element}))&&(ae.value=D),Ie.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const s=String(o.id);l=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(Tl(),jn.value=l,l.classList.add("editor-comment-highlighted"))},Tl=(o=!1)=>{!o&&hn.value!==null&&jn.value&&(jn.value.getAttribute("data-comment")||jn.value.getAttribute("data-fake-comment"))===hn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),jn.value&&(jn.value.classList.remove("editor-comment-highlighted"),jn.value=null))},ln=o=>{if(!o||!o.element)return;Tl(!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})},Al=()=>{Tl()},bo=()=>{!_.richText||!v.value||(De.value&&De.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),De.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Vt("MutationObserver")})},200))}),De.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Vt("setupCommentMarkersObserver-initial"))},qn=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=s.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ze.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);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(()=>{qn(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(()=>{wn()}):(Ze.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 i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>_.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:Xo,updateCommentMarkers:Vt,restoreCommentsFromModel:xl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":rt.value},At.value]]),style:e.normalizeStyle(Nt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:se,title:e.unref(V)("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,qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:on,title:e.unref(V)("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,Zu),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Uu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Fl("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Yu)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ju)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ku)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gu)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qu)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ju)):(e.openBlock(),e.createElementBlock("svg",ed,[...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,Xu),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=>Pn("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,td),e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Pn("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,nd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Pn("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ld),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Pn("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,od),e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Pn("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ad),e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Pn("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,sd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Pn("<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(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("bold")}]),onClick:l[9]||(l[9]=s=>Nn("bold")),title:e.unref(V)("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,rd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("italic")}]),onClick:l[10]||(l[10]=s=>Nn("italic")),title:e.unref(V)("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,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[11]||(l[11]=s=>Nn("underline")),title:e.unref(V)("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,cd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Yn,title:e.unref(V)("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,ud),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:cl,title:e.unref(V)("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,md)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Gl,title:e.unref(V)("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,dd)),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":Gt("insertUnorderedList")}]),onClick:Ul,title:e.unref(V)("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,pd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertOrderedList")}]),onClick:kl,title:e.unref(V)("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,fd),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qn,title:e.unref(V)("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,vd),rt.value&&G.value?(e.openBlock(),e.createElementBlock("div",gd)):e.createCommentVNode("",!0),rt.value&&G.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:On},[...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,hd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",yd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Fl("askAi")),title:e.unref(V)("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",bd,e.toDisplayString(e.unref(V)("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",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&i<E.customToolbarSlots.length-1&&Vl(i)?(e.openBlock(),e.createElementBlock("div",Ed)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Ce.value==="paragraph"||Ce.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:un})):e.createCommentVNode("",!0),e.createVNode(na,{showModal:Me.value,width:"500px",height:"55vh",onCloseModal:to},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Sd,[e.createElementVNode("div",Vd,[e.createElementVNode("label",Nd,e.toDisplayString(e.unref(V)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ae,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bd),[[e.vModelText,mt.value]])]),e.createElementVNode("div",Md,[e.createElementVNode("label",_d,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,$d),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:to},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:no},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(na,{showModal:vt.value,width:"500px",height:"80vh",onCloseModal:jl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Se.value==="upload"}]),onClick:l[17]||(l[17]=s=>Se.value="upload")},e.toDisplayString(e.unref(V)("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":Se.value==="url"}]),onClick:l[18]||(l[18]=s=>Se.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Se.value==="upload"?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",Ad,[e.createElementVNode("div",Dd,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hd,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),vl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ko},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Rd),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:pt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Jn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:pt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Jn},null,544))]),e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Jt,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,zd),[[e.vModelText,ut.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,Wd),[[e.vModelText,bt.value]])]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:Wn},null,40,Ud),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0),Se.value==="url"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("label",Kd,e.toDisplayString(e.unref(V)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:jt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Re.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ml,["enter"])},null,40,Gd),[[e.vModelText,Re.value]])]),e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,e1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",t1,[e.createElementVNode("label",n1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,l1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",o1,[e.createElementVNode("label",a1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:Wn},null,40,s1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:jl},e.toDisplayString(e.unref(V)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ml},e.toDisplayString(e.unref(V)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Un.value&&sn.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.title")),1),e.createElementVNode("div",r1,[sn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",i1,[E.title?(e.openBlock(),e.createElementBlock("span",c1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(il.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:be,value:E.title,onInput:ot,onFocus:Te,onBlur:ft,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sn.value}]),placeholder:il.value,disabled:E.disabled,rows:"1"},null,42,d1)])],2)):e.createCommentVNode("",!0),E.showTitle&&Un.value&&sn.value?(e.openBlock(),e.createElementBlock("div",m1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Xn.value&&N.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.description")),1),e.createElementVNode("div",p1,[N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",f1,[E.description?(e.openBlock(),e.createElementBlock("span",v1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",g1,e.toDisplayString(_n.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:E.description,onInput:gn,onFocus:vn,onBlur:bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!N.value}]),placeholder:_n.value,disabled:E.disabled,rows:"1"},null,42,h1)])],2)):e.createCommentVNode("",!0),E.showDescription&&Xn.value&&N.value?(e.openBlock(),e.createElementBlock("div",y1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":hn.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:i=>Lo(s),onMouseleave:Al},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,b1)):(e.openBlock(),e.createElementBlock("span",w1,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(i=>ln(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,E1)):(e.openBlock(),e.createElementBlock("span",S1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,x1)):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(i=>ln(s),["stop"])},[e.createElementVNode("span",N1,"+"+e.toDisplayString(s.additionalCount),1)],12,V1)):e.createCommentVNode("",!0)],46,k1))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(Vn.value),onInput:Mt,onBlur:ht,onClick:Pt,onMouseup:Dt,onKeyup:Dt,onKeydown:Yo,onPaste:yo,onMousemove:$l,onMouseleave:No},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[rt.value&&hn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||Ge.value.length>0?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,R1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",I1,[e.createElementVNode("div",z1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,P1)):(e.openBlock(),e.createElementBlock("span",O1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",U1,e.toDisplayString(A(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":z(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),_.commentUser&&s.user&&s.user.id===_.commentUser.id&&!z(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(s,i),["stop"]),title:e.unref(V)("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,X1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":l[26]||(l[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,j1),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["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",K1,[e.createElementVNode("div",G1,[e.createElementVNode("span",Q1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",J1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("textarea",{value:E.modelValue,onInput:L,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:gl.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(rn.value)},null,46,M1),e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",T1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:l[28]||(l[28]=s=>ue.value=!0),onMouseleave:In},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(jo,["stop"]),title:me.value},e.toDisplayString(me.value),9,em),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",nm,[...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,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&ye.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(P.value),onMouseenter:l[29]||(l[29]=s=>K.value=!0),onMouseleave:Yl},[e.createElementVNode("div",lm,[ye.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",om,[...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:ye.value},e.toDisplayString(ye.value),9,am)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ao,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",rm,[...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,sm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Je.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:et,class:"dss-floating-toolbar",style:e.normalizeStyle(we.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",im,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(se,["stop"]),title:e.unref(V)("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,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:e.withModifiers(on,["stop"]),title:e.unref(V)("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,um),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",dm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>eo("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,pm)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,fm)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,vm)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,gm)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,hm)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ym)):(e.openBlock(),e.createElementBlock("svg",km,[...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,mm),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=>dl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>dl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>dl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>dl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>dl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>dl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>dl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("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":Gt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Nn("bold"),["stop"])),title:e.unref(V)("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":Gt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Nn("italic"),["stop"])),title:e.unref(V)("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,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Nn("underline"),["stop"])),title:e.unref(V)("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,wm),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":Ye.value}]),onClick:e.withModifiers(Yn,["stop"]),title:e.unref(V)("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,xm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(cl,["stop"]),title:e.unref(V)("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,Sm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Gl,["stop"]),title:e.unref(V)("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,Em)),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":Gt("insertUnorderedList")}]),onClick:e.withModifiers(Ul,["stop"]),title:e.unref(V)("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":Gt("insertOrderedList")}]),onClick:e.withModifiers(kl,["stop"]),title:e.unref(V)("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,Nm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qn,["stop"]),title:e.unref(V)("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,Bm),rt.value?(e.openBlock(),e.createElementBlock("div",Mm)):e.createCommentVNode("",!0),rt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(On,["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,_m)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",$m)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>eo("askAi"),["stop"])),title:e.unref(V)("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",Am,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,Tm),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)]),An.value?(e.openBlock(),e.createElementBlock("div",Dm,[E.askAi&&An.value?(e.openBlock(),e.createElementBlock("div",Hm)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)&&hl(s)?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&hl(s)&&i<E.customToolbarSlots.length-1&&Rl(i)?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Pm={class:"dss-color-picker__section-title"},Om={class:"dss-color-picker__presets-row"},Wm=["title","onClick"],qm={key:1,class:"dss-color-picker__section"},Zm={class:"dss-color-picker__presets-row"},Um=["title","onClick"],Xm={key:2,class:"dss-color-picker__section"},Ym={class:"dss-color-picker__section-header"},jm={class:"dss-color-picker__presets-row"},Km=["title","onClick"],Gm=["onClick"],Qm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Jm=["title","onClick"],e2={class:"dss-color-picker__input-row"},t2=["value"],n2={__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(E,{emit:ne}){function $(oe){const Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(oe);if(!Y)return{h:0,s:0,l:50};const j=parseInt(Y[1],16)/255,de=parseInt(Y[2],16)/255,be=parseInt(Y[3],16)/255,je=Math.max(j,de,be),Tt=Math.min(j,de,be);let Xt=0,nt=0;const sn=(je+Tt)/2;if(je!==Tt){const N=je-Tt;switch(nt=sn>.5?N/(2-je-Tt):N/(je+Tt),je){case j:Xt=((de-be)/N+(de<be?6:0))/6;break;case de:Xt=((be-j)/N+2)/6;break;case be:Xt=((j-de)/N+4)/6;break}}return{h:Xt*360,s:nt*100,l:sn*100}}function V(oe,Y,j){Y/=100,j/=100;const de=Y*Math.min(j,1-j),be=je=>{const Tt=(je+oe/30)%12,Xt=j-de*Math.max(Math.min(Tt-3,9-Tt,1),-1);return Math.round(255*Xt).toString(16).padStart(2,"0")};return`#${be(0)}${be(8)}${be(4)}`}function ce(oe){const Y=oe.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Y)return null;let j=Y[1];return j.length===3&&(j=j.split("").map(de=>de+de).join("")),"#"+j}function I(oe){const Y=oe.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Y)return null;const j=Math.max(0,Math.min(255,Number.parseInt(Y[1],10))),de=Math.max(0,Math.min(255,Number.parseInt(Y[2],10))),be=Math.max(0,Math.min(255,Number.parseInt(Y[3],10)));return`#${j.toString(16).padStart(2,"0")}${de.toString(16).padStart(2,"0")}${be.toString(16).padStart(2,"0")}`}function _(oe){if(typeof oe!="string")return null;const Y=oe.trim();return ce(Y)||I(Y)}function pe(oe,Y,j){Y/=100,j/=100;const de=j+Y*Math.min(j,1-j),be=de===0?0:2-2*j/de;return{h:oe,s:be*100,v:de*100}}function st(oe,Y,j){Y/=100,j/=100;const de=j*(1-Y/2),be=de===0||de===1?0:(j-de)/Math.min(de,1-de);return{h:oe,s:be*100,l:de*100}}const te=E,v=ne,Ce=e.ref(!1),ke=e.ref(!1),Q=e.ref(!1),X=e.ref(-1),me=e.ref(-1),F=e.ref(null),ue=e.ref(null),Me=e.ref(null),tt=e.ref(null),mt=e.ref({top:0,left:0}),Z=e.ref($(te.modelValue||"#b8a5de")),Ae=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),We=e.computed(()=>!te.disableCustomColors),Ee=e.computed(()=>Ae.value?0:te.initialPresetCount!=null?te.initialPresetCount:me.value<0?null:me.value),_e=e.computed(()=>{const oe=Ee.value;return oe==null?!0:Math.max(0,te.presetColors.length-oe)<te.max}),Ye=e.computed(()=>!!(ke.value||X.value>=0||!ie.value&&te.presetColors.length===0));e.computed(()=>{const oe=Ee.value;return oe!=null&&te.presetColors.length>oe});const ie=e.computed(()=>Ae.value||Ee.value!=null),Je=e.computed(()=>{const oe=Ee.value;return oe==null?[]:te.presetColors.slice(0,oe)}),we=e.computed(()=>{const oe=Ee.value;return oe==null?[]:te.presetColors.slice(oe)});function et(oe){const Y=Ee.value;return Y!=null?Y+oe:-1}function ct(oe){const Y=Ee.value;return Y!=null&&oe>=Y}function vt(oe){ct(oe)&&(X.value=oe,Z.value=$(te.presetColors[oe]),ke.value=!0,e.nextTick(()=>tt.value?.focus()))}function ut(oe){if(!ct(oe))return;const Y=te.presetColors.filter((be,je)=>je!==oe);v("update:presetColors",Y);const j=ce(te.modelValue),de=ce(te.presetColors[oe]);if(j&&de&&j.toLowerCase()===de.toLowerCase()){const be=Y[Math.max(0,oe-1)]||Y[0];be&&v("update:modelValue",be)}}function Ft(){Q.value=!Q.value,Q.value||(X.value=-1,ke.value=!1)}function It(){if(!We.value||X.value<0)return;const oe=pt.value,Y=ce(oe);if(Y){const j=[...te.presetColors];j[X.value]=Y,v("update:presetColors",j),v("update:modelValue",Y),X.value=-1,ke.value=!1}}function bt(){te.disabled||!We.value||(X.value=-1,ke.value=!ke.value,ke.value&&(K(),e.nextTick(()=>tt.value?.focus())))}function wt(oe){const Y=_(oe),j=_(te.modelValue);return Y&&j&&Y.toLowerCase()===j.toLowerCase()}function Jt(){if(te.disabled||!We.value||!_e.value)return;const oe=pt.value,Y=ce(oe);if(Y){const j=[...te.presetColors,Y];v("update:presetColors",j),v("update:modelValue",Y);const de=Ee.value??me.value;de>=0&&j.length-de>=te.max&&(ke.value=!1)}}const pt=e.computed(()=>{const{h:oe,s:Y,l:j}=Z.value;return V(oe,Y,j)}),jt=e.computed(()=>pt.value.toLowerCase()),kt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),tn=e.computed(()=>{const oe=pe(Z.value.h,Z.value.s,Z.value.l);return{left:`${oe.s}%`,bottom:`${oe.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),ye=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function P(){if(!F.value||!Ce.value)return;const oe=F.value.getBoundingClientRect(),Y=window.innerHeight||document.documentElement.clientHeight;let j=oe.bottom+4;const de=ue.value;de&&j+de.offsetHeight>Y-8&&(j=oe.top-4-de.offsetHeight),mt.value={top:j,left:oe.left}}function K(){const oe=te.modelValue||"#b8a5de",Y=_(oe);Y&&(Z.value=$(Y))}function Se(){v("update:modelValue",pt.value)}function Re(){te.disabled||(Ce.value=!Ce.value,Ce.value&&(K(),e.nextTick(()=>{P(),tt.value?.focus()})))}function Ze(){const oe=pt.value,Y=ce(oe);if(Y){if(X.value>=0){const j=[...te.presetColors];j[X.value]=Y,v("update:presetColors",j),v("update:modelValue",Y)}else if(We.value&&(te.presetColors.length>0||Ae.value)&&ke.value&&_e.value&&!te.presetColors.some(de=>ce(de)?.toLowerCase()===Y.toLowerCase())){const de=[...te.presetColors,Y];v("update:presetColors",de),v("update:modelValue",Y)}}Ce.value=!1,ke.value=!1,Q.value=!1,X.value=-1}function xt(oe){if(!Me.value)return;const Y=Me.value.getBoundingClientRect(),j=de=>{const be=Math.max(0,Math.min(1,(de.clientX-Y.left)/Y.width)),je=Math.max(0,Math.min(1,1-(de.clientY-Y.top)/Y.height)),Tt={h:Z.value.h,s:be*100,v:je*100};Z.value=st(Tt.h,Tt.s,Tt.v)};j(oe),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),Se()},{once:!0})}function Ke(oe){if(!oe.currentTarget)return;const j=oe.currentTarget.getBoundingClientRect(),de=be=>{const je=Math.max(0,Math.min(1,(be.clientX-j.left)/j.width));Z.value={...Z.value,h:je*360}};de(oe),document.addEventListener("mousemove",de),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",de),Se()},{once:!0})}function zt(oe){const Y=oe.target.value,j=_(Y);j&&(Z.value=$(j),v("update:modelValue",j))}function qe(oe){if(te.disabled)return;const Y=_(oe);Y&&(Z.value=$(Y),v("update:modelValue",Y))}let ze=null,Lt=null;function $t(){ze&&(document.removeEventListener("keydown",ze),ze=null),Lt&&(window.removeEventListener("resize",Lt),Lt=null)}return e.watch(Ce,oe=>{if($t(),oe){if(!Ae.value&&te.initialPresetCount==null){const Y=te.presetColors.length;Y>0&&(me.value<0||Y<me.value)&&(me.value=Y)}ze=Y=>{Y.key==="Escape"&&Ze()},Lt=P,document.addEventListener("keydown",ze),window.addEventListener("resize",Lt)}}),e.watch(()=>te.modelValue,()=>{Ce.value&&K()},{immediate:!1}),e.watch(we,oe=>{oe.length===0&&(Q.value=!1,X.value=-1,ke.value=!1)}),e.onBeforeUnmount($t),(oe,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":Ce.value}]),onClick:Re},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:pt.value})},[...Y[0]||(Y[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"},[Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ze,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ye.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(j,de)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+de,class:"dss-color-picker__section"},[e.createElementVNode("span",Pm,e.toDisplayString(j.title),1),e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(be,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+de+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(be)}]),style:e.normalizeStyle({backgroundColor:be,"--dss-preset-color":be}),title:be,onClick:e.withModifiers(Tt=>qe(be),["stop"])},null,14,Wm))),128))])]))),128)):Je.value.length?(e.openBlock(),e.createElementBlock("div",qm,[Y[1]||(Y[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(j,de)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(be=>qe(j),["stop"])},null,14,Um))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Ym,[Y[3]||(Y[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(Ft,["stop"])},[...Y[2]||(Y[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",jm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(j,de)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+de,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&&wt(j),"dss-color-picker__preset-bubble--editing":Q.value&&X.value===et(de)}]),style:e.normalizeStyle({backgroundColor:X.value===et(de)?pt.value:j,"--dss-preset-color":X.value===et(de)?pt.value:j}),title:X.value===et(de)?pt.value:j,onClick:e.withModifiers(be=>Q.value?vt(et(de)):qe(j),["stop"])},null,14,Km),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(be=>ut(et(de)),["stop"])},[...Y[4]||(Y[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,Gm)):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":ke.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(j,de)=>(e.openBlock(),e.createElementBlock("button",{key:de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(be=>qe(j),["stop"])},null,14,Jm))),128)),We.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":ke.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Me,onMousedown:xt},[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(tn.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[Y[5]||(Y[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",e2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:jt.value,onInput:zt},null,40,t2)]),We.value&&ie.value&&(E.presetColors.length||Ae.value)&&_e.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Jt}," Save color ")):e.createCommentVNode("",!0),We.value&&ie.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),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ze}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},l2={key:0,class:"dss-loader"},o2={key:0,class:"dss-loader-label"},a2={key:1,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:2,class:"dss-loader"},i2={key:0,class:"dss-loader-label"},c2={key:3,class:"dss-loader"},u2={key:0,class:"dss-loader-label"},d2={key:4,class:"dss-loader"},m2={key:0,class:"dss-loader-label"},p2={key:5,class:"dss-loader dss-loader--inline"},f2={class:"dss-loader-inline-text"},v2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const ne=E,$=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),V=e.computed(()=>{const ce={};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);ce["--dss-loader-size"]=I}return ne.color&&(ce["--dss-loader-accent"]=ne.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ce});return(ce,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(V.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",l2,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",a2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",r2,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",i2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",c2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",u2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",d2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",m2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",p2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",f2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},da="dss-skeleton-item",g2={__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:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:da},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const ne=E,$=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!==da&&(I[`dss-skeleton--target-${ne.targetClass}`]=!0),I}),V=e.computed(()=>{const I={};return ne.borderRadius&&(I.borderRadius=ne.borderRadius),I}),ce=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,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(ce.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(V.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(I.$slots,"default")],2)],6))}},h2={key:0,class:"dss-dnd-column-header"},y2={class:"dss-dnd-column-title"},k2={class:"dss-dnd-column-count"},C2=["data-column"],b2={key:0,class:"dss-dnd-indicator"},w2=["onPointerdown"],x2=["onPointerdown"],E2={class:"dss-dnd-item-content"},S2={class:"dss-dnd-item-default"},V2={key:0,class:"dss-dnd-empty"},N2={name:"DSSDnd"},B2=Object.assign(N2,{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(E,{emit:ne}){const $=E,V=ne,ce=e.useSlots(),I=e.computed(()=>!!ce["delete-zone"]),_={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(()=>({..._,...$.options})),st=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 te(P){if(!pe.value.ColColor||!P)return{};const K=P.background||P.color;return K?{background:K}:{}}const v=e.ref(null),Ce=e.ref(null),ke=e.ref(!1),Q=e.ref(-1),X=e.ref(null);let me=null,F=null,ue=null,Me=null,tt=0,mt=0,Z="",Ae=null;const We=5,Ee=e.computed(()=>{const P={};for(const K of $.columns)P[K.value]=$.items.filter(Se=>Se[$.columnKey]===K.value).sort((Se,Re)=>(Se[$.positionKey]??0)-(Re[$.positionKey]??0));return P}),_e=e.computed(()=>{const P={},K=!!v.value,Se=v.value?.[$.itemKey],Re=Ce.value,Ze=Q.value;for(const xt of $.columns){const Ke=Ee.value[xt.value]||[],zt=[],qe=Re==xt.value;let ze=0;for(let Lt=0;Lt<Ke.length;Lt++){const $t=Ke[Lt],oe=K&&$t[$.itemKey]===Se;!oe&&qe&&Ze===ze&&zt.push({type:"indicator",key:`ind-${ze}`}),oe||ze++,zt.push({type:"item",item:$t,isDragged:oe,key:`item-${$t[$.itemKey]}`})}qe&&Ze>=ze&&zt.push({type:"indicator",key:"ind-end"}),P[xt.value]=zt}return P});function Ye(P,K){const Re=(Ee.value[P]||[]).filter(Ke=>Ke[$.itemKey]!==v.value?.[$.itemKey]);if(Re.length===0)return 1;if(K<=0){const Ke=Re[0][$.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(K>=Re.length){const Ke=Re[Re.length-1][$.positionKey];return(Ke??0)+1}const Ze=Re[K-1][$.positionKey]??0,xt=Re[K][$.positionKey]??0;return(Ze+xt)/2}function ie(P,K,Se){ue&&ue.remove();const Re=P.getBoundingClientRect(),Ze=P.cloneNode(!0);Ze.classList.add("dss-dnd-ghost"),Ze.style.cssText=`
102
+ </svg>`,f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(!1),fe=e.ref(""),R=e.ref({}),me=e.ref(!1),_e=e.ref(!1),Je=e.ref(""),pt=e.ref(""),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(""),Ye=e.ref(!1),ie=e.ref({}),Ge=e.ref(!1),be=e.ref({}),Qe=e.ref(null),ct=e.ref(null),gt=e.ref(!1),ut=e.ref(""),qt=e.ref(null),Zt=e.ref(""),kt=e.ref(""),xt=e.ref(""),Yt=e.ref(null),rt=e.ref(null),Jt=e.ref(null),yt=e.ref(null),ol=e.ref(null),U=e.ref(!1),ke=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Ie=e.ref(""),Ue=e.ref(null),Et=e.ref(null),Ke=e.ref([]),Ut=e.ref([]),qe=e.ref(null),Pe=e.ref(!1),Ht=e.ref(""),$t=e.ref(""),oe=e.ref(""),Y=e.ref(""),j=e.ref(""),pe=e.ref(""),xe=e.ref(null),je=e.ref(null),Rt=e.ref(null),jt=e.ref(!1),et=e.ref(null),pl=e.ref(!1),M=e.ref(!1),w=e.ref(null),A=e.ref("p"),se=e.ref(!1),ae=e.ref([]),He=e.ref(null),Ct=e.ref(null),nt=e.ref(null),Re=e.ref(!1),bt=e.ref(0),_t=100,St=e.ref(null),Lt=e.computed(()=>!!T.commentUser),zt=e.computed(()=>({"dss-text-editor-no-border":!T.border,"dss-text-editor-rounded":T.rounded,"dss-text-editor-full-height":T.fullHeight,"dss-comment-overlay-open":Lt.value&&nl.value!==null})),Bt=e.computed(()=>({})),Kt=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),ql=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),jl=e.computed(()=>T.richText&&Ut.value.length>0),El=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let a=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/&nbsp;/g," "),a=a.replace(/&amp;/g,"&"),a=a.replace(/&lt;/g,"<"),a=a.replace(/&gt;/g,">"),a=a.replace(/&quot;/g,'"'),a=a.replace(/&#39;/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return T.modelValue}),il=e.computed(()=>{const a=El.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),vl=e.computed(()=>El.value.length),dn=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&Zt.value&&Zt.value.startsWith("data:")),wn=e.computed(()=>T.titlePlaceholder||B("textEditor.placeholders.title")),Dl=e.computed(()=>T.descriptionPlaceholder||B("textEditor.placeholders.description")),mn=e.computed(()=>T.placeholder||B("textEditor.placeholders.startTyping")),$l=a=>st&&st[a]!==void 0,zn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++)if($l(T.customToolbarSlots[n]))return!0;return!1},Dn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++){const s=T.customToolbarSlots[n];if($l(s)&&on(s))return!0}return!1},on=a=>T.customToolbarFloatingMap.hasOwnProperty(a)?T.customToolbarFloatingMap[a]===!0:!0,bl=e.computed(()=>T.customToolbarSlots.some(a=>$l(a)&&on(a))),Fl=e.computed(()=>$l("title-slot")),Kl=e.computed(()=>$l("description-slot")),Hl=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Ml=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},pn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},$=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},O=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=B("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},D=a=>{const n=a.target.value;he("update:modelValue",n),he("change",n)},ne=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Ae=()=>{pl.value=!0,ne()},it=()=>{pl.value=!1,vt()},vt=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},tt=a=>{const s=a.target.value;pl.value&&ne(),he("update:title",s),he("title-change",s),Rt.value="title",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},lt=()=>{if(!je.value)return;const a=je.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},kl=()=>{M.value=!0,lt()},Sl=()=>{M.value=!1,Tt()},Tt=()=>{if(!je.value)return;const a=je.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&&lt(),he("update:description",s),he("description-change",s),Rt.value="description",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},el=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(f.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Vl=a=>{if(!(!a||!f.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(f.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},an=()=>{if(!f.value)return;f.value.focus();const a=window.getSelection(),n=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],p=s(u);if(p)return p}return c},i=s(f.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},al=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=T.title||"",i=T.description||"";if(!a&&n===Ht.value&&s===oe.value&&i===Y.value)return;const c={content:$t.value||Ht.value,title:j.value!==void 0?j.value:oe.value,description:pe.value!==void 0?pe.value:Y.value},d=Ke.value.length>0?Ke.value[Ke.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&&(Ke.value.push(c),Ke.value.length>50&&Ke.value.shift(),Ut.value=[]),Ht.value=n,oe.value=s,Y.value=i,$t.value=n,j.value=s,pe.value=i},At=a=>{if(!f.value)return;Pn(),f.value&&pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=el(),xn()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&w.value&&(w.value=null),J.value=!0;const i=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=Hl(i);he("update:modelValue",c),he("change",c),Rt.value="editor",Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al(),Mn(),Cn()},500),e.nextTick(()=>{n&&Vl(n),Pn();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&w.value?.command===k){ie.value[k]=w.value.state;return}if(k==="bold")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H;let V=!1;if(z&&((z.tagName==="STRONG"||z.tagName==="B"||z.closest&&z.closest("strong, b"))&&(V=!0),!V&&z.style&&parseInt(z.style.fontWeight)>=600&&(V=!0),!V))try{const Q=window.getComputedStyle(z);parseInt(Q.fontWeight)>=600&&(V=!0)}catch{}ie.value[k]=V}else ie.value.hasOwnProperty(k)||(ie.value[k]=!1);else if(k==="italic")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H,V=z&&(z.tagName==="EM"||z.tagName==="I"||z.closest&&z.closest("em, i"));ie.value[k]=!!V}else{const H=document.queryCommandState(k);ie.value[k]=H}else{const H=document.queryCommandState(k);ie.value[k]=H}}catch{}}),Ll(),Zl(),en(),Mt(),yn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Cn(k),0),(k===" "||k===`
103
+ `||/[.,;:!?]/.test(k))&&setTimeout(()=>{Mn()},100)}J.value=!1})},Pn=()=>{if(!f.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},xn=()=>{if(!f.value)return;const a=f.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(f.value&&!jt.value){jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),f.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),H=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||H||H)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=te,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{Mn(),he("blur",a),Bn()},fn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value&&(al(),Pe.value=!1);const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ke.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ut.value.push(i);const c=Ke.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},Hn=()=>{if(T.disabled||!T.richText||!f.value)return;dl();const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ut.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ke.value.push(i);const c=Ut.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},En=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},en=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ul=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.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(()=>{en()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{en()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{en()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{en()})}return!0},On=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.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(()=>{En()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.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 p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.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 p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}En()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{En()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{En()})}return!0},Il=(a,n=null)=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=el())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=On();ie.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("bold");ie.value.bold=p})),At(),sl(),Mt()});return}if(a==="italic"){const d=ul();ie.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("italic");ie.value.italic=p})),At(),en(),sl(),Mt()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Vl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=ll("bold");ie.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=ll("italic");ie.value.italic=u});else{const u=document.queryCommandState(a);ie.value[a]=u}else{const u=document.queryCommandState(a);ie.value[a]=u}}catch{ie.value.hasOwnProperty(a)?ie.value[a]=!ie.value[a]:ie.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}At(),sl(),Mt()})},ll=(a,n=null)=>{if(T.disabled||!f.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="STRONG"||V.tagName==="B"){u=!0;break}if(V.style&&parseInt(V.style.fontWeight)>=600){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="STRONG"||z.tagName==="B"){u=!0;break}if(z.style&&parseInt(z.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="EM"||V.tagName==="I"){u=!0;break}if(V.style&&V.style.fontStyle==="italic"){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="EM"||z.tagName==="I"){u=!0;break}if(z.style&&z.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=d,d)}return ie.value.hasOwnProperty(a)?ie.value[a]:!1}catch{return ie.value.hasOwnProperty(a)?ie.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Wn=a=>{T.disabled||!T.richText||(we.value=we.value===a?null:a,a==="askAi"&&(ct.value=null))},dl=()=>{we.value=null,Ue.value=null},wt=a=>{Il("formatBlock",a),dl()},$e=a=>{if(!a||!f.value)return a;const n=ge=>{let Me=ge.nodeType===Node.TEXT_NODE?ge.parentElement:ge;for(;Me&&Me!==f.value;){const ft=Me.tagName;if(ft==="P"){const xl=Me.parentElement;if(xl===f.value||xl.tagName==="BLOCKQUOTE")return Me}if(ft==="BLOCKQUOTE")break;Me=Me.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:ge=>{const Me=ge.tagName;if(Me==="P"){const ft=ge.parentElement;if(ft===f.value||ft.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),H=Math.max(p,h),z=c.slice(k,H+1);if(z.length===0)return a;const V=z[0],Q=z[z.length-1],ee=document.createRange();return ee.setStartBefore(V),ee.setEndAfter(Q),ee},Sn=()=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=$e(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=el());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:V=>V.parentNode===u&&V.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let H;for(;H=k.nextNode();)h.push(H);if(h.forEach(V=>{const Q=document.createElement("p");V.parentNode.insertBefore(Q,V),Q.appendChild(V)}),u.querySelectorAll("p, div").forEach(V=>{V.textContent.trim()===""&&!V.querySelector("img")&&(V.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const V=document.createElement("p");V.innerHTML="<br>",u.appendChild(V)}}e.nextTick(()=>{s&&Vl(s),tn(),At(),Mt()})},dt=()=>{if(!f.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!f.value.contains(i))return;const c=H=>{if(!H)return!1;const z=H.textContent||"",Q=(H.innerHTML||"").trim();return z.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<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&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const H=i.lastChild;if(H.nodeType===1&&H.tagName==="BR")H.remove();else if(H.nodeType===3)if((H.textContent||"").trim()==="")H.remove();else break;else break}if(i.children.length>0)for(let H=i.children.length-1;H>=0;H--){const z=i.children[H];if((z.tagName==="P"||z.tagName==="DIV")&&c(z))z.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):f.value&&f.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{tn(),At()})},sl=()=>{if(!f.value){Ce.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!i}else Ce.value=!1}catch{Ce.value=!1}},ot=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Se.value=el();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Je.value="",pt.value=s,Le.value="",We.value=null,_e.value=!0,dl(),e.nextTick(()=>{Z.value&&Z.value.focus()})},mt=()=>{if(!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&We.value&&(n=We.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}We.value=null}else Il("unlink");Ce.value=!1,dl(),e.nextTick(()=>{At(),sl()})},ce=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},tl=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},Oe=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Ll=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Oe(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},sn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=Oe(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Ll();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{At(),Mt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},Tl=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Ll();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{At(),Mt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},nl=e.ref(null),zl=e.ref(null),y=e.ref({}),g=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const ue=e.ref(null);e.ref("");const at=e.ref([]),Xt=e.ref(!1),Cl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;if(nl.value!==null){nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0);return}dl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;q.value=Pl(n)||"",ue.value=el();const s=n.getBoundingClientRect(),i=f.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},nl.value=Date.now(),e.nextTick(()=>{if(g.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const H=i.getBoundingClientRect(),z=h.getBoundingClientRect(),V=k.getBoundingClientRect(),Q=z.bottom-H.top,ee=V.top-H.top,ge=8;if(Q>ee-ge){const Me=V.height;y.value={bottom:`${Me+ge}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},hn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:q.value,selectionRange:ue.value,commentId:nl.value,user:T.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],he("comment-submitted",s),Xo(s),ue.value&&!So(ue.value)&&Vn(nl.value,ue.value),g.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},uo=(a,n)=>{if(!(!T.commentUser||!a.user||a.user.id!==T.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),nl.value!==null&&f.value){const s=String(nl.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.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?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(he("comment-deleted",{comment:a,index:n,commentId:nl.value}),T.comments&&Array.isArray(T.comments)){const s=T.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));he("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},So=a=>{if(!a||!f.value)return!1;try{const n=Vo(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Vo=a=>{if(!a||!f.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return f.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},Vn=(a,n)=>{if(!(!a||!n||!f.value))try{const s=Vo(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,H=s.endOffset,z=p.nodeType===3?p.parentNode:p,V=h.nodeType===3?h.parentNode:h;if(z===V&&k===0&&H===(h.nodeType===3?h.length:V.childNodes.length)&&(z.tagName==="P"||z.tagName==="DIV"||z.tagName==="H1"||z.tagName==="H2"||z.tagName==="H3"||z.tagName==="H4"||z.tagName==="H5"||z.tagName==="H6")){const ee=s.extractContents();d.appendChild(ee),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),At()})}catch{}},Xo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(T.comments)?[...T.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.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:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Xt.value=!0,he("update:comments",n)},Yo=(a,n=[])=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;const s=f.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;dl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",ue.value=el();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const H=p.getBoundingClientRect(),z=u.bottom-H.top,Q=Math.max(z+8,0);y.value={top:`${Q}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&T.comments&&Array.isArray(T.comments)){const H=T.comments.find(z=>String(z.conversation_id)===String(h));if(H&&H.conversation&&Array.isArray(H.conversation)){const z=H.conversation.map(V=>({id:V.id||V.commentary_id,commentary_id:V.id||V.commentary_id,conversation_id:H.id||H.conversation_id,text:V.text,user:V.user,createdAt:V.created_at||V.createdAt,updated_at:V.updated_at||V.updatedAt}));k.push(...z)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((H,z)=>{const V=ge=>{if(!ge)return 0;const Me=new Date(ge).getTime();return isNaN(Me)?0:Me},Q=V(H.createdAt),ee=V(z.createdAt);return Q===ee?0:Q-ee}),at.value=k,$n(!0),nl.value=h||null,i&&(zl.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",x.value){const H=x.value;H.style.height="auto",H.style.height=`${H.scrollHeight}px`,H.focus()}if(p){const H=p.querySelector(".dss-comment-overlay");if(H){const z=p.querySelector(".dss-text-editor-footer");if(z){const V=p.getBoundingClientRect(),Q=H.getBoundingClientRect(),ee=z.getBoundingClientRect(),ge=Q.bottom-V.top,Me=ee.top-V.top,ft=8;if(ge>Me-ft){const xl=ee.height;y.value={bottom:`${xl+ft}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},mo=e.ref(null),po=e.ref(0),jo=a=>{if(!(T.disabled||!T.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{dt()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=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 p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,z=s.cloneContents().textContent?.trim()||"",V=c.textContent?.trim()||"";(!h||!k||z.length>V.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{At()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Tl():sn();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const H=h.parentElement;return H&&H!==f.value?p(H):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==f.value){a.preventDefault(),a.stopPropagation();let H=null;const z=s.startOffset;z<u.length&&(H=u.splitText(z));const V=document.createElement("p");if(H?V.appendChild(H):V.innerHTML="<br>",u.length===0){const ee=u.parentElement;ee&&(ee.removeChild(u),ee.childNodes.length===0&&ee.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(V,k.nextSibling):k.parentNode.appendChild(V);const Q=document.createRange();H?Q.setStart(H,0):Q.setStart(V,0),Q.collapse(!0),n.removeAllRanges(),n.addRange(Q),e.nextTick(()=>{At()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=ee=>{if(!ee)return!1;const ge=ee.textContent||"",ft=(ee.innerHTML||"").trim(),xl=ft.replace(/<br\s*\/?>/gi,"").trim();return ge.trim()===""||ft===""||xl===""||ft==="<br>"||ft==="<br/>"||ft==="<p></p>"||ft==="<p><br></p>"||ft==="<p><br/></p>"||ft==="<p> </p>"||ft==="<p><br> </p>"||ft==="<div></div>"||ft==="<div><br></div>"||ft==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",H=s.startContainer,z=H.nodeType===3?H.parentElement:H,V=z===c||z&&z.parentElement===c;if(u&&p(u)||k&&V){a.preventDefault(),setTimeout(()=>{dt()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-po.value;if(mo.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.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){a.preventDefault(),sn();return}}}}mo.value=" ",po.value=n}else mo.value=a.key}},qn=a=>{if(T.disabled||!T.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),al();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(z=>{if(k>0){const V=h.createElement("p");V.innerHTML=z.innerHTML,z.parentNode.replaceChild(V,z)}else k++}),c){const z=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],V=Array.from(h.body.children).filter(Q=>z.includes(Q.tagName));if(V.length===1){const Q=V[0].tagName,ee=c.tagName,ge=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(ee)?Me=!0:ge||(Q===ee||Q==="P")&&(Me=!0),Me)return V[0].innerHTML.trim()}}return h.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);At()},vo=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&dl()}if(Ge.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ct.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Nl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ue.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);se.value=!i.collapsed&&Nn(i)}else se.value=!1}if(nl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0))}},gn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Ue.value=n},No=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Ue.value=null,Et.value=null},150)},Ko=a=>{Ue.value=null};let Go=0;const Qo=a=>{if(!a)return;const n=Array.from(a.children);n.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")}),n.forEach((s,i)=>{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(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.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(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Go}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(H=>{(H.tagName==="BUTTON"||H.tagName==="DIV")&&!H.classList.contains("dss-toolbar-dropdown-item")&&H.classList.add("dss-toolbar-dropdown-item")}))}})},Bo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qo(n),n.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=h=>{const k=c.getAttribute("data-submenu-id");k&&gn(h,k)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const H=c.getAttribute("data-submenu-id");H&&gn(k,H)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Ko)})})})};let Rn=null;const Kn=()=>{if(Ue.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ue.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ue.value}"]`);a&&n&&eo(a,n)}if(Ge.value&&Mt(),T.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},Zn=()=>{if(!T.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},fo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{pl.value?ne():vt(),M.value?lt():Tt()})}),e.nextTick(()=>{fo()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",vo),window.addEventListener("resize",Kn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Kn()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=a,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Kn()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Bo(),Zn()}),f.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!T.disabled&&p.preventDefault();const H=h.closest(".dss-image-no-alt-icon"),z=h.closest(".dss-image-wrapper");if(H||z&&h===z){p.preventDefault(),p.stopPropagation();const V=window.getSelection(),Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.removeAllRanges(),V.addRange(Q)}else z&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const V=window.getSelection();if(V.rangeCount>0){const ee=V.getRangeAt(0).commonAncestorContainer,ge=ee.nodeType===3?ee.parentElement:ee;if(z.contains(ge)&&ge!==z.querySelector("img")){const Me=document.createRange();Me.setStartAfter(z),Me.collapse(!0),V.removeAllRanges(),V.addRange(Me)}}else{const Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.addRange(Q)}}))},!0),f.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),H=h.closest(".dss-image-wrapper");if(k||H&&h.tagName!=="IMG"){p.preventDefault();const z=window.getSelection(),V=document.createRange();H&&(V.setStartAfter(H),V.collapse(!0),z.removeAllRanges(),z.addRange(V))}},!0),f.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const z=k.getAttribute("alt")||k.alt||"";if(z){const V=k.getAttribute("src")||k.src||"",Q=V.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),ee=z===V||z===Q;(z.startsWith("http://")||z.startsWith("https://")||z.startsWith("data:")||ee||ee)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),f.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),H=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(et.value=H||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!et.value||!f.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),H=k?h.querySelector("img"):h,z=k?h:H?.closest(".dss-image-wrapper");if(!H||!f.value.contains(H)){et.value=null;return}let V=null;const Q=p.clientX,ee=p.clientY;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(Q,ee);else{const Ft=window.getSelection();Ft.rangeCount>0?V=Ft.getRangeAt(0).cloneRange():(V=document.createRange(),V.selectNodeContents(f.value),V.collapse(!1))}if(!V){et.value=null;return}const ge=V.commonAncestorContainer,Me=ge.nodeType===3?ge.parentElement:ge;if(Me?.closest(".dss-image-wrapper")===z||z&&z.contains(Me)){et.value=null;return}if(z&&(Me===z||z.contains(Me))){et.value=null;return}const xl=H.getAttribute("src");let ht=null;z?ht=z.cloneNode(!0):ht=H.cloneNode(!0);try{let Ft=V.startContainer;if(Ft.nodeType===3&&(Ft=Ft.parentElement),z&&(Ft===z||z.contains(Ft))){const yl=document.createRange();yl.setStartAfter(z),yl.collapse(!0),V=yl}V.insertNode(ht);const gl=document.createRange();gl.setStartAfter(ht),gl.collapse(!0);const Ot=window.getSelection();Ot.removeAllRanges(),Ot.addRange(gl)}catch{if(f.value.childNodes.length===0){const gl=document.createElement("p");gl.appendChild(ht),f.value.appendChild(gl)}else{const gl=f.value.lastChild;if(gl&&gl.nodeType===1)gl.appendChild(ht);else{const Ot=document.createElement("p");Ot.appendChild(ht),f.value.appendChild(Ot)}}}z?z.remove():H.remove(),et.value=null,e.nextTick(()=>{const Ft=f.value.querySelectorAll("img");let gl=!1;Ft.forEach(Ot=>{if(Ot.getAttribute("src")===xl)if(!gl)gl=!0;else{const yl=Ot.closest(".dss-image-wrapper");yl?yl.remove():Ot.remove()}}),Zl(),At()})}),f.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const H=k.querySelectorAll&&k.querySelectorAll("img");H&&H.forEach(z=>{z.removeAttribute("alt"),z.removeAttribute("data-alt"),z.setAttribute("alt",""),z.setAttribute("data-alt",""),z.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),Zn(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{Zn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),T.modelValue){const p=Ml(T.modelValue);f.value.innerHTML=p,xn()}e.nextTick(()=>{const p=f.value.innerHTML||"",h=T.title||"",k=T.description||"";Ht.value=p,oe.value=h,Y.value=k,j.value=h,pe.value=k,Ll(),Zl(),en(),yn(),Ql(),yo()}),sl(),tn(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",vo),window.removeEventListener("resize",Kn),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),qe.value&&clearTimeout(qe.value),Et.value&&clearTimeout(Et.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),$n(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Mo=a=>{const n=a.target,s=n.closest("a");if(s&&!T.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),sl(),tn(),Mt(),yn()}):e.nextTick(()=>{Zl(),sl(),tn(),Mt(),yn()})},_o=()=>{Pn();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);se.value=!s.collapsed&&Nn(s),!s.collapsed&&w.value&&(w.value=null)}else se.value=!1;if(Zl(),sl(),tn(),Mt(),yn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),se.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}ie.value[s]=p}else{const d=document.queryCommandState(s);ie.value[s]=d}}}catch{}})},yn=()=>{if(!T.richText||T.disabled||!f.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},tn=()=>{if(!f.value){Ye.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},Nn=a=>{if(!a||!f.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Bn=()=>{Ge.value=!1},Mt=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){Ge.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Ge.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Ge.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Ge.value=!1;return}const i=f.value;if(!i){Ge.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Ge.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let H=0;Qe.value&&(H=Qe.value.getBoundingClientRect().width);const z=(H||320)/2;let V=c.left+z,Q=c.right-z;if(Q<V){const ee=c.left+c.width/2;V=ee,Q=ee}if(k>0){const ee=z+u,ge=k-z-u;if(V=Math.max(V,ee),Q=Math.min(Q,ge),Q<V){const Me=k/2;V=Me,Q=Me}}h<V?h=V:h>Q&&(h=Q),be.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ge.value=!0},I=a=>{T.disabled||!T.richText||(ct.value=ct.value===a?null:a,a==="askAi"&&(we.value=null))},Nl=()=>{ct.value=null,Ue.value=null},Bl=a=>{wt(a),Nl()};let Gl=null,cl=null,rl=null,Gt=null;const rn=a=>{if(T.disabled||!T.richText){Xl(),Dt();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),s&&s!==cl){Dt(),cl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,fe.value=c,X.value=!0,me.value=!0,kn(s)}else!s&&cl?(cl=null,Gl=setTimeout(()=>{me.value||Xl()},150)):s&&s===cl&&kn(s);if(i&&i!==Gt){Xl(),Gt=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ke.value=c.trim()||B("textEditor.image.noAlt"),U.value=!0,G.value=!0,Pt(i)}else!i&&Gt?(Gt=null,rl=setTimeout(()=>{G.value||Dt()},150)):i&&i===Gt&&Pt(i)},fl=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(cl=null,Gt=null,Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),Xl(),Dt())},Xl=()=>{me.value=!1,setTimeout(()=>{me.value||(X.value=!1,fe.value="",_e.value||(We.value=null))},100)},kn=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;R.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Dt=()=>{G.value=!1,setTimeout(()=>{G.value||(U.value=!1,ke.value="",gt.value||(yt.value=null))},100)},Pt=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Vt=()=>{if(!fe.value||!We.value)return;let n=We.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},hl=()=>{if(We.value){const a=We.value.textContent||"",n=We.value.getAttribute("href")||"",s=We.value;Je.value=n,pt.value=a,Le.value=a,me.value=!1,X.value=!1,fe.value="",We.value=s,_e.value=!0}else if(Ce.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";Je.value=d,pt.value=c,Le.value=c,We.value=i,_e.value=!0}}}else{Se.value=el();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),Je.value="",pt.value=n,Le.value="",We.value=null,_e.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},Gn=()=>{_e.value=!1,Je.value="",pt.value="",Le.value="",We.value=null,Se.value=null},Qn=()=>{if(!Je.value.trim()){Gn();return}if(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),pt.value.trim()||(pt.value=Je.value.trim()),We.value&&f.value&&f.value.contains(We.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=We.value;if(n.setAttribute("href",Je.value.trim()),pt.value.trim()!==Le.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=pt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),At()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),Se.value&&Vl(Se.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Je.value.trim(),s.textContent=pt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=Je.value.trim(),d.textContent=pt.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 p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),H=k[k.length-1];if(H&&H!==" "&&H!==" "&&H!==`
104
+ `){const z=document.createTextNode(" ");n.insertNode(z),n.setStartAfter(z)}}n.insertNode(d);const h=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(h),n.setStartAfter(h),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),h=p[p.length-1];if(h&&h!==" "&&h!==" "&&h!==`
105
+ `){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}At()}e.nextTick(()=>{sl(),Gn()})},Mn=()=>{if(!f.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=el());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,i=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const H=[...k.matchAll(s)];if(H.length===0)continue;const z=H.filter(ee=>{const ge=ee[0],Me=ee.index;if(Me>0&&k[Me-1]==="@"||Me+ge.length<k.length&&k[Me+ge.length]==="@")return!1;const ft=h.parentElement;return!(ft&&ft.closest("a"))});if(z.length===0)continue;if(z.length===1&&z[0][0]===k.trim()){const ee=z[0][0],ge=ee.startsWith("http://")||ee.startsWith("https://")?ee:`https://${ee}`,Me=document.createElement("a");Me.href=ge,Me.textContent=ee,Me.style.color="#60afdf",Me.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(Me,h),u=!0);continue}let V=0;const Q=document.createDocumentFragment();if(z.forEach(ee=>{const ge=ee.index,Me=ee[0];if(ge>V){const ht=k.substring(V,ge);ht&&Q.appendChild(document.createTextNode(ht))}const ft=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,xl=document.createElement("a");xl.href=ft,xl.textContent=Me,xl.style.color="#60afdf",xl.style.textDecoration="underline",Q.appendChild(xl),V=ge+Me.length}),V<k.length){const ee=k.substring(V);ee&&Q.appendChild(document.createTextNode(ee))}h.parentNode&&Q.childNodes.length>0&&(h.parentNode.replaceChild(Q,h),u=!0)}u&&n&&e.nextTick(()=>{Vl(n),sl()})},ho=()=>{if(!f.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=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 i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(H=>{const z=H.index,V=H[0].startsWith("<u>")?"u":"ins",Q=H[1]||H[2]||"";z>h&&k.appendChild(document.createTextNode(u.substring(h,z)));const ee=document.createElement(V);ee.textContent=Q,k.appendChild(ee),h=z+H[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Cn=a=>{if(!f.value||J.value)return;if(!a){ho();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.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 ht="",Ft=0,gl=!1;const Ot=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Al=>Al.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let yl=0;for(;Ot.nextNode();){const Al=Ot.currentNode,nn=Al.textContent||"",bn=yl;if(yl+=nn.length,Al===i.startContainer){ht+=nn.substring(0,i.startOffset),Ft=bn+i.startOffset,gl=!0;break}ht+=nn}return gl||(Ft=ht.length),{textBeforeCursor:ht,cursorCharOffset:Ft}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],H=p[1],z=u.length-k.length,Q=(ht=>{let Ft=0;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:yl=>yl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Ot;for(;Ot=gl.nextNode();){const yl=(Ot.textContent||"").length;if(Ft+yl>=ht)return{node:Ot,offset:ht-Ft};Ft+=yl}return null})(z);if(!Q)return;const ee=document.createRange();ee.setStart(Q.node,Q.offset),ee.setEnd(i.endContainer,i.endOffset);const ge=document.createElement(h);ge.textContent=H,ee.deleteContents(),ee.insertNode(ge);const Me=window.getSelection(),ft=document.createRange();ft.setStartAfter(ge),ft.collapse(!0),Me.removeAllRanges(),Me.addRange(ft);const xl=el();e.nextTick(()=>{At(),xl&&Vl(xl)})},Un=()=>{f.value&&(ol.value=el(),ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,Ne.value="upload",gt.value=!0,dl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),rt.value&&(rt.value.value="")}))},Xn=a=>{const n=a.target?.files?.[0];if(!n){qt.value=null,Zt.value="";return}qt.value=n;const s=new FileReader;s.onload=i=>{Zt.value=i.target?.result||""},s.readAsDataURL(n)},Jo=()=>{rt.value&&rt.value.click()},go=()=>{kt.value&&(xt.value="")},$o=()=>{xt.value&&(kt.value="")},_n=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,ut.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ie.value=s,Zt.value="",Ne.value="url"):(Zt.value=s,Ie.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";kt.value=c.endsWith("px")?c.replace("px",""):c,xt.value=d.endsWith("px")?d.replace("px",""):d,ol.value=null}else{Un();return}gt.value=!0,G.value=!1,U.value=!1,e.nextTick(()=>{Ne.value==="url"&&Jt.value?(Jt.value.focus(),Jt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),rt.value&&(rt.value.value="")})},Fn=()=>{gt.value=!1,ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,ol.value=null,Ne.value="upload"},_l=()=>{const a=(ut.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const s=Ne.value==="url"?Ie.value.trim():Zt.value;if(yt.value&&f.value&&f.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),kt.value?(yt.value.style.width=`${kt.value}px`,yt.value.setAttribute("width",kt.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),xt.value?(yt.value.style.height=`${xt.value}px`,yt.value.setAttribute("height",xt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}At()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Fn();return}if(f.value){f.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(ol.value&&(Vl(ol.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 k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Fn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!f.value.contains(p)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),kt.value&&(h.style.width=`${kt.value}px`,h.setAttribute("width",kt.value)),xt.value&&(h.style.height=`${xt.value}px`,h.setAttribute("height",xt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const z=document.createElement("p");f.value.appendChild(z),z.appendChild(h)}else{const z=f.value.lastChild;if(z&&z.nodeType===1)z.appendChild(h);else{const V=document.createElement("p");f.value.appendChild(V),V.appendChild(h)}}const H=document.createRange();H.setStartAfter(h),H.collapse(!0),c&&(c.removeAllRanges(),c.addRange(H))}}yt.value=h,At()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),sl(),Mt(),Fn()})};e.watch(()=>T.modelValue,a=>{if(T.richText&&f.value&&!J.value){const n=Ml(a||""),i=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=el();f.value.innerHTML=n,e.nextTick(()=>{xn();const u=f.value.innerHTML||"",p=T.title||"",h=T.description||"";Ht.value=u,oe.value=p,Y.value=h,$t.value=u,j.value=p,pe.value=h,Ke.value=[],Ut.value=[],qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value=!1,d&&Vl(d),Ll(),Zl(),en(),sl(),Mt(),yn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,a=>{a?(Mt(),e.nextTick(()=>{Ql()})):(Bn(),ae.value=[],He.value&&(He.value.disconnect(),He.value=null)),yn()}),e.watch(()=>T.floatingToolbar,a=>{a?Mt():Bn()}),e.watch(()=>T.disabled,a=>{a&&Bn(),yn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{M.value?lt():Tt()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{pl.value?ne():vt()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Zn()})},{deep:!0}),e.watch(()=>T.comments,(a,n)=>{if(T.commentUser){if(Xt.value){Xt.value=!1;return}Cl.value||T.richText&&f.value&&e.nextTick(()=>{yo()})}},{deep:!0,immediate:!1});const yo=()=>{if(T.commentUser&&!Cl.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Cl.value=!0;try{const a=new Set,n=T.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=f.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const H=To(u.selection_range,u.selection_text);if(H&&!H.collapsed){const z=H.commonAncestorContainer,V=z.nodeType===3?z.parentElement:z;if(V){const ge=V.closest("[data-comment], [data-fake-comment]");if(ge){const Me=ge.getAttribute("data-comment")||ge.getAttribute("data-fake-comment");if(String(Me)===String(p)){ge.setAttribute("data-comment",h),ge.removeAttribute("data-fake-comment"),Jn(ge,u),d.add(h);return}else return}}const Q=f.value.querySelector(`[data-comment="${h}"]`);if(Q){Jn(Q,u),d.add(h);return}const ee=document.createElement("span");ee.setAttribute("data-comment",h),Jn(ee,u);try{H.surroundContents(ee),c++,d.add(h)}catch{try{const Me=document.createRange();Me.setStart(H.startContainer,H.startOffset),Me.setEnd(H.endContainer,H.endOffset),Lo(Me),Me.surroundContents(ee),c++,d.add(h)}catch{try{const ft=H.extractContents();ee.appendChild(ft),H.insertNode(ee),c++,d.add(h)}catch(ft){console.warn("Failed to create comment marker:",ft)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),At(),Cl.value=!1})}catch{Cl.value=!1}}},Lo=a=>{if(!a||!f.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Yn(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Yn=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},ea=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},To=(a,n)=>{if(!a||!f.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?Lo(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!T.commentUser||!T.richText||!f.value){ae.value=[];return}Date.now()-bt.value<_t&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,bt.value=Date.now(),Re.value)return;Re.value=!0;const s={},i=f.value;if(!i){Re.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Re.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");Q&&V.tagName==="SPAN"&&(p.has(Q)||(u.push(V),p.add(Q)))}),d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");!Q||p.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(V.tagName)?V.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(V),p.add(Q)):V.tagName!=="SPAN"&&(u.push(V),p.add(Q)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((V,Q)=>{let ee=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");if(!ee)return;if(typeof ee=="string"&&ee.startsWith("comment-")){const cn=V.textContent?.trim(),Jl=T.comments?.find(Ol=>(typeof Ol.conversation_id=="string"&&Ol.conversation_id.startsWith("comment-")?null:Ol.conversation_id)&&Ol.selection_text?.trim()===cn);Jl?(ee=String(Jl.conversation_id),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment")):(ee=String(Date.now()),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment"))}const ge=V.getBoundingClientRect(),Me=window.getComputedStyle(V),ft=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,Ft=ge.top-k.top+ft/2-15,Ot=k.top-h.top+Ft;let yl=null,Al=null,nn=0;const bn=[],Co=new Set;if(ee&&T.comments){const cn=T.comments.find(Jl=>String(Jl.conversation_id||Jl.id)===String(ee));if(cn){const Jl=cn.conversation||[];Jl.length>0?(Jl.forEach(Ol=>{Ol.user&&Ol.user.id&&!Co.has(Ol.user.id)&&(Co.add(Ol.user.id),bn.push(Ol.user))}),nn=Jl.length):(nn=0,yl=null,Al=null),bn.length>0?yl=bn[0]:yl=null,bn.length>1?Al=bn[1]:Al=null}}const Do=ge.top+ft/2-15,bo=Do+30,Ho=5,to=bo>k.top+Ho&&Do<k.bottom-Ho?1:0;ae.value.find(cn=>cn.id===ee);let lo=V;if(!lo&&ee&&f.value){const cn=String(ee);lo=f.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Qt=bn.length;s[ee]?(s[ee].top=Ot,s[ee].opacity=to,s[ee].element=lo,s[ee].firstUser=yl,s[ee].secondUser=Al,s[ee].totalCount=nn,s[ee].uniqueUserCount=Qt):s[ee]={id:ee,top:Ot,opacity:to,element:lo,firstUser:yl,secondUser:Al,totalCount:nn,uniqueUserCount:Qt}});const H=Object.values(s).map(V=>{const Q=Math.max(0,(V.uniqueUserCount??0)-2);if(!V.element&&V.id&&f.value){const ge=String(V.id);V.element=f.value.querySelector(`[data-comment="${ge}"], [data-fake-comment="${ge}"]`)}return{...V,firstUser:V.firstUser||null,secondUser:V.secondUser||null,totalCount:V.totalCount,additionalCount:Q}});(ae.value.length!==H.length||H.some((V,Q)=>{const ee=ae.value[Q];if(!ee)return!0;const ge=(ee.firstUser?.id||null)!==(V.firstUser?.id||null),Me=(ee.secondUser?.id||null)!==(V.secondUser?.id||null);return ee.id!==V.id||Math.abs(ee.top-V.top)>1||ee.opacity!==V.opacity||ee.totalCount!==V.totalCount||ee.additionalCount!==V.additionalCount||ge||Me||ee.element!==V.element}))&&(ae.value=H),Re.value=!1}))},Ao=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&f.value){const s=String(a.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&($n(),zl.value=n,n.classList.add("editor-comment-highlighted"))},$n=(a=!1)=>{!a&&nl.value!==null&&zl.value&&(zl.value.getAttribute("data-comment")||zl.value.getAttribute("data-fake-comment"))===nl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),zl.value&&(zl.value.classList.remove("editor-comment-highlighted"),zl.value=null))},ko=a=>{if(!a||!a.element)return;$n(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;he("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},ln=()=>{$n()},Ql=()=>{!T.richText||!f.value||(He.value&&He.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),He.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),He.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"]}),Yl("setupCommentMarkersObserver-initial"))},eo=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Ue.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);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(()=>{eo(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(()=>[we.value,ct.value],()=>{we.value==="askAi"||ct.value==="askAi"?e.nextTick(()=>{Bo()}):(Ue.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>T.locale,a=>{a&&a!==de.value&&(de.value=a)},{immediate:!0}),le({openCommentOverlayForSelector:Yo,updateCommentMarkers:Yl,restoreCommentsFromModel:yo}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Lt.value},zt.value]]),style:e.normalizeStyle(Bt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ed,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:fn,title:e.unref(B)("textEditor.toolbar.undo")},[...n[45]||(n[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,Sd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:Hn,title:e.unref(B)("textEditor.toolbar.redo")},[...n[46]||(n[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,Vd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nd,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Wn("paragraph")),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Md)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,_d)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ad)):(e.openBlock(),e.createElementBlock("svg",Dd,[...n[47]||(n[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)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Bd),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>wt("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Hd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>wt("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Rd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>wt("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>wt("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>wt("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>wt("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>wt("<p>"))},[n[49]||(n[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(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("bold")}]),onClick:n[9]||(n[9]=s=>Il("bold")),title:e.unref(B)("textEditor.toolbar.bold")},[...n[50]||(n[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,Od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[10]||(n[10]=s=>Il("italic")),title:e.unref(B)("textEditor.toolbar.italic")},[...n[51]||(n[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,Wd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[11]||(n[11]=s=>Il("underline")),title:e.unref(B)("textEditor.toolbar.underline")},[...n[52]||(n[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,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Sn,title:e.unref(B)("textEditor.toolbar.citation")},[...n[53]||(n[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,Zd),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:mt,title:e.unref(B)("textEditor.toolbar.removeLink")},[...n[55]||(n[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,Xd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ot,title:e.unref(B)("textEditor.toolbar.insertLink")},[...n[54]||(n[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,Ud)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertUnorderedList")}]),onClick:ce,title:e.unref(B)("textEditor.toolbar.bulletList")},[...n[56]||(n[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,Yd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:tl,title:e.unref(B)("textEditor.toolbar.numberList")},[...n[57]||(n[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,jd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Un,title:e.unref(B)("textEditor.toolbar.image")},[...n[58]||(n[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,Kd),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",Gd)):e.createCommentVNode("",!0),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:Ul},[...n[59]||(n[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,Qd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",e1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Wn("askAi")),title:e.unref(B)("textEditor.toolbar.askAi")},[n[60]||(n[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",l1,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,t1),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)?(e.openBlock(),e.createElementBlock("div",o1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&i<E.customToolbarSlots.length-1&&zn(i)?(e.openBlock(),e.createElementBlock("div",a1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:dl})):e.createCommentVNode("",!0),e.createVNode(ia,{showModal:_e.value,width:"500px",height:"55vh",onCloseModal:Gn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",s1,[e.createElementVNode("div",r1,[e.createElementVNode("label",i1,e.toDisplayString(e.unref(B)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Fe,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>pt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Qn,["enter"])},null,40,c1),[[e.vModelText,pt.value]])]),e.createElementVNode("div",u1,[e.createElementVNode("label",d1,e.toDisplayString(e.unref(B)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qn,["enter"])},null,40,m1),[[e.vModelText,Je.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Gn},e.toDisplayString(e.unref(B)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qn},e.toDisplayString(e.unref(B)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ia,{showModal:gt.value,width:"500px",height:"80vh",onCloseModal:Fn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(B)("textEditor.image.editImage"):e.unref(B)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",p1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(B)("textEditor.image.upload")),3),n[65]||(n[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":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(B)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",v1,[e.createElementVNode("div",f1,[e.createElementVNode("div",h1,[dn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",g1,e.toDisplayString(e.unref(B)("textEditor.image.uploadImage")),1)),dn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Jo},[e.createElementVNode("img",{src:Zt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,y1),n[66]||(n[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:rt,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:rt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Xn},null,544))]),e.createElementVNode("div",k1,[e.createElementVNode("label",C1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,b1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",w1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,E1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",S1,[e.createElementVNode("label",V1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,N1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[e.createElementVNode("div",_1,[e.createElementVNode("label",$1,e.toDisplayString(e.unref(B)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Jt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Ie.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(_l,["enter"])},null,40,L1),[[e.vModelText,Ie.value]])]),e.createElementVNode("div",T1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,D1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",H1,[e.createElementVNode("label",R1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,F1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",I1,[e.createElementVNode("label",z1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,P1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fn},e.toDisplayString(e.unref(B)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:_l},e.toDisplayString(e.unref(B)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Fl.value&&pl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.title")),1),e.createElementVNode("div",O1,[pl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",W1,[E.title?(e.openBlock(),e.createElementBlock("span",q1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",Z1,e.toDisplayString(wn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:tt,onFocus:Ae,onBlur:it,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!pl.value}]),placeholder:wn.value,disabled:E.disabled,rows:"1"},null,42,U1)])],2)):e.createCommentVNode("",!0),E.showTitle&&Fl.value&&pl.value?(e.openBlock(),e.createElementBlock("div",X1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Kl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.description")),1),e.createElementVNode("div",Y1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",j1,[E.description?(e.openBlock(),e.createElementBlock("span",K1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",G1,e.toDisplayString(Dl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:E.description,onInput:wl,onFocus:kl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Dl.value,disabled:E.disabled,rows:"1"},null,42,Q1)])],2)):e.createCommentVNode("",!0),E.showDescription&&Kl.value&&M.value?(e.openBlock(),e.createElementBlock("div",J1,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":nl.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:i=>Ao(s),onMouseleave:ln},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,lm)):(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,tm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,am)):(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,om)):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(i=>ko(s),["stop"])},[e.createElementVNode("span",im,"+"+e.toDisplayString(s.additionalCount),1)],12,rm)):e.createCommentVNode("",!0)],46,em))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",fm,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(ql.value),onInput:At,onBlur:vn,onClick:Mo,onMouseup:_o,onKeyup:_o,onKeydown:jo,onPaste:qn,onMousemove:rn,onMouseleave:fl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value&&nl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",gm,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,ym)):e.createCommentVNode("",!0)]),e.createElementVNode("div",km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",bm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,wm)):(e.openBlock(),e.createElementBlock("span",xm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.createElementVNode("div",Sm,[e.createElementVNode("div",Vm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Nm,e.toDisplayString($(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":O(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!O(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>uo(s,i),["stop"]),title:e.unref(B)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[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,Bm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(B)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(hn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,_m),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(hn,["stop"])},[...n[69]||(n[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",$m,[e.createElementVNode("div",Lm,[e.createElementVNode("span",Tm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Am,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",cm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:D,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:mn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(Kt.value)},null,46,um),e.createElementVNode("div",dm,[e.createElementVNode("div",mm,[e.createElementVNode("span",pm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",vm,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(R.value),onMouseenter:n[28]||(n[28]=s=>me.value=!0),onMouseleave:Xl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Vt,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,Dm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(hl,["stop"]),title:e.unref(B)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Rm,[...n[71]||(n[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,Hm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&ke.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Dt},[e.createElementVNode("div",Fm,[ke.value===e.unref(B)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Im,[...n[72]||(n[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:ke.value},e.toDisplayString(ke.value),9,zm)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_n,["stop"]),title:e.unref(B)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Om,[...n[73]||(n[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,Pm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Qe,class:"dss-floating-toolbar",style:e.normalizeStyle(be.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(fn,["stop"]),title:e.unref(B)("textEditor.toolbar.undo")},[...n[74]||(n[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,qm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(B)("textEditor.toolbar.redo")},[...n[75]||(n[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,Zm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Um,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>I("paragraph"),["stop"])),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ym)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,jm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Jm)):(e.openBlock(),e.createElementBlock("svg",e2,[...n[76]||(n[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)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Xm),ct.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>Bl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>Bl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>Bl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>Bl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>Bl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>Bl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>Bl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Il("bold"),["stop"])),title:e.unref(B)("textEditor.toolbar.bold")},[...n[78]||(n[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,t2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Il("italic"),["stop"])),title:e.unref(B)("textEditor.toolbar.italic")},[...n[79]||(n[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,l2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Il("underline"),["stop"])),title:e.unref(B)("textEditor.toolbar.underline")},[...n[80]||(n[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,n2),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:e.withModifiers(Sn,["stop"]),title:e.unref(B)("textEditor.toolbar.citation")},[...n[81]||(n[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,o2),n[92]||(n[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(mt,["stop"]),title:e.unref(B)("textEditor.toolbar.removeLink")},[...n[83]||(n[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,s2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ot,["stop"]),title:e.unref(B)("textEditor.toolbar.insertLink")},[...n[82]||(n[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,a2)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertUnorderedList")}]),onClick:e.withModifiers(ce,["stop"]),title:e.unref(B)("textEditor.toolbar.bulletList")},[...n[84]||(n[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,r2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:e.withModifiers(tl,["stop"]),title:e.unref(B)("textEditor.toolbar.numberList")},[...n[85]||(n[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,i2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Un,["stop"]),title:e.unref(B)("textEditor.toolbar.image")},[...n[86]||(n[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,c2),Lt.value?(e.openBlock(),e.createElementBlock("div",u2)):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["stop"])},[...n[87]||(n[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,d2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",p2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>I("askAi"),["stop"])),title:e.unref(B)("textEditor.toolbar.askAi")},[n[88]||(n[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",f2,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,v2),ct.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),bl.value?(e.openBlock(),e.createElementBlock("div",h2,[E.askAi&&bl.value?(e.openBlock(),e.createElementBlock("div",g2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)&&on(s)?(e.openBlock(),e.createElementBlock("div",y2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&on(s)&&i<E.customToolbarSlots.length-1&&Dn(i)?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),w2={class:"dss-color-picker__section-title"},x2={class:"dss-color-picker__presets-row"},E2=["title","onClick"],S2={key:1,class:"dss-color-picker__section"},V2={class:"dss-color-picker__presets-row"},N2=["title","onClick"],B2={key:2,class:"dss-color-picker__section"},M2={class:"dss-color-picker__section-header"},_2={class:"dss-color-picker__presets-row"},$2=["title","onClick"],L2=["onClick"],T2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},A2=["title","onClick"],D2={class:"dss-color-picker__input-row"},H2=["value"],R2={__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(E,{emit:le}){function _(oe){const Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(oe);if(!Y)return{h:0,s:0,l:50};const j=parseInt(Y[1],16)/255,pe=parseInt(Y[2],16)/255,xe=parseInt(Y[3],16)/255,je=Math.max(j,pe,xe),Rt=Math.min(j,pe,xe);let jt=0,et=0;const pl=(je+Rt)/2;if(je!==Rt){const M=je-Rt;switch(et=pl>.5?M/(2-je-Rt):M/(je+Rt),je){case j:jt=((pe-xe)/M+(pe<xe?6:0))/6;break;case pe:jt=((xe-j)/M+2)/6;break;case xe:jt=((j-pe)/M+4)/6;break}}return{h:jt*360,s:et*100,l:pl*100}}function B(oe,Y,j){Y/=100,j/=100;const pe=Y*Math.min(j,1-j),xe=je=>{const Rt=(je+oe/30)%12,jt=j-pe*Math.max(Math.min(Rt-3,9-Rt,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function de(oe){const Y=oe.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Y)return null;let j=Y[1];return j.length===3&&(j=j.split("").map(pe=>pe+pe).join("")),"#"+j}function P(oe){const Y=oe.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Y)return null;const j=Math.max(0,Math.min(255,Number.parseInt(Y[1],10))),pe=Math.max(0,Math.min(255,Number.parseInt(Y[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(Y[3],10)));return`#${j.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function T(oe){if(typeof oe!="string")return null;const Y=oe.trim();return de(Y)||P(Y)}function he(oe,Y,j){Y/=100,j/=100;const pe=j+Y*Math.min(j,1-j),xe=pe===0?0:2-2*j/pe;return{h:oe,s:xe*100,v:pe*100}}function st(oe,Y,j){Y/=100,j/=100;const pe=j*(1-Y/2),xe=pe===0||pe===1?0:(j-pe)/Math.min(pe,1-pe);return{h:oe,s:xe*100,l:pe*100}}const te=E,f=le,we=e.ref(!1),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(-1),fe=e.ref(-1),R=e.ref(null),me=e.ref(null),_e=e.ref(null),Je=e.ref(null),pt=e.ref({top:0,left:0}),Z=e.ref(_(te.modelValue||"#b8a5de")),Fe=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),We=e.computed(()=>!te.disableCustomColors),Se=e.computed(()=>Fe.value?0:te.initialPresetCount!=null?te.initialPresetCount:fe.value<0?null:fe.value),Le=e.computed(()=>{const oe=Se.value;return oe==null?!0:Math.max(0,te.presetColors.length-oe)<te.max}),Ye=e.computed(()=>!!(Ce.value||X.value>=0||!ie.value&&te.presetColors.length===0));e.computed(()=>{const oe=Se.value;return oe!=null&&te.presetColors.length>oe});const ie=e.computed(()=>Fe.value||Se.value!=null),Ge=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(0,oe)}),be=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(oe)});function Qe(oe){const Y=Se.value;return Y!=null?Y+oe:-1}function ct(oe){const Y=Se.value;return Y!=null&&oe>=Y}function gt(oe){ct(oe)&&(X.value=oe,Z.value=_(te.presetColors[oe]),Ce.value=!0,e.nextTick(()=>Je.value?.focus()))}function ut(oe){if(!ct(oe))return;const Y=te.presetColors.filter((xe,je)=>je!==oe);f("update:presetColors",Y);const j=de(te.modelValue),pe=de(te.presetColors[oe]);if(j&&pe&&j.toLowerCase()===pe.toLowerCase()){const xe=Y[Math.max(0,oe-1)]||Y[0];xe&&f("update:modelValue",xe)}}function qt(){J.value=!J.value,J.value||(X.value=-1,Ce.value=!1)}function Zt(){if(!We.value||X.value<0)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y),X.value=-1,Ce.value=!1}}function kt(){te.disabled||!We.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(G(),e.nextTick(()=>Je.value?.focus())))}function xt(oe){const Y=T(oe),j=T(te.modelValue);return Y&&j&&Y.toLowerCase()===j.toLowerCase()}function Yt(){if(te.disabled||!We.value||!Le.value)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors,Y];f("update:presetColors",j),f("update:modelValue",Y);const pe=Se.value??fe.value;pe>=0&&j.length-pe>=te.max&&(Ce.value=!1)}}const rt=e.computed(()=>{const{h:oe,s:Y,l:j}=Z.value;return B(oe,Y,j)}),Jt=e.computed(()=>rt.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),ol=e.computed(()=>{const oe=he(Z.value.h,Z.value.s,Z.value.l);return{left:`${oe.s}%`,bottom:`${oe.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),ke=e.computed(()=>({position:"fixed",left:`${pt.value.left}px`,top:`${pt.value.top}px`,zIndex:1002}));function W(){if(!R.value||!we.value)return;const oe=R.value.getBoundingClientRect(),Y=window.innerHeight||document.documentElement.clientHeight;let j=oe.bottom+4;const pe=me.value;pe&&j+pe.offsetHeight>Y-8&&(j=oe.top-4-pe.offsetHeight),pt.value={top:j,left:oe.left}}function G(){const oe=te.modelValue||"#b8a5de",Y=T(oe);Y&&(Z.value=_(Y))}function Ne(){f("update:modelValue",rt.value)}function Ie(){te.disabled||(we.value=!we.value,we.value&&(G(),e.nextTick(()=>{W(),Je.value?.focus()})))}function Ue(){const oe=rt.value,Y=de(oe);if(Y){if(X.value>=0){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y)}else if(We.value&&(te.presetColors.length>0||Fe.value)&&Ce.value&&Le.value&&!te.presetColors.some(pe=>de(pe)?.toLowerCase()===Y.toLowerCase())){const pe=[...te.presetColors,Y];f("update:presetColors",pe),f("update:modelValue",Y)}}we.value=!1,Ce.value=!1,J.value=!1,X.value=-1}function Et(oe){if(!_e.value)return;const Y=_e.value.getBoundingClientRect(),j=pe=>{const xe=Math.max(0,Math.min(1,(pe.clientX-Y.left)/Y.width)),je=Math.max(0,Math.min(1,1-(pe.clientY-Y.top)/Y.height)),Rt={h:Z.value.h,s:xe*100,v:je*100};Z.value=st(Rt.h,Rt.s,Rt.v)};j(oe),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),Ne()},{once:!0})}function Ke(oe){if(!oe.currentTarget)return;const j=oe.currentTarget.getBoundingClientRect(),pe=xe=>{const je=Math.max(0,Math.min(1,(xe.clientX-j.left)/j.width));Z.value={...Z.value,h:je*360}};pe(oe),document.addEventListener("mousemove",pe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",pe),Ne()},{once:!0})}function Ut(oe){const Y=oe.target.value,j=T(Y);j&&(Z.value=_(j),f("update:modelValue",j))}function qe(oe){if(te.disabled)return;const Y=T(oe);Y&&(Z.value=_(Y),f("update:modelValue",Y))}let Pe=null,Ht=null;function $t(){Pe&&(document.removeEventListener("keydown",Pe),Pe=null),Ht&&(window.removeEventListener("resize",Ht),Ht=null)}return e.watch(we,oe=>{if($t(),oe){if(!Fe.value&&te.initialPresetCount==null){const Y=te.presetColors.length;Y>0&&(fe.value<0||Y<fe.value)&&(fe.value=Y)}Pe=Y=>{Y.key==="Escape"&&Ue()},Ht=W,document.addEventListener("keydown",Pe),window.addEventListener("resize",Ht)}}),e.watch(()=>te.modelValue,()=>{we.value&&G()},{immediate:!1}),e.watch(be,oe=>{oe.length===0&&(J.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount($t),(oe,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:R,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:rt.value})},[...Y[0]||(Y[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"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ue,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ke.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Fe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+pe,class:"dss-color-picker__section"},[e.createElementVNode("span",w2,e.toDisplayString(j.title),1),e.createElementVNode("div",x2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(xe,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+pe+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Rt=>qe(xe),["stop"])},null,14,E2))),128))])]))),128)):Ge.value.length?(e.openBlock(),e.createElementBlock("div",S2,[Y[1]||(Y[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",V2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,N2))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",B2,[e.createElementVNode("div",M2,[Y[3]||(Y[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),be.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":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(qt,["stop"])},[...Y[2]||(Y[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",_2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+pe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&xt(j),"dss-color-picker__preset-bubble--editing":J.value&&X.value===Qe(pe)}]),style:e.normalizeStyle({backgroundColor:X.value===Qe(pe)?rt.value:j,"--dss-preset-color":X.value===Qe(pe)?rt.value:j}),title:X.value===Qe(pe)?rt.value:j,onClick:e.withModifiers(xe=>J.value?gt(Qe(pe)):qe(j),["stop"])},null,14,$2),J.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(xe=>ut(Qe(pe)),["stop"])},[...Y[4]||(Y[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,L2)):e.createCommentVNode("",!0)],2))),128)),Le.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(kt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",T2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,A2))),128)),We.value&&Le.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(kt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:_e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(ol.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[Y[5]||(Y[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",D2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Je,type:"text",class:"dss-color-picker__hex-input",value:Jt.value,onInput:Ut},null,40,H2)]),We.value&&ie.value&&(E.presetColors.length||Fe.value)&&Le.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),We.value&&ie.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Zt}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ue}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},F2={key:0,class:"dss-loader"},I2={key:0,class:"dss-loader-label"},z2={key:1,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:2,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:3,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:4,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:5,class:"dss-loader dss-loader--inline"},j2={class:"dss-loader-inline-text"},K2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const le=E,_=e.computed(()=>le.size==="small"?"dss-loaders--size-small":le.size==="large"?"dss-loaders--size-large":le.size==="medium"||le.size==null?"dss-loaders--size-medium":null),B=e.computed(()=>{const de={};if(!(le.size==="small"||le.size==="medium"||le.size==="large"||le.size==null)){const P=typeof le.size=="number"?`${le.size}px`:String(le.size);de["--dss-loader-size"]=P}return le.color&&(de["--dss-loader-accent"]=le.color,de["--dss-loader-accent-soft"]=`color-mix(in srgb, ${le.color} 30%, white)`),de});return(de,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(B.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",F2,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",I2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",z2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",O2,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",q2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",U2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",Y2,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",j2,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Sa="dss-skeleton-item",G2={__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:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Sa},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const le=E,_=e.computed(()=>{const P={"dss-skeleton--loading":le.loading,"dss-skeleton--static":!le.shimmer,"dss-skeleton--multiple":le.mode==="multiple","dss-skeleton--dark":le.darkMode};return le.mode==="multiple"&&le.targetClass!==Sa&&(P[`dss-skeleton--target-${le.targetClass}`]=!0),P}),B=e.computed(()=>{const P={};return le.borderRadius&&(P.borderRadius=le.borderRadius),P}),de=e.computed(()=>{const P={};return le.borderRadius&&(P["--dss-skeleton-border-radius"]=le.borderRadius),le.darkMode?(P["--dss-skeleton-bg"]=le.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=le.shimmerDark||"#3e3f41",P):(le.bgColor&&(P["--dss-skeleton-bg"]=le.bgColor),le.shimmerColor&&(P["--dss-skeleton-shimmer"]=le.shimmerColor),P)});return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(de.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(B.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},Q2={key:0,class:"dss-dnd-column-header"},J2={class:"dss-dnd-column-title"},e0={class:"dss-dnd-column-count"},t0=["data-column"],l0={key:0,class:"dss-dnd-indicator"},n0=["onPointerdown"],o0=["onPointerdown"],a0={class:"dss-dnd-item-content"},s0={class:"dss-dnd-item-default"},r0={key:0,class:"dss-dnd-empty"},i0={name:"DSSDnd"},c0=Object.assign(i0,{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(E,{emit:le}){const _=E,B=le,de=e.useSlots(),P=e.computed(()=>!!de["delete-zone"]),T={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},he=e.computed(()=>({...T,..._.options})),st=e.computed(()=>({"--dss-dnd-col-min-w":he.value.columnMinWidth,"--dss-dnd-col-max-w":he.value.columnMaxWidth,"--dss-dnd-col-gap":he.value.columnGap,"--dss-dnd-indicator-color":he.value.indicatorColor,"--dss-dnd-body-max-h":he.value.columnBodyMaxHeight}));function te(W){if(!he.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(-1),X=e.ref(null);let fe=null,R=null,me=null,_e=null,Je=0,pt=0,Z="",Fe=null;const We=5,Se=e.computed(()=>{const W={};for(const G of _.columns)W[G.value]=_.items.filter(Ne=>Ne[_.columnKey]===G.value).sort((Ne,Ie)=>(Ne[_.positionKey]??0)-(Ie[_.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!f.value,Ne=f.value?.[_.itemKey],Ie=we.value,Ue=J.value;for(const Et of _.columns){const Ke=Se.value[Et.value]||[],Ut=[],qe=Ie==Et.value;let Pe=0;for(let Ht=0;Ht<Ke.length;Ht++){const $t=Ke[Ht],oe=G&&$t[_.itemKey]===Ne;!oe&&qe&&Ue===Pe&&Ut.push({type:"indicator",key:`ind-${Pe}`}),oe||Pe++,Ut.push({type:"item",item:$t,isDragged:oe,key:`item-${$t[_.itemKey]}`})}qe&&Ue>=Pe&&Ut.push({type:"indicator",key:"ind-end"}),W[Et.value]=Ut}return W});function Ye(W,G){const Ie=(Se.value[W]||[]).filter(Ke=>Ke[_.itemKey]!==f.value?.[_.itemKey]);if(Ie.length===0)return 1;if(G<=0){const Ke=Ie[0][_.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(G>=Ie.length){const Ke=Ie[Ie.length-1][_.positionKey];return(Ke??0)+1}const Ue=Ie[G-1][_.positionKey]??0,Et=Ie[G][_.positionKey]??0;return(Ue+Et)/2}function ie(W,G,Ne){me&&me.remove();const Ie=W.getBoundingClientRect(),Ue=W.cloneNode(!0);Ue.classList.add("dss-dnd-ghost"),Ue.style.cssText=`
104
106
  position: fixed;
105
- left: ${K-tt}px;
106
- top: ${Se-mt}px;
107
- width: ${Re.width}px;
108
- height: ${Re.height}px;
107
+ left: ${G-Je}px;
108
+ top: ${Ne-pt}px;
109
+ width: ${Ie.width}px;
110
+ height: ${Ie.height}px;
109
111
  z-index: 9999;
110
112
  pointer-events: none;
111
- opacity: ${pe.value.dragGhostOpacity};
113
+ opacity: ${he.value.dragGhostOpacity};
112
114
  box-sizing: border-box;
113
115
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
114
- background-color: ${pe.value.dragSourceBackground};
116
+ background-color: ${he.value.dragSourceBackground};
115
117
  font-family: 'Work Sans', sans-serif;
116
118
  cursor: grabbing;
117
- `,document.body.appendChild(Ze),ue=Ze}function Je(P,K){ue&&(ue.style.left=`${P-tt}px`,ue.style.top=`${K-mt}px`)}function we(P){P.classList.add("dss-dnd-item--dragging"),P.style.background=pe.value.dragSourceBackground,P.style.borderColor=pe.value.dragSourceBorder,P.style.transform="scale(0.97)"}function et(P){P.classList.remove("dss-dnd-item--dragging"),P.style.background="",P.style.borderColor="",P.style.transform=""}function ct(P,K){return document.elementFromPoint(P,K)?.closest(".dss-dnd-column-body")??null}function vt(P,K){return!!document.elementFromPoint(P,K)?.closest("[data-dss-dnd-delete-zone]")}function ut(P,K){if(I.value&&vt(P,K)){ke.value=!0,Ce.value=null,Q.value=-1;return}ke.value=!1;const Se=ct(P,K),Re=Se?.getAttribute("data-column")??null;if(!Re){Ce.value=null,Q.value=-1;return}Ce.value=Re;const Ze=Se.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let xt=Ze.length;for(let Ke=0;Ke<Ze.length;Ke++){const zt=Ze[Ke].getBoundingClientRect();if(K<zt.top+zt.height/2){xt=Ke;break}}Q.value=xt}function Ft(P){P.preventDefault(),Je(P.clientX,P.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,ut(P.clientX,P.clientY)}))}function It(P){window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Me?.releasePointerCapture?.(P.pointerId),et(Me),Me=null;const K=I.value&&vt(P.clientX,P.clientY);if(v.value&&K)V("delete",{item:v.value});else{const Re=ct(P.clientX,P.clientY)?.getAttribute("data-column")??null;if(v.value&&Re){const Ze=v.value[$.columnKey],xt=Re,zt=(Ee.value[xt]||[]).filter($t=>$t[$.itemKey]!==v.value[$.itemKey]),qe=Math.max(0,Math.min(Q.value,zt.length)),ze=Ye(xt,qe),Lt=v.value[$.itemKey];V("move",{item:v.value,from:Ze,to:xt,position:ze,index:qe}),F&&clearTimeout(F),X.value={id:Lt,from:Ze,to:xt},F=setTimeout(()=>{X.value=null},3500)}}ue&&(ue.remove(),ue=null),Z!==null&&(document.body.style.cursor=Z,Z=""),ye()}function bt(P,K){P.preventDefault();const Se=P.target.closest(".dss-dnd-item");if(!Se)return;const Re=Se.getBoundingClientRect();tt=P.clientX-Re.left,mt=P.clientY-Re.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=K,Me=Se,ie(Se,P.clientX,P.clientY),requestAnimationFrame(()=>we(Se)),Se.setPointerCapture?.(P.pointerId),window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function wt(){Ae&&(window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),Ae=null)}function Jt(P){if(!Ae||P.pointerId!==Ae.pointerId)return;const K=P.clientX-Ae.startX,Se=P.clientY-Ae.startY;if(Math.abs(K)>=We||Math.abs(Se)>=We){const Re=Ae.item;wt(),bt(P,Re)}}function pt(P){!Ae||P.pointerId!==Ae.pointerId||wt()}function jt(P,K){wt(),Ae={item:K,startX:P.clientX,startY:P.clientY,pointerId:P.pointerId},window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",pt),window.addEventListener("pointercancel",pt)}function kt(P,K){pe.value.useHandle||jt(P,K)}function tn(P,K){jt(P,K)}function U(){me&&(cancelAnimationFrame(me),me=null)}function ye(){U(),v.value=null,Ce.value=null,ke.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{U(),wt(),F&&clearTimeout(F),ue&&(ue.remove(),ue=null)}),(P,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(st.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":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(P.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Se=>(e.openBlock(),e.createElementBlock("div",{key:Se.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Ce.value==Se.value},Se.class||""]]),style:e.normalizeStyle(te(Se))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",h2,[e.renderSlot(P.$slots,"column-header",{column:Se,items:Ee.value[Se.value]||[]},()=>[e.createElementVNode("span",y2,e.toDisplayString(Se.title||Se.value),1),e.createElementVNode("span",k2,e.toDisplayString((Ee.value[Se.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value[Se.value],Re=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Re.key},[Re.type==="indicator"?(e.openBlock(),e.createElementBlock("div",b2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Re.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:Ze=>kt(Ze,Re.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ze=>tn(Ze,Re.item),["stop"])},[e.renderSlot(P.$slots,"handle",{},()=>[K[0]||(K[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,x2)):e.createCommentVNode("",!0),e.createElementVNode("div",E2,[e.renderSlot(P.$slots,"item",{item:Re.item,column:Se,justDropped:X.value?.id===Re.item[E.itemKey],droppedFrom:X.value?.id===Re.item[E.itemKey]?X.value.from:null,droppedTo:X.value?.id===Re.item[E.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",S2,e.toDisplayString(Re.item[E.itemKey]),1)])])],42,w2))],64))),128)),(Ee.value[Se.value]||[]).length===0&&Ce.value!=Se.value?(e.openBlock(),e.createElementBlock("div",V2,[e.renderSlot(P.$slots,"empty",{column:Se},()=>[K[1]||(K[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,C2)],6))),128))],6))}}),M2={name:"DSSConfetti"},_2=Object.assign(M2,{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(E){const ne=E,$=e.ref(null),V=e.ref(!1);let ce=[],I=null,_=null;function pe(Q,X){const me=[];for(let F=0;F<ne.count;F++)me.push(st(Q));return me}function st(Q,X){return{x:Math.random()*Q,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 te(Q,X,me,F){Q.clearRect(0,0,X,me);for(const ue of ce)Q.save(),Q.globalAlpha=ue.opacity*F,Q.beginPath(),Q.lineWidth=ue.r,Q.strokeStyle=ue.color,Q.moveTo(ue.x+ue.tilt+ue.r/2,ue.y),Q.lineTo(ue.x+ue.tilt,ue.y+ue.tilt+ue.r/2),Q.stroke(),Q.restore()}function v(Q,X,me){const F=.3+me*.7;for(let ue=0;ue<ce.length;ue++){const Me=ce[ue];Me.tiltAngle+=Me.tiltInc,Me.y+=Me.speed*F,Me.x+=Math.sin(Me.d)*.5*F,Me.tilt=Math.sin(Me.tiltAngle)*15,me>=.99&&Me.y>X+20&&(ce[ue]=st(Q))}}function Ce(){V.value=!0,e.nextTick(()=>{const Q=$.value;if(!Q)return;const X=Q.getContext("2d"),me=Q.parentElement;if(!me)return;const F=me.getBoundingClientRect();Q.width=F.width,Q.height=F.height,ce=pe(Q.width,Q.height);const ue=Date.now(),Me=ue+ne.duration,tt=()=>{const mt=Date.now(),Z=mt-ue;if(mt<Me){let Ae=1;Z>ne.fadeStart&&(Ae=1-(Z-ne.fadeStart)/(ne.duration-ne.fadeStart)),te(X,Q.width,Q.height,Ae),v(Q.width,Q.height,Ae),I=requestAnimationFrame(tt)}else ke()};tt()})}function ke(){I&&(cancelAnimationFrame(I),I=null),ce=[],V.value=!1}return e.watch(()=>ne.trigger,Q=>{Q&&(_&&clearTimeout(_),_=setTimeout(Ce,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),_&&clearTimeout(_)}),(Q,X)=>V.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$2={class:"dss-filter-global-inner"},L2=["placeholder","value"],T2=["title"],A2={key:0,class:"dss-filter-funnel-badge"},D2={key:1,class:"dss-filter-sortby"},H2=["value"],R2=["value"],F2=["disabled","title"],I2={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"},z2={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"},P2={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"},O2={class:"dss-filter-panel"},W2={key:0,class:"dss-filter-empty"},q2={class:"dss-filter-row-prefix"},Z2={class:"dss-filter-cell"},U2=["onClick"],X2={class:"dss-filter-trigger-text"},Y2=["placeholder"],j2={class:"dss-filter-popup-list"},K2=["onClick"],G2={key:0,class:"dss-filter-popup-empty"},Q2={key:0,class:"dss-filter-cell"},J2=["onClick"],e0={class:"dss-filter-trigger-text"},t0={class:"dss-filter-popup-list"},n0=["onClick"],l0={key:1,class:"dss-filter-cell dss-filter-cell--value"},o0=["placeholder","onUpdate:modelValue"],a0={key:1,class:"dss-filter-date-wrap"},s0=["placeholder","onUpdate:modelValue"],r0=["placeholder","value","onInput","step"],i0={key:4,class:"dss-filter-between"},c0=["placeholder","value","onInput","step"],u0={class:"dss-filter-between-sep"},d0=["placeholder","value","onInput","step"],m0={key:5,class:"dss-filter-multiselect"},p0=["onClick"],f0={class:"dss-filter-trigger-text"},v0=["placeholder"],g0={class:"dss-filter-popup-list dss-filter-popup-list--check"},h0=["onClick"],y0=["checked"],k0={key:0,class:"dss-filter-popup-empty"},C0=["onClick"],b0={class:"dss-filter-foot"},w0={class:"dss-filter-cell"},x0=["placeholder"],E0={class:"dss-filter-popup-list"},S0=["onClick"],V0={key:0,class:"dss-filter-popup-divider"},N0=["onClick"],B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0=["placeholder"],T0={class:"dss-filter-popup-list"},A0=["onClick"],D0={key:0,class:"dss-filter-popup-empty"},H0={name:"DSSFilter"},R0=Object.assign(H0,{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(E,{expose:ne,emit:$}){const{t:V}=co.useI18n(),ce=E,I=$,_={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({..._,...ce.options})),st={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"}]},te=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],Ce=e.ref(""),ke=e.ref([]),Q=e.ref(null),X=e.ref(!1),me=e.ref(null),F=e.ref(""),ue=e.ref(null),Me=e.ref(""),tt=e.ref("asc");let mt=1;function Z(N){const b=N.find(B=>B&&typeof B=="object");if(!b)return null;for(const B of v)if(B in b&&typeof b[B]=="string")return B;return Object.keys(b).find(B=>typeof b[B]=="string")||null}function Ae(N,b){const B=b.filter(G=>G!=null&&G!=="NULL");if(B.length===0)return null;if(B.every(G=>Array.isArray(G))){const G=B.flatMap(De=>De).filter(De=>De!=null);return G.length===0?null:typeof G.find(De=>De!=null)=="object"?"arraySelect":"arrayText"}return B.every(G=>typeof G=="boolean")?"boolean":B.every(G=>typeof G=="number")?new Set(B).size<=pe.value.maxUniqueForEnum?"select":"range":B.every(G=>typeof G=="string")?new Set(B).size<=pe.value.maxUniqueForSelect?"select":"text":B.some(G=>typeof G=="object"&&!Array.isArray(G))?null:"text"}const We=e.computed(()=>{if(!ce.data?.length)return[];const N=new Set;for(const ae of ce.data)if(ae&&typeof ae=="object")for(const De of Object.keys(ae))N.add(De);const b=new Set(ce.exclude),B=[];for(const ae of N){if(b.has(ae))continue;const De=ce.config[ae]||{},Ct=ce.data.map(St=>St?.[ae]),lt=De.type||Ae(ae,Ct);if(!lt)continue;const Ie=De.filterMode||"contain",Et=Ie==="date"?"date":Ie==="string"?"text":lt,Bt={key:ae,label:De.label||nt(ae),type:Et,filterMode:Ie};if(lt==="select"){const St=Ct.filter(rt=>rt!=null&&rt!=="NULL");Bt.uniqueValues=[...new Set(St)].sort((rt,At)=>typeof rt=="number"&&typeof At=="number"?rt-At:String(rt).localeCompare(String(At)))}else if(lt==="range"||lt==="int"){const St=Ct.filter(rt=>typeof rt=="number");Bt.min=Math.min(...St),Bt.max=Math.max(...St)}else if(lt==="arraySelect"){const St=De.displayKey||Z(Ct.flatMap(rt=>Array.isArray(rt)?rt:[]));if(Bt.displayKey=St,Array.isArray(De.uniqueValues)&&De.uniqueValues.length>0)Bt.uniqueValues=De.uniqueValues.map(rt=>String(rt));else{const rt=Ct.flatMap(At=>Array.isArray(At)?At:[]).filter(At=>At!=null).map(At=>St&&typeof At=="object"?At[St]:String(At)).filter(At=>At!=null&&At!=="");Bt.uniqueValues=[...new Set(rt)].sort((At,Nt)=>String(At).localeCompare(String(Nt)))}}B.push(Bt)}const G=ce.config._order;return G&&B.sort((ae,De)=>{const Ct=G.indexOf(ae.key),lt=G.indexOf(De.key);return Ct===-1&&lt===-1?0:Ct===-1?1:lt===-1?-1:Ct-lt}),B}),Ee=e.computed(()=>{const N={};for(const b of We.value)N[b.key]=b;return N}),_e=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),Ye=e.computed(()=>{if(!_e.value)return[];const N=new Set(We.value.map(b=>b.key));return ce.config.groups.map(b=>({...b,keys:b.keys.filter(B=>N.has(B))})).filter(b=>b.keys.length>0)}),ie=e.computed(()=>{if(!_e.value)return[];const N=new Set(ce.config.groups.flatMap(b=>b.keys));return We.value.filter(b=>!N.has(b.key))}),Je=e.computed(()=>{if(!ue.value)return[];const N=new Set(ue.value.keys),b=We.value.filter(G=>N.has(G.key));if(!F.value)return b;const B=F.value.toLowerCase();return b.filter(G=>G.label.toLowerCase().includes(B))}),we=e.computed(()=>{if(!F.value)return We.value;const N=F.value.toLowerCase();return We.value.filter(b=>b.label.toLowerCase().includes(N))}),et=e.computed(()=>We.value.filter(N=>!["arraySelect","arrayText"].includes(N.type))),ct=e.computed(()=>Me.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function vt(N){Q.value===N?ut():(Q.value=N,F.value="",ue.value=null)}function ut(){Q.value=null,F.value="",ue.value=null}function Ft(N){const b=N.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!b&&!N.target.closest(".dss-filter-popup")&&!N.target.closest(".dss-filter-trigger")&&!N.target.closest(".dss-filter-add-btn")&&ut(),X.value&&me.value&&!me.value.contains(N.target)&&(b||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Ft)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ft));function It(N){return Ee.value[N]?.label||nt(N)}function bt(N){return Ee.value[N.key]?.filterMode||"contain"}function wt(N){return V(`filter.operators.${N}`)}function Jt(N){const b=Ee.value[N.key];return(st[b?.type]||st.text).map(B=>({...B,label:V(`filter.operators.${B.value}`)}))}function pt(N){return te.has(N)}function jt(N){const b=Ee.value[N.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?N.operator==="between"?"between":"number":"text":"text"}function kt(N){return st[N]?.[0]?.value||"contains"}function tn(N,b){return te.has(b)||N==="date"?null:N==="select"||N==="arraySelect"?[]:(N==="range"||N==="int")&&b==="between"?{min:null,max:null}:N==="range"||N==="int"?null:""}function U(N){return Ee.value[N.key]?.uniqueValues||[]}function ye(N){const b=U(N);if(!F.value)return b;const B=F.value.toLowerCase();return b.filter(G=>String(G).toLowerCase().includes(B))}function P(N){const b=N.value;return!b||b.length===0?V("filter.select"):b.length<=2?b.join(", "):V("filter.selectedCount",{count:b.length})}function K(N){const b=Ee.value[N],B=b?.filterMode||"contain",G=b?.type||"text",ae=B==="string"?"contains":kt(G);ke.value.push(e.reactive({id:mt++,key:N,operator:ae,value:tn(G,ae)})),ut()}function Se(N){ke.value=ke.value.filter(b=>b.id!==N)}function Re(N,b){const G=Ee.value[b]?.type||"text";N.key=b,N.operator=kt(G),N.value=tn(G,N.operator),ut()}function Ze(N,b){const B=jt(N);N.operator=b;const G=jt(N);if(B!==G||te.has(b)){const ae=Ee.value[N.key];N.value=tn(ae?.type||"text",b)}ut()}function xt(N,b){const B=b.target.value;N.value=B===""?null:Number(B)}function Ke(N,b,B){const G=B.target.value,ae=G===""?null:Number(G);(!N.value||typeof N.value!="object")&&(N.value={min:null,max:null}),N.value={...N.value,[b]:isNaN(ae)?null:ae}}function zt(N,b){const B=N.value||[],G=B.indexOf(b);N.value=G>=0?B.filter(ae=>ae!==b):[...B,b]}function qe(){ke.value=[],Ce.value="",ut()}function ze(N){Ce.value=N.target.value}function Lt(N){Me.value=N.target.value}function $t(){tt.value=tt.value==="asc"?"desc":"asc"}const oe=e.computed(()=>{if(!ce.data)return[];let N=ce.data;if(Ce.value){const b=Ce.value.toLowerCase();N=N.filter(B=>{for(const G of Object.keys(B)){const ae=B[G];if(typeof ae=="string"&&ae.toLowerCase().includes(b)||typeof ae=="number"&&String(ae).includes(b)||Array.isArray(ae)&&ae.some(De=>De!=null&&(typeof De=="string"?De.toLowerCase().includes(b):typeof De=="object"?Object.values(De).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of ke.value){if(!de(b))continue;const B=Ee.value[b.key];B&&(N=N.filter(G=>be(G,b,B)))}if(ce.showSortBy&&Me.value){const b=Me.value,B=tt.value==="asc"?1:-1;N=[...N].sort((G,ae)=>Y(G?.[b],ae?.[b])*B)}return N});function Y(N,b){const B=j(N),G=j(b);return B==null&&G==null?0:B==null?1:G==null?-1:typeof B=="number"&&typeof G=="number"?B-G:String(B).localeCompare(String(G),void 0,{numeric:!0,sensitivity:"base"})}function j(N){return N==null||N==="NULL"?null:typeof N=="string"||typeof N=="number"||typeof N=="boolean"?N:N instanceof Date?N.getTime():null}function de(N){return te.has(N.operator)?!0:N.value==null||typeof N.value=="string"&&N.value===""||Array.isArray(N.value)&&N.value.length===0?!1:N.value instanceof Date?!isNaN(N.value.getTime()):!(typeof N.value=="object"&&!Array.isArray(N.value)&&N.value.min==null&&N.value.max==null)}function be(N,b,B){const G=N?.[b.key],ae=b.value,De=b.operator;if(De==="is_empty")return Xt(G);if(De==="is_not_empty")return!Xt(G);const Ct=B.type;if(Ct==="text"||Ct==="arrayText"){const lt=Ct==="arrayText"&&Array.isArray(G)?G.filter(Bt=>Bt!=null).map(String).join(" "):G!=null?String(G):"",Ie=String(ae).toLowerCase(),Et=lt.toLowerCase();switch(De){case"contains":return Et.includes(Ie);case"not_contains":return!Et.includes(Ie);case"equals":return Et===Ie;case"not_equals":return Et!==Ie;case"starts_with":return Et.startsWith(Ie);case"ends_with":return Et.endsWith(Ie);default:return!0}}if(Ct==="select")switch(De){case"is_any_of":return ae.includes(G);case"is_none_of":return!ae.includes(G);default:return!0}if(Ct==="range"||Ct==="int"){const lt=typeof G=="number"?G:Number(G);if(typeof lt!="number"||isNaN(lt))return!1;if(De==="between"){const Et=ae?.min!=null?Number(ae.min):null,Bt=ae?.max!=null?Number(ae.max):null,St=Et!=null&&!isNaN(Et)?Et:null,rt=Bt!=null&&!isNaN(Bt)?Bt:null;return(St==null||lt>=St)&&(rt==null||lt<=rt)}const Ie=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(De==="contains"||De==="not_contains"){const Et=String(lt),Bt=String(ae??"").toLowerCase(),St=Et.toLowerCase().includes(Bt);return De==="contains"?St:!St}if(typeof Ie!="number"||isNaN(Ie))return!1;switch(De){case"eq":return lt===Ie;case"neq":return lt!==Ie;case"gt":return lt>Ie;case"gte":return lt>=Ie;case"lt":return lt<Ie;case"lte":return lt<=Ie;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(G))return!1;const lt=G.filter(Ie=>Ie!=null).map(Ie=>B.displayKey&&typeof Ie=="object"?Ie[B.displayKey]:String(Ie));switch(De){case"contains_any":return lt.some(Ie=>ae.includes(Ie));case"contains_all":return ae.every(Ie=>lt.includes(Ie));case"not_contains_any":return!lt.some(Ie=>ae.includes(Ie));default:return!0}}if(Ct==="date"){const lt=je(ae);if(!lt||isNaN(lt.getTime()))return!1;const Ie=je(G);if(!Ie||isNaN(Ie.getTime()))return!1;const Et=Tt(Ie),Bt=Tt(lt);switch(De){case"eq":return Et===Bt;case"before":return Et<Bt;case"after":return Et>Bt;default:return!0}}if(Ct==="boolean"){const lt=G===!0||G==="true"||G===1,Ie=G===!1||G==="false"||G===0;switch(De){case"is_true":return lt;case"is_false":return Ie;default:return!0}}return!0}function je(N){if(N==null)return null;if(N instanceof Date)return isNaN(N.getTime())?null:N;if(typeof N=="number")return new Date(N>1e10?N:N*1e3);if(typeof N=="string"){const b=new Date(N);return isNaN(b.getTime())?null:b}return null}function Tt(N){const b=N.getFullYear(),B=String(N.getMonth()+1).padStart(2,"0"),G=String(N.getDate()).padStart(2,"0");return`${b}-${B}-${G}`}function Xt(N){return!!(N==null||N===""||N==="NULL"||Array.isArray(N)&&N.length===0||Array.isArray(N)&&N.every(b=>b==null))}e.watch(oe,N=>I("update:modelValue",N),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],Ce.value="",X.value=!1,Me.value="",tt.value="asc",ut()});function nt(N){return N.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function sn(){const N=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(N);if(typeof b=="object"&&!Array.isArray(b)){const B={};for(const G of Object.keys(b))B[G]=N(b[G]);return B}return b};return{globalSearch:Ce.value,rows:ke.value.map(b=>({key:b.key,operator:b.operator,value:N(b.value),defType:Ee.value[b.key]?.type,defFilterMode:Ee.value[b.key]?.filterMode})),filteredCount:oe.value?.length??0}}return ne({getDebugState:sn}),(N,b)=>(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:me},[e.createElementVNode("div",$2,[b[20]||(b[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(V)("filter.searchAcrossFields"),value:Ce.value,onInput:ze},null,40,L2),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=B=>Ce.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:b[1]||(b[1]=B=>X.value=!X.value),type:"button",title:X.value?e.unref(V)("filter.closeAdvancedFilter"):e.unref(V)("filter.openAdvancedFilter")},[b[14]||(b[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)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,T2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",D2,[b[19]||(b[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:Me.value,onChange:Lt},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,B=>(e.openBlock(),e.createElementBlock("option",{key:B.key,value:B.key},e.toDisplayString(B.label),9,R2))),128))],40,H2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:$t,disabled:!Me.value,title:ct.value},[Me.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",z2,[...b[17]||(b[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",P2,[...b[18]||(b[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",I2,[...b[16]||(b[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,F2)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",O2,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",W2,e.toDisplayString(e.unref(V)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(B,G)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"dss-filter-row"},[e.createElementVNode("span",q2,e.toDisplayString(G===0?e.unref(V)("filter.where"):e.unref(V)("filter.and")),1),e.createElementVNode("div",Z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:field`),["stop"])},[e.createElementVNode("span",X2,e.toDisplayString(It(B.key)),1),b[21]||(b[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,U2),Q.value===`${B.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=ae=>F.value=ae),placeholder:e.unref(V)("filter.searchAttributes")},null,8,Y2),[[e.vModelText,F.value]]),e.createElementVNode("ul",j2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:De=>Re(B,ae.key)},e.toDisplayString(ae.label),9,K2))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",G2,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),bt(B)==="contain"||bt(B)==="date"?(e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:op`),["stop"])},[e.createElementVNode("span",e0,e.toDisplayString(wt(B.operator)),1),b[22]||(b[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,J2),Q.value===`${B.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt(B),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:B.operator===ae.value}]),onClick:De=>Ze(B,ae.value)},e.toDisplayString(ae.label),11,n0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pt(B.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l0,[bt(B)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":ae=>B.value=ae},null,8,o0)),[[e.vModelText,B.value]]):bt(B)==="date"?(e.openBlock(),e.createElementBlock("div",a0,[e.createVNode(la,{mode:"single",modelValue:B.value,"onUpdate:modelValue":ae=>B.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):jt(B)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":ae=>B.value=ae},null,8,s0)),[[e.vModelText,B.value]]):jt(B)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),value:B.value,onInput:ae=>xt(B,ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,r0)):jt(B)==="between"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.min"),value:B.value?.min,onInput:ae=>Ke(B,"min",ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,c0),e.createElementVNode("span",u0,e.toDisplayString(e.unref(V)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.max"),value:B.value?.max,onInput:ae=>Ke(B,"max",ae),step:Ee.value[B.key]?.type==="int"?1:void 0},null,40,d0)])):jt(B)==="multiselect"?(e.openBlock(),e.createElementBlock("div",m0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>vt(`${B.id}:val`),["stop"])},[e.createElementVNode("span",f0,e.toDisplayString(P(B)),1),b[23]||(b[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,p0),Q.value===`${B.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[U(B).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=ae=>F.value=ae),placeholder:e.unref(V)("filter.search")},null,8,v0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",g0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(B),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:De=>zt(B,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(B.value||[]).includes(ae),tabindex:"-1"},null,8,y0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,h0))),128)),ye(B).length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Se(B.id)},[...b[24]||(b[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,C0)]))),128)),e.createElementVNode("div",b0,[e.createElementVNode("div",w0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(B=>vt("add"),["stop"]))},e.toDisplayString(e.unref(V)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!ue.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,x0),[[e.vModelText,F.value]]),e.createElementVNode("ul",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:G=>ue.value=B},[e.createElementVNode("span",null,e.toDisplayString(B.label),1),b[25]||(b[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,S0))),128)),ie.value.length>0?(e.openBlock(),e.createElementBlock("li",V0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,N0))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=B=>ue.value=null)},[b[26]||(b[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(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,B0),[[e.vModelText,F.value]]),e.createElementVNode("ul",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,_0))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(V)("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":b[11]||(b[11]=B=>F.value=B),placeholder:e.unref(V)("filter.searchAttributes")},null,8,L0),[[e.vModelText,F.value]]),e.createElementVNode("ul",T0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:G=>K(B.key)},e.toDisplayString(B.label),9,A0))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",D0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:qe},e.toDisplayString(e.unref(V)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),F0={class:"dss-pill-field__pills"},I0=["data-value"],z0=["disabled"],P0={class:"dss-pill-field__pill-text"},O0={key:0,class:"dss-pill-field__pill-actions"},W0=["onClick"],q0=["onClick"],Z0=["placeholder","disabled"],U0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:ne}){const $=E,V=ne,ce=e.ref(""),I=e.ref([...$.modelValue]),_=e.ref(null);let pe=null;const st=e.ref(null),te=e.ref(""),v=e.ref(null),Ce=e.ref(null),ke=e.computed(()=>{if(!Ce.value)return;const{width:_e,height:Ye}=Ce.value;return{minWidth:`${_e}px`,height:`${Ye}px`}});function Q(_e,Ye){st.value===Ye&&(v.value=_e)}function X(){st.value=null,te.value="",Ce.value=null,v.value=null}const me=e.computed(()=>new Set(I.value.map(_e=>_e.trim()).filter(Boolean)));function F(_e){_.value=_e,pe&&clearTimeout(pe),pe=setTimeout(()=>{_.value=null,pe=null},900)}function ue(_e){const Ye=_e.trim();return Ye?me.value.has(Ye)?(F(Ye),!1):(I.value=[...I.value,Ye],V("update:modelValue",[...I.value]),!0):!1}function Me(_e){const Ye=_e.split(/\r?\n/g).map(et=>et.trim()).filter(Boolean);if(!Ye.length)return;const ie=new Set(I.value.map(et=>et.trim()).filter(Boolean)),Je=[...I.value];let we=null;for(const et of Ye){if(ie.has(et)){we??=et;continue}ie.add(et),Je.push(et)}Je.length!==I.value.length&&(I.value=Je,V("update:modelValue",[...I.value])),we&&F(we)}function tt(_e){$.disabled||(st.value===_e&&X(),I.value=I.value.filter((Ye,ie)=>ie!==_e),V("update:modelValue",[...I.value]))}async function mt(_e,Ye){if($.disabled)return;const ie=Ye.currentTarget.closest(".dss-pill-field__pill");ie&&(Ce.value={width:ie.offsetWidth,height:ie.offsetHeight}),st.value=_e,te.value=I.value[_e]??"",await e.nextTick();const Je=v.value;if(!Je)return;Je.focus();const we=Je.value.length;Je.setSelectionRange(we,we)}function Z(){X()}function Ae(){if($.disabled||st.value===null)return;const _e=st.value,Ye=I.value[_e]??"",ie=te.value.trim();if(X(),ie!==Ye&&me.value.has(ie)){F(ie);return}if(!ie){I.value=I.value.filter((we,et)=>et!==_e),V("update:modelValue",[...I.value]);return}const Je=I.value.map((we,et)=>et===_e?ie:we);I.value=Je,V("update:modelValue",[...I.value])}function We(_e){_e.preventDefault(),!$.disabled&&(ue(ce.value),ce.value="")}function Ee(_e){if($.disabled)return;const Ye=_e.clipboardData?.getData("text")??"";!Ye.includes(`
118
- `)&&!Ye.includes("\r")||(_e.preventDefault(),Me(Ye),ce.value="")}return e.watch(()=>$.modelValue,_e=>{I.value=Array.isArray(_e)?[..._e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),(_e,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":_e.disabled}])},[e.createElementVNode("div",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(ie,Je)=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":_.value===ie,"dss-pill-field__pill--editing":st.value===Je}]),style:e.normalizeStyle(st.value===Je&&Ce.value?ke.value:void 0)},[st.value===Je?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":te.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:we=>Q(we,Je),"onUpdate:modelValue":Ye[0]||(Ye[0]=we=>te.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:_e.disabled,onKeydown:[e.withKeys(Ae,["enter"]),e.withKeys(Z,["esc"])],onBlur:Ae},null,40,z0),[[e.vModelText,te.value]])],8,I0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",P0,e.toDisplayString(ie),1),_e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",O0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>mt(Je,we)},[...Ye[2]||(Ye[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,W0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:we=>tt(Je)}," × ",8,q0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ie=>ce.value=ie),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":_e.placeholder,disabled:_e.disabled,onPaste:Ee,onKeydown:e.withKeys(We,["enter"])},null,40,Z0),[[e.vModelText,ce.value]])])],2))}}),X0={class:"dss-step-bar__layout"},Y0={class:"dss-step-bar__header"},j0={class:"dss-step-bar__label"},K0={key:0,class:"dss-step-bar__counter"},G0={class:"dss-step-bar__track-wrapper"},Q0=["aria-valuemax","aria-valuenow","aria-label"],J0=["onMouseenter"],ep={__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:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},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(E){const ne=E,$={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"}}},V=U=>U&&typeof U=="object"&&!Array.isArray(U),ce=(U,ye)=>{const P=Object.assign({},U);return!V(U)||!V(ye)||Object.keys(ye).forEach(K=>{if(V(ye[K])){K in U?P[K]=ce(U[K],ye[K]):Object.assign(P,{[K]:ye[K]});return}Object.assign(P,{[K]:ye[K]})}),P},I=e.computed(()=>ce($,ne.options)),_=e.computed(()=>Math.max(1,Number(ne.steps)||1)),pe=e.computed(()=>Math.min(_.value,Math.max(0,Number(ne.currentStep)||0))),st=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),te=e.computed(()=>{if(!st.value)return[];const U=ne.segments.map((ye,P)=>{const K=Number(ye?.value);return{label:ye?.label||`Step ${P+1}`,value:Number.isFinite(K)&&K>0?K:0,color:ye?.color||ne.activeColor,marker:ye?.marker}});return ne.segmentOrder==="desc"?[...U].sort((ye,P)=>P.value-ye.value):ne.segmentOrder==="asc"?[...U].sort((ye,P)=>ye.value-P.value):U}),v=e.computed(()=>st.value?te.value.reduce((U,ye)=>U+ye.value,0):pe.value),Ce=e.computed(()=>st.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,v.value):_.value),ke=e.computed(()=>st.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),Q=e.computed(()=>ke.value?Math.max(0,Number(ne.totalValue)-v.value):0),X=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),me=e.computed(()=>Q.value>0),F=e.computed(()=>te.value.reduce((U,ye)=>Math.max(U,Number(ye.value)||0),0)),ue=e.computed(()=>te.value.filter(U=>U.value>0).map(U=>`${U.label}: ${bt(U.value)}`).join(" | ")),Me=e.computed(()=>st.value?ke.value?te.value.filter(U=>U.value>0):te.value:[]),tt=e.computed(()=>{if(!ne.counterAsPercentage)return`${v.value} / ${Ce.value}`;const U=Number(Ce.value);if(!Number.isFinite(U)||U<=0)return"0%";const ye=Math.round(Number(v.value)/U*100);return`${Math.min(Math.max(ye,0),100)}%`}),mt=e.computed(()=>v.value),Z=e.computed(()=>Ce.value),Ae=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>ne.orientation==="vertical"),Ee=e.computed(()=>{const U=ne.barHeight;return U==null||U===""?"200px":typeof U=="number"?`${U}px`:String(U)}),_e=e.computed(()=>{const U=ne.sideLabelMaxWidth;if(!(U==null||U===""))return typeof U=="number"?`${U}px`:String(U)}),Ye=e.computed(()=>{const U=ne.sideLabelWrapWidth;return U==null||U===""?"18ch":typeof U=="number"?`${U}ch`:String(U)}),ie=e.computed(()=>({left:`${Ae.x}px`,top:`${Ae.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Je=U=>We.value?{flex:`${U} 0 0`,minHeight:U>0?"6px":"0",minWidth:"0"}:{flex:`${U} 0 0`,minWidth:U>0?"6px":"0"},we=U=>{const ye=U?.parentElement;if(!ye)return{x:0,y:0};const P=ye.getBoundingClientRect();return{x:P.left+P.width/2,y:P.top}},et=U=>{const ye=U.getBoundingClientRect();return{x:ye.left+ye.width/2,y:ye.top}},ct=U=>{if(ke.value){const K=Math.max(0,Number(U.value)||0);return{...Je(K),backgroundColor:U.color}}const ye=v.value,P=U.value>0?U.value:ye>0?1e-4:1;return{...Je(P),backgroundColor:U.color}},vt=U=>Number(U?.value||0)>0&&Number(U?.value||0)===F.value,ut=U=>{const ye=V(U?.marker)?U.marker:{},P=U?.marker===!0||ye.enabled===!0,K=vt(U)&&I.value.maxSegment?.marker?.enabled===!0;if(!(P||K))return{enabled:!1};const Re=ye.backgroundColor??(K?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Ze=ye.borderColor??(K?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),xt=ye.color??(K?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),Ke=ye.width??(K?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),zt=ye.height??(K?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Re,borderColor:Ze,color:xt,width:Ke,height:zt,icon:ye.icon??null,...ye}},Ft=U=>{const ye=ut(U);return{backgroundColor:ye.backgroundColor??void 0,borderColor:ye.borderColor??void 0,color:ye.color??void 0}},It=U=>{const ye=ut(U);return{width:ye.width??void 0,height:ye.height??void 0}},bt=U=>`${U}${ne.valueLabel}`,wt=e.computed(()=>({...Je(Q.value),backgroundColor:ne.inactiveColor})),Jt=(U,ye)=>{if(!U||!ye?.currentTarget)return;const P=ye.currentTarget;if(ne.remainderTooltipSummary){const Se=we(P);Ae.x=Se.x,Ae.y=Se.y,Ae.content=ue.value,Ae.visible=!!Ae.content;return}const K=et(P);Ae.x=K.x,Ae.y=K.y,Ae.content=`${U.label}: ${bt(U.value)}`,Ae.visible=!0},pt=U=>{if(!Q.value||!U?.currentTarget)return;const ye=U.currentTarget;if(ne.remainderTooltipSummary){const K=we(ye);Ae.x=K.x,Ae.y=K.y,Ae.content=ue.value,Ae.visible=!!Ae.content;return}const P=et(ye);Ae.x=P.x,Ae.y=P.y,X.value&&(Ae.content=`${ne.remainderLabel}: ${bt(Q.value)}`,Ae.visible=!0)},jt=()=>{Ae.visible=!1},kt=()=>{Ae.visible&&jt()};e.onMounted(()=>{window.addEventListener("scroll",kt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",kt,!0)});const tn=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,"--dss-step-bar-bar-height":We.value?Ee.value:void 0,"--dss-step-bar-side-label-max-width":_e.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(U,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(tn.value)},[e.createElementVNode("div",X0,[e.createElementVNode("div",Y0,[e.createElementVNode("span",j0,[e.renderSlot(U.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",K0,[e.renderSlot(U.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",G0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":mt.value,"aria-label":E.label},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(P,K)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${K}-${P.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":vt(P),"dss-step-bar__segment--marker-enabled":ut(P).enabled}]),style:e.normalizeStyle(ct(P)),onMouseenter:Se=>Jt(P,Se),onMouseleave:jt},[ut(P).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Ft(P)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(It(P))},[e.renderSlot(U.$slots,"segment-marker-icon",{segment:P,index:K,marker:ut(P)},()=>[e.renderSlot(U.$slots,"max-segment-icon",{segment:P,index:K,marker:ut(P)},()=>[e.createTextVNode(e.toDisplayString(ut(P).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,J0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(wt.value),onMouseenter:ye[0]||(ye[0]=P=>pt(P)),onMouseleave:jt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,P=>(e.openBlock(),e.createElementBlock("div",{key:P,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":P<=pe.value}])},null,2))),128))],8,Q0)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ae.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ie.value)},e.toDisplayString(Ae.content),5)):e.createCommentVNode("",!0)]))],6))}},tp={key:0,class:"dss-title dss-title--separator"},np={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:ne,emit:$}){const V=E,ce=$,I=e.ref(null),_=e.computed(()=>`dss-title--${V.type}`),pe=e.computed(()=>V.h!=null?`dss-title--h${V.h}`:null),st={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>V.h!=null?`h${V.h}`:st[V.type]??"div"),v=e.computed(()=>V.editable?"plaintext-only":void 0),Ce=e.computed(()=>{const ue={};return V.size!=null&&(ue.fontSize=typeof V.size=="number"?`${V.size}px`:V.size),V.weight!=null&&(ue.fontWeight=V.weight),V.color!=null&&(ue.color=V.color),Object.keys(ue).length?ue:void 0}),ke=e.computed(()=>V.editable?{input:X,keydown:me,paste:F}:{}),Q=()=>{const ue=I.value;!V.editable||!ue||document.activeElement!==ue&&(ue.innerText=V.modelValue??"")},X=ue=>{const Me=ue.target.innerText;ce("update:modelValue",Me),ce("change",Me)},me=ue=>{ue.key==="Enter"&&ue.preventDefault()},F=ue=>{ue.preventDefault();const Me=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Me)};return e.watch(()=>V.modelValue,()=>{Q()}),e.watch(()=>V.editable,()=>{e.nextTick(Q)}),e.onMounted(()=>{e.nextTick(Q)}),ne({focus:()=>I.value?.focus()}),(ue,Me)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",tp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:I,class:["dss-title__separator-label",pe.value,{"dss-title--editable":E.editable}],style:Ce.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:I,class:["dss-title",[_.value,pe.value,{"dss-title--editable":E.editable}]],style:Ce.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},lp={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"}},op={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"},ap={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"}},sp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",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"}},rp={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"}},uo={chart:lp,table:op,filter:ap,datepicker:sp,textEditor:rp},ip={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"}},cp={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"},up={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"}},dp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",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"}},mp={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"}},mo={chart:ip,table:cp,filter:up,datepicker:dp,textEditor:mp},pp={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"}},fp={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"},vp={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"}},gp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",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"}},hp={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"}},po={chart:pp,table:fp,filter:vp,datepicker:gp,textEditor:hp},Po={en:uo,fr:mo,nl:po};function ma(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Po).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Po[$])})}const Oo={en:{textEditor:uo.textEditor},fr:{textEditor:mo.textEditor},nl:{textEditor:po.textEditor}};function pa(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Oo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Oo[$])})}const Wo={en:{table:uo.table},fr:{table:mo.table},nl:{table:po.table}};function fa(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Wo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Wo[$])})}const qo={en:{datepicker:uo.datepicker},fr:{datepicker:mo.datepicker},nl:{datepicker:po.datepicker}};function va(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(qo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{filter:uo.filter},fr:{filter:mo.filter},nl:{filter:po.filter}};function ga(E){if(!E||!E.global)return;const ne=E.global.availableLocales||[];Object.keys(Zo).forEach($=>{ne.includes($)&&E.global.mergeLocaleMessage($,Zo[$])})}const yp={chart:Po,textEditor:Oo,table:Wo,datepicker:qo,filter:Zo};function kp(E){!E||!E.global||(ma(E),pa(E),fa(E),va(E),ga(E))}const Cp={en:{...uo},fr:{...mo},nl:{...po}};co.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Cp});exports.DSSChart=fc;exports.DSSChartMessages=Po;exports.DSSColorPicker=n2;exports.DSSConfetti=_2;exports.DSSDatepicker=la;exports.DSSDatepickerMessages=qo;exports.DSSDnd=B2;exports.DSSFilter=R0;exports.DSSFilterMessages=Zo;exports.DSSLoader=v2;exports.DSSMessages=yp;exports.DSSModal=na;exports.DSSPillField=U0;exports.DSSSkeleton=g2;exports.DSSStepBar=ep;exports.DSSTable=Hu;exports.DSSTableMessages=Wo;exports.DSSTextEditor=zm;exports.DSSTextEditorMessages=Oo;exports.DSSTitle=np;exports.addDSSChartTranslations=ma;exports.addDSSDatepickerTranslations=va;exports.addDSSFilterTranslations=ga;exports.addDSSTableTranslations=fa;exports.addDSSTextEditorTranslations=pa;exports.addDSSTranslations=kp;
119
+ `,document.body.appendChild(Ue),me=Ue}function Ge(W,G){me&&(me.style.left=`${W-Je}px`,me.style.top=`${G-pt}px`)}function be(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=he.value.dragSourceBackground,W.style.borderColor=he.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Qe(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ct(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function gt(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function ut(W,G){if(P.value&&gt(W,G)){Ce.value=!0,we.value=null,J.value=-1;return}Ce.value=!1;const Ne=ct(W,G),Ie=Ne?.getAttribute("data-column")??null;if(!Ie){we.value=null,J.value=-1;return}we.value=Ie;const Ue=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Ue.length;for(let Ke=0;Ke<Ue.length;Ke++){const Ut=Ue[Ke].getBoundingClientRect();if(G<Ut.top+Ut.height/2){Et=Ke;break}}J.value=Et}function qt(W){W.preventDefault(),Ge(W.clientX,W.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,ut(W.clientX,W.clientY)}))}function Zt(W){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",Zt),window.removeEventListener("pointercancel",Zt),_e?.releasePointerCapture?.(W.pointerId),Qe(_e),_e=null;const G=P.value&&gt(W.clientX,W.clientY);if(f.value&&G)B("delete",{item:f.value});else{const Ie=ct(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(f.value&&Ie){const Ue=f.value[_.columnKey],Et=Ie,Ut=(Se.value[Et]||[]).filter($t=>$t[_.itemKey]!==f.value[_.itemKey]),qe=Math.max(0,Math.min(J.value,Ut.length)),Pe=Ye(Et,qe),Ht=f.value[_.itemKey];B("move",{item:f.value,from:Ue,to:Et,position:Pe,index:qe}),R&&clearTimeout(R),X.value={id:Ht,from:Ue,to:Et},R=setTimeout(()=>{X.value=null},3500)}}me&&(me.remove(),me=null),Z!==null&&(document.body.style.cursor=Z,Z=""),ke()}function kt(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Ie=Ne.getBoundingClientRect();Je=W.clientX-Ie.left,pt=W.clientY-Ie.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=G,_e=Ne,ie(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>be(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",Zt,{once:!0}),window.addEventListener("pointercancel",Zt,{once:!0})}function xt(){Fe&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",rt),window.removeEventListener("pointercancel",rt),Fe=null)}function Yt(W){if(!Fe||W.pointerId!==Fe.pointerId)return;const G=W.clientX-Fe.startX,Ne=W.clientY-Fe.startY;if(Math.abs(G)>=We||Math.abs(Ne)>=We){const Ie=Fe.item;xt(),kt(W,Ie)}}function rt(W){!Fe||W.pointerId!==Fe.pointerId||xt()}function Jt(W,G){xt(),Fe={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",rt),window.addEventListener("pointercancel",rt)}function yt(W,G){he.value.useHandle||Jt(W,G)}function ol(W,G){Jt(W,G)}function U(){fe&&(cancelAnimationFrame(fe),fe=null)}function ke(){U(),f.value=null,we.value=null,Ce.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{U(),xt(),R&&clearTimeout(R),me&&(me.remove(),me=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":he.value.unstyled}]),style:e.normalizeStyle(st.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(W.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||he.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(te(Ne))},[he.value.showHeader?(e.openBlock(),e.createElementBlock("div",Q2,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Se.value[Ne.value]||[]},()=>[e.createElementVNode("span",J2,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",e0,e.toDisplayString((Se.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie.key},[Ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",l0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ie.isDragged,"dss-dnd-item--no-handle":!he.value.useHandle}]),onPointerdown:Ue=>yt(Ue,Ie.item)},[he.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ue=>ol(Ue,Ie.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,o0)):e.createCommentVNode("",!0),e.createElementVNode("div",a0,[e.renderSlot(W.$slots,"item",{item:Ie.item,column:Ne,justDropped:X.value?.id===Ie.item[E.itemKey],droppedFrom:X.value?.id===Ie.item[E.itemKey]?X.value.from:null,droppedTo:X.value?.id===Ie.item[E.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",s0,e.toDisplayString(Ie.item[E.itemKey]),1)])])],42,n0))],64))),128)),(Se.value[Ne.value]||[]).length===0&&we.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",r0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,t0)],6))),128))],6))}}),u0={name:"DSSConfetti"},d0=Object.assign(u0,{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(E){const le=E,_=e.ref(null),B=e.ref(!1);let de=[],P=null,T=null;function he(J,X){const fe=[];for(let R=0;R<le.count;R++)fe.push(st(J));return fe}function st(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:le.colors[Math.floor(Math.random()*le.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 te(J,X,fe,R){J.clearRect(0,0,X,fe);for(const me of de)J.save(),J.globalAlpha=me.opacity*R,J.beginPath(),J.lineWidth=me.r,J.strokeStyle=me.color,J.moveTo(me.x+me.tilt+me.r/2,me.y),J.lineTo(me.x+me.tilt,me.y+me.tilt+me.r/2),J.stroke(),J.restore()}function f(J,X,fe){const R=.3+fe*.7;for(let me=0;me<de.length;me++){const _e=de[me];_e.tiltAngle+=_e.tiltInc,_e.y+=_e.speed*R,_e.x+=Math.sin(_e.d)*.5*R,_e.tilt=Math.sin(_e.tiltAngle)*15,fe>=.99&&_e.y>X+20&&(de[me]=st(J))}}function we(){B.value=!0,e.nextTick(()=>{const J=_.value;if(!J)return;const X=J.getContext("2d"),fe=J.parentElement;if(!fe)return;const R=fe.getBoundingClientRect();J.width=R.width,J.height=R.height,de=he(J.width,J.height);const me=Date.now(),_e=me+le.duration,Je=()=>{const pt=Date.now(),Z=pt-me;if(pt<_e){let Fe=1;Z>le.fadeStart&&(Fe=1-(Z-le.fadeStart)/(le.duration-le.fadeStart)),te(X,J.width,J.height,Fe),f(J.width,J.height,Fe),P=requestAnimationFrame(Je)}else Ce()};Je()})}function Ce(){P&&(cancelAnimationFrame(P),P=null),de=[],B.value=!1}return e.watch(()=>le.trigger,J=>{J&&(T&&clearTimeout(T),T=setTimeout(we,le.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),T&&clearTimeout(T)}),(J,X)=>B.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),m0={class:"dss-filter-global-inner"},p0=["placeholder","value"],v0=["title"],f0={key:0,class:"dss-filter-funnel-badge"},h0={key:1,class:"dss-filter-sortby"},g0=["value"],y0=["value"],k0=["disabled","title"],C0={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"},b0={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"},w0={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"},x0={class:"dss-filter-panel"},E0={key:0,class:"dss-filter-empty"},S0={class:"dss-filter-row-prefix"},V0={class:"dss-filter-cell"},N0=["onClick"],B0={class:"dss-filter-trigger-text"},M0=["placeholder"],_0={class:"dss-filter-popup-list"},$0=["onClick"],L0={key:0,class:"dss-filter-popup-empty"},T0={key:0,class:"dss-filter-cell"},A0=["onClick"],D0={class:"dss-filter-trigger-text"},H0={class:"dss-filter-popup-list"},R0=["onClick"],F0={key:1,class:"dss-filter-cell dss-filter-cell--value"},I0=["placeholder","onUpdate:modelValue"],z0={key:1,class:"dss-filter-date-wrap"},P0=["placeholder","onUpdate:modelValue"],O0=["placeholder","value","onInput","step"],W0={key:4,class:"dss-filter-between"},q0=["placeholder","value","onInput","step"],Z0={class:"dss-filter-between-sep"},U0=["placeholder","value","onInput","step"],X0={key:5,class:"dss-filter-multiselect"},Y0=["onClick"],j0={class:"dss-filter-trigger-text"},K0=["placeholder"],G0={class:"dss-filter-popup-list dss-filter-popup-list--check"},Q0=["onClick"],J0=["checked"],ep={key:0,class:"dss-filter-popup-empty"},tp=["onClick"],lp={class:"dss-filter-foot"},np={class:"dss-filter-cell"},op=["placeholder"],ap={class:"dss-filter-popup-list"},sp=["onClick"],rp={key:0,class:"dss-filter-popup-divider"},ip=["onClick"],cp=["placeholder"],up={class:"dss-filter-popup-list"},dp=["onClick"],mp={key:0,class:"dss-filter-popup-empty"},pp=["placeholder"],vp={class:"dss-filter-popup-list"},fp=["onClick"],hp={key:0,class:"dss-filter-popup-empty"},gp={name:"DSSFilter"},yp=Object.assign(gp,{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(E,{expose:le,emit:_}){const{t:B}=so.useI18n(),de=E,P=_,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},he=e.computed(()=>({...T,...de.options})),st={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"}]},te=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),Ce=e.ref([]),J=e.ref(null),X=e.ref(!1),fe=e.ref(null),R=e.ref(""),me=e.ref(null),_e=e.ref(""),Je=e.ref("asc");let pt=1;function Z(M){const w=M.find(A=>A&&typeof A=="object");if(!w)return null;for(const A of f)if(A in w&&typeof w[A]=="string")return A;return Object.keys(w).find(A=>typeof w[A]=="string")||null}function Fe(M,w){const A=w.filter(se=>se!=null&&se!=="NULL");if(A.length===0)return null;if(A.every(se=>Array.isArray(se))){const se=A.flatMap(He=>He).filter(He=>He!=null);return se.length===0?null:typeof se.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return A.every(se=>typeof se=="boolean")?"boolean":A.every(se=>typeof se=="number")?new Set(A).size<=he.value.maxUniqueForEnum?"select":"range":A.every(se=>typeof se=="string")?new Set(A).size<=he.value.maxUniqueForSelect?"select":"text":A.some(se=>typeof se=="object"&&!Array.isArray(se))?null:"text"}const We=e.computed(()=>{if(!de.data?.length)return[];const M=new Set;for(const ae of de.data)if(ae&&typeof ae=="object")for(const He of Object.keys(ae))M.add(He);const w=new Set(de.exclude),A=[];for(const ae of M){if(w.has(ae))continue;const He=de.config[ae]||{},Ct=de.data.map(St=>St?.[ae]),nt=He.type||Fe(ae,Ct);if(!nt)continue;const Re=He.filterMode||"contain",bt=Re==="date"?"date":Re==="string"?"text":nt,_t={key:ae,label:He.label||et(ae),type:bt,filterMode:Re};if(nt==="select"){const St=Ct.filter(Lt=>Lt!=null&&Lt!=="NULL");_t.uniqueValues=[...new Set(St)].sort((Lt,zt)=>typeof Lt=="number"&&typeof zt=="number"?Lt-zt:String(Lt).localeCompare(String(zt)))}else if(nt==="range"||nt==="int"){const St=Ct.filter(Lt=>typeof Lt=="number");_t.min=Math.min(...St),_t.max=Math.max(...St)}else if(nt==="arraySelect"){const St=He.displayKey||Z(Ct.flatMap(Lt=>Array.isArray(Lt)?Lt:[]));if(_t.displayKey=St,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)_t.uniqueValues=He.uniqueValues.map(Lt=>String(Lt));else{const Lt=Ct.flatMap(zt=>Array.isArray(zt)?zt:[]).filter(zt=>zt!=null).map(zt=>St&&typeof zt=="object"?zt[St]:String(zt)).filter(zt=>zt!=null&&zt!=="");_t.uniqueValues=[...new Set(Lt)].sort((zt,Bt)=>String(zt).localeCompare(String(Bt)))}}A.push(_t)}const se=de.config._order;return se&&A.sort((ae,He)=>{const Ct=se.indexOf(ae.key),nt=se.indexOf(He.key);return Ct===-1&&nt===-1?0:Ct===-1?1:nt===-1?-1:Ct-nt}),A}),Se=e.computed(()=>{const M={};for(const w of We.value)M[w.key]=w;return M}),Le=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),Ye=e.computed(()=>{if(!Le.value)return[];const M=new Set(We.value.map(w=>w.key));return de.config.groups.map(w=>({...w,keys:w.keys.filter(A=>M.has(A))})).filter(w=>w.keys.length>0)}),ie=e.computed(()=>{if(!Le.value)return[];const M=new Set(de.config.groups.flatMap(w=>w.keys));return We.value.filter(w=>!M.has(w.key))}),Ge=e.computed(()=>{if(!me.value)return[];const M=new Set(me.value.keys),w=We.value.filter(se=>M.has(se.key));if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>se.label.toLowerCase().includes(A))}),be=e.computed(()=>{if(!R.value)return We.value;const M=R.value.toLowerCase();return We.value.filter(w=>w.label.toLowerCase().includes(M))}),Qe=e.computed(()=>We.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ct=e.computed(()=>_e.value?Je.value==="asc"?"Ascending":"Descending":"No sort selected");function gt(M){J.value===M?ut():(J.value=M,R.value="",me.value=null)}function ut(){J.value=null,R.value="",me.value=null}function qt(M){const w=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!w&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&ut(),X.value&&fe.value&&!fe.value.contains(M.target)&&(w||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function Zt(M){return Se.value[M]?.label||et(M)}function kt(M){return Se.value[M.key]?.filterMode||"contain"}function xt(M){return B(`filter.operators.${M}`)}function Yt(M){const w=Se.value[M.key];return(st[w?.type]||st.text).map(A=>({...A,label:B(`filter.operators.${A.value}`)}))}function rt(M){return te.has(M)}function Jt(M){const w=Se.value[M.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"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return st[M]?.[0]?.value||"contains"}function ol(M,w){return te.has(w)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&w==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function U(M){return Se.value[M.key]?.uniqueValues||[]}function ke(M){const w=U(M);if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>String(se).toLowerCase().includes(A))}function W(M){const w=M.value;return!w||w.length===0?B("filter.select"):w.length<=2?w.join(", "):B("filter.selectedCount",{count:w.length})}function G(M){const w=Se.value[M],A=w?.filterMode||"contain",se=w?.type||"text",ae=A==="string"?"contains":yt(se);Ce.value.push(e.reactive({id:pt++,key:M,operator:ae,value:ol(se,ae)})),ut()}function Ne(M){Ce.value=Ce.value.filter(w=>w.id!==M)}function Ie(M,w){const se=Se.value[w]?.type||"text";M.key=w,M.operator=yt(se),M.value=ol(se,M.operator),ut()}function Ue(M,w){const A=Jt(M);M.operator=w;const se=Jt(M);if(A!==se||te.has(w)){const ae=Se.value[M.key];M.value=ol(ae?.type||"text",w)}ut()}function Et(M,w){const A=w.target.value;M.value=A===""?null:Number(A)}function Ke(M,w,A){const se=A.target.value,ae=se===""?null:Number(se);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[w]:isNaN(ae)?null:ae}}function Ut(M,w){const A=M.value||[],se=A.indexOf(w);M.value=se>=0?A.filter(ae=>ae!==w):[...A,w]}function qe(){Ce.value=[],we.value="",ut()}function Pe(M){we.value=M.target.value}function Ht(M){_e.value=M.target.value}function $t(){Je.value=Je.value==="asc"?"desc":"asc"}const oe=e.computed(()=>{if(!de.data)return[];let M=de.data;if(we.value){const w=we.value.toLowerCase();M=M.filter(A=>{for(const se of Object.keys(A)){const ae=A[se];if(typeof ae=="string"&&ae.toLowerCase().includes(w)||typeof ae=="number"&&String(ae).includes(w)||Array.isArray(ae)&&ae.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(w):typeof He=="object"?Object.values(He).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of Ce.value){if(!pe(w))continue;const A=Se.value[w.key];A&&(M=M.filter(se=>xe(se,w,A)))}if(de.showSortBy&&_e.value){const w=_e.value,A=Je.value==="asc"?1:-1;M=[...M].sort((se,ae)=>Y(se?.[w],ae?.[w])*A)}return M});function Y(M,w){const A=j(M),se=j(w);return A==null&&se==null?0:A==null?1:se==null?-1:typeof A=="number"&&typeof se=="number"?A-se:String(A).localeCompare(String(se),void 0,{numeric:!0,sensitivity:"base"})}function j(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function pe(M){return te.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,w,A){const se=M?.[w.key],ae=w.value,He=w.operator;if(He==="is_empty")return jt(se);if(He==="is_not_empty")return!jt(se);const Ct=A.type;if(Ct==="text"||Ct==="arrayText"){const nt=Ct==="arrayText"&&Array.isArray(se)?se.filter(_t=>_t!=null).map(String).join(" "):se!=null?String(se):"",Re=String(ae).toLowerCase(),bt=nt.toLowerCase();switch(He){case"contains":return bt.includes(Re);case"not_contains":return!bt.includes(Re);case"equals":return bt===Re;case"not_equals":return bt!==Re;case"starts_with":return bt.startsWith(Re);case"ends_with":return bt.endsWith(Re);default:return!0}}if(Ct==="select")switch(He){case"is_any_of":return ae.includes(se);case"is_none_of":return!ae.includes(se);default:return!0}if(Ct==="range"||Ct==="int"){const nt=typeof se=="number"?se:Number(se);if(typeof nt!="number"||isNaN(nt))return!1;if(He==="between"){const bt=ae?.min!=null?Number(ae.min):null,_t=ae?.max!=null?Number(ae.max):null,St=bt!=null&&!isNaN(bt)?bt:null,Lt=_t!=null&&!isNaN(_t)?_t:null;return(St==null||nt>=St)&&(Lt==null||nt<=Lt)}const Re=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(He==="contains"||He==="not_contains"){const bt=String(nt),_t=String(ae??"").toLowerCase(),St=bt.toLowerCase().includes(_t);return He==="contains"?St:!St}if(typeof Re!="number"||isNaN(Re))return!1;switch(He){case"eq":return nt===Re;case"neq":return nt!==Re;case"gt":return nt>Re;case"gte":return nt>=Re;case"lt":return nt<Re;case"lte":return nt<=Re;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(se))return!1;const nt=se.filter(Re=>Re!=null).map(Re=>A.displayKey&&typeof Re=="object"?Re[A.displayKey]:String(Re));switch(He){case"contains_any":return nt.some(Re=>ae.includes(Re));case"contains_all":return ae.every(Re=>nt.includes(Re));case"not_contains_any":return!nt.some(Re=>ae.includes(Re));default:return!0}}if(Ct==="date"){const nt=je(ae);if(!nt||isNaN(nt.getTime()))return!1;const Re=je(se);if(!Re||isNaN(Re.getTime()))return!1;const bt=Rt(Re),_t=Rt(nt);switch(He){case"eq":return bt===_t;case"before":return bt<_t;case"after":return bt>_t;default:return!0}}if(Ct==="boolean"){const nt=se===!0||se==="true"||se===1,Re=se===!1||se==="false"||se===0;switch(He){case"is_true":return nt;case"is_false":return Re;default:return!0}}return!0}function je(M){if(M==null)return null;if(M instanceof Date)return isNaN(M.getTime())?null:M;if(typeof M=="number")return new Date(M>1e10?M:M*1e3);if(typeof M=="string"){const w=new Date(M);return isNaN(w.getTime())?null:w}return null}function Rt(M){const w=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),se=String(M.getDate()).padStart(2,"0");return`${w}-${A}-${se}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(w=>w==null))}e.watch(oe,M=>P("update:modelValue",M),{immediate:!0}),e.watch(()=>de.data,()=>{Ce.value=[],we.value="",X.value=!1,_e.value="",Je.value="asc",ut()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function pl(){const M=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(M);if(typeof w=="object"&&!Array.isArray(w)){const A={};for(const se of Object.keys(w))A[se]=M(w[se]);return A}return w};return{globalSearch:we.value,rows:Ce.value.map(w=>({key:w.key,operator:w.operator,value:M(w.value),defType:Se.value[w.key]?.type,defFilterMode:Se.value[w.key]?.filterMode})),filteredCount:oe.value?.length??0}}return le({getDebugState:pl}),(M,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":he.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",m0,[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(B)("filter.searchAcrossFields"),value:we.value,onInput:Pe},null,40,p0),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=A=>we.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":de.showSortBy}]),onClick:w[1]||(w[1]=A=>X.value=!X.value),type:"button",title:X.value?e.unref(B)("filter.closeAdvancedFilter"):e.unref(B)("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",f0,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,v0),de.showSortBy?(e.openBlock(),e.createElementBlock("div",h0,[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:_e.value,onChange:Ht},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,y0))),128))],40,g0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:$t,disabled:!_e.value,title:ct.value},[_e.value?Je.value==="asc"?(e.openBlock(),e.createElementBlock("svg",b0,[...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",w0,[...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",C0,[...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,k0)])):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",x0,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",E0,e.toDisplayString(e.unref(B)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(A,se)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",S0,e.toDisplayString(se===0?e.unref(B)("filter.where"):e.unref(B)("filter.and")),1),e.createElementVNode("div",V0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:field`),["stop"])},[e.createElementVNode("span",B0,e.toDisplayString(Zt(A.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,N0),J.value===`${A.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]=ae=>R.value=ae),placeholder:e.unref(B)("filter.searchAttributes")},null,8,M0),[[e.vModelText,R.value]]),e.createElementVNode("ul",_0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:He=>Ie(A,ae.key)},e.toDisplayString(ae.label),9,$0))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",L0,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),kt(A)==="contain"||kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",T0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:op`),["stop"])},[e.createElementVNode("span",D0,e.toDisplayString(xt(A.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,A0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",H0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===ae.value}]),onClick:He=>Ue(A,ae.value)},e.toDisplayString(ae.label),11,R0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),rt(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F0,[kt(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,I0)),[[e.vModelText,A.value]]):kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",z0,[e.createVNode(ca,{mode:"single",modelValue:A.value,"onUpdate:modelValue":ae=>A.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):Jt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,P0)),[[e.vModelText,A.value]]):Jt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),value:A.value,onInput:ae=>Et(A,ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,O0)):Jt(A)==="between"?(e.openBlock(),e.createElementBlock("div",W0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.min"),value:A.value?.min,onInput:ae=>Ke(A,"min",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,q0),e.createElementVNode("span",Z0,e.toDisplayString(e.unref(B)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.max"),value:A.value?.max,onInput:ae=>Ke(A,"max",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,U0)])):Jt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",X0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:val`),["stop"])},[e.createElementVNode("span",j0,e.toDisplayString(W(A)),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,Y0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[U(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=ae=>R.value=ae),placeholder:e.unref(B)("filter.search")},null,8,K0)),[[e.vModelText,R.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",G0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:He=>Ut(A,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(ae),tabindex:"-1"},null,8,J0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,Q0))),128)),ke(A).length===0?(e.openBlock(),e.createElementBlock("li",ep,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Ne(A.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,tp)]))),128)),e.createElementVNode("div",lp,[e.createElementVNode("div",np,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(A=>gt("add"),["stop"]))},e.toDisplayString(e.unref(B)("filter.addFilter")),1),J.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&&!me.value&&!R.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]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,op),[[e.vModelText,R.value]]),e.createElementVNode("ul",ap,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:se=>me.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.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,sp))),128)),ie.value.length>0?(e.openBlock(),e.createElementBlock("li",rp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,ip))),128))])],64)):me.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=A=>me.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(me.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,cp),[[e.vModelText,R.value]]),e.createElementVNode("ul",up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,dp))),128)),Ge.value.length===0?(e.openBlock(),e.createElementBlock("li",mp,e.toDisplayString(e.unref(B)("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]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,pp),[[e.vModelText,R.value]]),e.createElementVNode("ul",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,fp))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",hp,e.toDisplayString(e.unref(B)("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:qe},e.toDisplayString(e.unref(B)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),kp={class:"dss-pill-field__pills"},Cp=["data-value"],bp=["disabled"],wp={class:"dss-pill-field__pill-text"},xp={key:0,class:"dss-pill-field__pill-actions"},Ep=["onClick"],Sp=["onClick"],Vp=["placeholder","disabled"],Np=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:le}){const _=E,B=le,de=e.ref(""),P=e.ref([..._.modelValue]),T=e.ref(null);let he=null;const st=e.ref(null),te=e.ref(""),f=e.ref(null),we=e.ref(null),Ce=e.computed(()=>{if(!we.value)return;const{width:Le,height:Ye}=we.value;return{minWidth:`${Le}px`,height:`${Ye}px`}});function J(Le,Ye){st.value===Ye&&(f.value=Le)}function X(){st.value=null,te.value="",we.value=null,f.value=null}const fe=e.computed(()=>new Set(P.value.map(Le=>Le.trim()).filter(Boolean)));function R(Le){T.value=Le,he&&clearTimeout(he),he=setTimeout(()=>{T.value=null,he=null},900)}function me(Le){const Ye=Le.trim();return Ye?fe.value.has(Ye)?(R(Ye),!1):(P.value=[...P.value,Ye],B("update:modelValue",[...P.value]),!0):!1}function _e(Le){const Ye=Le.split(/\r?\n/g).map(Qe=>Qe.trim()).filter(Boolean);if(!Ye.length)return;const ie=new Set(P.value.map(Qe=>Qe.trim()).filter(Boolean)),Ge=[...P.value];let be=null;for(const Qe of Ye){if(ie.has(Qe)){be??=Qe;continue}ie.add(Qe),Ge.push(Qe)}Ge.length!==P.value.length&&(P.value=Ge,B("update:modelValue",[...P.value])),be&&R(be)}function Je(Le){_.disabled||(st.value===Le&&X(),P.value=P.value.filter((Ye,ie)=>ie!==Le),B("update:modelValue",[...P.value]))}async function pt(Le,Ye){if(_.disabled)return;const ie=Ye.currentTarget.closest(".dss-pill-field__pill");ie&&(we.value={width:ie.offsetWidth,height:ie.offsetHeight}),st.value=Le,te.value=P.value[Le]??"",await e.nextTick();const Ge=f.value;if(!Ge)return;Ge.focus();const be=Ge.value.length;Ge.setSelectionRange(be,be)}function Z(){X()}function Fe(){if(_.disabled||st.value===null)return;const Le=st.value,Ye=P.value[Le]??"",ie=te.value.trim();if(X(),ie!==Ye&&fe.value.has(ie)){R(ie);return}if(!ie){P.value=P.value.filter((be,Qe)=>Qe!==Le),B("update:modelValue",[...P.value]);return}const Ge=P.value.map((be,Qe)=>Qe===Le?ie:be);P.value=Ge,B("update:modelValue",[...P.value])}function We(Le){Le.preventDefault(),!_.disabled&&(me(de.value),de.value="")}function Se(Le){if(_.disabled)return;const Ye=Le.clipboardData?.getData("text")??"";!Ye.includes(`
120
+ `)&&!Ye.includes("\r")||(Le.preventDefault(),_e(Ye),de.value="")}return e.watch(()=>_.modelValue,Le=>{P.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{he&&clearTimeout(he)}),(Le,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(ie,Ge)=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===ie,"dss-pill-field__pill--editing":st.value===Ge}]),style:e.normalizeStyle(st.value===Ge&&we.value?Ce.value:void 0)},[st.value===Ge?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":te.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:be=>J(be,Ge),"onUpdate:modelValue":Ye[0]||(Ye[0]=be=>te.value=be),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(Fe,["enter"]),e.withKeys(Z,["esc"])],onBlur:Fe},null,40,bp),[[e.vModelText,te.value]])],8,Cp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",wp,e.toDisplayString(ie),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",xp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:be=>pt(Ge,be)},[...Ye[2]||(Ye[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,Ep),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:be=>Je(Ge)}," × ",8,Sp)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ie=>de.value=ie),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Se,onKeydown:e.withKeys(We,["enter"])},null,40,Vp),[[e.vModelText,de.value]])])],2))}}),Bp={class:"dss-step-bar__layout"},Mp={class:"dss-step-bar__header"},_p={class:"dss-step-bar__label"},$p={key:0,class:"dss-step-bar__counter"},Lp={class:"dss-step-bar__track-wrapper"},Tp=["aria-valuemax","aria-valuenow","aria-label"],Ap=["onMouseenter"],Dp={__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:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},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(E){const le=E,_={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"}}},B=U=>U&&typeof U=="object"&&!Array.isArray(U),de=(U,ke)=>{const W=Object.assign({},U);return!B(U)||!B(ke)||Object.keys(ke).forEach(G=>{if(B(ke[G])){G in U?W[G]=de(U[G],ke[G]):Object.assign(W,{[G]:ke[G]});return}Object.assign(W,{[G]:ke[G]})}),W},P=e.computed(()=>de(_,le.options)),T=e.computed(()=>Math.max(1,Number(le.steps)||1)),he=e.computed(()=>Math.min(T.value,Math.max(0,Number(le.currentStep)||0))),st=e.computed(()=>Array.isArray(le.segments)&&le.segments.length>0),te=e.computed(()=>{if(!st.value)return[];const U=le.segments.map((ke,W)=>{const G=Number(ke?.value);return{label:ke?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ke?.color||le.activeColor,marker:ke?.marker}});return le.segmentOrder==="desc"?[...U].sort((ke,W)=>W.value-ke.value):le.segmentOrder==="asc"?[...U].sort((ke,W)=>ke.value-W.value):U}),f=e.computed(()=>st.value?te.value.reduce((U,ke)=>U+ke.value,0):he.value),we=e.computed(()=>st.value?Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0?Number(le.totalValue):Math.max(1,f.value):T.value),Ce=e.computed(()=>st.value&&Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0),J=e.computed(()=>Ce.value?Math.max(0,Number(le.totalValue)-f.value):0),X=e.computed(()=>typeof le.remainderLabel=="string"&&le.remainderLabel.trim().length>0),fe=e.computed(()=>J.value>0),R=e.computed(()=>te.value.reduce((U,ke)=>Math.max(U,Number(ke.value)||0),0)),me=e.computed(()=>te.value.filter(U=>U.value>0).map(U=>`${U.label}: ${kt(U.value)}`).join(" | ")),_e=e.computed(()=>st.value?Ce.value?te.value.filter(U=>U.value>0):te.value:[]),Je=e.computed(()=>{if(!le.counterAsPercentage)return`${f.value} / ${we.value}`;const U=Number(we.value);if(!Number.isFinite(U)||U<=0)return"0%";const ke=Math.round(Number(f.value)/U*100);return`${Math.min(Math.max(ke,0),100)}%`}),pt=e.computed(()=>f.value),Z=e.computed(()=>we.value),Fe=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>le.orientation==="vertical"),Se=e.computed(()=>{const U=le.barHeight;return U==null||U===""?"200px":typeof U=="number"?`${U}px`:String(U)}),Le=e.computed(()=>{const U=le.sideLabelMaxWidth;if(!(U==null||U===""))return typeof U=="number"?`${U}px`:String(U)}),Ye=e.computed(()=>{const U=le.sideLabelWrapWidth;return U==null||U===""?"18ch":typeof U=="number"?`${U}ch`:String(U)}),ie=e.computed(()=>({left:`${Fe.x}px`,top:`${Fe.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Ge=U=>We.value?{flex:`${U} 0 0`,minHeight:U>0?"6px":"0",minWidth:"0"}:{flex:`${U} 0 0`,minWidth:U>0?"6px":"0"},be=U=>{const ke=U?.parentElement;if(!ke)return{x:0,y:0};const W=ke.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Qe=U=>{const ke=U.getBoundingClientRect();return{x:ke.left+ke.width/2,y:ke.top}},ct=U=>{if(Ce.value){const G=Math.max(0,Number(U.value)||0);return{...Ge(G),backgroundColor:U.color}}const ke=f.value,W=U.value>0?U.value:ke>0?1e-4:1;return{...Ge(W),backgroundColor:U.color}},gt=U=>Number(U?.value||0)>0&&Number(U?.value||0)===R.value,ut=U=>{const ke=B(U?.marker)?U.marker:{},W=U?.marker===!0||ke.enabled===!0,G=gt(U)&&P.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Ie=ke.backgroundColor??(G?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),Ue=ke.borderColor??(G?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),Et=ke.color??(G?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Ke=ke.width??(G?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),Ut=ke.height??(G?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ie,borderColor:Ue,color:Et,width:Ke,height:Ut,icon:ke.icon??null,...ke}},qt=U=>{const ke=ut(U);return{backgroundColor:ke.backgroundColor??void 0,borderColor:ke.borderColor??void 0,color:ke.color??void 0}},Zt=U=>{const ke=ut(U);return{width:ke.width??void 0,height:ke.height??void 0}},kt=U=>`${U}${le.valueLabel}`,xt=e.computed(()=>({...Ge(J.value),backgroundColor:le.inactiveColor})),Yt=(U,ke)=>{if(!U||!ke?.currentTarget)return;const W=ke.currentTarget;if(le.remainderTooltipSummary){const Ne=be(W);Fe.x=Ne.x,Fe.y=Ne.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const G=Qe(W);Fe.x=G.x,Fe.y=G.y,Fe.content=`${U.label}: ${kt(U.value)}`,Fe.visible=!0},rt=U=>{if(!J.value||!U?.currentTarget)return;const ke=U.currentTarget;if(le.remainderTooltipSummary){const G=be(ke);Fe.x=G.x,Fe.y=G.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const W=Qe(ke);Fe.x=W.x,Fe.y=W.y,X.value&&(Fe.content=`${le.remainderLabel}: ${kt(J.value)}`,Fe.visible=!0)},Jt=()=>{Fe.visible=!1},yt=()=>{Fe.visible&&Jt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const ol=e.computed(()=>({"--dss-step-bar-label-color":le.labelColor??void 0,"--dss-step-bar-counter-color":le.counterColor??void 0,"--dss-step-bar-active-color":le.activeColor,"--dss-step-bar-inactive-color":le.inactiveColor,"--dss-step-bar-bar-height":We.value?Se.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(U,ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(ol.value)},[e.createElementVNode("div",Bp,[e.createElementVNode("div",Mp,[e.createElementVNode("span",_p,[e.renderSlot(U.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",$p,[e.renderSlot(U.$slots,"counter",{counterDisplay:Je.value},()=>[e.createTextVNode(e.toDisplayString(Je.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":pt.value,"aria-label":E.label},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":gt(W),"dss-step-bar__segment--marker-enabled":ut(W).enabled}]),style:e.normalizeStyle(ct(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Jt},[ut(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(qt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Zt(W))},[e.renderSlot(U.$slots,"segment-marker-icon",{segment:W,index:G,marker:ut(W)},()=>[e.renderSlot(U.$slots,"max-segment-icon",{segment:W,index:G,marker:ut(W)},()=>[e.createTextVNode(e.toDisplayString(ut(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Ap))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(xt.value),onMouseenter:ke[0]||(ke[0]=W=>rt(W)),onMouseleave:Jt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=he.value}])},null,2))),128))],8,Tp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Fe.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ie.value)},e.toDisplayString(Fe.content),5)):e.createCommentVNode("",!0)]))],6))}},Hp={key:0,class:"dss-title dss-title--separator"},Rp={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:le,emit:_}){const B=E,de=_,P=e.ref(null),T=e.computed(()=>`dss-title--${B.type}`),he=e.computed(()=>B.h!=null?`dss-title--h${B.h}`:null),st={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>B.h!=null?`h${B.h}`:st[B.type]??"div"),f=e.computed(()=>B.editable?"plaintext-only":void 0),we=e.computed(()=>{const me={};return B.size!=null&&(me.fontSize=typeof B.size=="number"?`${B.size}px`:B.size),B.weight!=null&&(me.fontWeight=B.weight),B.color!=null&&(me.color=B.color),Object.keys(me).length?me:void 0}),Ce=e.computed(()=>B.editable?{input:X,keydown:fe,paste:R}:{}),J=()=>{const me=P.value;!B.editable||!me||document.activeElement!==me&&(me.innerText=B.modelValue??"")},X=me=>{const _e=me.target.innerText;de("update:modelValue",_e),de("change",_e)},fe=me=>{me.key==="Enter"&&me.preventDefault()},R=me=>{me.preventDefault();const _e=(me.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,_e)};return e.watch(()=>B.modelValue,()=>{J()}),e.watch(()=>B.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),le({focus:()=>P.value?.focus()}),(me,_e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Hp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:P,class:["dss-title__separator-label",he.value,{"dss-title--editable":E.editable}],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:P,class:["dss-title",[T.value,he.value,{"dss-title--editable":E.editable}]],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},Fp={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"}},Ip={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"},zp={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"}},Pp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",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"}},Op={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"}},ro={chart:Fp,table:Ip,filter:zp,datepicker:Pp,textEditor:Op},Wp={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"}},qp={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"},Zp={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"}},Up={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",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"}},Xp={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"}},io={chart:Wp,table:qp,filter:Zp,datepicker:Up,textEditor:Xp},Yp={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"}},jp={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"},Kp={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"}},Gp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",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"}},Qp={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"}},co={chart:Yp,table:jp,filter:Kp,datepicker:Gp,textEditor:Qp},Oo={en:ro,fr:io,nl:co};function Va(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Oo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Oo[_])})}const Wo={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function Na(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Wo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Wo[_])})}const qo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function Ba(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(qo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,qo[_])})}const Zo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function Ma(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Zo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Zo[_])})}const Uo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function _a(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Uo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Uo[_])})}const Jp={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function e9(E){!E||!E.global||(Va(E),Na(E),Ba(E),Ma(E),_a(E))}const t9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:t9});exports.DSSChart=jc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=R2;exports.DSSConfetti=d0;exports.DSSDatepicker=ca;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=c0;exports.DSSFilter=yp;exports.DSSFilterMessages=Uo;exports.DSSLoader=K2;exports.DSSMessages=Jp;exports.DSSModal=ia;exports.DSSPillField=Np;exports.DSSSkeleton=G2;exports.DSSStepBar=Dp;exports.DSSTable=gd;exports.DSSTableMessages=qo;exports.DSSTextEditor=b2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Rp;exports.addDSSChartTranslations=Va;exports.addDSSDatepickerTranslations=Ma;exports.addDSSFilterTranslations=_a;exports.addDSSTableTranslations=Ba;exports.addDSSTextEditorTranslations=Na;exports.addDSSTranslations=e9;