dsp-semactic 0.7.16 → 0.7.18

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"),va=require("vue-i18n"),Ss={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Vs=["value"],Ns=["placeholder","value","disabled"],Bs=["aria-label"],_s=["placeholder","value"],Ms={key:0,class:"dss-datepicker__range-values"},$s=["placeholder","value"],Ds={key:0,class:"dss-datepicker__comparison-range"},Ls={class:"dss-datepicker__comparison-date"},Ts={class:"dss-datepicker__comparison-date"},As=["placeholder","value"],Hs=["aria-label","aria-pressed"],Rs=["aria-selected","onClick"],Fs={class:"dss-datepicker__list-item-label"},Is={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"},zs={key:1,class:"dss-datepicker__list-empty"},Ps={key:1,class:"dss-datepicker__double-wrap"},Os={key:0,class:"dss-datepicker__side-panel"},Ws={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},qs=["disabled","onClick"],Zs={key:1,class:"dss-datepicker__comparison-panel"},Us={key:0,class:"dss-datepicker__comparison-modes"},Ys=["onClick"],Xs={class:"dss-datepicker__double-content"},js={class:"dss-datepicker__double-calendars"},Ks={class:"dss-datepicker__double-calendar"},Gs={class:"dss-datepicker__calendar-header"},Qs=["aria-label"],Js={class:"dss-datepicker__month-year-row"},er=["aria-label"],tr={class:"dss-datepicker__weekdays"},lr={class:"dss-datepicker__grid"},nr=["disabled","onClick","onMouseenter"],ar={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},or={class:"dss-datepicker__double-calendar"},sr={class:"dss-datepicker__calendar-header"},rr=["aria-label"],ir={class:"dss-datepicker__month-year-row"},cr=["aria-label"],ur={class:"dss-datepicker__weekdays"},dr={class:"dss-datepicker__grid"},mr=["disabled","onClick","onMouseenter"],pr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},vr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--bottom"},fr={key:0,class:"dss-datepicker__comparison-modes dss-datepicker__comparison-modes--inline"},hr=["onClick"],gr={key:0,class:"dss-datepicker__side-panel"},yr={class:"dss-datepicker__quick-select","aria-label":"Quick date"},kr=["disabled","onClick"],Cr={class:"dss-datepicker__single-calendar"},br={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--single"},wr={key:0,class:"dss-datepicker__comparison-modes"},xr=["onClick"],Er={class:"dss-datepicker__calendar-header"},Sr=["aria-label"],Vr={class:"dss-datepicker__month-year-row"},Nr=["aria-label"],Br={class:"dss-datepicker__weekdays"},_r={class:"dss-datepicker__grid"},Mr=["disabled","onClick","onMouseenter"],$r={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Dr={class:"dss-datepicker__calendar-header"},Lr={class:"dss-datepicker__month-year-row"},Tr={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ar={class:"dss-datepicker__months-grid"},Hr=["onClick"],Rr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Fr={class:"dss-datepicker__month-year"},Ir={class:"dss-datepicker__years-grid"},zr=["data-year","onClick"],Ho=27,Qn=8,yo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:B=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(B)},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},quickSelectOptions:{type:Array,default:null},comparisonEnabled:{type:Boolean,default:!1},comparisonValue:{type:Object,default:()=>({start:null,end:null})},comparisonControlsPlacement:{type:String,default:"side",validator:B=>["side","bottom"].includes(B)},comparisonModeOptions:{type:Array,default:null},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","update:comparisonValue"],setup(B,{emit:ee}){const N=B,$=ee,{t:se,locale:O}=va.useI18n(),A=e.ref(!1),pe=e.ref("days"),rt=new Date,te=e.computed(()=>N.minDate instanceof Date?N.minDate:rt),g=e.ref(te.value.getMonth()),xe=e.ref(te.value.getFullYear()),ye=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),he=e.ref(te.value.getFullYear()),Ae=e.ref("start"),ge=e.ref("start"),Te=e.ref(null),q=e.ref(null),Re=e.ref(!1),Ue=e.ref("previousPeriod"),Be=e.ref("primary"),Ye=e.ref({start:null,end:null});function Z(){const k=te.value,w=k.getMonth(),x=k.getFullYear(),d=w===11?0:w+1,v=w===11?x+1:x;return{left:{month:w,year:x},right:{month:d,year:v}}}const De=e.ref(null),Ze=e.ref(null),ke=e.ref(null),et=e.ref(null),at=e.ref(null),Pe=e.ref(null),$t=e.ref(null),Wt=e.ref(null),Qe=new Date().getFullYear(),Tt=e.computed(()=>["single","singleFromAvailable"].includes(N.mode)),Ce=e.computed(()=>["range","rangeFromAvailable"].includes(N.mode)),ht=e.computed(()=>N.mode==="listFromAvailable"),Je=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(N.mode))return null;const k=N.modelValue;return k instanceof Date?k:null}),ut=e.computed(()=>{if(!Ce.value)return{start:null,end:null};const k=N.modelValue;return!k||typeof k!="object"?{start:null,end:null}:{start:k.start instanceof Date?k.start:null,end:k.end instanceof Date?k.end:null}}),ot=e.computed(()=>nt(N.comparisonValue)),gt=e.computed(()=>N.comparisonEnabled&&Ce.value),dt=e.computed(()=>gt.value&&N.comparisonControlsPlacement==="side"),Gt=e.computed(()=>gt.value&&N.comparisonControlsPlacement==="bottom"),wt=e.computed(()=>gt.value&&Re.value&&Ue.value==="custom"&&Be.value==="comparison"),Vt={previousPeriod:"datepicker.comparison.previousPeriod",previousYear:"datepicker.comparison.previousYear",custom:"datepicker.comparison.custom"},ue=[{id:"previousPeriod",labelKey:"datepicker.comparison.previousPeriod"},{id:"previousYear",labelKey:"datepicker.comparison.previousYear"},{id:"custom",labelKey:"datepicker.comparison.custom"}],R=e.computed(()=>{const w=(Array.isArray(N.comparisonModeOptions)&&N.comparisonModeOptions.length?N.comparisonModeOptions:ue).map(x=>typeof x=="string"?{id:x,labelKey:Vt[x]}:!x||typeof x!="object"||!x.id?null:{...x,labelKey:x.labelKey||Vt[x.id]}).filter(x=>x&&Vt[x.id]);return w.length?w:ue});function Y(k){return k.label?k.label:k.labelKey?se(k.labelKey):k.id}function ie(k){return R.value.some(w=>w.id===k)}function be(){if(ie(Ue.value))return;const k=R.value[0]?.id||"previousPeriod";Ue.value=k,Be.value=k==="custom"?"comparison":"primary",Re.value&&k!=="custom"&&Yl()}function lt(k){if(!k||!(k instanceof Date))return"";const w=k.getDate(),x=k.getMonth()+1,d=k.getFullYear(),v=b=>String(b).padStart(2,"0");return`${v(w)}/${v(x)}/${d}`}function He(k){return k instanceof Date&&!Number.isNaN(k.getTime())?new Date(k.getFullYear(),k.getMonth(),k.getDate()):null}function nt(k){return!k||typeof k!="object"?{start:null,end:null}:{start:He(k.start),end:He(k.end)}}function Me(k){const w=nt(k),{start:x,end:d}=w;return x&&d&&x>d?{start:d,end:x}:w}function tt(k){const{start:w,end:x}=Me(k);return!w&&!x?"":!w||!x?lt(w||x):w&&x&&Vl(w,x)?lt(w):`${lt(w||x)} - ${lt(x||w)}`}const it=e.computed(()=>lt(Je.value)),Ut=e.computed(()=>tt(ut.value)),ae=e.computed(()=>{const{start:k,end:w}=Me(ot.value);return!k||!w?null:{start:lt(k),end:lt(w)}}),Q=e.computed(()=>{if(N.mode!=="readonly")return"—";const k=N.modelValue;if(k instanceof Date)return lt(k)||"—";if(k&&typeof k=="object"&&("start"in k||"end"in k)){const w=k.start instanceof Date?k.start:null,x=k.end instanceof Date?k.end:null;if(!w&&!x)return"—";const d=!x||w&&w<=x?w:x,v=!w||x&&x>=w?x:w;return Vl(d,v)?lt(d):`${lt(d)} - ${lt(v)}`}return"—"});e.computed(()=>{const k=new Date(xe.value,g.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)});const oe=e.computed(()=>q.value==="left"?ye.value:q.value==="right"?X.value:g.value),re=e.computed(()=>q.value==="left"?J.value:q.value==="right"?he.value:xe.value),Se=e.computed(()=>{const k=new Date(xe.value,g.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Ke=e.computed(()=>{const k=new Date(re.value,oe.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Bt=e.computed(()=>{const k=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(w,x)=>k.format(new Date(2024,x,1)))}),Qt=e.computed(()=>{const w=(q.value?re.value:xe.value)-Math.floor(Ho/2);return Array.from({length:Ho},(x,d)=>w+d)}),_t=e.computed(()=>{const k=Qt.value;return k.length?`${k[0]} – ${k[k.length-1]}`:""});function ul(k){return k===7?0:k}function M(k){try{const w=new Intl.Locale(k);if(w.weekInfo?.firstDay!=null)return ul(w.weekInfo.firstDay)}catch{}return 1}function V(k){const w=new Date(2024,0,1),x=(w.getDay()-k+7)%7,d=new Date(w);return d.setDate(w.getDate()-x),d}const T=e.computed(()=>M(O.value)),ce=e.computed(()=>{const k=new Intl.DateTimeFormat(O.value,{weekday:"short"}),w=V(T.value),x=[];for(let d=0;d<7;d++){const v=new Date(w);v.setDate(w.getDate()+d),x.push(k.format(v).slice(0,2))}return x});function j(k,w,x){const d=new Date(k,w,1),v=new Date(k,w+1,0),b=(d.getDay()-x+7)%7,H=v.getDate(),U=[];for(let ne=0;ne<b;ne++)U.push(null);for(let ne=1;ne<=H;ne++)U.push(new Date(k,w,ne));return U}const Oe=e.computed(()=>j(xe.value,g.value,T.value)),kt=e.computed(()=>j(J.value,ye.value,T.value)),st=e.computed(()=>j(he.value,X.value,T.value));e.computed(()=>{const k=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)}),e.computed(()=>{const k=new Date(he.value,X.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)});const Xe=e.computed(()=>{const k=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),xt=e.computed(()=>{const k=new Date(he.value,X.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Ct=e.computed(()=>N.availableDates&&N.availableDates.length>0),Et={all:"datepicker.quickSelect.allDates",last2:"datepicker.quickSelect.last2Dates",last3:"datepicker.quickSelect.last3Dates",last4:"datepicker.quickSelect.last4Dates",last5:"datepicker.quickSelect.last5Dates",today:"datepicker.quickSelect.today",lastWeek:"datepicker.quickSelect.lastWeek",last15Days:"datepicker.quickSelect.last15Days",last30Days:"datepicker.quickSelect.last30Days",thisMonth:"datepicker.quickSelect.thisMonth",lastMonth:"datepicker.quickSelect.lastMonth",last3Months:"datepicker.quickSelect.last3Months",last6Months:"datepicker.quickSelect.last6Months",last12Months:"datepicker.quickSelect.last12Months",lastYear:"datepicker.quickSelect.lastYear",in7Days:"datepicker.quickSelect.in7Days",in14Days:"datepicker.quickSelect.in14Days",in30Days:"datepicker.quickSelect.in30Days"},Mt=e.computed(()=>Tt.value&&!Ct.value?[{id:"in7Days",labelKey:"datepicker.quickSelect.in7Days"},{id:"in14Days",labelKey:"datepicker.quickSelect.in14Days"},{id:"in30Days",labelKey:"datepicker.quickSelect.in30Days"}]:Ct.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:"lastMonth",labelKey:"datepicker.quickSelect.lastMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),bt=e.computed(()=>(Array.isArray(N.quickSelectOptions)&&N.quickSelectOptions.length?N.quickSelectOptions:Mt.value).map(w=>typeof w=="string"?{id:w,labelKey:Et[w]}:!w||typeof w!="object"||!w.id?null:{...w,labelKey:w.labelKey||Et[w.id]}).filter(w=>w&&w.id));function St(k){return k.label?k.label:k.labelKey?se(k.labelKey):k.id}const El=e.ref({top:0,left:0}),Wl=e.ref("left");let Ll=null;function Sl(){A.value&&e.nextTick(()=>{A.value&&(Ll!==null&&window.cancelAnimationFrame(Ll),Ll=window.requestAnimationFrame(()=>{Ll=null,Kt()}))})}function Kt(){if(!at.value||!A.value)return;const k=at.value.getBoundingClientRect(),w=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight;let d=k.left,v=k.bottom+4;const b=Pe.value;if(b){const H=b.offsetWidth,U=b.offsetHeight;Wl.value==="right"||d+H>w-Qn?(Wl.value="right",d=k.right-H):Wl.value="left";const K=Math.max(Qn,w-H-Qn);if(d=Math.min(Math.max(d,Qn),K),v+U>x-Qn){const vt=k.top-4-U;vt>=Qn?v=vt:v=Math.max(Qn,x-U-Qn)}}El.value={top:v,left:d}}const Tl=e.computed(()=>!at.value||!A.value?{}:{position:"fixed",left:`${El.value.left}px`,top:`${El.value.top}px`,zIndex:1002});function Vl(k,w){return!k||!w?!1:k.getFullYear()===w.getFullYear()&&k.getMonth()===w.getMonth()&&k.getDate()===w.getDate()}function At(k){return new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime()}function Bl(k){return!N.availableDates||!N.availableDates.length?!0:N.availableDates.some(w=>w instanceof Date&&Vl(w,k))}function sl(k){const w=At(k);return!(N.minDate instanceof Date&&w<At(N.minDate)||N.maxDate instanceof Date&&w>At(N.maxDate))}function Al(k){const w=new Date(k);return new Date(w.getFullYear(),w.getMonth(),w.getDate())}function Zn(k){return Math.floor(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())/864e5)}function Tn(k,w){return new Date(k.getFullYear(),k.getMonth(),k.getDate()+w)}function Sn(k){return k.filter(w=>sl(w))}function Gl(k,w){if(!(k instanceof Date)||!(w instanceof Date))return null;let x=At(k),d=At(w);if(x>d&&([x,d]=[d,x]),N.minDate instanceof Date){const v=At(N.minDate);x=Math.max(x,v),d=Math.max(d,v)}if(N.maxDate instanceof Date){const v=At(N.maxDate);x=Math.min(x,v),d=Math.min(d,v)}return x>d?null:{start:Al(x),end:Al(d)}}function un(k){return!N.exceptDates||!N.exceptDates.length?!1:N.exceptDates.some(w=>w instanceof Date&&Vl(w,k))}function Ml(k){return un(k)?!1:["singleFromAvailable","rangeFromAvailable"].includes(N.mode)?Bl(k)&&sl(k):sl(k)}function gn(k){const w=Je.value,x=ut.value,d=ot.value,v=At(k),b=Ce.value&&x.start&&x.end&&v>Math.min(At(x.start),At(x.end))&&v<Math.max(At(x.start),At(x.end)),H=Ce.value&&x.start&&Vl(k,x.start),U=Ce.value&&x.end&&Vl(k,x.end),ne=H&&U,K=gt.value&&Re.value,vt=K&&d.start&&Vl(k,d.start),je=K&&d.end&&Vl(k,d.end),Ot=vt&&je,$e=K&&d.start&&d.end&&v>Math.min(At(d.start),At(d.end))&&v<Math.max(At(d.start),At(d.end)),mt=Tt.value&&w&&Vl(k,w)||H||U;let de=!1,tl=!1;const ze=wt.value?d:x;if(Ce.value&&ze.start&&!ze.end&&Te.value){const la=At(ze.start),na=At(Te.value),pn=Math.min(la,na),vn=Math.max(la,na);wt.value?tl=v>pn&&v<vn:de=v>pn&&v<vn}return{"dss-datepicker__day--comparison-start":vt&&!Ot&&!mt,"dss-datepicker__day--comparison-end":je&&!Ot&&!mt,"dss-datepicker__day--comparison-single":Ot&&!mt,"dss-datepicker__day--in-comparison-range":$e&&!vt&&!je&&!H&&!U,"dss-datepicker__day--in-comparison-preview":tl&&!vt&&!je&&!$e&&!H&&!U,"dss-datepicker__day--selected":mt&&!ne,"dss-datepicker__day--range-start":H&&!ne,"dss-datepicker__day--range-end":U&&!ne,"dss-datepicker__day--range-single":ne,"dss-datepicker__day--in-range":b&&!H&&!U,"dss-datepicker__day--in-range-preview":de&&!H&&!U&&!b,"dss-datepicker__day--disabled":!Ml(k)}}function Vn(k){if(!Ce.value)return;const w=wt.value?ot.value:ut.value;if(!w.start||w.end){Te.value=null;return}if(!Ml(k)){Te.value=null;return}Te.value=new Date(k.getFullYear(),k.getMonth(),k.getDate())}function An(){Te.value=null}function bl(k=ut.value){if(!N.doubleCalendar||!Ce.value)return;const w=nt(k),{start:x,end:d}=w;if(x&&d){const H=x<=d?x:d,U=x<=d?d:x,ne=H.getMonth(),K=H.getFullYear(),vt=U.getMonth(),je=U.getFullYear();if(ne!==vt||K!==je){const Ot=ye.value===ne&&J.value===K,$e=X.value===vt&&he.value===je;if(Ot&&$e)return;ye.value=ne,J.value=K,X.value=vt,he.value=je}else{const Ot=ne===0?11:ne-1,$e=ne===0?K-1:K;ye.value===Ot&&J.value===$e&&X.value===ne&&he.value===K||(ye.value=ne,J.value=K,ne===11?(X.value=0,he.value=K+1):(X.value=ne+1,he.value=K))}return}const v=x||d;if(v){const H=v.getMonth(),U=v.getFullYear(),ne=ye.value===H&&J.value===U,K=X.value===H&&he.value===U;if(ne||K)return;ye.value=H,J.value=U,H===11?(X.value=0,he.value=U+1):(X.value=H+1,he.value=U);return}const b=Z();ye.value=b.left.month,J.value=b.left.year,X.value=b.right.month,he.value=b.right.year}const yn=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),dn=e.computed(()=>{if(!ht.value)return[];const k=(N.availableDates||[]).filter(x=>x instanceof Date&&!Number.isNaN(x.getTime())).filter(x=>!un(x)&&sl(x)).map(x=>new Date(x.getFullYear(),x.getMonth(),x.getDate()));k.sort((x,d)=>d.getTime()-x.getTime());const w=Je.value;return k.map(x=>({date:x,ts:x.getTime(),label:yn.value.format(x),selected:!!(w&&Vl(x,w))}))});function Hl(){if(A.value){ql();return}at.value=et.value?.closest(".dss-datepicker__input-wrap"),Wl.value="left",A.value=!0,Sl(),e.nextTick(()=>{Wt.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Hn(k){if(!(k instanceof Date))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());$("update:modelValue",w),ql()}function _l(k="start"){if(N.mode==="readonly")return;Ae.value=k;const w=Je.value,x=ut.value;if(Tt.value&&w)g.value=w.getMonth(),xe.value=w.getFullYear();else if(Ce.value)if(N.doubleCalendar)bl();else{const d=k==="start"&&x.start?x.start:x.end||x.start;d&&(g.value=d.getMonth(),xe.value=d.getFullYear())}at.value=Tt.value?De.value?.closest(".dss-datepicker__input-wrap"):Ze.value,pe.value="days",q.value=null,Wl.value="left",A.value=!0,Sl()}function ql(){pe.value="days",q.value=null,Te.value=null,A.value=!1}function kn(k,w){q.value=k,pe.value=w}function Rl(){pe.value="days",q.value=null}function Jn(k,w,x,d){switch(k){case"today":return new Date(w,x,d);case"in7Days":return new Date(w,x,d+7);case"in14Days":return new Date(w,x,d+14);case"in30Days":return new Date(w,x,d+30);default:return null}}function Zl(k,w,x,d){const v=new Date(w,x,d);let b,H;switch(k){case"today":b=v,H=v;break;case"lastWeek":b=new Date(w,x,d-6),H=v;break;case"last15Days":b=new Date(w,x,d-14),H=v;break;case"last30Days":b=new Date(w,x,d-29),H=v;break;case"thisMonth":b=new Date(w,x,1),H=v;break;case"lastMonth":b=new Date(w,x-1,1),H=new Date(w,x,0);break;case"last3Months":b=new Date(w,x-3,1),H=new Date(w,x,0);break;case"last6Months":b=new Date(w,x-6,1),H=new Date(w,x,0);break;case"last12Months":b=new Date(w,x-12,1),H=new Date(w,x,0);break;case"lastYear":b=new Date(w-1,0,1),H=new Date(w-1,11,31);break;default:return null}return{start:b,end:H}}function dl(k){const w=new Date,x=w.getFullYear(),d=w.getMonth(),v=w.getDate();let b,H;if(Ct.value){const U=Sn([...N.availableDates].filter(ne=>ne instanceof Date).map(ne=>new Date(ne.getFullYear(),ne.getMonth(),ne.getDate()))).sort((ne,K)=>ne.getTime()-K.getTime());if(U.length===0)return null;if(k==="all")b=U[0],H=U[U.length-1];else{const ne=parseInt(k.replace("last",""),10);if(Number.isInteger(ne)&&ne>=2&&ne<=5){const K=U.slice(-ne);if(K.length===0)return null;b=K[0],H=K[K.length-1]}else{const K=Zl(k,x,d,v);if(!K)return null;const vt=en(K);if(!vt.length)return null;b=vt[0],H=vt[vt.length-1]}}}else{const U=Zl(k,x,d,v);if(!U)return null;b=U.start,H=U.end}return{start:b,end:H}}function $l(k){const w=new Date,x=Jn(k,w.getFullYear(),w.getMonth(),w.getDate()),d=He(x);return!d||!Ml(d)?null:d}function Yt(k){const w=dl(k);return w?Gl(w.start,w.end):null}function Ht(k){return Tt.value?$l(k)!==null:Yt(k)!==null}function Ql(k){const w=$l(k);w&&($("update:modelValue",w),ql())}function qt(k){if(Tt.value){Ql(k);return}Pl(k)}function yt(){$("update:modelValue",null)}function Pl(k){const w=Yt(k);w&&($("update:modelValue",w),bl())}function vl(k){return!!(k&&k.start instanceof Date&&k.end instanceof Date)}function Zt(k){$("update:comparisonValue",nt(k))}function Jl(k=ot.value){const w=nt(k);vl(w)&&(Ye.value=w)}function Ul(){return vl(Ye.value)?(Zt(Ye.value),N.doubleCalendar&&bl(Ye.value),!0):!1}function Rn(k){const w=Me(k);return vl(w)?Ml(w.start)&&Ml(w.end):!1}function en(k){const w=Me(k);if(!vl(w))return[];const x=At(w.start),d=At(w.end);return(N.availableDates||[]).filter(v=>v instanceof Date&&!Number.isNaN(v.getTime())).map(v=>He(v)).filter(v=>{const b=At(v);return b>=x&&b<=d&&Ml(v)}).sort((v,b)=>At(v)-At(b))}function Dl(k){if(!(k instanceof Date))return null;const w=new Date(k.getFullYear()-1,k.getMonth(),k.getDate());return w.getMonth()!==k.getMonth()?new Date(k.getFullYear()-1,k.getMonth()+1,0):w}function Jt(k=Ue.value){const w=Me(ut.value);if(!vl(w))return{start:null,end:null};let x,d;if(k==="previousPeriod"){const b=Zn(w.end)-Zn(w.start)+1;d=Tn(w.start,-1),x=Tn(d,-(b-1))}else if(k==="previousYear")x=Dl(w.start),d=Dl(w.end);else return ot.value;let v=Me({start:x,end:d});if(N.mode==="rangeFromAvailable"&&N.availableDates?.length){const b=en(v);if(!b.length)return{start:null,end:null};v={start:b[0],end:b[b.length-1]}}return Rn(v)?v:{start:null,end:null}}function Yl(){!gt.value||!Re.value||Ue.value==="custom"||Zt(Jt())}function wl(){if(gt.value){if(Re.value=!Re.value,!Re.value){Ue.value==="custom"&&Jl(),Be.value="primary",Zt({start:null,end:null});return}if(Ue.value==="custom"){Be.value="comparison",Ul();return}Be.value="primary",Yl()}}function Pt(k){if(ie(k)){if(Ue.value=k,Te.value=null,k==="custom"){if(Be.value="comparison",Ul())return;N.doubleCalendar&&vl(ot.value)&&bl(ot.value);return}Be.value="primary",Yl()}}function Fn(k,w,x){const d=nt(k);return!d.start&&!d.end?(x.value="end",{start:w,end:null}):d.start&&d.end?(x.value="end",{start:w,end:null}):x.value==="start"?(x.value="end",Me({start:w,end:d.end})):(x.value="start",Me({start:d.start,end:w}))}function Dt(k){q.value==="left"?ye.value=k:q.value==="right"?X.value=k:g.value=k,Rl()}function Fl(k){q.value==="left"?J.value=k:q.value==="right"?he.value=k:xe.value=k,Rl()}function Nn(){g.value===0?(g.value=11,xe.value--):g.value--}function Cn(){g.value===11?(g.value=0,xe.value++):g.value++}function tn(){ye.value===0?(ye.value=11,J.value--):ye.value--}function fl(){ye.value===11?(ye.value=0,J.value++):ye.value++}function In(){X.value===0?(X.value=11,he.value--):X.value--}function ln(){X.value===11?(X.value=0,he.value++):X.value++}function mn(k){if(!Ml(k))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());if(Tt.value){$("update:modelValue",w),ql();return}if(wt.value){const d=Fn(ot.value,w,ge);vl(d)&&Jl(d),Zt(d);return}Be.value="primary";const x=Fn(ut.value,w,Ae);$("update:modelValue",x)}e.watch(ut,()=>{N.doubleCalendar&&Ce.value&&A.value&&bl(),Yl()},{deep:!0}),e.watch(()=>N.comparisonEnabled,k=>{if(be(),!k){Re.value=!1,Be.value="primary";return}vl(ot.value)?Re.value=!0:Re.value&&Ue.value!=="custom"&&Yl()}),e.watch(R,()=>{be()},{deep:!0}),e.watch(ot,k=>{gt.value&&vl(k)&&(Re.value=!0,Ue.value==="custom"&&Jl(k))},{deep:!0,immediate:!0});let Il=null,nn=null,rl=null;function Ol(){Il&&(document.removeEventListener("keydown",Il),Il=null),nn&&(window.removeEventListener("resize",nn),nn=null),rl&&(window.removeEventListener("scroll",rl,!0),rl=null)}return e.watch(pe,k=>{k==="years"&&e.nextTick(()=>{$t.value?.querySelector(`[data-year="${re.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[A.value,pe.value,g.value,xe.value,ye.value,J.value,X.value,he.value,q.value,N.doubleCalendar,N.quickSelect,N.quickSelectOptions,N.comparisonControlsPlacement],()=>{Sl()}),e.watch(A,k=>{Ol(),k&&(Il=w=>{w.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Rl():ql())},nn=()=>{Kt()},rl=()=>{Kt()},document.addEventListener("keydown",Il),window.addEventListener("resize",nn),window.addEventListener("scroll",rl,!0))}),e.onBeforeUnmount(()=>{Ll!==null&&(window.cancelAnimationFrame(Ll),Ll=null),Ol()}),(k,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":B.mode==="readonly"}])},[B.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Ss,[w[10]||(w[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Q.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Vs)])):Tt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--open":A.value}]),onClick:w[0]||(w[0]=x=>_l("start"))},[w[12]||(w[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:De,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectDate"),value:it.value,readonly:"",disabled:B.mode==="readonly"},null,8,Ns),B.clearable&&Je.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-datepicker__clear","aria-label":e.unref(se)("datepicker.clear"),onClick:e.withModifiers(yt,["stop"])},[...w[11]||(w[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})],-1)])],8,Bs)):e.createCommentVNode("",!0)],2)):ht.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":A.value}]),onClick:Hl},[w[14]||(w[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:"inputListRef",ref:et,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectFromList"),value:it.value,readonly:""},null,8,_s),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":A.value}]),"aria-hidden":"true"},[...w[13]||(w[13]=[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)):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"inputRangeWrapRef",ref:Ze,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--with-comparison":gt.value,"dss-datepicker__input-wrap--comparison-active":gt.value&&Re.value,"dss-datepicker__input-wrap--open":A.value}]),onClick:w[1]||(w[1]=x=>_l("start"))},[w[17]||(w[17]=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)),gt.value?(e.openBlock(),e.createElementBlock("div",Ms,[e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectRange"),value:Ut.value,readonly:""},null,8,$s),Re.value&&ae.value?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("span",Ls,e.toDisplayString(ae.value.start),1),w[15]||(w[15]=e.createElementVNode("span",{class:"dss-datepicker__comparison-sep"},"/",-1)),e.createElementVNode("span",Ts,e.toDisplayString(ae.value.end),1)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectRange"),value:Ut.value,readonly:""},null,8,As)),gt.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle dss-datepicker__comparison-toggle--icon",{"dss-datepicker__comparison-toggle--active":Re.value}]),"aria-label":Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo"),"aria-pressed":Re.value,onClick:e.withModifiers(wl,["stop"])},[...w[16]||(w[16]=[e.createElementVNode("svg",{class:"dss-datepicker__comparison-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M9.06387 6.587C9.16352 6.54566 9.27319 6.5348 9.37901 6.5558C9.48484 6.57679 9.58205 6.6287 9.65837 6.70495L11.84 8.88661C11.8907 8.93727 11.931 8.99742 11.9584 9.06363C11.9859 9.12984 12 9.20082 12 9.27249C12 9.34417 11.9859 9.41514 11.9584 9.48135C11.931 9.54757 11.8907 9.60772 11.84 9.65837L9.65837 11.84C9.58209 11.9164 9.48487 11.9684 9.37902 11.9895C9.27316 12.0106 9.16343 11.9998 9.06371 11.9585C8.964 11.9171 8.87879 11.8472 8.81886 11.7574C8.75894 11.6676 8.72699 11.5621 8.72708 11.4542L8.72708 9.81791L0.545845 9.81791C0.401191 9.81791 0.262463 9.76045 0.160178 9.65816C0.0578924 9.55587 0.00042901 9.41715 0.000429004 9.27249C0.000428997 9.12784 0.0578924 8.98911 0.160178 8.88683C0.262463 8.78454 0.401191 8.72708 0.545845 8.72708L8.72708 8.72708L8.72708 7.09083C8.7271 6.98296 8.75911 6.87752 8.81906 6.78783C8.87901 6.69815 8.9642 6.62826 9.06387 6.587ZM2.34162 0.159964L0.159963 2.34163C0.109252 2.39228 0.0690227 2.45243 0.0415751 2.51865C0.0141274 2.58486 -4.08447e-07 2.65583 -4.05314e-07 2.72751C-4.0218e-07 2.79918 0.0141274 2.87016 0.0415751 2.93637C0.0690227 3.00258 0.109252 3.06273 0.159963 3.11339L2.34162 5.29505C2.4179 5.37142 2.51513 5.42343 2.62098 5.44451C2.72684 5.46559 2.83657 5.45479 2.93629 5.41347C3.036 5.37216 3.12121 5.30218 3.18114 5.21241C3.24106 5.12264 3.27301 5.0171 3.27292 4.90917L3.27292 3.27292L11.4542 3.27292C11.5988 3.27292 11.7375 3.21546 11.8398 3.11317C11.9421 3.01089 11.9996 2.87216 11.9996 2.72751C11.9996 2.58285 11.9421 2.44412 11.8398 2.34184C11.7375 2.23955 11.5988 2.18209 11.4542 2.18209L3.27292 2.18209L3.27292 0.545846C3.27301 0.43791 3.24106 0.332376 3.18114 0.242604C3.12121 0.152832 3.036 0.0828592 2.93629 0.0415426C2.83657 0.000226074 2.72684 -0.0105762 2.62098 0.0105043C2.51513 0.0315849 2.4179 0.0835995 2.34162 0.159964Z"})],-1)])],10,Hs)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ql,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Pe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":B.doubleCalendar&&Ce.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":pe.value==="days"&&(B.doubleCalendar&&Ce.value&&(B.quickSelect||dt.value)||Tt.value&&B.quickSelect),"dss-datepicker__dropdown--list":ht.value}]),onClick:w[9]||(w[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Tl.value)},[ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[dn.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:Wt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.ts,role:"option","aria-selected":x.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":x.selected}]),onClick:d=>Hn(x.date)},[e.createElementVNode("span",Fs,e.toDisplayString(x.label),1),x.selected?(e.openBlock(),e.createElementBlock("svg",Is,[...w[18]||(w[18]=[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,Rs))),128))],512)):(e.openBlock(),e.createElementBlock("div",zs,e.toDisplayString(e.unref(se)("datepicker.noAvailableDates")),1))],64)):pe.value==="days"&&B.doubleCalendar&&Ce.value?(e.openBlock(),e.createElementBlock("div",Ps,[B.quickSelect||dt.value?(e.openBlock(),e.createElementBlock("div",Os,[B.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Ht(x.id),onClick:d=>qt(x.id)},e.toDisplayString(St(x)),9,qs))),128))])):e.createCommentVNode("",!0),dt.value?(e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ue.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,Ys))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xs,[e.createElementVNode("div",js,[e.createElementVNode("div",Ks,[e.createElementVNode("div",Gs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:tn}," ‹ ",8,Qs),e.createElementVNode("div",Js,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[2]||(w[2]=x=>kn("left","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[3]||(w[3]=x=>kn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:fl}," › ",8,er)]),e.createElementVNode("div",tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!Ml(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,nr)):(e.openBlock(),e.createElementBlock("span",ar))],64))),128))])]),e.createElementVNode("div",or,[e.createElementVNode("div",sr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:In}," ‹ ",8,rr),e.createElementVNode("div",ir,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[4]||(w[4]=x=>kn("right","months"))},e.toDisplayString(xt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[5]||(w[5]=x=>kn("right","years"))},e.toDisplayString(he.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:ln}," › ",8,cr)]),e.createElementVNode("div",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!Ml(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,mr)):(e.openBlock(),e.createElementBlock("span",pr))],64))),128))])])]),Gt.value?(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ue.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,hr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):pe.value==="days"?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"dss-datepicker__double-wrap":B.quickSelect&&Tt.value})},[B.quickSelect&&Tt.value?(e.openBlock(),e.createElementBlock("div",gr,[e.createElementVNode("nav",yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Ht(x.id),onClick:d=>qt(x.id)},e.toDisplayString(St(x)),9,kr))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Cr,[gt.value?(e.openBlock(),e.createElementBlock("div",br,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ue.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,xr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Nn}," ‹ ",8,Sr),e.createElementVNode("div",Vr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[6]||(w[6]=x=>pe.value="months")},e.toDisplayString(Se.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[7]||(w[7]=x=>pe.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Cn}," › ",8,Nr)]),e.createElementVNode("div",Br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!Ml(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,Mr)):(e.openBlock(),e.createElementBlock("span",$r))],64))),128))])])],2)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Dr,[e.createElementVNode("div",Lr,[e.createElementVNode("span",Tr,e.toDisplayString(Ke.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[8]||(w[8]=x=>pe.value="years")},e.toDisplayString(re.value),1)])]),e.createElementVNode("div",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(x,d)=>(e.openBlock(),e.createElementBlock("button",{key:d,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":d===oe.value}]),onClick:v=>Dt(d)},e.toDisplayString(x),11,Hr))),128))])],64)):pe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Rr,[e.createElementVNode("span",Fr,e.toDisplayString(_t.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:$t},[e.createElementVNode("div",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":x===re.value,"dss-datepicker__year-cell--current":x===e.unref(Qe)}]),"data-year":x,onClick:d=>Fl(x)},e.toDisplayString(x),11,zr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Pr={class:"dss-step-bar__layout"},Or={class:"dss-step-bar__header"},Wr={class:"dss-step-bar__label"},qr={key:0,class:"dss-step-bar__counter"},Zr={class:"dss-step-bar__track-wrapper"},Ur=["aria-valuemax","aria-valuenow","aria-label"],Yr=["onMouseenter"],Fo={__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:B=>["input","desc","asc"].includes(B)},orientation:{type:String,default:"horizontal",validator:B=>["horizontal","vertical"].includes(B)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:B=>["up","down","left","right"].includes(B)},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:()=>({})},disableTooltips:{type:Boolean,default:!1}},setup(B){const ee=B,N={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"}}},$=R=>R&&typeof R=="object"&&!Array.isArray(R),se=(R,Y)=>{const ie=Object.assign({},R);return!$(R)||!$(Y)||Object.keys(Y).forEach(be=>{if($(Y[be])){be in R?ie[be]=se(R[be],Y[be]):Object.assign(ie,{[be]:Y[be]});return}Object.assign(ie,{[be]:Y[be]})}),ie},O=e.computed(()=>se(N,ee.options)),A=e.computed(()=>Math.max(1,Number(ee.steps)||1)),pe=e.computed(()=>Math.min(A.value,Math.max(0,Number(ee.currentStep)||0))),rt=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),te=e.computed(()=>{if(!rt.value)return[];const R=ee.segments.map((Y,ie)=>{const be=Number(Y?.value);return{label:Y?.label||`Step ${ie+1}`,value:Number.isFinite(be)&&be>0?be:0,color:Y?.color||ee.activeColor,marker:Y?.marker}});return ee.segmentOrder==="desc"?[...R].sort((Y,ie)=>ie.value-Y.value):ee.segmentOrder==="asc"?[...R].sort((Y,ie)=>Y.value-ie.value):R}),g=e.computed(()=>rt.value?te.value.reduce((R,Y)=>R+Y.value,0):pe.value),xe=e.computed(()=>rt.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,g.value):A.value),ye=e.computed(()=>rt.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),J=e.computed(()=>ye.value?Math.max(0,Number(ee.totalValue)-g.value):0),X=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),he=e.computed(()=>J.value>0),Ae=e.computed(()=>te.value.reduce((R,Y)=>Math.max(R,Number(Y.value)||0),0)),ge=e.computed(()=>te.value.filter(R=>R.value>0).map(R=>`${R.label}: ${ht(R.value)}`).join(" | ")),Te=e.computed(()=>rt.value?ye.value?te.value.filter(R=>R.value>0):te.value:[]),q=e.computed(()=>{if(!ee.counterAsPercentage)return`${g.value} / ${xe.value}`;const R=Number(xe.value);if(!Number.isFinite(R)||R<=0)return"0%";const Y=Math.round(Number(g.value)/R*100);return`${Math.min(Math.max(Y,0),100)}%`}),Re=e.computed(()=>g.value),Ue=e.computed(()=>xe.value),Be=e.reactive({visible:!1,x:0,y:0,content:""}),Ye=e.computed(()=>ee.orientation==="vertical"),Z=e.computed(()=>{const R=ee.barHeight;return R==null||R===""?"200px":typeof R=="number"?`${R}px`:String(R)}),De=e.computed(()=>{const R=ee.sideLabelMaxWidth;if(!(R==null||R===""))return typeof R=="number"?`${R}px`:String(R)}),Ze=e.computed(()=>{const R=ee.sideLabelWrapWidth;return R==null||R===""?"18ch":typeof R=="number"?`${R}ch`:String(R)}),ke=e.computed(()=>({left:`${Be.x}px`,top:`${Be.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),et=R=>Ye.value?{flex:`${R} 0 0`,minHeight:R>0?"6px":"0",minWidth:"0"}:{flex:`${R} 0 0`,minWidth:R>0?"6px":"0"},at=R=>{const Y=R?.parentElement;if(!Y)return{x:0,y:0};const ie=Y.getBoundingClientRect();return{x:ie.left+ie.width/2,y:ie.top}},Pe=R=>{const Y=R.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},$t=R=>{if(ye.value){const be=Math.max(0,Number(R.value)||0);return{...et(be),backgroundColor:R.color}}const Y=g.value,ie=R.value>0?R.value:Y>0?1e-4:1;return{...et(ie),backgroundColor:R.color}},Wt=R=>Number(R?.value||0)>0&&Number(R?.value||0)===Ae.value,Qe=R=>{const Y=$(R?.marker)?R.marker:{},ie=R?.marker===!0||Y.enabled===!0,be=Wt(R)&&O.value.maxSegment?.marker?.enabled===!0;if(!(ie||be))return{enabled:!1};const He=Y.backgroundColor??(be?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),nt=Y.borderColor??(be?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Me=Y.color??(be?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),tt=Y.width??(be?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),it=Y.height??(be?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:He,borderColor:nt,color:Me,width:tt,height:it,icon:Y.icon??null,...Y}},Tt=R=>{const Y=Qe(R);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},Ce=R=>{const Y=Qe(R);return{width:Y.width??void 0,height:Y.height??void 0}},ht=R=>`${R}${ee.valueLabel}`,Je=e.computed(()=>({...et(J.value),backgroundColor:ee.inactiveColor})),ut=(R,Y)=>{ee.disableTooltips||dt(R,Y)},ot=R=>{ee.disableTooltips||Gt(R)},gt=()=>{ee.disableTooltips||wt()},dt=(R,Y)=>{if(!R||!Y?.currentTarget)return;const ie=Y.currentTarget;if(ee.remainderTooltipSummary){const lt=at(ie);Be.x=lt.x,Be.y=lt.y,Be.content=ge.value,Be.visible=!!Be.content;return}const be=Pe(ie);Be.x=be.x,Be.y=be.y,Be.content=`${R.label}: ${ht(R.value)}`,Be.visible=!0},Gt=R=>{if(!J.value||!R?.currentTarget)return;const Y=R.currentTarget;if(ee.remainderTooltipSummary){const be=at(Y);Be.x=be.x,Be.y=be.y,Be.content=ge.value,Be.visible=!!Be.content;return}const ie=Pe(Y);Be.x=ie.x,Be.y=ie.y,X.value&&(Be.content=`${ee.remainderLabel}: ${ht(J.value)}`,Be.visible=!0)},wt=()=>{Be.visible=!1},Vt=()=>{Be.visible&&wt()};e.onMounted(()=>{window.addEventListener("scroll",Vt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Vt,!0)});const ue=e.computed(()=>({"--dss-step-bar-label-color":ee.labelColor??void 0,"--dss-step-bar-counter-color":ee.counterColor??void 0,"--dss-step-bar-active-color":ee.activeColor,"--dss-step-bar-inactive-color":ee.inactiveColor,"--dss-step-bar-bar-height":Ye.value?Z.value:void 0,"--dss-step-bar-side-label-max-width":De.value,"--dss-step-bar-side-label-wrap-width":Ze.value}));return(R,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${B.orientation}`,`dss-step-bar--label-${B.labelPosition}`]]),style:e.normalizeStyle(ue.value)},[e.createElementVNode("div",Pr,[e.createElementVNode("div",Or,[e.createElementVNode("span",Wr,[e.renderSlot(R.$slots,"label",{label:B.label},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])]),B.showCounter?(e.openBlock(),e.createElementBlock("span",qr,[e.renderSlot(R.$slots,"counter",{counterDisplay:q.value},()=>[e.createTextVNode(e.toDisplayString(q.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zr,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Ue.value,"aria-valuenow":Re.value,"aria-label":B.label},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(ie,be)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${be}-${ie.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Wt(ie),"dss-step-bar__segment--marker-enabled":Qe(ie).enabled}]),style:e.normalizeStyle($t(ie)),onMouseenter:lt=>ut(ie,lt),onMouseleave:gt},[Qe(ie).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Tt(ie)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Ce(ie))},[e.renderSlot(R.$slots,"segment-marker-icon",{segment:ie,index:be,marker:Qe(ie)},()=>[e.renderSlot(R.$slots,"max-segment-icon",{segment:ie,index:be,marker:Qe(ie)},()=>[e.createTextVNode(e.toDisplayString(Qe(ie).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Yr))),128)),he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(Je.value),onMouseenter:Y[0]||(Y[0]=ie=>ot(ie)),onMouseleave:gt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,ie=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ie<=pe.value}])},null,2))),128))],8,Ur)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!B.disableTooltips&&Be.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ke.value)},e.toDisplayString(Be.content),5)):e.createCommentVNode("",!0)]))],6))}},Xr=["data-chart-type"],jr={class:"dss-chart-header-titles"},Kr={key:0,class:"dss-chart-title"},Gr={key:1,class:"dss-chart-subtitle"},Qr=["onClick","onMouseenter"],Jr={class:"dss-legend-text"},ei=["onClick","onMouseenter"],ti={class:"dss-legend-text"},li=["title"],ni=["src"],ai={class:"dss-chart-area-wrapper"},oi={key:0,class:"dss-chart-z-axis-label"},si=["width","height","viewBox","preserveAspectRatio","data-smooth","data-animated"],ri=["id"],ii=["y","width","height"],ci=["id"],ui=["d"],di=["id"],mi=["d"],pi={key:0},vi=["clip-path"],fi=["x1","x2","y1","y2"],hi=["clip-path"],gi=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],yi={class:"dss-axes"},ki=["x1","x2","y1","y2"],Ci=["x1","x2","y1","y2"],bi=["x1","x2","y1","y2"],wi={class:"dss-axis-labels"},xi=["x","y"],Ei=["x","y"],Si=["x","y"],Vi=["x","y"],Ni=["y","transform"],Bi=["x","y","transform"],_i={key:2,class:"dss-flag-markers"},Mi=["clip-path"],$i=["x1","x2","y1","y2","onMouseover"],Di=["x1","x2","y1","y2","onMouseover"],Li=["x1","x2","y1","y2","onMouseover"],Ti=["cx","cy","onMouseover"],Ai=["cx","cy","fill","onMouseover"],Hi=["x","y"],Ri=["clip-path"],Fi={key:0},Ii=["d","onMouseover"],zi=["x","y","width","height","fill","onMouseover"],Pi={class:"dss-line-chart"},Oi=["d","stroke","stroke-width","stroke-dasharray"],Wi=["d","stroke","stroke-width","opacity"],qi=["cx","cy","r","fill","onMouseover"],Zi={key:1},Ui=["d","stroke","stroke-width","stroke-dasharray"],Yi=["d","stroke","stroke-width","stroke-dasharray"],Xi=["d","stroke","stroke-width","opacity"],ji=["cx","cy","r","fill","onMouseover"],Ki={key:2},Gi=["id"],Qi=["x","y","width","height"],Ji=["d","fill","fill-opacity","mask"],ec=["d","stroke","stroke-width"],tc=["d","fill","onMouseover"],lc=["x","y","width","height","onMouseover"],nc=["clip-path"],ac=["x1","x2","y1","y2","stroke"],oc=["cx","cy","r","fill"],sc={key:1,class:"dss-bubble-chart"},rc={key:0,class:"dss-bubble-group"},ic=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],cc=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],uc=["transform"],dc=["cx","cy","r"],mc=["data-chart-type","clip-path"],pc=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],vc={key:1,class:"dss-radial-segment-data-labels"},fc=["x","y"],hc=["x","y","font-size","fill"],gc=["x1","y1","x2","y2","stroke"],yc=["x1","y1","x2","y2","stroke"],kc=["x","y","text-anchor","font-size"],Cc=["transform"],bc={key:0,class:"dss-spider-grid"},wc=["cx","cy","r"],xc={class:"dss-spider-grid-labels"},Ec=["x","y"],Sc=["x","y"],Vc=["x1","x2","y1","y2"],Nc={class:"dss-spider-labels"},Bc=["x","y","text-anchor","dominant-baseline"],_c=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Mc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],$c={class:"dss-chart-logos"},Dc=["cx","cy","r","fill"],Lc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Tc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},Ac=["onClick","onMouseenter"],Hc=["src"],Rc={class:"dss-marker-tooltip-category"},Fc={key:0,class:"dss-marker-tooltip-description"},Ic={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},zc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Pc={class:"dss-tooltip-series-name"},Oc={class:"dss-tooltip-series-value"},Wc={key:1,class:"dss-tooltip-section"},qc={key:0,class:"dss-tooltip-title"},Zc={class:"dss-bubble-tooltip-data"},Uc={key:2,class:"dss-tooltip-section"},Yc={class:"dss-tooltip-title"},Xc={class:"dss-tooltip-value"},jc={key:0,class:"dss-tooltip-section"},Kc={class:"dss-tooltip-section-title"},Gc={class:"dss-tooltip-group-header"},Qc={class:"dss-tooltip-item-content"},Jc={class:"dss-tooltip-item-text"},eu={key:1,class:"dss-tooltip-section"},tu={class:"dss-tooltip-section-title"},lu={class:"dss-tooltip-item-content"},nu={class:"dss-tooltip-item-title"},au={key:0,class:"dss-tooltip-item-description"},ou={class:"dss-tooltip-section"},su={class:"dss-tooltip-title"},ru={key:0,class:"dss-bubble-tooltip-data"},iu={class:"dss-tooltip-series-name"},cu={class:"dss-tooltip-series-value"},uu={key:0,class:"dss-tooltip-section"},du={class:"dss-tooltip-section-title"},mu={class:"dss-tooltip-group-header"},pu={class:"dss-tooltip-item-content"},vu={class:"dss-tooltip-item-text"},fu={key:1,class:"dss-tooltip-section"},hu={class:"dss-tooltip-section-title"},gu={class:"dss-tooltip-item-content"},yu={class:"dss-tooltip-item-title"},ku={key:0,class:"dss-tooltip-item-description"},Cu=["onClick","onMouseenter"],bu={class:"dss-legend-text"},wu={key:1,class:"dss-context-menu-separator"},xu={key:0,class:"dss-context-menu-separator"},Eu={key:0,class:"dss-context-menu-separator"},Su=["onClick"],Vu=["innerHTML"],Nu={key:0,class:"dss-context-menu-icon"},Bu={class:"dss-marker-modal-header"},_u={class:"dss-marker-modal-body"},Mu={class:"dss-form-group"},$u={class:"dss-form-group"},Du={for:"dss-marker-description"},Lu={key:0,class:"dss-form-text-display"},Tu=["placeholder"],Au={class:"dss-marker-modal-footer"},Hu={class:"modal-footer-left"},Ru={class:"dss-modal-footer-right"},Fu=["disabled"],Iu={name:"DSSChart"},zu=Object.assign(Iu,{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:B=>typeof B=="object"&&B!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(B,{emit:ee}){const{t:N,locale:$}=va.useI18n(),se=ee,O=e.ref(null),A=e.ref(null);let pe=null;const rt=()=>{pe&&(pe(),pe=null);const t=A.value;if(!t||Ce.value!=="stepbar")return;const a=l=>$a(l);t.addEventListener("wheel",a,{passive:!1}),pe=()=>t.removeEventListener("wheel",a)},te=e.ref(null),g=e.ref(null),xe=e.ref(0),ye=e.ref(0);let J=null,X=null;const he=20,Ae=e.computed(()=>{if(ye.value,xe.value,!O.value||!te.value)return 0;try{const t=O.value.getBoundingClientRect();return te.value.getBoundingClientRect().top-t.top}catch{return 0}}),ge=e.computed(()=>`chart-clip-${q.chartId}`),Te=e.computed(()=>`url(#${ge.value})`),q=B,Re={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:14,columnWidth:72,trackWidth:14,minBarWidth:12,maxBarWidth:120,barRadius:6,columnGap:16,labelReserve:48,trackAreaHeight:220,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 Ue(t,a){const l=Object.assign({},t);return Ye(t)&&Ye(a)&&Object.keys(a).forEach(r=>{Ye(a[r])?r in t?l[r]=Ue(t[r],a[r]):Object.assign(l,{[r]:a[r]}):Object.assign(l,{[r]:a[r]})}),l}const Be=()=>{let t=20,a=0,l=0;if(Je.value&&(t+=30),ut.value&&(t+=25),He.value&&q.series.length>0){const r=q.series.filter((p,h)=>!ne.value.has(h)).length;if(nt.value==="top"||nt.value==="bottom"){if(Me.value==="horizontal"){const h=Math.floor(Pe.value/100);a=Math.ceil(r/h)*25+10}else a=r*25+10;t+=a}else l=150}return{height:t,legendHeight:a,legendWidth:l}};function Ye(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ue(Re,q.options)),De=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),Ze=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>De.value||Ze.value),et=e.computed(()=>`0 0 ${Pe.value} ${Qe.value}`),at=e.computed(()=>{const t=Z.value;return t?.chart?.type==="stepbar"&&t?.chart?.height==="fit"}),Pe=e.computed(()=>{const t=Z.value;return De.value?xe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),$t=e.ref(he),Wt=e.computed(()=>{if(Ze.value){const t=Wt.value;return t??Math.max(0,(ye.value||400)-$t.value*5)}}),Qe=e.computed(()=>{const t=Z.value;if(Ce.value==="mini-radial")return Pe.value;if(at.value)return At.value;if(Ze.value){const a=Wt.value;return a??(Ce.value==="radial"?Pe.value:Math.max(0,(ye.value||400)-$t.value))}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Tt=e.computed(()=>{if(Ze.value&&Ce.value==="semi-radial"&&Wt.value!=null||Ze.value&&Xt.value)return $t.value+Qe.value+"px";if(Ze.value)return"100%";if(Xt.value)return $t.value+Qe.value+"px";if(He.value&&nt.value==="bottom"){const t=Be();return Qe.value+(t.legendHeight||35)+"px"}return Qe.value+(He.value?20:0)+"px"}),Ce=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),ht=e.computed(()=>{const t=q.series.map(a=>a.type||Ce.value);return new Set(t).size>1}),Je=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),ut=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ot=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:""}),gt=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),dt=e.computed(()=>{const a=Z.value?.yAxis?.title?.text;return a==null||String(a).trim()===""?"":String(a)}),Gt=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=Gt.value;return t&&t.title&&t.title.text?t.title.text:""}),Vt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.min;return typeof a=="number"||a===ol?a:ol}),ue=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.max;return typeof a=="number"||a===ol?a:ol}),R=e.computed(()=>{const t=Gt.value;if(!t)return ol;const a=t.min;return typeof a=="number"||a===ol?a:ol}),Y=e.computed(()=>{const t=Gt.value;if(!t)return ol;const a=t.max;return typeof a=="number"||a===ol?a:ol}),ie=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),be=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),lt=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),He=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),nt=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Me=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),tt=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),it=e.computed(()=>{const t=Z.value;if(!t)return!1;if(Ce.value==="stepbar"){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Ut=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),ae=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Q=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),oe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),re=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Se=e.computed(()=>{if(!Xt.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ke=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Bt=e.computed(()=>{const{maxX:t}=jt.value;return t===0}),Qt=(t,a)=>Bt.value&&a===0?5:a,_t=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ul=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),M=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),V=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),T=e.computed(()=>{const t=Z.value;return M.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ce=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"]}),j=e.computed(()=>Z.value?.stepbar||{}),Oe=e.computed(()=>{const t=j.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),kt=e.computed(()=>{const t=Number(j.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),st=e.computed(()=>j.value?.showRemainder!==!1),Xe=e.computed(()=>j.value?.remainderLabel||"Remaining"),xt=e.computed(()=>j.value?.remainderColor||"#E5E7EB"),Ct=e.computed(()=>{const t=Number(j.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),Et=e.computed(()=>{const t=Number(j.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Mt=e.computed(()=>{const t=Number(j.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(j.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const bt=e.computed(()=>j.value?.axisBars||{}),St=e.computed(()=>bt.value?.show!==!1);e.computed(()=>bt.value?.showVertical===!0);const El=e.computed(()=>bt.value?.color||"#d6d6d6"),Wl=e.computed(()=>{const t=Number(bt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),Ll=e.computed(()=>{const t=Number(bt.value?.width);return Number.isFinite(t)&&t>0?t:1}),Sl=e.computed(()=>bt.value?.dashArray||"3,4"),Kt=e.computed(()=>{const t=Number(j.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),Tl=e.computed(()=>{const t=Number(j.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),Vl=e.computed(()=>{const t=Number(j.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),At=e.computed(()=>{let t=0;Je.value&&(t+=15),ut.value&&(t+=10);const a=50+t,l=Tl.value+8;return a+Vl.value+l}),Bl=e.computed(()=>Math.max(z.value.height,0)),sl=e.computed(()=>{const t=Number(j.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const a=Ct.value,l=Et.value,r=Mt.value;return Math.max(l,Math.min(r,a))}),Al=e.computed(()=>{const t=Number(j.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,sl.value);const a=Number(j.value?.barWidth);return Number.isFinite(Number(j.value?.columnWidth))&&Number(j.value?.columnWidth)>0&&Number.isFinite(a)&&a>0?Math.min(a,sl.value):Math.min(sl.value,Math.max(10,Math.round(sl.value*.32)))}),Zn=e.computed(()=>({width:`${sl.value}px`,flex:`0 0 ${sl.value}px`,"--dss-step-bar-track-thickness":`${Al.value}px`,"--dss-stepbar-label-height":`${Tl.value}px`})),Tn=e.computed(()=>{const t=Gl.value.length;return t?t*sl.value+Math.max(0,t-1)*Kt.value:0}),Sn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Gl=e.computed(()=>Ce.value!=="stepbar"?[]:jl.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(a=>!a.isRemainder).map(a=>({label:a.label,value:a.value,color:a.color,marker:a.marker}))}))),un=e.computed(()=>{if(Ce.value!=="stepbar")return[];const{minY:t,maxY:a}=jt.value,l=5,r=[];for(let p=0;p<=l;p++){const h=t+(a-t)*(p/l);r.push({top:Kn(h)-z.value.top,value:h})}return r}),Ml=e.computed(()=>({top:`${z.value.top}px`,left:`${z.value.left}px`,width:`${z.value.width}px`,height:`${Bl.value+Tl.value}px`})),gn=e.computed(()=>({width:`${Tn.value}px`,minHeight:`${Bl.value+Tl.value}px`})),Vn=e.computed(()=>Ce.value==="stepbar"&&it.value&&$e.value.show&&!de.value.isZooming),An=e.computed(()=>{const t=sl.value+Kt.value;return{left:`${$e.value.categoryIndex*t+sl.value/2}px`,height:`${Bl.value}px`,borderColor:Ut.value}}),bl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),yn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dn=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Hl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Hn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),_l=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ql=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),kn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Rl=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Jn=e.computed(()=>Z.value?.spider?.gridSteps||5),Zl=e.computed(()=>{const t=[],a=Jn.value;for(let l=1;l<=a;l++)t.push(ct.value/a*l);return t}),dl=t=>{const a=$l.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const l=Zl.value[t];return Math.round(l/ct.value*100)+"%"},$l=e.computed(()=>Z.value?.spider?.gridLabels||null),Yt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ht=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}),Ql=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),qt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Fl.value}),yt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Pl=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),vl=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Zt=t=>{const a=vl.value;if(t==null)return"";const l=String(t);return a?l+a:l},Jl=e.computed(()=>!de.value.isZooming);e.computed(()=>tl.value.map(t=>{if(t.categoryIndex!==void 0&&(Nl.value||ll.value)){const a=kl(t.categoryIndex),l=Ae.value+z.value.bottom-Pl.value/2;return{...t,x:a,y:l}}return t}));function Ul(t,a){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[h,E,S]=t.split("-"),W=Number(S?.length===2?`20${S}`:S);l=new Date(W,Number(E)-1,Number(h))}else return 0;let r=0,p=1/0;return a.forEach((h,E)=>{const[S,W,L]=h.split("-"),I=Number(L?.length===2?`20${L}`:L),D=new Date(I,Number(W)-1,Number(S)),G=Math.abs(D-l);G<p&&(p=G,r=E)}),r}const Rn=e.computed(()=>{const t=q.markers.map(l=>{const r=Ul(l.marker_date,q.categories),p=kl(r),h=Ae.value+z.value.bottom-Pl.value/2;return{...l,x:p,y:h,categoryIndex:r,source:"props"}}),a=tl.value.map(l=>{if(l.categoryIndex!==void 0&&(Nl.value||ll.value)){const r=kl(l.categoryIndex),p=Ae.value+z.value.bottom-Pl.value/2;return{...l,x:r,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...a]}),en=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),Dl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Jt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Yl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),wl=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let a,l;const r=String(Jt.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,l=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),l=a*(96/499)}return{width:a,height:l,area:t}}),Pt=e.computed(()=>{const{width:t,height:a}=wl.value,l=Yl.value;let r,p;const h=z.value.left,E=z.value.right,S=z.value.top,W=z.value.bottom,L=z.value.width,I=z.value.height;switch(l){case"center":r=h+(L-t)/2,p=S+(I-a)/2;break;case"top-left":r=h+15,p=S+5;break;case"top-right":r=E-t-15,p=S+5;break;case"bottom-left":r=h+15,p=W-a-5;break;case"bottom-right":default:r=E-t-15,p=W-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Fn=t=>!q.flags||!q.flags.length?[]:q.flags.filter(a=>a.categoryIndex===t),Dt=t=>{const a=Fn(t),l=Da(t),r=a.filter(E=>E.manual),p=a.filter(E=>!E.manual),h=[];return r.length>0&&h.push({type:N("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(E=>({text:E.text,color:"#698dbe"}))}),p.length>0&&h.push({type:N("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(E=>({text:E.text,color:"#a1d499"}))}),{flagGroups:h,markers:l.map(E=>({title:E.title,description:E.description,type:N("chart.tooltip.markers"),color:E.color||"#9784ba"}))}},Fl=e.computed(()=>{const t=q.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"),va=require("vue-i18n"),Vs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Ns=["value"],Bs=["placeholder","value","disabled"],_s=["aria-label"],Ms=["placeholder","value"],$s={key:0,class:"dss-datepicker__range-values"},Ds=["placeholder","value"],Ls={key:0,class:"dss-datepicker__comparison-range"},Ts={class:"dss-datepicker__comparison-date"},As={class:"dss-datepicker__comparison-date"},Hs=["placeholder","value"],Rs=["aria-label","aria-pressed"],Fs=["aria-selected","onClick"],Is={class:"dss-datepicker__list-item-label"},zs={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"},Ps={key:1,class:"dss-datepicker__list-empty"},Os={key:1,class:"dss-datepicker__double-wrap"},Ws={key:0,class:"dss-datepicker__side-panel"},qs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Zs=["disabled","onClick"],Us={key:1,class:"dss-datepicker__comparison-panel"},Ys={key:0,class:"dss-datepicker__comparison-modes"},Xs=["onClick"],js={class:"dss-datepicker__double-content"},Ks={class:"dss-datepicker__double-calendars"},Gs={class:"dss-datepicker__double-calendar"},Qs={class:"dss-datepicker__calendar-header"},Js=["aria-label"],er={class:"dss-datepicker__month-year-row"},tr=["aria-label"],lr={class:"dss-datepicker__weekdays"},nr={class:"dss-datepicker__grid"},ar=["disabled","onClick","onMouseenter"],or={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},sr={class:"dss-datepicker__double-calendar"},rr={class:"dss-datepicker__calendar-header"},ir=["aria-label"],cr={class:"dss-datepicker__month-year-row"},ur=["aria-label"],dr={class:"dss-datepicker__weekdays"},mr={class:"dss-datepicker__grid"},pr=["disabled","onClick","onMouseenter"],vr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},fr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--bottom"},hr={key:0,class:"dss-datepicker__comparison-modes dss-datepicker__comparison-modes--inline"},gr=["onClick"],yr={key:0,class:"dss-datepicker__side-panel"},kr={class:"dss-datepicker__quick-select","aria-label":"Quick date"},Cr=["disabled","onClick"],br={class:"dss-datepicker__single-calendar"},wr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--single"},xr={key:0,class:"dss-datepicker__comparison-modes"},Er=["onClick"],Sr={class:"dss-datepicker__calendar-header"},Vr=["aria-label"],Nr={class:"dss-datepicker__month-year-row"},Br=["aria-label"],_r={class:"dss-datepicker__weekdays"},Mr={class:"dss-datepicker__grid"},$r=["disabled","onClick","onMouseenter"],Dr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Lr={class:"dss-datepicker__calendar-header"},Tr={class:"dss-datepicker__month-year-row"},Ar={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Hr={class:"dss-datepicker__months-grid"},Rr=["onClick"],Fr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ir={class:"dss-datepicker__month-year"},zr={class:"dss-datepicker__years-grid"},Pr=["data-year","onClick"],Ho=27,Qn=8,yo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:B=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(B)},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},quickSelectOptions:{type:Array,default:null},comparisonEnabled:{type:Boolean,default:!1},comparisonValue:{type:Object,default:()=>({start:null,end:null})},comparisonControlsPlacement:{type:String,default:"side",validator:B=>["side","bottom"].includes(B)},comparisonModeOptions:{type:Array,default:null},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","update:comparisonValue"],setup(B,{emit:ee}){const N=B,$=ee,{t:se,locale:O}=va.useI18n(),A=e.ref(!1),pe=e.ref("days"),rt=new Date,te=e.computed(()=>N.minDate instanceof Date?N.minDate:rt),g=e.ref(te.value.getMonth()),xe=e.ref(te.value.getFullYear()),Ce=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),he=e.ref(te.value.getFullYear()),Ae=e.ref("start"),ge=e.ref("start"),Te=e.ref(null),q=e.ref(null),Re=e.ref(!1),Ze=e.ref("previousPeriod"),Be=e.ref("primary"),Ue=e.ref({start:null,end:null});function Z(){const k=te.value,w=k.getMonth(),x=k.getFullYear(),d=w===11?0:w+1,v=w===11?x+1:x;return{left:{month:w,year:x},right:{month:d,year:v}}}const De=e.ref(null),Ye=e.ref(null),ke=e.ref(null),et=e.ref(null),at=e.ref(null),ze=e.ref(null),Tt=e.ref(null),Zt=e.ref(null),Qe=new Date().getFullYear(),At=e.computed(()=>["single","singleFromAvailable"].includes(N.mode)),ye=e.computed(()=>["range","rangeFromAvailable"].includes(N.mode)),ft=e.computed(()=>N.mode==="listFromAvailable"),Je=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(N.mode))return null;const k=N.modelValue;return k instanceof Date?k:null}),ct=e.computed(()=>{if(!ye.value)return{start:null,end:null};const k=N.modelValue;return!k||typeof k!="object"?{start:null,end:null}:{start:k.start instanceof Date?k.start:null,end:k.end instanceof Date?k.end:null}}),ot=e.computed(()=>nt(N.comparisonValue)),ht=e.computed(()=>N.comparisonEnabled&&ye.value),ut=e.computed(()=>ht.value&&N.comparisonControlsPlacement==="side"),Gt=e.computed(()=>ht.value&&N.comparisonControlsPlacement==="bottom"),xt=e.computed(()=>ht.value&&Re.value&&Ze.value==="custom"&&Be.value==="comparison"),Nt={previousPeriod:"datepicker.comparison.previousPeriod",previousYear:"datepicker.comparison.previousYear",custom:"datepicker.comparison.custom"},ue=[{id:"previousPeriod",labelKey:"datepicker.comparison.previousPeriod"},{id:"previousYear",labelKey:"datepicker.comparison.previousYear"},{id:"custom",labelKey:"datepicker.comparison.custom"}],R=e.computed(()=>{const w=(Array.isArray(N.comparisonModeOptions)&&N.comparisonModeOptions.length?N.comparisonModeOptions:ue).map(x=>typeof x=="string"?{id:x,labelKey:Nt[x]}:!x||typeof x!="object"||!x.id?null:{...x,labelKey:x.labelKey||Nt[x.id]}).filter(x=>x&&Nt[x.id]);return w.length?w:ue});function Y(k){return k.label?k.label:k.labelKey?se(k.labelKey):k.id}function ie(k){return R.value.some(w=>w.id===k)}function be(){if(ie(Ze.value))return;const k=R.value[0]?.id||"previousPeriod";Ze.value=k,Be.value=k==="custom"?"comparison":"primary",Re.value&&k!=="custom"&&Yl()}function lt(k){if(!k||!(k instanceof Date))return"";const w=k.getDate(),x=k.getMonth()+1,d=k.getFullYear(),v=b=>String(b).padStart(2,"0");return`${v(w)}/${v(x)}/${d}`}function He(k){return k instanceof Date&&!Number.isNaN(k.getTime())?new Date(k.getFullYear(),k.getMonth(),k.getDate()):null}function nt(k){return!k||typeof k!="object"?{start:null,end:null}:{start:He(k.start),end:He(k.end)}}function Me(k){const w=nt(k),{start:x,end:d}=w;return x&&d&&x>d?{start:d,end:x}:w}function tt(k){const{start:w,end:x}=Me(k);return!w&&!x?"":!w||!x?lt(w||x):w&&x&&Nl(w,x)?lt(w):`${lt(w||x)} - ${lt(x||w)}`}const it=e.computed(()=>lt(Je.value)),Ut=e.computed(()=>tt(ct.value)),ae=e.computed(()=>{const{start:k,end:w}=Me(ot.value);return!k||!w?null:{start:lt(k),end:lt(w)}}),Q=e.computed(()=>{if(N.mode!=="readonly")return"—";const k=N.modelValue;if(k instanceof Date)return lt(k)||"—";if(k&&typeof k=="object"&&("start"in k||"end"in k)){const w=k.start instanceof Date?k.start:null,x=k.end instanceof Date?k.end:null;if(!w&&!x)return"—";const d=!x||w&&w<=x?w:x,v=!w||x&&x>=w?x:w;return Nl(d,v)?lt(d):`${lt(d)} - ${lt(v)}`}return"—"});e.computed(()=>{const k=new Date(xe.value,g.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)});const oe=e.computed(()=>q.value==="left"?Ce.value:q.value==="right"?X.value:g.value),re=e.computed(()=>q.value==="left"?J.value:q.value==="right"?he.value:xe.value),Se=e.computed(()=>{const k=new Date(xe.value,g.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Ke=e.computed(()=>{const k=new Date(re.value,oe.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),_t=e.computed(()=>{const k=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(w,x)=>k.format(new Date(2024,x,1)))}),Qt=e.computed(()=>{const w=(q.value?re.value:xe.value)-Math.floor(Ho/2);return Array.from({length:Ho},(x,d)=>w+d)}),Mt=e.computed(()=>{const k=Qt.value;return k.length?`${k[0]} – ${k[k.length-1]}`:""});function ul(k){return k===7?0:k}function M(k){try{const w=new Intl.Locale(k);if(w.weekInfo?.firstDay!=null)return ul(w.weekInfo.firstDay)}catch{}return 1}function V(k){const w=new Date(2024,0,1),x=(w.getDay()-k+7)%7,d=new Date(w);return d.setDate(w.getDate()-x),d}const T=e.computed(()=>M(O.value)),ce=e.computed(()=>{const k=new Intl.DateTimeFormat(O.value,{weekday:"short"}),w=V(T.value),x=[];for(let d=0;d<7;d++){const v=new Date(w);v.setDate(w.getDate()+d),x.push(k.format(v).slice(0,2))}return x});function j(k,w,x){const d=new Date(k,w,1),v=new Date(k,w+1,0),b=(d.getDay()-x+7)%7,H=v.getDate(),U=[];for(let ne=0;ne<b;ne++)U.push(null);for(let ne=1;ne<=H;ne++)U.push(new Date(k,w,ne));return U}const Oe=e.computed(()=>j(xe.value,g.value,T.value)),kt=e.computed(()=>j(J.value,Ce.value,T.value)),st=e.computed(()=>j(he.value,X.value,T.value));e.computed(()=>{const k=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)}),e.computed(()=>{const k=new Date(he.value,X.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(k)});const Xe=e.computed(()=>{const k=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Et=e.computed(()=>{const k=new Date(he.value,X.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(k)}),Ct=e.computed(()=>N.availableDates&&N.availableDates.length>0),St={all:"datepicker.quickSelect.allDates",last2:"datepicker.quickSelect.last2Dates",last3:"datepicker.quickSelect.last3Dates",last4:"datepicker.quickSelect.last4Dates",last5:"datepicker.quickSelect.last5Dates",today:"datepicker.quickSelect.today",lastWeek:"datepicker.quickSelect.lastWeek",last15Days:"datepicker.quickSelect.last15Days",last30Days:"datepicker.quickSelect.last30Days",thisMonth:"datepicker.quickSelect.thisMonth",lastMonth:"datepicker.quickSelect.lastMonth",last3Months:"datepicker.quickSelect.last3Months",last6Months:"datepicker.quickSelect.last6Months",last12Months:"datepicker.quickSelect.last12Months",lastYear:"datepicker.quickSelect.lastYear",in7Days:"datepicker.quickSelect.in7Days",in14Days:"datepicker.quickSelect.in14Days",in30Days:"datepicker.quickSelect.in30Days"},$t=e.computed(()=>At.value&&!Ct.value?[{id:"in7Days",labelKey:"datepicker.quickSelect.in7Days"},{id:"in14Days",labelKey:"datepicker.quickSelect.in14Days"},{id:"in30Days",labelKey:"datepicker.quickSelect.in30Days"}]:Ct.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:"lastMonth",labelKey:"datepicker.quickSelect.lastMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),bt=e.computed(()=>(Array.isArray(N.quickSelectOptions)&&N.quickSelectOptions.length?N.quickSelectOptions:$t.value).map(w=>typeof w=="string"?{id:w,labelKey:St[w]}:!w||typeof w!="object"||!w.id?null:{...w,labelKey:w.labelKey||St[w.id]}).filter(w=>w&&w.id));function Vt(k){return k.label?k.label:k.labelKey?se(k.labelKey):k.id}const Sl=e.ref({top:0,left:0}),Wl=e.ref("left");let Tl=null;function Vl(){A.value&&e.nextTick(()=>{A.value&&(Tl!==null&&window.cancelAnimationFrame(Tl),Tl=window.requestAnimationFrame(()=>{Tl=null,Kt()}))})}function Kt(){if(!at.value||!A.value)return;const k=at.value.getBoundingClientRect(),w=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight;let d=k.left,v=k.bottom+4;const b=ze.value;if(b){const H=b.offsetWidth,U=b.offsetHeight;Wl.value==="right"||d+H>w-Qn?(Wl.value="right",d=k.right-H):Wl.value="left";const K=Math.max(Qn,w-H-Qn);if(d=Math.min(Math.max(d,Qn),K),v+U>x-Qn){const pt=k.top-4-U;pt>=Qn?v=pt:v=Math.max(Qn,x-U-Qn)}}Sl.value={top:v,left:d}}const Al=e.computed(()=>!at.value||!A.value?{}:{position:"fixed",left:`${Sl.value.left}px`,top:`${Sl.value.top}px`,zIndex:1002});function Nl(k,w){return!k||!w?!1:k.getFullYear()===w.getFullYear()&&k.getMonth()===w.getMonth()&&k.getDate()===w.getDate()}function Ht(k){return new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime()}function _l(k){return!N.availableDates||!N.availableDates.length?!0:N.availableDates.some(w=>w instanceof Date&&Nl(w,k))}function sl(k){const w=Ht(k);return!(N.minDate instanceof Date&&w<Ht(N.minDate)||N.maxDate instanceof Date&&w>Ht(N.maxDate))}function Hl(k){const w=new Date(k);return new Date(w.getFullYear(),w.getMonth(),w.getDate())}function Zn(k){return Math.floor(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())/864e5)}function Tn(k,w){return new Date(k.getFullYear(),k.getMonth(),k.getDate()+w)}function Sn(k){return k.filter(w=>sl(w))}function Gl(k,w){if(!(k instanceof Date)||!(w instanceof Date))return null;let x=Ht(k),d=Ht(w);if(x>d&&([x,d]=[d,x]),N.minDate instanceof Date){const v=Ht(N.minDate);x=Math.max(x,v),d=Math.max(d,v)}if(N.maxDate instanceof Date){const v=Ht(N.maxDate);x=Math.min(x,v),d=Math.min(d,v)}return x>d?null:{start:Hl(x),end:Hl(d)}}function un(k){return!N.exceptDates||!N.exceptDates.length?!1:N.exceptDates.some(w=>w instanceof Date&&Nl(w,k))}function $l(k){return un(k)?!1:["singleFromAvailable","rangeFromAvailable"].includes(N.mode)?_l(k)&&sl(k):sl(k)}function gn(k){const w=Je.value,x=ct.value,d=ot.value,v=Ht(k),b=ye.value&&x.start&&x.end&&v>Math.min(Ht(x.start),Ht(x.end))&&v<Math.max(Ht(x.start),Ht(x.end)),H=ye.value&&x.start&&Nl(k,x.start),U=ye.value&&x.end&&Nl(k,x.end),ne=H&&U,K=ht.value&&Re.value,pt=K&&d.start&&Nl(k,d.start),je=K&&d.end&&Nl(k,d.end),Ot=pt&&je,$e=K&&d.start&&d.end&&v>Math.min(Ht(d.start),Ht(d.end))&&v<Math.max(Ht(d.start),Ht(d.end)),dt=At.value&&w&&Nl(k,w)||H||U;let de=!1,tl=!1;const Pe=xt.value?d:x;if(ye.value&&Pe.start&&!Pe.end&&Te.value){const la=Ht(Pe.start),na=Ht(Te.value),pn=Math.min(la,na),vn=Math.max(la,na);xt.value?tl=v>pn&&v<vn:de=v>pn&&v<vn}return{"dss-datepicker__day--comparison-start":pt&&!Ot&&!dt,"dss-datepicker__day--comparison-end":je&&!Ot&&!dt,"dss-datepicker__day--comparison-single":Ot&&!dt,"dss-datepicker__day--in-comparison-range":$e&&!pt&&!je&&!H&&!U,"dss-datepicker__day--in-comparison-preview":tl&&!pt&&!je&&!$e&&!H&&!U,"dss-datepicker__day--selected":dt&&!ne,"dss-datepicker__day--range-start":H&&!ne,"dss-datepicker__day--range-end":U&&!ne,"dss-datepicker__day--range-single":ne,"dss-datepicker__day--in-range":b&&!H&&!U,"dss-datepicker__day--in-range-preview":de&&!H&&!U&&!b,"dss-datepicker__day--disabled":!$l(k)}}function Vn(k){if(!ye.value)return;const w=xt.value?ot.value:ct.value;if(!w.start||w.end){Te.value=null;return}if(!$l(k)){Te.value=null;return}Te.value=new Date(k.getFullYear(),k.getMonth(),k.getDate())}function An(){Te.value=null}function bl(k=ct.value){if(!N.doubleCalendar||!ye.value)return;const w=nt(k),{start:x,end:d}=w;if(x&&d){const H=x<=d?x:d,U=x<=d?d:x,ne=H.getMonth(),K=H.getFullYear(),pt=U.getMonth(),je=U.getFullYear();if(ne!==pt||K!==je){const Ot=Ce.value===ne&&J.value===K,$e=X.value===pt&&he.value===je;if(Ot&&$e)return;Ce.value=ne,J.value=K,X.value=pt,he.value=je}else{const Ot=ne===0?11:ne-1,$e=ne===0?K-1:K;Ce.value===Ot&&J.value===$e&&X.value===ne&&he.value===K||(Ce.value=ne,J.value=K,ne===11?(X.value=0,he.value=K+1):(X.value=ne+1,he.value=K))}return}const v=x||d;if(v){const H=v.getMonth(),U=v.getFullYear(),ne=Ce.value===H&&J.value===U,K=X.value===H&&he.value===U;if(ne||K)return;Ce.value=H,J.value=U,H===11?(X.value=0,he.value=U+1):(X.value=H+1,he.value=U);return}const b=Z();Ce.value=b.left.month,J.value=b.left.year,X.value=b.right.month,he.value=b.right.year}const yn=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),dn=e.computed(()=>{if(!ft.value)return[];const k=(N.availableDates||[]).filter(x=>x instanceof Date&&!Number.isNaN(x.getTime())).filter(x=>!un(x)&&sl(x)).map(x=>new Date(x.getFullYear(),x.getMonth(),x.getDate()));k.sort((x,d)=>d.getTime()-x.getTime());const w=Je.value;return k.map(x=>({date:x,ts:x.getTime(),label:yn.value.format(x),selected:!!(w&&Nl(x,w))}))});function Rl(){if(A.value){ql();return}at.value=et.value?.closest(".dss-datepicker__input-wrap"),Wl.value="left",A.value=!0,Vl(),e.nextTick(()=>{Zt.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Hn(k){if(!(k instanceof Date))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());$("update:modelValue",w),ql()}function Ml(k="start"){if(N.mode==="readonly")return;Ae.value=k;const w=Je.value,x=ct.value;if(At.value&&w)g.value=w.getMonth(),xe.value=w.getFullYear();else if(ye.value)if(N.doubleCalendar)bl();else{const d=k==="start"&&x.start?x.start:x.end||x.start;d&&(g.value=d.getMonth(),xe.value=d.getFullYear())}at.value=At.value?De.value?.closest(".dss-datepicker__input-wrap"):Ye.value,pe.value="days",q.value=null,Wl.value="left",A.value=!0,Vl()}function ql(){pe.value="days",q.value=null,Te.value=null,A.value=!1}function kn(k,w){q.value=k,pe.value=w}function Fl(){pe.value="days",q.value=null}function Jn(k,w,x,d){switch(k){case"today":return new Date(w,x,d);case"in7Days":return new Date(w,x,d+7);case"in14Days":return new Date(w,x,d+14);case"in30Days":return new Date(w,x,d+30);default:return null}}function Zl(k,w,x,d){const v=new Date(w,x,d);let b,H;switch(k){case"today":b=v,H=v;break;case"lastWeek":b=new Date(w,x,d-6),H=v;break;case"last15Days":b=new Date(w,x,d-14),H=v;break;case"last30Days":b=new Date(w,x,d-29),H=v;break;case"thisMonth":b=new Date(w,x,1),H=v;break;case"lastMonth":b=new Date(w,x-1,1),H=new Date(w,x,0);break;case"last3Months":b=new Date(w,x-3,1),H=new Date(w,x,0);break;case"last6Months":b=new Date(w,x-6,1),H=new Date(w,x,0);break;case"last12Months":b=new Date(w,x-12,1),H=new Date(w,x,0);break;case"lastYear":b=new Date(w-1,0,1),H=new Date(w-1,11,31);break;default:return null}return{start:b,end:H}}function dl(k){const w=new Date,x=w.getFullYear(),d=w.getMonth(),v=w.getDate();let b,H;if(Ct.value){const U=Sn([...N.availableDates].filter(ne=>ne instanceof Date).map(ne=>new Date(ne.getFullYear(),ne.getMonth(),ne.getDate()))).sort((ne,K)=>ne.getTime()-K.getTime());if(U.length===0)return null;if(k==="all")b=U[0],H=U[U.length-1];else{const ne=parseInt(k.replace("last",""),10);if(Number.isInteger(ne)&&ne>=2&&ne<=5){const K=U.slice(-ne);if(K.length===0)return null;b=K[0],H=K[K.length-1]}else{const K=Zl(k,x,d,v);if(!K)return null;const pt=en(K);if(!pt.length)return null;b=pt[0],H=pt[pt.length-1]}}}else{const U=Zl(k,x,d,v);if(!U)return null;b=U.start,H=U.end}return{start:b,end:H}}function Dl(k){const w=new Date,x=Jn(k,w.getFullYear(),w.getMonth(),w.getDate()),d=He(x);return!d||!$l(d)?null:d}function Yt(k){const w=dl(k);return w?Gl(w.start,w.end):null}function Rt(k){return At.value?Dl(k)!==null:Yt(k)!==null}function Ql(k){const w=Dl(k);w&&($("update:modelValue",w),ql())}function Wt(k){if(At.value){Ql(k);return}Pl(k)}function gt(){$("update:modelValue",null)}function Pl(k){const w=Yt(k);w&&($("update:modelValue",w),bl())}function vl(k){return!!(k&&k.start instanceof Date&&k.end instanceof Date)}function qt(k){$("update:comparisonValue",nt(k))}function Jl(k=ot.value){const w=nt(k);vl(w)&&(Ue.value=w)}function Ul(){return vl(Ue.value)?(qt(Ue.value),N.doubleCalendar&&bl(Ue.value),!0):!1}function Rn(k){const w=Me(k);return vl(w)?$l(w.start)&&$l(w.end):!1}function en(k){const w=Me(k);if(!vl(w))return[];const x=Ht(w.start),d=Ht(w.end);return(N.availableDates||[]).filter(v=>v instanceof Date&&!Number.isNaN(v.getTime())).map(v=>He(v)).filter(v=>{const b=Ht(v);return b>=x&&b<=d&&$l(v)}).sort((v,b)=>Ht(v)-Ht(b))}function Ll(k){if(!(k instanceof Date))return null;const w=new Date(k.getFullYear()-1,k.getMonth(),k.getDate());return w.getMonth()!==k.getMonth()?new Date(k.getFullYear()-1,k.getMonth()+1,0):w}function Jt(k=Ze.value){const w=Me(ct.value);if(!vl(w))return{start:null,end:null};let x,d;if(k==="previousPeriod"){const b=Zn(w.end)-Zn(w.start)+1;d=Tn(w.start,-1),x=Tn(d,-(b-1))}else if(k==="previousYear")x=Ll(w.start),d=Ll(w.end);else return ot.value;let v=Me({start:x,end:d});if(N.mode==="rangeFromAvailable"&&N.availableDates?.length){const b=en(v);if(!b.length)return{start:null,end:null};v={start:b[0],end:b[b.length-1]}}return Rn(v)?v:{start:null,end:null}}function Yl(){!ht.value||!Re.value||Ze.value==="custom"||qt(Jt())}function wl(){if(ht.value){if(Re.value=!Re.value,!Re.value){Ze.value==="custom"&&Jl(),Be.value="primary",qt({start:null,end:null});return}if(Ze.value==="custom"){Be.value="comparison",Ul();return}Be.value="primary",Yl()}}function Pt(k){if(ie(k)){if(Ze.value=k,Te.value=null,k==="custom"){if(Be.value="comparison",Ul())return;N.doubleCalendar&&vl(ot.value)&&bl(ot.value);return}Be.value="primary",Yl()}}function Fn(k,w,x){const d=nt(k);return!d.start&&!d.end?(x.value="end",{start:w,end:null}):d.start&&d.end?(x.value="end",{start:w,end:null}):x.value==="start"?(x.value="end",Me({start:w,end:d.end})):(x.value="start",Me({start:d.start,end:w}))}function Dt(k){q.value==="left"?Ce.value=k:q.value==="right"?X.value=k:g.value=k,Fl()}function Il(k){q.value==="left"?J.value=k:q.value==="right"?he.value=k:xe.value=k,Fl()}function Nn(){g.value===0?(g.value=11,xe.value--):g.value--}function Cn(){g.value===11?(g.value=0,xe.value++):g.value++}function tn(){Ce.value===0?(Ce.value=11,J.value--):Ce.value--}function fl(){Ce.value===11?(Ce.value=0,J.value++):Ce.value++}function In(){X.value===0?(X.value=11,he.value--):X.value--}function ln(){X.value===11?(X.value=0,he.value++):X.value++}function mn(k){if(!$l(k))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());if(At.value){$("update:modelValue",w),ql();return}if(xt.value){const d=Fn(ot.value,w,ge);vl(d)&&Jl(d),qt(d);return}Be.value="primary";const x=Fn(ct.value,w,Ae);$("update:modelValue",x)}e.watch(ct,()=>{N.doubleCalendar&&ye.value&&A.value&&bl(),Yl()},{deep:!0}),e.watch(()=>N.comparisonEnabled,k=>{if(be(),!k){Re.value=!1,Be.value="primary";return}vl(ot.value)?Re.value=!0:Re.value&&Ze.value!=="custom"&&Yl()}),e.watch(R,()=>{be()},{deep:!0}),e.watch(ot,k=>{ht.value&&vl(k)&&(Re.value=!0,Ze.value==="custom"&&Jl(k))},{deep:!0,immediate:!0});let zl=null,nn=null,rl=null;function Ol(){zl&&(document.removeEventListener("keydown",zl),zl=null),nn&&(window.removeEventListener("resize",nn),nn=null),rl&&(window.removeEventListener("scroll",rl,!0),rl=null)}return e.watch(pe,k=>{k==="years"&&e.nextTick(()=>{Tt.value?.querySelector(`[data-year="${re.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[A.value,pe.value,g.value,xe.value,Ce.value,J.value,X.value,he.value,q.value,N.doubleCalendar,N.quickSelect,N.quickSelectOptions,N.comparisonControlsPlacement],()=>{Vl()}),e.watch(A,k=>{Ol(),k&&(zl=w=>{w.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Fl():ql())},nn=()=>{Kt()},rl=()=>{Kt()},document.addEventListener("keydown",zl),window.addEventListener("resize",nn),window.addEventListener("scroll",rl,!0))}),e.onBeforeUnmount(()=>{Tl!==null&&(window.cancelAnimationFrame(Tl),Tl=null),Ol()}),(k,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":B.mode==="readonly"}])},[B.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Vs,[w[10]||(w[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Q.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Ns)])):At.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--open":A.value}]),onClick:w[0]||(w[0]=x=>Ml("start"))},[w[12]||(w[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:De,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectDate"),value:it.value,readonly:"",disabled:B.mode==="readonly"},null,8,Bs),B.clearable&&Je.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-datepicker__clear","aria-label":e.unref(se)("datepicker.clear"),onClick:e.withModifiers(gt,["stop"])},[...w[11]||(w[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})],-1)])],8,_s)):e.createCommentVNode("",!0)],2)):ft.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":A.value}]),onClick:Rl},[w[14]||(w[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:"inputListRef",ref:et,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectFromList"),value:it.value,readonly:""},null,8,Ms),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":A.value}]),"aria-hidden":"true"},[...w[13]||(w[13]=[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)):ye.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"inputRangeWrapRef",ref:Ye,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--with-comparison":ht.value,"dss-datepicker__input-wrap--comparison-active":ht.value&&Re.value,"dss-datepicker__input-wrap--open":A.value}]),onClick:w[1]||(w[1]=x=>Ml("start"))},[w[17]||(w[17]=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)),ht.value?(e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectRange"),value:Ut.value,readonly:""},null,8,Ds),Re.value&&ae.value?(e.openBlock(),e.createElementBlock("div",Ls,[e.createElementVNode("span",Ts,e.toDisplayString(ae.value.start),1),w[15]||(w[15]=e.createElementVNode("span",{class:"dss-datepicker__comparison-sep"},"/",-1)),e.createElementVNode("span",As,e.toDisplayString(ae.value.end),1)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(se)("datepicker.selectRange"),value:Ut.value,readonly:""},null,8,Hs)),ht.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle dss-datepicker__comparison-toggle--icon",{"dss-datepicker__comparison-toggle--active":Re.value}]),"aria-label":Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo"),"aria-pressed":Re.value,onClick:e.withModifiers(wl,["stop"])},[...w[16]||(w[16]=[e.createElementVNode("svg",{class:"dss-datepicker__comparison-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M9.06387 6.587C9.16352 6.54566 9.27319 6.5348 9.37901 6.5558C9.48484 6.57679 9.58205 6.6287 9.65837 6.70495L11.84 8.88661C11.8907 8.93727 11.931 8.99742 11.9584 9.06363C11.9859 9.12984 12 9.20082 12 9.27249C12 9.34417 11.9859 9.41514 11.9584 9.48135C11.931 9.54757 11.8907 9.60772 11.84 9.65837L9.65837 11.84C9.58209 11.9164 9.48487 11.9684 9.37902 11.9895C9.27316 12.0106 9.16343 11.9998 9.06371 11.9585C8.964 11.9171 8.87879 11.8472 8.81886 11.7574C8.75894 11.6676 8.72699 11.5621 8.72708 11.4542L8.72708 9.81791L0.545845 9.81791C0.401191 9.81791 0.262463 9.76045 0.160178 9.65816C0.0578924 9.55587 0.00042901 9.41715 0.000429004 9.27249C0.000428997 9.12784 0.0578924 8.98911 0.160178 8.88683C0.262463 8.78454 0.401191 8.72708 0.545845 8.72708L8.72708 8.72708L8.72708 7.09083C8.7271 6.98296 8.75911 6.87752 8.81906 6.78783C8.87901 6.69815 8.9642 6.62826 9.06387 6.587ZM2.34162 0.159964L0.159963 2.34163C0.109252 2.39228 0.0690227 2.45243 0.0415751 2.51865C0.0141274 2.58486 -4.08447e-07 2.65583 -4.05314e-07 2.72751C-4.0218e-07 2.79918 0.0141274 2.87016 0.0415751 2.93637C0.0690227 3.00258 0.109252 3.06273 0.159963 3.11339L2.34162 5.29505C2.4179 5.37142 2.51513 5.42343 2.62098 5.44451C2.72684 5.46559 2.83657 5.45479 2.93629 5.41347C3.036 5.37216 3.12121 5.30218 3.18114 5.21241C3.24106 5.12264 3.27301 5.0171 3.27292 4.90917L3.27292 3.27292L11.4542 3.27292C11.5988 3.27292 11.7375 3.21546 11.8398 3.11317C11.9421 3.01089 11.9996 2.87216 11.9996 2.72751C11.9996 2.58285 11.9421 2.44412 11.8398 2.34184C11.7375 2.23955 11.5988 2.18209 11.4542 2.18209L3.27292 2.18209L3.27292 0.545846C3.27301 0.43791 3.24106 0.332376 3.18114 0.242604C3.12121 0.152832 3.036 0.0828592 2.93629 0.0415426C2.83657 0.000226074 2.72684 -0.0105762 2.62098 0.0105043C2.51513 0.0315849 2.4179 0.0835995 2.34162 0.159964Z"})],-1)])],10,Rs)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ql,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ze,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":B.doubleCalendar&&ye.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":pe.value==="days"&&(B.doubleCalendar&&ye.value&&(B.quickSelect||ut.value)||At.value&&B.quickSelect),"dss-datepicker__dropdown--list":ft.value}]),onClick:w[9]||(w[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Al.value)},[ft.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[dn.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:Zt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.ts,role:"option","aria-selected":x.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":x.selected}]),onClick:d=>Hn(x.date)},[e.createElementVNode("span",Is,e.toDisplayString(x.label),1),x.selected?(e.openBlock(),e.createElementBlock("svg",zs,[...w[18]||(w[18]=[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,Fs))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ps,e.toDisplayString(e.unref(se)("datepicker.noAvailableDates")),1))],64)):pe.value==="days"&&B.doubleCalendar&&ye.value?(e.openBlock(),e.createElementBlock("div",Os,[B.quickSelect||ut.value?(e.openBlock(),e.createElementBlock("div",Ws,[B.quickSelect?(e.openBlock(),e.createElementBlock("nav",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Rt(x.id),onClick:d=>Wt(x.id)},e.toDisplayString(Vt(x)),9,Zs))),128))])):e.createCommentVNode("",!0),ut.value?(e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ze.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,Xs))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",js,[e.createElementVNode("div",Ks,[e.createElementVNode("div",Gs,[e.createElementVNode("div",Qs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:tn}," ‹ ",8,Js),e.createElementVNode("div",er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[2]||(w[2]=x=>kn("left","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[3]||(w[3]=x=>kn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:fl}," › ",8,tr)]),e.createElementVNode("div",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!$l(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,ar)):(e.openBlock(),e.createElementBlock("span",or))],64))),128))])]),e.createElementVNode("div",sr,[e.createElementVNode("div",rr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:In}," ‹ ",8,ir),e.createElementVNode("div",cr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[4]||(w[4]=x=>kn("right","months"))},e.toDisplayString(Et.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[5]||(w[5]=x=>kn("right","years"))},e.toDisplayString(he.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:ln}," › ",8,ur)]),e.createElementVNode("div",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!$l(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,pr)):(e.openBlock(),e.createElementBlock("span",vr))],64))),128))])])]),Gt.value?(e.openBlock(),e.createElementBlock("div",fr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ze.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,gr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):pe.value==="days"?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"dss-datepicker__double-wrap":B.quickSelect&&At.value})},[B.quickSelect&&At.value?(e.openBlock(),e.createElementBlock("div",yr,[e.createElementVNode("nav",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Rt(x.id),onClick:d=>Wt(x.id)},e.toDisplayString(Vt(x)),9,Cr))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",br,[ht.value?(e.openBlock(),e.createElementBlock("div",wr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Re.value}]),onClick:wl},e.toDisplayString(Re.value?e.unref(se)("datepicker.comparison.active"):e.unref(se)("datepicker.comparison.compareTo")),3),Re.value?(e.openBlock(),e.createElementBlock("div",xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ze.value===x.id}]),onClick:d=>Pt(x.id)},e.toDisplayString(Y(x)),11,Er))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Sr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Nn}," ‹ ",8,Vr),e.createElementVNode("div",Nr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[6]||(w[6]=x=>pe.value="months")},e.toDisplayString(Se.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[7]||(w[7]=x=>pe.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Cn}," › ",8,Br)]),e.createElementVNode("div",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(x,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gn(x)]),disabled:!$l(x),onClick:v=>mn(x),onMouseenter:v=>Vn(x),onMouseleave:An},e.toDisplayString(x.getDate()),43,$r)):(e.openBlock(),e.createElementBlock("span",Dr))],64))),128))])])],2)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Lr,[e.createElementVNode("div",Tr,[e.createElementVNode("span",Ar,e.toDisplayString(Ke.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[8]||(w[8]=x=>pe.value="years")},e.toDisplayString(re.value),1)])]),e.createElementVNode("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,(x,d)=>(e.openBlock(),e.createElementBlock("button",{key:d,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":d===oe.value}]),onClick:v=>Dt(d)},e.toDisplayString(x),11,Rr))),128))])],64)):pe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Fr,[e.createElementVNode("span",Ir,e.toDisplayString(Mt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Tt},[e.createElementVNode("div",zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":x===re.value,"dss-datepicker__year-cell--current":x===e.unref(Qe)}]),"data-year":x,onClick:d=>Il(x)},e.toDisplayString(x),11,Pr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Or={class:"dss-step-bar__layout"},Wr={class:"dss-step-bar__header"},qr={class:"dss-step-bar__label"},Zr={key:0,class:"dss-step-bar__counter"},Ur={class:"dss-step-bar__track-wrapper"},Yr=["aria-valuemax","aria-valuenow","aria-label"],Xr=["onMouseenter"],Fo={__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:B=>["input","desc","asc"].includes(B)},orientation:{type:String,default:"horizontal",validator:B=>["horizontal","vertical"].includes(B)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:B=>["up","down","left","right"].includes(B)},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:()=>({})},disableTooltips:{type:Boolean,default:!1}},setup(B){const ee=B,N={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"}}},$=R=>R&&typeof R=="object"&&!Array.isArray(R),se=(R,Y)=>{const ie=Object.assign({},R);return!$(R)||!$(Y)||Object.keys(Y).forEach(be=>{if($(Y[be])){be in R?ie[be]=se(R[be],Y[be]):Object.assign(ie,{[be]:Y[be]});return}Object.assign(ie,{[be]:Y[be]})}),ie},O=e.computed(()=>se(N,ee.options)),A=e.computed(()=>Math.max(1,Number(ee.steps)||1)),pe=e.computed(()=>Math.min(A.value,Math.max(0,Number(ee.currentStep)||0))),rt=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),te=e.computed(()=>{if(!rt.value)return[];const R=ee.segments.map((Y,ie)=>{const be=Number(Y?.value);return{label:Y?.label||`Step ${ie+1}`,value:Number.isFinite(be)&&be>0?be:0,color:Y?.color||ee.activeColor,marker:Y?.marker}});return ee.segmentOrder==="desc"?[...R].sort((Y,ie)=>ie.value-Y.value):ee.segmentOrder==="asc"?[...R].sort((Y,ie)=>Y.value-ie.value):R}),g=e.computed(()=>rt.value?te.value.reduce((R,Y)=>R+Y.value,0):pe.value),xe=e.computed(()=>rt.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,g.value):A.value),Ce=e.computed(()=>rt.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),J=e.computed(()=>Ce.value?Math.max(0,Number(ee.totalValue)-g.value):0),X=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),he=e.computed(()=>J.value>0),Ae=e.computed(()=>te.value.reduce((R,Y)=>Math.max(R,Number(Y.value)||0),0)),ge=e.computed(()=>te.value.filter(R=>R.value>0).map(R=>`${R.label}: ${ft(R.value)}`).join(" | ")),Te=e.computed(()=>rt.value?Ce.value?te.value.filter(R=>R.value>0):te.value:[]),q=e.computed(()=>{if(!ee.counterAsPercentage)return`${g.value} / ${xe.value}`;const R=Number(xe.value);if(!Number.isFinite(R)||R<=0)return"0%";const Y=Math.round(Number(g.value)/R*100);return`${Math.min(Math.max(Y,0),100)}%`}),Re=e.computed(()=>g.value),Ze=e.computed(()=>xe.value),Be=e.reactive({visible:!1,x:0,y:0,content:""}),Ue=e.computed(()=>ee.orientation==="vertical"),Z=e.computed(()=>{const R=ee.barHeight;return R==null||R===""?"200px":typeof R=="number"?`${R}px`:String(R)}),De=e.computed(()=>{const R=ee.sideLabelMaxWidth;if(!(R==null||R===""))return typeof R=="number"?`${R}px`:String(R)}),Ye=e.computed(()=>{const R=ee.sideLabelWrapWidth;return R==null||R===""?"18ch":typeof R=="number"?`${R}ch`:String(R)}),ke=e.computed(()=>({left:`${Be.x}px`,top:`${Be.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),et=R=>Ue.value?{flex:`${R} 0 0`,minHeight:R>0?"6px":"0",minWidth:"0"}:{flex:`${R} 0 0`,minWidth:R>0?"6px":"0"},at=R=>{const Y=R?.parentElement;if(!Y)return{x:0,y:0};const ie=Y.getBoundingClientRect();return{x:ie.left+ie.width/2,y:ie.top}},ze=R=>{const Y=R.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},Tt=R=>{if(Ce.value){const be=Math.max(0,Number(R.value)||0);return{...et(be),backgroundColor:R.color}}const Y=g.value,ie=R.value>0?R.value:Y>0?1e-4:1;return{...et(ie),backgroundColor:R.color}},Zt=R=>Number(R?.value||0)>0&&Number(R?.value||0)===Ae.value,Qe=R=>{const Y=$(R?.marker)?R.marker:{},ie=R?.marker===!0||Y.enabled===!0,be=Zt(R)&&O.value.maxSegment?.marker?.enabled===!0;if(!(ie||be))return{enabled:!1};const He=Y.backgroundColor??(be?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),nt=Y.borderColor??(be?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Me=Y.color??(be?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),tt=Y.width??(be?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),it=Y.height??(be?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:He,borderColor:nt,color:Me,width:tt,height:it,icon:Y.icon??null,...Y}},At=R=>{const Y=Qe(R);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},ye=R=>{const Y=Qe(R);return{width:Y.width??void 0,height:Y.height??void 0}},ft=R=>`${R}${ee.valueLabel}`,Je=e.computed(()=>({...et(J.value),backgroundColor:ee.inactiveColor})),ct=(R,Y)=>{ee.disableTooltips||ut(R,Y)},ot=R=>{ee.disableTooltips||Gt(R)},ht=()=>{ee.disableTooltips||xt()},ut=(R,Y)=>{if(!R||!Y?.currentTarget)return;const ie=Y.currentTarget;if(ee.remainderTooltipSummary){const lt=at(ie);Be.x=lt.x,Be.y=lt.y,Be.content=ge.value,Be.visible=!!Be.content;return}const be=ze(ie);Be.x=be.x,Be.y=be.y,Be.content=`${R.label}: ${ft(R.value)}`,Be.visible=!0},Gt=R=>{if(!J.value||!R?.currentTarget)return;const Y=R.currentTarget;if(ee.remainderTooltipSummary){const be=at(Y);Be.x=be.x,Be.y=be.y,Be.content=ge.value,Be.visible=!!Be.content;return}const ie=ze(Y);Be.x=ie.x,Be.y=ie.y,X.value&&(Be.content=`${ee.remainderLabel}: ${ft(J.value)}`,Be.visible=!0)},xt=()=>{Be.visible=!1},Nt=()=>{Be.visible&&xt()};e.onMounted(()=>{window.addEventListener("scroll",Nt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Nt,!0)});const ue=e.computed(()=>({"--dss-step-bar-label-color":ee.labelColor??void 0,"--dss-step-bar-counter-color":ee.counterColor??void 0,"--dss-step-bar-active-color":ee.activeColor,"--dss-step-bar-inactive-color":ee.inactiveColor,"--dss-step-bar-bar-height":Ue.value?Z.value:void 0,"--dss-step-bar-side-label-max-width":De.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(R,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${B.orientation}`,`dss-step-bar--label-${B.labelPosition}`]]),style:e.normalizeStyle(ue.value)},[e.createElementVNode("div",Or,[e.createElementVNode("div",Wr,[e.createElementVNode("span",qr,[e.renderSlot(R.$slots,"label",{label:B.label},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])]),B.showCounter?(e.openBlock(),e.createElementBlock("span",Zr,[e.renderSlot(R.$slots,"counter",{counterDisplay:q.value},()=>[e.createTextVNode(e.toDisplayString(q.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ur,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Ze.value,"aria-valuenow":Re.value,"aria-label":B.label},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(ie,be)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${be}-${ie.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Zt(ie),"dss-step-bar__segment--marker-enabled":Qe(ie).enabled}]),style:e.normalizeStyle(Tt(ie)),onMouseenter:lt=>ct(ie,lt),onMouseleave:ht},[Qe(ie).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(At(ie)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(ye(ie))},[e.renderSlot(R.$slots,"segment-marker-icon",{segment:ie,index:be,marker:Qe(ie)},()=>[e.renderSlot(R.$slots,"max-segment-icon",{segment:ie,index:be,marker:Qe(ie)},()=>[e.createTextVNode(e.toDisplayString(Qe(ie).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Xr))),128)),he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(Je.value),onMouseenter:Y[0]||(Y[0]=ie=>ot(ie)),onMouseleave:ht},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,ie=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ie<=pe.value}])},null,2))),128))],8,Yr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!B.disableTooltips&&Be.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ke.value)},e.toDisplayString(Be.content),5)):e.createCommentVNode("",!0)]))],6))}},jr=["data-chart-type"],Kr={class:"dss-chart-header-titles"},Gr={key:0,class:"dss-chart-title"},Qr={key:1,class:"dss-chart-subtitle"},Jr=["onClick","onMouseenter"],ei={class:"dss-legend-text"},ti=["onClick","onMouseenter"],li={class:"dss-legend-text"},ni=["title"],ai=["src"],oi={class:"dss-chart-area-wrapper"},si={key:0,class:"dss-chart-z-axis-label"},ri=["width","height","viewBox","preserveAspectRatio","data-smooth","data-animated"],ii=["id"],ci=["y","width","height"],ui=["id"],di=["d"],mi=["id"],pi=["d"],vi={key:0},fi=["clip-path"],hi=["x1","x2","y1","y2"],gi=["clip-path"],yi=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],ki={class:"dss-axes"},Ci=["x1","x2","y1","y2"],bi=["x1","x2","y1","y2"],wi=["x1","x2","y1","y2"],xi={class:"dss-axis-labels"},Ei=["x","y"],Si=["x","y"],Vi=["x","y"],Ni=["x","y"],Bi=["y","transform"],_i=["x","y","transform"],Mi={key:2,class:"dss-flag-markers"},$i=["clip-path"],Di=["x1","x2","y1","y2","onMouseover"],Li=["x1","x2","y1","y2","onMouseover"],Ti=["x1","x2","y1","y2","onMouseover"],Ai=["cx","cy","onMouseover"],Hi=["cx","cy","fill","onMouseover"],Ri=["x","y"],Fi=["clip-path"],Ii={key:0},zi=["d","onMouseover"],Pi=["x","y","width","height","fill","onMouseover"],Oi={class:"dss-line-chart"},Wi=["d","stroke","stroke-width","stroke-dasharray"],qi=["d","stroke","stroke-width","opacity"],Zi=["cx","cy","r","fill","onMouseover"],Ui={key:1},Yi=["d","stroke","stroke-width","stroke-dasharray"],Xi=["d","stroke","stroke-width","stroke-dasharray"],ji=["d","stroke","stroke-width","opacity"],Ki=["cx","cy","r","fill","onMouseover"],Gi={key:2},Qi=["id"],Ji=["x","y","width","height"],ec=["d","fill","fill-opacity","mask"],tc=["d","stroke","stroke-width"],lc=["d","fill","onMouseover"],nc=["x","y","width","height","onMouseover"],ac=["clip-path"],oc=["x1","x2","y1","y2","stroke"],sc=["cx","cy","r","fill"],rc={key:1,class:"dss-bubble-chart"},ic={key:0,class:"dss-bubble-group"},cc=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],uc=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],dc=["transform"],mc=["cx","cy","r"],pc=["data-chart-type","clip-path"],vc=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],fc={key:1,class:"dss-radial-segment-data-labels"},hc=["x","y"],gc=["x","y","font-size","fill"],yc=["x1","y1","x2","y2","stroke"],kc=["x1","y1","x2","y2","stroke"],Cc=["x","y","text-anchor","font-size"],bc=["transform"],wc={key:0,class:"dss-spider-grid"},xc=["cx","cy","r"],Ec={class:"dss-spider-grid-labels"},Sc=["x","y"],Vc=["x","y"],Nc=["x1","x2","y1","y2"],Bc={class:"dss-spider-labels"},_c=["x","y","text-anchor","dominant-baseline"],Mc=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],$c=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Dc={class:"dss-chart-logos"},Lc=["cx","cy","r","fill"],Tc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ac={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},Hc=["onClick","onMouseenter"],Rc=["src"],Fc={class:"dss-marker-tooltip-category"},Ic={key:0,class:"dss-marker-tooltip-description"},zc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Pc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Oc={class:"dss-tooltip-series-name"},Wc={class:"dss-tooltip-series-value"},qc={key:1,class:"dss-tooltip-section"},Zc={key:0,class:"dss-tooltip-title"},Uc={class:"dss-bubble-tooltip-data"},Yc={key:2,class:"dss-tooltip-section"},Xc={class:"dss-tooltip-title"},jc={class:"dss-tooltip-value"},Kc={key:0,class:"dss-tooltip-section"},Gc={class:"dss-tooltip-section-title"},Qc={class:"dss-tooltip-group-header"},Jc={class:"dss-tooltip-item-content"},eu={class:"dss-tooltip-item-text"},tu={key:1,class:"dss-tooltip-section"},lu={class:"dss-tooltip-section-title"},nu={class:"dss-tooltip-item-content"},au={class:"dss-tooltip-item-title"},ou={key:0,class:"dss-tooltip-item-description"},su={class:"dss-tooltip-section"},ru={class:"dss-tooltip-title"},iu={key:0,class:"dss-bubble-tooltip-data"},cu={class:"dss-tooltip-series-name"},uu={class:"dss-tooltip-series-value"},du={key:0,class:"dss-tooltip-section"},mu={class:"dss-tooltip-section-title"},pu={class:"dss-tooltip-group-header"},vu={class:"dss-tooltip-item-content"},fu={class:"dss-tooltip-item-text"},hu={key:1,class:"dss-tooltip-section"},gu={class:"dss-tooltip-section-title"},yu={class:"dss-tooltip-item-content"},ku={class:"dss-tooltip-item-title"},Cu={key:0,class:"dss-tooltip-item-description"},bu=["onClick","onMouseenter"],wu={class:"dss-legend-text"},xu={key:1,class:"dss-context-menu-separator"},Eu={key:0,class:"dss-context-menu-separator"},Su={key:0,class:"dss-context-menu-separator"},Vu=["onClick"],Nu=["innerHTML"],Bu={key:0,class:"dss-context-menu-icon"},_u={class:"dss-marker-modal-header"},Mu={class:"dss-marker-modal-body"},$u={class:"dss-form-group"},Du={class:"dss-form-group"},Lu={for:"dss-marker-description"},Tu={key:0,class:"dss-form-text-display"},Au=["placeholder"],Hu={class:"dss-marker-modal-footer"},Ru={class:"modal-footer-left"},Fu={class:"dss-modal-footer-right"},Iu=["disabled"],zu={name:"DSSChart"},Pu=Object.assign(zu,{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:B=>typeof B=="object"&&B!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(B,{emit:ee}){const{t:N,locale:$}=va.useI18n(),se=ee,O=e.ref(null),A=e.ref(null);let pe=null;const rt=()=>{pe&&(pe(),pe=null);const t=A.value;if(!t||ye.value!=="stepbar")return;const a=l=>$a(l);t.addEventListener("wheel",a,{passive:!1}),pe=()=>t.removeEventListener("wheel",a)},te=e.ref(null),g=e.ref(null),xe=e.ref(0),Ce=e.ref(0);let J=null,X=null;const he=20,Ae=e.computed(()=>{if(Ce.value,xe.value,!O.value||!te.value)return 0;try{const t=O.value.getBoundingClientRect();return te.value.getBoundingClientRect().top-t.top}catch{return 0}}),ge=e.computed(()=>`chart-clip-${q.chartId}`),Te=e.computed(()=>`url(#${ge.value})`),q=B,Re={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:14,columnWidth:72,trackWidth:14,minBarWidth:12,maxBarWidth:120,barRadius:6,columnGap:16,labelReserve:48,trackAreaHeight:220,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 Ze(t,a){const l=Object.assign({},t);return Ue(t)&&Ue(a)&&Object.keys(a).forEach(r=>{Ue(a[r])?r in t?l[r]=Ze(t[r],a[r]):Object.assign(l,{[r]:a[r]}):Object.assign(l,{[r]:a[r]})}),l}const Be=()=>{let t=20,a=0,l=0;if(Je.value&&(t+=30),ct.value&&(t+=25),He.value&&q.series.length>0){const r=q.series.filter((p,h)=>!ne.value.has(h)).length;if(nt.value==="top"||nt.value==="bottom"){if(Me.value==="horizontal"){const h=Math.floor(ze.value/100);a=Math.ceil(r/h)*25+10}else a=r*25+10;t+=a}else l=150}return{height:t,legendHeight:a,legendWidth:l}};function Ue(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ze(Re,q.options)),De=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),Ye=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>De.value||Ye.value),et=e.computed(()=>`0 0 ${ze.value} ${Qe.value}`),at=e.computed(()=>{const t=Z.value;return t?.chart?.type==="stepbar"&&t?.chart?.height==="fit"}),ze=e.computed(()=>{const t=Z.value;return De.value?xe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Tt=e.ref(he),Zt=e.computed(()=>{if(ye.value!=="semi-radial")return;const t=xl.value,a=(ze.value-t.left-t.right)/2;return t.top+a+t.bottom}),Qe=e.computed(()=>{const t=Z.value;if(ye.value==="mini-radial")return ze.value;if(at.value)return Ht.value;if(Ye.value){const a=Zt.value;return a??(ye.value==="radial"?ze.value:Math.max(0,(Ce.value||400)-Tt.value))}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),At=e.computed(()=>{if(Ye.value&&ye.value==="semi-radial"&&Zt.value!=null||Ye.value&&Xt.value)return Tt.value+Qe.value+"px";if(Ye.value)return"100%";if(Xt.value)return Tt.value+Qe.value+"px";if(He.value&&nt.value==="bottom"){const t=Be();return Qe.value+(t.legendHeight||35)+"px"}return Qe.value+(He.value?20:0)+"px"}),ye=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),ft=e.computed(()=>{const t=q.series.map(a=>a.type||ye.value);return new Set(t).size>1}),Je=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),ct=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ot=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:""}),ht=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),ut=e.computed(()=>{const a=Z.value?.yAxis?.title?.text;return a==null||String(a).trim()===""?"":String(a)}),Gt=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=Gt.value;return t&&t.title&&t.title.text?t.title.text:""}),Nt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.min;return typeof a=="number"||a===ol?a:ol}),ue=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.max;return typeof a=="number"||a===ol?a:ol}),R=e.computed(()=>{const t=Gt.value;if(!t)return ol;const a=t.min;return typeof a=="number"||a===ol?a:ol}),Y=e.computed(()=>{const t=Gt.value;if(!t)return ol;const a=t.max;return typeof a=="number"||a===ol?a:ol}),ie=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),be=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),lt=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),He=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),nt=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Me=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),tt=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),it=e.computed(()=>{const t=Z.value;if(!t)return!1;if(ye.value==="stepbar"){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Ut=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),ae=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Q=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),oe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),re=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Se=e.computed(()=>{if(!Xt.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ke=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),_t=e.computed(()=>{const{maxX:t}=jt.value;return t===0}),Qt=(t,a)=>_t.value&&a===0?5:a,Mt=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ul=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),M=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),V=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),T=e.computed(()=>{const t=Z.value;return M.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ce=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"]}),j=e.computed(()=>Z.value?.stepbar||{}),Oe=e.computed(()=>{const t=j.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),kt=e.computed(()=>{const t=Number(j.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),st=e.computed(()=>j.value?.showRemainder!==!1),Xe=e.computed(()=>j.value?.remainderLabel||"Remaining"),Et=e.computed(()=>j.value?.remainderColor||"#E5E7EB"),Ct=e.computed(()=>{const t=Number(j.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),St=e.computed(()=>{const t=Number(j.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),$t=e.computed(()=>{const t=Number(j.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(j.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const bt=e.computed(()=>j.value?.axisBars||{}),Vt=e.computed(()=>bt.value?.show!==!1);e.computed(()=>bt.value?.showVertical===!0);const Sl=e.computed(()=>bt.value?.color||"#d6d6d6"),Wl=e.computed(()=>{const t=Number(bt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),Tl=e.computed(()=>{const t=Number(bt.value?.width);return Number.isFinite(t)&&t>0?t:1}),Vl=e.computed(()=>bt.value?.dashArray||"3,4"),Kt=e.computed(()=>{const t=Number(j.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),Al=e.computed(()=>{const t=Number(j.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),Nl=e.computed(()=>{const t=Number(j.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),Ht=e.computed(()=>{let t=0;Je.value&&(t+=15),ct.value&&(t+=10);const a=50+t,l=Al.value+8;return a+Nl.value+l}),_l=e.computed(()=>Math.max(z.value.height,0)),sl=e.computed(()=>{const t=Number(j.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const a=Ct.value,l=St.value,r=$t.value;return Math.max(l,Math.min(r,a))}),Hl=e.computed(()=>{const t=Number(j.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,sl.value);const a=Number(j.value?.barWidth);return Number.isFinite(Number(j.value?.columnWidth))&&Number(j.value?.columnWidth)>0&&Number.isFinite(a)&&a>0?Math.min(a,sl.value):Math.min(sl.value,Math.max(10,Math.round(sl.value*.32)))}),Zn=e.computed(()=>({width:`${sl.value}px`,flex:`0 0 ${sl.value}px`,"--dss-step-bar-track-thickness":`${Hl.value}px`,"--dss-stepbar-label-height":`${Al.value}px`})),Tn=e.computed(()=>{const t=Gl.value.length;return t?t*sl.value+Math.max(0,t-1)*Kt.value:0}),Sn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Gl=e.computed(()=>ye.value!=="stepbar"?[]:jl.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(a=>!a.isRemainder).map(a=>({label:a.label,value:a.value,color:a.color,marker:a.marker}))}))),un=e.computed(()=>{if(ye.value!=="stepbar")return[];const{minY:t,maxY:a}=jt.value,l=5,r=[];for(let p=0;p<=l;p++){const h=t+(a-t)*(p/l);r.push({top:Kn(h)-z.value.top,value:h})}return r}),$l=e.computed(()=>({top:`${z.value.top}px`,left:`${z.value.left}px`,width:`${z.value.width}px`,height:`${_l.value+Al.value}px`})),gn=e.computed(()=>({width:`${Tn.value}px`,minHeight:`${_l.value+Al.value}px`})),Vn=e.computed(()=>ye.value==="stepbar"&&it.value&&$e.value.show&&!de.value.isZooming),An=e.computed(()=>{const t=sl.value+Kt.value;return{left:`${$e.value.categoryIndex*t+sl.value/2}px`,height:`${_l.value}px`,borderColor:Ut.value}}),bl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),yn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dn=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Rl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Hn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Ml=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ql=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),kn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Fl=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Jn=e.computed(()=>Z.value?.spider?.gridSteps||5),Zl=e.computed(()=>{const t=[],a=Jn.value;for(let l=1;l<=a;l++)t.push(yt.value/a*l);return t}),dl=t=>{const a=Dl.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const l=Zl.value[t];return Math.round(l/yt.value*100)+"%"},Dl=e.computed(()=>Z.value?.spider?.gridLabels||null),Yt=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}),Ql=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Wt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Il.value}),gt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Pl=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),vl=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),qt=t=>{const a=vl.value;if(t==null)return"";const l=String(t);return a?l+a:l},Jl=e.computed(()=>!de.value.isZooming);e.computed(()=>tl.value.map(t=>{if(t.categoryIndex!==void 0&&(Bl.value||ll.value)){const a=kl(t.categoryIndex),l=Ae.value+z.value.bottom-Pl.value/2;return{...t,x:a,y:l}}return t}));function Ul(t,a){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[h,E,S]=t.split("-"),W=Number(S?.length===2?`20${S}`:S);l=new Date(W,Number(E)-1,Number(h))}else return 0;let r=0,p=1/0;return a.forEach((h,E)=>{const[S,W,L]=h.split("-"),I=Number(L?.length===2?`20${L}`:L),D=new Date(I,Number(W)-1,Number(S)),G=Math.abs(D-l);G<p&&(p=G,r=E)}),r}const Rn=e.computed(()=>{const t=q.markers.map(l=>{const r=Ul(l.marker_date,q.categories),p=kl(r),h=Ae.value+z.value.bottom-Pl.value/2;return{...l,x:p,y:h,categoryIndex:r,source:"props"}}),a=tl.value.map(l=>{if(l.categoryIndex!==void 0&&(Bl.value||ll.value)){const r=kl(l.categoryIndex),p=Ae.value+z.value.bottom-Pl.value/2;return{...l,x:r,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...a]}),en=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),Ll=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Jt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Yl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),wl=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let a,l;const r=String(Jt.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,l=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),l=a*(96/499)}return{width:a,height:l,area:t}}),Pt=e.computed(()=>{const{width:t,height:a}=wl.value,l=Yl.value;let r,p;const h=z.value.left,E=z.value.right,S=z.value.top,W=z.value.bottom,L=z.value.width,I=z.value.height;switch(l){case"center":r=h+(L-t)/2,p=S+(I-a)/2;break;case"top-left":r=h+15,p=S+5;break;case"top-right":r=E-t-15,p=S+5;break;case"bottom-left":r=h+15,p=W-a-5;break;case"bottom-right":default:r=E-t-15,p=W-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Fn=t=>!q.flags||!q.flags.length?[]:q.flags.filter(a=>a.categoryIndex===t),Dt=t=>{const a=Fn(t),l=Da(t),r=a.filter(E=>E.manual),p=a.filter(E=>!E.manual),h=[];return r.length>0&&h.push({type:N("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(E=>({text:E.text,color:"#698dbe"}))}),p.length>0&&h.push({type:N("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(E=>({text:E.text,color:"#a1d499"}))}),{flagGroups:h,markers:l.map(E=>({title:E.title,description:E.description,type:N("chart.tooltip.markers"),color:E.color||"#9784ba"}))}},Il=e.computed(()=>{const t=q.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"/>
@@ -41,22 +41,22 @@
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)}`}),Cn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),tn=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 fl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),In=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ln=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),mn=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),Il=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),nn=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return xn.value?!0:n.value&&a&&(a.show===!0||a.enabled===!0)}),rl=e.computed(()=>{if(!nn.value||!Wn.value.length)return"";if(xn.value){const r=Wn.value[1]??Wn.value[0];return Zt(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Wn.value[0]?.value??0:Wn.value.reduce((r,p)=>r+(p.value??0),0);return Zt(l)}),Ol=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),k=e.computed(()=>({x:ft.value,y:xn.value?Rt.value:Rt.value-Ol.value/2})),w=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),x=e.computed(()=>{if(!mn.value||!Xt.value||!Wn.value.length)return[];const t=Il.value*Math.PI/180,a=(nl.value+ct.value)/2;return Wn.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,h=ft.value+Math.cos(l.midAngle)*a,E=Rt.value+Math.sin(l.midAngle)*a;return{value:Zt(l.value),x:h,y:E,show:p,color:l.color,contrastColor:Ko(l.color)}})}),d=e.computed(()=>{if(!q.flags||!q.flags.length)return[];const t=new Map;return q.flags.forEach(a=>{const l=a.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(a)}),Array.from(t.entries()).map(([a,l])=>{const r=kl(a),p=l.filter(E=>E.manual),h=l.filter(E=>!E.manual);return{categoryIndex:parseInt(a),x:r,flags:l,manualCount:p.length,autoCount:h.length,totalCount:l.length,hasManual:p.length>0,hasAuto:h.length>0,texts:l.map(E=>E.text).join(`
45
- `)}})}),v=e.ref({show:!1,x:0,y:0,content:"",count:0}),b=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),H=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),U=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),ne=e.ref(new Set),K=e.ref(null),vt=e.ref(!1),je=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ot=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),$e=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}),de=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tl=e.ref([]),ze=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 yt.value&&t.push(...Object.keys(yt.value)),t}),e.computed(()=>{if(!q.categories||q.categories.length===0){const{maxX:t}=jt.value;return Array.from({length:t+1},(a,l)=>N("chart.fallback.item",{number:l+1}))}return q.categories});const la=e.computed(()=>{if(!q.categories||q.categories.length===0)return null;const t=q.categories[0],[a,l,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;return!h||!l||!p?null:new Date(p,E,h)}),na=e.computed(()=>{if(!q.categories||q.categories.length===0)return null;const t=q.categories[q.categories.length-1],[a,l,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;return!h||!l||!p?null:new Date(p,E,h)}),pn=e.computed(()=>ze.value.editingMarkerId!==null),vn=e.computed(()=>ze.value.readonly),ya=t=>{ne.value.has(t)||(vo.value=!0,K.value=t)},ka=()=>{vo.value=!1,K.value=null},_a=t=>{if(Va.value||Oa.value){$e.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top,h=ll.value?r>=z.value.left-50&&r<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:gl.value?r>=z.value.left&&r<=z.value.right&&p>=z.value.top&&p<=z.value.bottom+Tl.value:r>=z.value.left&&r<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(vt.value=h,ll.value){if(!it.value||!h||de.value.isDragging||de.value.isZooming){$e.value.show=!1;return}if(za.value.find(fe=>!fe||fe.isHidden?!1:Math.sqrt(Math.pow(fe.x-r,2)+Math.pow(fe.y-p,2))<=fe.radius+3))$e.value.show=!1;else{const fe=za.value.filter(we=>!we||we.isHidden?!1:Math.sqrt(Math.pow(we.x-r,2)+Math.pow(we.y-p,2))<=250);if(fe.length>0){let we=fe[0],Ee=Math.sqrt(Math.pow(we.x-r,2)+Math.pow(we.y-p,2));fe.forEach(Ie=>{const Le=Math.sqrt(Math.pow(Ie.x-r,2)+Math.pow(Ie.y-p,2));Le<Ee&&(Ee=Le,we=Ie)});const ve=30,Ge=za.value.filter(Ie=>!Ie||Ie.isHidden?!1:Math.abs(Ie.x-we.x)<=ve).sort((Ie,Le)=>Ie.y-Le.y);$e.value={show:!0,x:we.x,categoryIndex:Math.round(we.originalX),data:(()=>{const Ie=b.value,Le=H.value,Ne=[];return Ge.forEach(Fe=>{Ie.forEach(Nt=>{const zt=Le[Nt]||Nt,rn=Bo(Nt,Fe);rn&&Ne.push({seriesName:Fe.seriesName,label:Fe.label,value:`${zt}: ${rn}`,color:Fe.color,y:Fe.y})})}),Ne})()}}else $e.value.show=!1}return}if(gl.value){if(!it.value||!h||de.value.isDragging||de.value.isZooming){$e.value.show=!1;return}const qe=A.value;if(!qe){$e.value.show=!1;return}const fe=qe.getBoundingClientRect(),we=t.clientX-fe.left+qe.scrollLeft,Ee=sl.value+Kt.value,ve=Math.floor(we/Ee);if(ve<0||ve>=Gl.value.length){$e.value.show=!1;return}const Ge=jl.value[ve];if(!Ge){$e.value.show=!1;return}const Ie=ve*Ee+sl.value/2,Le=fe.left+Ie-qe.scrollLeft-l.left;$e.value={show:!0,x:Le,categoryIndex:ve,data:Ge.segments.filter(Ne=>!Ne.isRemainder).map(Ne=>({seriesName:Ne.label,value:Ne.value,color:Ne.color,y:null}))};return}if(de.value.isDragging&&de.value.scale>1&&Nl.value&&ae.value&&!gl.value){$e.value.show=!1;const qe=t.clientX-de.value.lastMouseX,{minX:fe,maxX:we}=jt.value,Ee=we-fe||1,Ge=qe*.8;de.value.offsetX+=Ge;const Ie=Ee/de.value.scale,Le=Ee-Ie,Ne=0,Fe=-Le/Ee*z.value.width,Nt=Ne;de.value.offsetX=Math.max(Fe,Math.min(Nt,de.value.offsetX)),de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY;return}if(!it.value||!Nl.value||gl.value||de.value.isDragging||de.value.isZooming||!h){$e.value.show=!1;return}const{minX:E,maxX:S}=jt.value,W=S-E||1,L=W/de.value.scale,I=E-de.value.offsetX/z.value.width*W,D=(r-z.value.left)/z.value.width,G=I+D*L,Ve=Math.round(G);if(Ve>=0&&Ve<=S){const qe=kl(Ve),fe=It.value.map((we,Ee)=>{const ve=q.series.findIndex(Ie=>Ie===we),Ge=we.data[Ve];return{seriesName:we.name,value:Ge!==void 0?Ge:null,color:el(ve),y:Ge!==void 0?En(we,Ge):null}}).filter(we=>we.value!==null);$e.value={show:!0,x:qe,categoryIndex:Ve,data:fe}}},Ma=()=>{$e.value.show&&($e.value.show=!1)},$a=t=>{const a=A.value;if(!a||a.scrollWidth<=a.clientWidth)return;t.preventDefault(),t.stopPropagation();const l=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;a.scrollLeft+=l},Ka=()=>Gl.value[$e.value.categoryIndex]?.label||N("chart.fallback.item",{number:$e.value.categoryIndex+1}),Ga=()=>{$e.value.show=!1,vt.value=!1,Oa.value=!1,Va.value||(v.value.show=!1),de.value.isDragging&&(de.value.isDragging=!1),de.value.zoomTimeout&&(clearTimeout(de.value.zoomTimeout),de.value.zoomTimeout=null),de.value.isZooming=!1,setTimeout(()=>{K.value=null,je.value.show=!1},150)},Qa=t=>{if(t.preventDefault(),t.stopPropagation(),!Yt.value)return;const a=t.currentTarget.getBoundingClientRect(),l=t.clientX-a.left,r=t.clientY-a.top;if(Xt.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 p=Math.max(0,z.value.left-20),h=z.value.right,E=z.value.top,S=z.value.bottom+80;l>=p&&l<=h&&r>=E&&r<=S&&(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 W=Math.max(z.value.left,Math.min(l,z.value.right))-z.value.left,I=z.value.width/so.value.length,D=Math.floor(W/I);D>=0&&D<so.value.length&&(mt.value.categoryIndex=D)}))},bn=t=>{if(!(t&&t.button===2)){if(mt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}mt.value.show=!1}},Un=t=>{if(typeof t.template=="function"){const a={series:q.series,categories:q.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(a,l)}return t.template||t.label||""},aa=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},oa=t=>t.style||{},Ja=t=>t.type&&yt.value[t.type]?yt.value[t.type]:t.customIcon?t.customIcon:qt.value,eo=t=>t==null?"":q.categories&&q.categories[t]?q.categories[t]:"",Da=t=>tl.value.length?tl.value.filter(a=>a.categoryIndex===t):[],Bn=t=>{if(!Nl.value&&!ll.value)return{x:0,y:0};const a=kl(t),l=Ae.value+z.value.bottom-Pl.value/2;return{x:a,y:l}},wn=()=>{tl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Nl.value||ll.value)){const a=Bn(t.categoryIndex);t.x=a.x,t.y=a.y}})},zn=()=>{if(ze.value.description&&ze.value.description.length&&ze.value.date){if(pn.value){const t=tl.value.findIndex(a=>a.id===ze.value.editingMarkerId);t!==-1?(tl.value[t].description=ze.value.description||"",tl.value[t].color=ze.value.color||"",tl.value[t].type=ze.value.type||"default",se("update-marker",tl.value[t])):se("update-marker",{id:ze.value.editingMarkerId,description:ze.value.description||"",color:ze.value.color||"",type:ze.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=Ul(ze.value.date,q.categories||[]);if(ll.value){const{maxX:E}=jt.value;a=Math.max(0,Math.min(a,Math.floor(E)))}else Nl.value&&(a=Math.max(0,Math.min(a,jt.value.maxX)));const l=kl(a),r=Ae.value+z.value.bottom-Pl.value/2,p=Array.isArray(q.categories)?q.categories[a]:null,h={id:t,title:"",description:ze.value.description||"",color:ze.value.color||"",type:ze.value.type||"default",categoryIndex:a,x:l,y:r,marker_date:p||null};ze.value.categoryIndex=a,tl.value.push(h),se("add-marker",h)}an(),_n()}},an=()=>{ze.value.show=!1,ze.value.title="",ze.value.description="",ze.value.color="#FF6B6B",ze.value.type="default",ze.value.editingMarkerId=null,ze.value.readonly=!1,ze.value.categoryIndex=null,ze.value.fromButton=!1,ze.value.date=null},il=()=>{pn.value&&(La(ze.value.editingMarkerId),an())},La=t=>{const a=tl.value.findIndex(l=>l.id===t);a!==-1&&(tl.value.splice(a,1),_n()),se("delete-marker",t)},Ta=t=>{if(ze.value.show=!0,ze.value.title=t?.title??t?.comment??"",ze.value.description=t?.description??t?.comment??"",ze.value.color=t?.color??"",ze.value.type=t?.type??"default",ze.value.editingMarkerId=t?.id??t?.marker_id??null,ze.value.readonly=t?.readonly??!1,ze.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,l,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;h&&l&&p?ze.value.date=new Date(p,E,h):ze.value.date=null}else ze.value.date=null},_n=()=>{try{const t=`dss-chart-markers-${q.chartId}`;localStorage.setItem(t,JSON.stringify(tl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Pn=()=>{try{const t=`dss-chart-markers-${q.chartId}`,a=localStorage.getItem(t);if(a){const l=JSON.parse(a);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=[]}},fn=t=>{const a=Je.value||"Chart",l=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"}-${l}.${t}`},Mn=()=>{const t=$e.value.show,a=je.value.show;return $e.value.show=!1,je.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Xl=t=>{$e.value.show=t.originalCrosshair,je.value.show=t.originalTooltip},to=async(t,a=32,l=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const h=new Image;h.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);h.onload=()=>{clearTimeout(E);try{const S=document.createElement("canvas"),W=S.getContext("2d");S.width=a,S.height=l,W.fillStyle="#fafafa",W.fillRect(0,0,a,l),W.drawImage(h,0,0,a,l);const L=S.toDataURL("image/png");r(L)}catch(S){console.warn("Canvas conversion failed:",S),r(t)}},h.onerror=S=>{clearTimeout(E),console.warn("Failed to load image:",t,S),r(t)},h.src=t}),lo=async()=>{try{const t=Mn();setTimeout(async()=>{try{const a=te.value;if(!a){console.error("Chart SVG element not found"),Xl(t);return}const l=Be(),r=Pe.value,p=Qe.value+l.height,h=a.cloneNode(!0);h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const S=h.querySelectorAll("image"),W=Array.from(S).map(async ve=>{const Ge=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ge&&!Ge.startsWith("data:"))try{const Ie=await to(Ge,32,32);ve.setAttribute("xlink:href",Ie),ve.setAttribute("href",Ie)}catch(Ie){console.warn("Failed to convert logo to base64:",Ie)}});await Promise.all(W);const I=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let D="",G=30;if(Je.value&&(D+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Cn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),tn=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 fl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),In=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ln=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),mn=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),zl=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),nn=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return xn.value?!0:n.value&&a&&(a.show===!0||a.enabled===!0)}),rl=e.computed(()=>{if(!nn.value||!Wn.value.length)return"";if(xn.value){const r=Wn.value[1]??Wn.value[0];return qt(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Wn.value[0]?.value??0:Wn.value.reduce((r,p)=>r+(p.value??0),0);return qt(l)}),Ol=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),k=e.computed(()=>({x:vt.value,y:xn.value?wt.value:wt.value-Ol.value/2})),w=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),x=e.computed(()=>{if(!mn.value||!Xt.value||!Wn.value.length)return[];const t=zl.value*Math.PI/180,a=(nl.value+yt.value)/2;return Wn.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,h=vt.value+Math.cos(l.midAngle)*a,E=wt.value+Math.sin(l.midAngle)*a;return{value:qt(l.value),x:h,y:E,show:p,color:l.color,contrastColor:Ko(l.color)}})}),d=e.computed(()=>{if(!q.flags||!q.flags.length)return[];const t=new Map;return q.flags.forEach(a=>{const l=a.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(a)}),Array.from(t.entries()).map(([a,l])=>{const r=kl(a),p=l.filter(E=>E.manual),h=l.filter(E=>!E.manual);return{categoryIndex:parseInt(a),x:r,flags:l,manualCount:p.length,autoCount:h.length,totalCount:l.length,hasManual:p.length>0,hasAuto:h.length>0,texts:l.map(E=>E.text).join(`
45
+ `)}})}),v=e.ref({show:!1,x:0,y:0,content:"",count:0}),b=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),H=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),U=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),ne=e.ref(new Set),K=e.ref(null),pt=e.ref(!1),je=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ot=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),$e=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),dt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),de=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tl=e.ref([]),Pe=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 gt.value&&t.push(...Object.keys(gt.value)),t}),e.computed(()=>{if(!q.categories||q.categories.length===0){const{maxX:t}=jt.value;return Array.from({length:t+1},(a,l)=>N("chart.fallback.item",{number:l+1}))}return q.categories});const la=e.computed(()=>{if(!q.categories||q.categories.length===0)return null;const t=q.categories[0],[a,l,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;return!h||!l||!p?null:new Date(p,E,h)}),na=e.computed(()=>{if(!q.categories||q.categories.length===0)return null;const t=q.categories[q.categories.length-1],[a,l,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;return!h||!l||!p?null:new Date(p,E,h)}),pn=e.computed(()=>Pe.value.editingMarkerId!==null),vn=e.computed(()=>Pe.value.readonly),ya=t=>{ne.value.has(t)||(vo.value=!0,K.value=t)},ka=()=>{vo.value=!1,K.value=null},_a=t=>{if(Va.value||Oa.value){$e.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top,h=ll.value?r>=z.value.left-50&&r<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:gl.value?r>=z.value.left&&r<=z.value.right&&p>=z.value.top&&p<=z.value.bottom+Al.value:r>=z.value.left&&r<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(pt.value=h,ll.value){if(!it.value||!h||de.value.isDragging||de.value.isZooming){$e.value.show=!1;return}if(za.value.find(fe=>!fe||fe.isHidden?!1:Math.sqrt(Math.pow(fe.x-r,2)+Math.pow(fe.y-p,2))<=fe.radius+3))$e.value.show=!1;else{const fe=za.value.filter(we=>!we||we.isHidden?!1:Math.sqrt(Math.pow(we.x-r,2)+Math.pow(we.y-p,2))<=250);if(fe.length>0){let we=fe[0],Ee=Math.sqrt(Math.pow(we.x-r,2)+Math.pow(we.y-p,2));fe.forEach(Ie=>{const Le=Math.sqrt(Math.pow(Ie.x-r,2)+Math.pow(Ie.y-p,2));Le<Ee&&(Ee=Le,we=Ie)});const ve=30,Ge=za.value.filter(Ie=>!Ie||Ie.isHidden?!1:Math.abs(Ie.x-we.x)<=ve).sort((Ie,Le)=>Ie.y-Le.y);$e.value={show:!0,x:we.x,categoryIndex:Math.round(we.originalX),data:(()=>{const Ie=b.value,Le=H.value,Ne=[];return Ge.forEach(Fe=>{Ie.forEach(Bt=>{const zt=Le[Bt]||Bt,rn=Bo(Bt,Fe);rn&&Ne.push({seriesName:Fe.seriesName,label:Fe.label,value:`${zt}: ${rn}`,color:Fe.color,y:Fe.y})})}),Ne})()}}else $e.value.show=!1}return}if(gl.value){if(!it.value||!h||de.value.isDragging||de.value.isZooming){$e.value.show=!1;return}const qe=A.value;if(!qe){$e.value.show=!1;return}const fe=qe.getBoundingClientRect(),we=t.clientX-fe.left+qe.scrollLeft,Ee=sl.value+Kt.value,ve=Math.floor(we/Ee);if(ve<0||ve>=Gl.value.length){$e.value.show=!1;return}const Ge=jl.value[ve];if(!Ge){$e.value.show=!1;return}const Ie=ve*Ee+sl.value/2,Le=fe.left+Ie-qe.scrollLeft-l.left;$e.value={show:!0,x:Le,categoryIndex:ve,data:Ge.segments.filter(Ne=>!Ne.isRemainder).map(Ne=>({seriesName:Ne.label,value:Ne.value,color:Ne.color,y:null}))};return}if(de.value.isDragging&&de.value.scale>1&&Bl.value&&ae.value&&!gl.value){$e.value.show=!1;const qe=t.clientX-de.value.lastMouseX,{minX:fe,maxX:we}=jt.value,Ee=we-fe||1,Ge=qe*.8;de.value.offsetX+=Ge;const Ie=Ee/de.value.scale,Le=Ee-Ie,Ne=0,Fe=-Le/Ee*z.value.width,Bt=Ne;de.value.offsetX=Math.max(Fe,Math.min(Bt,de.value.offsetX)),de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY;return}if(!it.value||!Bl.value||gl.value||de.value.isDragging||de.value.isZooming||!h){$e.value.show=!1;return}const{minX:E,maxX:S}=jt.value,W=S-E||1,L=W/de.value.scale,I=E-de.value.offsetX/z.value.width*W,D=(r-z.value.left)/z.value.width,G=I+D*L,Ve=Math.round(G);if(Ve>=0&&Ve<=S){const qe=kl(Ve),fe=It.value.map((we,Ee)=>{const ve=q.series.findIndex(Ie=>Ie===we),Ge=we.data[Ve];return{seriesName:we.name,value:Ge!==void 0?Ge:null,color:el(ve),y:Ge!==void 0?En(we,Ge):null}}).filter(we=>we.value!==null);$e.value={show:!0,x:qe,categoryIndex:Ve,data:fe}}},Ma=()=>{$e.value.show&&($e.value.show=!1)},$a=t=>{const a=A.value;if(!a||a.scrollWidth<=a.clientWidth)return;t.preventDefault(),t.stopPropagation();const l=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;a.scrollLeft+=l},Ka=()=>Gl.value[$e.value.categoryIndex]?.label||N("chart.fallback.item",{number:$e.value.categoryIndex+1}),Ga=()=>{$e.value.show=!1,pt.value=!1,Oa.value=!1,Va.value||(v.value.show=!1),de.value.isDragging&&(de.value.isDragging=!1),de.value.zoomTimeout&&(clearTimeout(de.value.zoomTimeout),de.value.zoomTimeout=null),de.value.isZooming=!1,setTimeout(()=>{K.value=null,je.value.show=!1},150)},Qa=t=>{if(t.preventDefault(),t.stopPropagation(),!Yt.value)return;const a=t.currentTarget.getBoundingClientRect(),l=t.clientX-a.left,r=t.clientY-a.top;if(Xt.value){dt.value.show=!1,e.nextTick(()=>{dt.value.show=!0,dt.value.x=t.clientX,dt.value.y=t.clientY,dt.value.categoryIndex=null});return}const p=Math.max(0,z.value.left-20),h=z.value.right,E=z.value.top,S=z.value.bottom+80;l>=p&&l<=h&&r>=E&&r<=S&&(dt.value.show=!1,e.nextTick(()=>{dt.value.show=!0,dt.value.x=t.clientX,dt.value.y=t.clientY,dt.value.categoryIndex=null;const W=Math.max(z.value.left,Math.min(l,z.value.right))-z.value.left,I=z.value.width/so.value.length,D=Math.floor(W/I);D>=0&&D<so.value.length&&(dt.value.categoryIndex=D)}))},bn=t=>{if(!(t&&t.button===2)){if(dt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}dt.value.show=!1}},Un=t=>{if(typeof t.template=="function"){const a={series:q.series,categories:q.categories,markers:tl.value},l={chartX:dt.value.chartX,chartY:dt.value.chartY,dataX:dt.value.mouseDataX,dataY:dt.value.mouseDataY,categoryIndex:dt.value.categoryIndex};return t.template(a,l)}return t.template||t.label||""},aa=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},oa=t=>t.style||{},Ja=t=>t.type&&gt.value[t.type]?gt.value[t.type]:t.customIcon?t.customIcon:Wt.value,eo=t=>t==null?"":q.categories&&q.categories[t]?q.categories[t]:"",Da=t=>tl.value.length?tl.value.filter(a=>a.categoryIndex===t):[],Bn=t=>{if(!Bl.value&&!ll.value)return{x:0,y:0};const a=kl(t),l=Ae.value+z.value.bottom-Pl.value/2;return{x:a,y:l}},wn=()=>{tl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Bl.value||ll.value)){const a=Bn(t.categoryIndex);t.x=a.x,t.y=a.y}})},zn=()=>{if(Pe.value.description&&Pe.value.description.length&&Pe.value.date){if(pn.value){const t=tl.value.findIndex(a=>a.id===Pe.value.editingMarkerId);t!==-1?(tl.value[t].description=Pe.value.description||"",tl.value[t].color=Pe.value.color||"",tl.value[t].type=Pe.value.type||"default",se("update-marker",tl.value[t])):se("update-marker",{id:Pe.value.editingMarkerId,description:Pe.value.description||"",color:Pe.value.color||"",type:Pe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=Ul(Pe.value.date,q.categories||[]);if(ll.value){const{maxX:E}=jt.value;a=Math.max(0,Math.min(a,Math.floor(E)))}else Bl.value&&(a=Math.max(0,Math.min(a,jt.value.maxX)));const l=kl(a),r=Ae.value+z.value.bottom-Pl.value/2,p=Array.isArray(q.categories)?q.categories[a]:null,h={id:t,title:"",description:Pe.value.description||"",color:Pe.value.color||"",type:Pe.value.type||"default",categoryIndex:a,x:l,y:r,marker_date:p||null};Pe.value.categoryIndex=a,tl.value.push(h),se("add-marker",h)}an(),_n()}},an=()=>{Pe.value.show=!1,Pe.value.title="",Pe.value.description="",Pe.value.color="#FF6B6B",Pe.value.type="default",Pe.value.editingMarkerId=null,Pe.value.readonly=!1,Pe.value.categoryIndex=null,Pe.value.fromButton=!1,Pe.value.date=null},il=()=>{pn.value&&(La(Pe.value.editingMarkerId),an())},La=t=>{const a=tl.value.findIndex(l=>l.id===t);a!==-1&&(tl.value.splice(a,1),_n()),se("delete-marker",t)},Ta=t=>{if(Pe.value.show=!0,Pe.value.title=t?.title??t?.comment??"",Pe.value.description=t?.description??t?.comment??"",Pe.value.color=t?.color??"",Pe.value.type=t?.type??"default",Pe.value.editingMarkerId=t?.id??t?.marker_id??null,Pe.value.readonly=t?.readonly??!1,Pe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,l,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),h=Number(a),E=Number(l)-1;h&&l&&p?Pe.value.date=new Date(p,E,h):Pe.value.date=null}else Pe.value.date=null},_n=()=>{try{const t=`dss-chart-markers-${q.chartId}`;localStorage.setItem(t,JSON.stringify(tl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Pn=()=>{try{const t=`dss-chart-markers-${q.chartId}`,a=localStorage.getItem(t);if(a){const l=JSON.parse(a);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=[]}},fn=t=>{const a=Je.value||"Chart",l=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"}-${l}.${t}`},Mn=()=>{const t=$e.value.show,a=je.value.show;return $e.value.show=!1,je.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Xl=t=>{$e.value.show=t.originalCrosshair,je.value.show=t.originalTooltip},to=async(t,a=32,l=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const h=new Image;h.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);h.onload=()=>{clearTimeout(E);try{const S=document.createElement("canvas"),W=S.getContext("2d");S.width=a,S.height=l,W.fillStyle="#fafafa",W.fillRect(0,0,a,l),W.drawImage(h,0,0,a,l);const L=S.toDataURL("image/png");r(L)}catch(S){console.warn("Canvas conversion failed:",S),r(t)}},h.onerror=S=>{clearTimeout(E),console.warn("Failed to load image:",t,S),r(t)},h.src=t}),lo=async()=>{try{const t=Mn();setTimeout(async()=>{try{const a=te.value;if(!a){console.error("Chart SVG element not found"),Xl(t);return}const l=Be(),r=ze.value,p=Qe.value+l.height,h=a.cloneNode(!0);h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const S=h.querySelectorAll("image"),W=Array.from(S).map(async ve=>{const Ge=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ge&&!Ge.startsWith("data:"))try{const Ie=await to(Ge,32,32);ve.setAttribute("xlink:href",Ie),ve.setAttribute("href",Ie)}catch(Ie){console.warn("Failed to convert logo to base64:",Ie)}});await Promise.all(W);const I=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let D="",G=30;if(Je.value&&(D+=`
46
46
  <text x="24" y="${G}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
51
  ${Je.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,G+=30),ut.value&&(D+=`
52
+ </text>`,G+=30),ct.value&&(D+=`
53
53
  <text x="24" y="${G}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${ut.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,G+=25),He.value&&q.series.length>0){let ve=r-200,Ge=Je.value||ut.value?35:25;const Ie=Math.floor((r-250)/120);let Le=0;q.series.forEach((Ne,Fe)=>{if(!ne.value.has(Fe)){const Nt=el(Fe),zt=Ne.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");D+=`<circle cx="${ve+6}" cy="${Ge-4}" r="6" fill="${Nt}"/>`,D+=`<text x="${ve+18}" y="${Ge}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Le++,Le%Ie===0?(ve=r-200,Ge+=20):ve+=Math.min(120,zt.length*8+35)}})}let Ve="";if(en.value)try{const{width:ve,height:Ge}=wl.value,Ie=Yl.value,Le=z.value.left,Ne=z.value.right,Fe=z.value.top,Nt=z.value.bottom,zt=z.value.width,rn=z.value.height;let Cl,cn;switch(Ie){case"center":Cl=Le+(zt-ve)/2,cn=Fe+(rn-Ge)/2;break;case"top-left":Cl=Le+15,cn=Fe+5;break;case"top-right":Cl=Ne-ve-5,cn=Fe+5;break;case"bottom-left":Cl=Le+15,cn=Nt-Ge-5;break;case"bottom-right":default:Cl=Ne-ve-5,cn=Nt-Ge-5;break}Ve=`
59
- <g opacity="${Dl.value}">
57
+ ${ct.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,G+=25),He.value&&q.series.length>0){let ve=r-200,Ge=Je.value||ct.value?35:25;const Ie=Math.floor((r-250)/120);let Le=0;q.series.forEach((Ne,Fe)=>{if(!ne.value.has(Fe)){const Bt=el(Fe),zt=Ne.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");D+=`<circle cx="${ve+6}" cy="${Ge-4}" r="6" fill="${Bt}"/>`,D+=`<text x="${ve+18}" y="${Ge}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Le++,Le%Ie===0?(ve=r-200,Ge+=20):ve+=Math.min(120,zt.length*8+35)}})}let Ve="";if(en.value)try{const{width:ve,height:Ge}=wl.value,Ie=Yl.value,Le=z.value.left,Ne=z.value.right,Fe=z.value.top,Bt=z.value.bottom,zt=z.value.width,rn=z.value.height;let Cl,cn;switch(Ie){case"center":Cl=Le+(zt-ve)/2,cn=Fe+(rn-Ge)/2;break;case"top-left":Cl=Le+15,cn=Fe+5;break;case"top-right":Cl=Ne-ve-5,cn=Fe+5;break;case"bottom-left":Cl=Le+15,cn=Bt-Ge-5;break;case"bottom-right":default:Cl=Ne-ve-5,cn=Bt-Ge-5;break}Ve=`
59
+ <g opacity="${Ll.value}">
60
60
  <g transform="translate(${Cl}, ${cn}) 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"/>
@@ -89,20 +89,20 @@
89
89
  ${I}
90
90
  ${Ve}
91
91
  </g>
92
- </svg>`,fe=new Blob([qe],{type:"image/svg+xml;charset=utf-8"}),we=URL.createObjectURL(fe),Ee=document.createElement("a");Ee.href=we,Ee.download=fn("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(we),Xl(t),bn()}catch(a){console.error("Error downloading SVG:",a),Xl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},ea=async()=>{try{const t=Mn();O.value&&O.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const a=Be(),l=Pe.value,r=Qe.value+a.height,p=document.createElement("canvas"),h=p.getContext("2d"),E=2;p.width=l*E,p.height=r*E,p.style.width=l+"px",p.style.height=r+"px",h.scale(E,E),h.fillStyle="#fafafa",h.fillRect(0,0,l,r);let S=30;if(Je.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Je.value,24,S),S+=30),ut.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText(ut.value,24,S),S+=25),He.value&&q.series.length>0){let ve=l-200,Ge=Je.value||ut.value?35:25;const Ie=Math.floor((l-250)/120);let Le=0;h.font="12px Arial, sans-serif",q.series.forEach((Ne,Fe)=>{if(!ne.value.has(Fe)){const Nt=el(Fe);h.beginPath(),h.arc(ve+6,Ge-4,6,0,2*Math.PI),h.fillStyle=Nt,h.fill(),h.fillStyle="#333",h.fillText(Ne.name,ve+18,Ge),Le++,Le%Ie===0?(ve=l-200,Ge+=20):ve+=Math.min(120,Ne.name.length*8+35)}})}const L=te.value.cloneNode(!0),I=L.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),D=L.querySelectorAll(".dss-crosshair"),G=L.querySelectorAll('[class*="tooltip"]');I.forEach(ve=>ve.remove()),D.forEach(ve=>ve.remove()),G.forEach(ve=>ve.remove()),L.querySelectorAll("image").forEach((ve,Ge)=>{const Ie=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ie&&!Ie.startsWith("data:")){const Le=Pa.value[Ge],Ne=Le?el(Le.seriesIndex):"#3B82F6",Fe=ve.getAttribute("x")||0,Nt=ve.getAttribute("y")||0,zt=ve.getAttribute("width")||32,rn=ve.getAttribute("height")||32,Cl=document.createElementNS("http://www.w3.org/2000/svg","circle");Cl.setAttribute("cx",parseFloat(Fe)+parseFloat(zt)/2),Cl.setAttribute("cy",parseFloat(Nt)+parseFloat(rn)/2),Cl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(rn))/2-1),Cl.setAttribute("fill",Ne),Cl.setAttribute("stroke","#fafafa"),Cl.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(Cl,ve)}});const qe=new XMLSerializer().serializeToString(L),fe=new Blob([qe],{type:"image/svg+xml;charset=utf-8"}),we=URL.createObjectURL(fe),Ee=new Image;return new Promise((ve,Ge)=>{Ee.onload=async()=>{try{if(h.drawImage(Ee,0,a.height),Pa.value.forEach(Ie=>{const Le=Ie.x,Ne=Ie.y+a.height,Fe=(Ie.width||32)/2,Nt=el(Ie.seriesIndex);h.save(),h.beginPath(),h.arc(Le,Ne,Fe-1,0,2*Math.PI),h.fillStyle=Nt,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),en.value){const Ie=new Image,Le=()=>{const{width:Fe,height:Nt}=wl.value,zt=Yl.value,rn=z.value.left,Cl=z.value.right,cn=z.value.top,qa=z.value.bottom,xs=z.value.width,Es=z.value.height;let ma,pa;switch(zt){case"center":ma=rn+(xs-Fe)/2,pa=cn+a.height+(Es-Nt)/2;break;case"top-left":ma=rn+15,pa=cn+a.height+10;break;case"top-right":ma=Cl-Fe-5,pa=cn+a.height+10;break;case"bottom-left":ma=rn+15,pa=qa+a.height-Nt-5;break;case"bottom-right":default:ma=Cl-Fe-5,pa=qa+a.height-Nt-5;break}h.globalAlpha=Dl.value,h.drawImage(Ie,ma,pa,Fe,Nt),h.globalAlpha=1,Ne()},Ne=()=>{p.toBlob(Fe=>{const Nt=URL.createObjectURL(Fe),zt=document.createElement("a");zt.href=Nt,zt.download=fn("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(Nt),URL.revokeObjectURL(we),Xl(t),bn(),ve()},"image/png")};Ie.onload=Le,Ie.onerror=Ne,Ie.src=Nn.value}else p.toBlob(Ie=>{const Le=URL.createObjectURL(Ie),Ne=document.createElement("a");Ne.href=Le,Ne.download=fn("png"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(Le),URL.revokeObjectURL(we),Xl(t),bn(),ve()},"image/png")}catch(Ie){URL.revokeObjectURL(we),Xl(t),Ge(Ie)}},Ee.onerror=()=>{URL.revokeObjectURL(we),Xl(t),Ge(new Error("Failed to load SVG image"))},Ee.src=we})}catch(t){console.error("Error downloading PNG:",t)}},Aa=()=>{try{let t="";if(Je.value&&(t+=`# ${N("chart.csv.chartTitle")}: ${Je.value}
93
- `),ut.value&&(t+=`# ${N("chart.csv.chartSubtitle")}: ${ut.value}
92
+ </svg>`,fe=new Blob([qe],{type:"image/svg+xml;charset=utf-8"}),we=URL.createObjectURL(fe),Ee=document.createElement("a");Ee.href=we,Ee.download=fn("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(we),Xl(t),bn()}catch(a){console.error("Error downloading SVG:",a),Xl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},ea=async()=>{try{const t=Mn();O.value&&O.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const a=Be(),l=ze.value,r=Qe.value+a.height,p=document.createElement("canvas"),h=p.getContext("2d"),E=2;p.width=l*E,p.height=r*E,p.style.width=l+"px",p.style.height=r+"px",h.scale(E,E),h.fillStyle="#fafafa",h.fillRect(0,0,l,r);let S=30;if(Je.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Je.value,24,S),S+=30),ct.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText(ct.value,24,S),S+=25),He.value&&q.series.length>0){let ve=l-200,Ge=Je.value||ct.value?35:25;const Ie=Math.floor((l-250)/120);let Le=0;h.font="12px Arial, sans-serif",q.series.forEach((Ne,Fe)=>{if(!ne.value.has(Fe)){const Bt=el(Fe);h.beginPath(),h.arc(ve+6,Ge-4,6,0,2*Math.PI),h.fillStyle=Bt,h.fill(),h.fillStyle="#333",h.fillText(Ne.name,ve+18,Ge),Le++,Le%Ie===0?(ve=l-200,Ge+=20):ve+=Math.min(120,Ne.name.length*8+35)}})}const L=te.value.cloneNode(!0),I=L.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),D=L.querySelectorAll(".dss-crosshair"),G=L.querySelectorAll('[class*="tooltip"]');I.forEach(ve=>ve.remove()),D.forEach(ve=>ve.remove()),G.forEach(ve=>ve.remove()),L.querySelectorAll("image").forEach((ve,Ge)=>{const Ie=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ie&&!Ie.startsWith("data:")){const Le=Pa.value[Ge],Ne=Le?el(Le.seriesIndex):"#3B82F6",Fe=ve.getAttribute("x")||0,Bt=ve.getAttribute("y")||0,zt=ve.getAttribute("width")||32,rn=ve.getAttribute("height")||32,Cl=document.createElementNS("http://www.w3.org/2000/svg","circle");Cl.setAttribute("cx",parseFloat(Fe)+parseFloat(zt)/2),Cl.setAttribute("cy",parseFloat(Bt)+parseFloat(rn)/2),Cl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(rn))/2-1),Cl.setAttribute("fill",Ne),Cl.setAttribute("stroke","#fafafa"),Cl.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(Cl,ve)}});const qe=new XMLSerializer().serializeToString(L),fe=new Blob([qe],{type:"image/svg+xml;charset=utf-8"}),we=URL.createObjectURL(fe),Ee=new Image;return new Promise((ve,Ge)=>{Ee.onload=async()=>{try{if(h.drawImage(Ee,0,a.height),Pa.value.forEach(Ie=>{const Le=Ie.x,Ne=Ie.y+a.height,Fe=(Ie.width||32)/2,Bt=el(Ie.seriesIndex);h.save(),h.beginPath(),h.arc(Le,Ne,Fe-1,0,2*Math.PI),h.fillStyle=Bt,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),en.value){const Ie=new Image,Le=()=>{const{width:Fe,height:Bt}=wl.value,zt=Yl.value,rn=z.value.left,Cl=z.value.right,cn=z.value.top,qa=z.value.bottom,Es=z.value.width,Ss=z.value.height;let ma,pa;switch(zt){case"center":ma=rn+(Es-Fe)/2,pa=cn+a.height+(Ss-Bt)/2;break;case"top-left":ma=rn+15,pa=cn+a.height+10;break;case"top-right":ma=Cl-Fe-5,pa=cn+a.height+10;break;case"bottom-left":ma=rn+15,pa=qa+a.height-Bt-5;break;case"bottom-right":default:ma=Cl-Fe-5,pa=qa+a.height-Bt-5;break}h.globalAlpha=Ll.value,h.drawImage(Ie,ma,pa,Fe,Bt),h.globalAlpha=1,Ne()},Ne=()=>{p.toBlob(Fe=>{const Bt=URL.createObjectURL(Fe),zt=document.createElement("a");zt.href=Bt,zt.download=fn("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(Bt),URL.revokeObjectURL(we),Xl(t),bn(),ve()},"image/png")};Ie.onload=Le,Ie.onerror=Ne,Ie.src=Nn.value}else p.toBlob(Ie=>{const Le=URL.createObjectURL(Ie),Ne=document.createElement("a");Ne.href=Le,Ne.download=fn("png"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(Le),URL.revokeObjectURL(we),Xl(t),bn(),ve()},"image/png")}catch(Ie){URL.revokeObjectURL(we),Xl(t),Ge(Ie)}},Ee.onerror=()=>{URL.revokeObjectURL(we),Xl(t),Ge(new Error("Failed to load SVG image"))},Ee.src=we})}catch(t){console.error("Error downloading PNG:",t)}},Aa=()=>{try{let t="";if(Je.value&&(t+=`# ${N("chart.csv.chartTitle")}: ${Je.value}
93
+ `),ct.value&&(t+=`# ${N("chart.csv.chartSubtitle")}: ${ct.value}
94
94
  `),t+=`# ${N("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,gl.value){t+=`Category,Segment,Value
97
97
  `,jl.value.forEach(W=>{W.segments.forEach(L=>{const I=String(W.label||"").replace(/"/g,'""'),D=String(L.label||"").replace(/"/g,'""');t+=`"${I}","${D}",${L.value}
98
98
  `})});const h=new Blob([t],{type:"text/csv;charset=utf-8;"}),E=URL.createObjectURL(h),S=document.createElement("a");S.href=E,S.download=fn("csv"),document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(E),bn();return}t+="Category",q.series.forEach(h=>{const E=h.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
99
99
  `;const a=Math.max(...q.series.map(h=>h.data?.length||0));for(let h=0;h<a;h++){let W='"'+(q.categories[h]||N("chart.fallback.item",{number:h+1})).toString().replace(/"/g,'""')+'"';q.series.forEach(L=>{const I=L.data&&L.data[h]!==void 0?L.data[h]:"";W+=","+I}),t+=W+`
100
- `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),p=document.createElement("a");p.href=r,p.download=fn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),bn()}catch(t){console.error("Error downloading CSV:",t)}},ta=t=>{if(typeof t.action=="function"){const a={series:q.series,categories:q.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(a,l)}bn()},Ha=()=>{an(),ze.value.show=!0,ze.value.categoryIndex=mt.value.categoryIndex,ze.value.fromButton=!1,bn()},no=()=>{an(),ze.value.show=!0,ze.value.categoryIndex=0,ze.value.fromButton=!0},Ra=t=>{if(mt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(mt.value.show=!1)}},Yn=t=>{mt.value.show&&!t.target.closest(".context-menu")&&(mt.value.show=!1)},sa=t=>{if(!Nl.value||!ae.value||gl.value)return;t.preventDefault(),t.stopPropagation(),de.value.isZooming=!0,$e.value.show=!1,de.value.zoomTimeout&&clearTimeout(de.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top;if(r<z.value.left-50||r>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){de.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,E=Math.max(de.value.minScale,Math.min(de.value.maxScale,de.value.scale*h));if(E!==de.value.scale){const{minX:S,maxX:W}=jt.value,L=W-S||1,I=L/de.value.scale,D=S-de.value.offsetX/z.value.width*L,G=(r-z.value.left)/z.value.width,Ve=D+G*I;de.value.scale=E;const qe=L/de.value.scale,fe=Ve-G*qe;de.value.offsetX=-(fe-S)/L*z.value.width,de.value.scale<=1.01&&(de.value.scale=1,de.value.offsetX=0)}de.value.zoomTimeout=setTimeout(()=>{de.value.isZooming=!1,de.value.zoomTimeout=null},300)},Ca=t=>{if(!Nl.value||!ae.value||de.value.scale<=1)return;$e.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,de.value.isDragging=!0,de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY,t.preventDefault()},ao=()=>{de.value.isDragging=!1},ra=()=>{!Nl.value||!ae.value||(de.value.scale=1,de.value.offsetX=0,de.value.isDragging=!1,de.value.zoomTimeout&&(clearTimeout(de.value.zoomTimeout),de.value.zoomTimeout=null),de.value.isZooming=!1)},ba=()=>!Nl.value||!vt.value||!ae.value?"default":de.value.isDragging?"grabbing":de.value.scale>1?"grab":"dss-crosshair",ia=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 l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],p=t[l],h=t[l+1],E=t[Math.min(l+2,t.length-1)],S=p.x+(h.x-r.x)/6*V.value,W=p.y+(h.y-r.y)/6*V.value,L=h.x-(E.x-p.x)/6*V.value,I=h.y-(E.y-p.y)/6*V.value;a+=` C ${S} ${W} ${L} ${I} ${h.x} ${h.y}`}return a},zl=e.computed(()=>{const a=Z.value?.chart?.padding,l=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let h=p+(gt.value?30:0)+60;if(hl.value){const D={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??D.left,top:r.top??D.top,right:r.right??D.right,bottom:r.bottom??D.bottom}:D}if(Xt.value){const D=!He.value,G=Cn.value,Ve=G?fl.value+In.value+Math.max(24,tn.value+16):0,qe=D?12:p;let fe=0;Je.value&&(fe+=D?8:15),ut.value&&(fe+=D?6:10);const we=Be();let Ee=qe+(D?4:16)+(G?Ve:0),ve=qe+(G?Ve:0);He.value&&nt.value==="left"?Ee+=we.legendWidth||150:He.value&&nt.value==="right"&&(ve+=we.legendWidth||150);const Ie=Ce.value==="semi-radial"?G?Ve:8:G?Ve:D?8:p+80,Le=G?14:0,Ne=qe+fe+Le,Fe={left:Ee,top:Ne,right:ve,bottom:Ie};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Fe.left,top:r.top??Fe.top,right:r.right??Fe.right,bottom:r.bottom??Fe.bottom}:Fe}let E=0;Je.value&&(E+=15),ut.value&&(E+=10);const S=Be();let W=p+16+(dt.value?30:0),L=p+(wt.value?30:0);He.value&&nt.value==="left"?W+=S.legendWidth||150:He.value&&nt.value==="right"&&(L+=S.legendWidth||150),jn.value&&(L+=44),Ce.value==="stepbar"&&(h=Tl.value+8);const I={left:W,top:p+E,right:L,bottom:h};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??I.left,top:r.top??I.top,right:r.right??I.right,bottom:r.bottom??I.bottom}:I}),z=e.computed(()=>({left:zl.value.left,top:zl.value.top,right:Pe.value-zl.value.right,bottom:Qe.value-zl.value.bottom,width:Pe.value-(zl.value.left+zl.value.right),height:Qe.value-(zl.value.top+zl.value.bottom)})),Nl=e.computed(()=>["line","area","bar","stepbar"].includes(Ce.value)||ht.value),on=e.computed(()=>ht.value),xn=e.computed(()=>Ce.value==="mini-radial"),Xt=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Ce.value)),hl=e.computed(()=>Ce.value==="spider"),ll=e.computed(()=>Ce.value==="bubble"),gl=e.computed(()=>Ce.value==="stepbar");e.watch([A,gl,()=>q.series],()=>{e.nextTick(rt)},{deep:!0});const ml=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(Ce.value==="bar"||on.value)),$n=t=>{const{minY:a,maxY:l}=jt.value,r=l-a||1;return z.value.left+(t-a)/r*z.value.width},hn=t=>{const{maxX:a}=jt.value,l=a+1,p=z.value.height/l;return z.value.top+(t+.5)*p},ft=e.computed(()=>Xt.value?zl.value.left+(Pe.value-zl.value.left-zl.value.right)/2:Pe.value/2),Rt=e.computed(()=>hl.value?Qe.value/2-40:Xt.value?zl.value.top+(Qe.value-zl.value.top-zl.value.bottom)/2:Qe.value/2),ct=e.computed(()=>{if(hl.value){const t=z.value.width-80,a=z.value.height-80;return Math.min(t,a)/2}return Math.min(z.value.width,z.value.height)/2}),nl=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof a=="number"&&a>=0&&a<=1?a:.45;return ct.value*l}),oo=e.computed(()=>{const t=Z.value,a=typeof q.innerSize=="number"?q.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Xt.value||hl.value)?1:1+a/100}),wa=e.computed(()=>{const t=oo.value;if(t===1||t<=0)return;const a=ft.value,l=Rt.value;return`translate(${a}, ${l}) scale(${t}) translate(${-a}, ${-l})`}),Xn=e.ref(0),o=e.computed(()=>`semi-radial-fill-clip-${q.chartId}`),n=e.computed(()=>Ce.value==="semi-radial"),s=e.computed(()=>n.value&&bl.value&&!qn.value),i=e.computed(()=>n.value&&bl.value&&!qn.value&&yn.value==="fill"),c=e.computed(()=>{const t=s.value?Xn.value:1,a=ft.value,l=Rt.value,r=nl.value,p=ct.value,h=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;const S=a+p*Math.cos(h),W=l+p*Math.sin(h),L=a+p*Math.cos(E),I=l+p*Math.sin(E),D=a+r*Math.cos(E),G=l+r*Math.sin(E),Ve=a+r*Math.cos(h),qe=l+r*Math.sin(h),fe=t>.5?1:0;return`M ${a} ${l} L ${S} ${W} A ${p} ${p} 0 ${fe} 1 ${L} ${I} L ${D} ${G} A ${r} ${r} 0 ${fe} 1 ${Ve} ${qe} Z`}),m=e.computed(()=>{if(!(!n.value||!s.value)&&!i.value)return`url(#${o.value})`}),u=t=>{if(!(!i.value||t!==0))return`url(#${o.value})`},f=e.ref(0),y=e.computed(()=>`radial-reveal-clip-${q.chartId}`),C=e.computed(()=>Ce.value==="radial"),F=e.computed(()=>{const t=C.value?f.value:1,a=ft.value,l=Rt.value,r=Math.max(ct.value*1.5,Pe.value,Qe.value);if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;if(t>=1){const D=a-r,G=a+r;return`M ${D} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${D} ${l} Z`}const p=-Math.PI/2,h=p+t*Math.PI*2,E=a+r*Math.cos(p),S=l+r*Math.sin(p),W=a+r*Math.cos(h),L=l+r*Math.sin(h),I=t>=.5?1:0;return`M ${a} ${l} L ${E} ${S} A ${r} ${r} 0 ${I} 1 ${W} ${L} Z`}),P=e.computed(()=>{if(m.value)return m.value;if(C.value)return`url(#${y.value})`});let _=null;const me=()=>{if(!s.value)return;Xn.value=0;const t=dn.value,a=performance.now(),l=r=>{const p=r-a,h=Math.min(1,p/t);Xn.value=fo(Hn.value,h),h<1&&(_=requestAnimationFrame(l))};_=requestAnimationFrame(l)},le=e.computed(()=>Z.value?.bubbles?.minSize||8),We=e.computed(()=>Z.value?.bubbles?.maxSize||50),_e=e.computed(()=>Z.value?.bubbles?.opacity||.7),pt=(t,a)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},xl=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},yl=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Lt=e.computed(()=>q.series),It=e.computed(()=>q.series.filter((t,a)=>!ne.value.has(a))),cl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},al=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,pl=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,sn=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}}),Dn=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?sn.value.bubbleSize:Ke.value,xa=(t,a)=>pl(t)&&sn.value.usePrimaryColor?el(0):el(a),On=(t,a)=>hl.value&&pl(t)?xa(t,a):el(a),Fa=e.computed(()=>It.value.filter(t=>cl(t)==="primary")),Ea=e.computed(()=>It.value.filter(t=>cl(t)==="secondary")),jn=e.computed(()=>!ml.value&&!!Gt.value&&Ea.value.length>0),Sa=(t,a=0)=>{const l=Number(t);return Number.isFinite(l)?l:a},ca=(t,a,l)=>{if(!Array.isArray(t))return[];const r=t.map((p,h)=>{const E=p&&typeof p=="object"&&!Array.isArray(p),S=Sa(E?p.value:p,0);return S<=0?null:{key:`${l}-${h}-${E&&p.label||h}`,label:E?p.label||a?.name||`Segment ${h+1}`:a?.name||`Segment ${h+1}`,value:S,color:E?p.color||el(h):el(l),marker:E?p.marker:null,isRemainder:!1}}).filter(Boolean);return Oe.value==="asc"?r.sort((p,h)=>p.value-h.value):Oe.value==="desc"?r.sort((p,h)=>h.value-p.value):r},Ia=(t,a,l,r)=>{const p=t&&typeof t=="object"&&!Array.isArray(t),h=p?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:el(r)}],E=ca(h,l,r),S=E.reduce((D,G)=>D+G.value,0),W=Sa(p?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,kt.value),L=Math.max(W,S,1);st.value&&L>S&&E.push({key:`${r}-${a}-remainder`,label:Xe.value,value:L-S,color:xt.value,marker:null,isRemainder:!0});const I=E.filter(D=>!D.isRemainder).reduce((D,G)=>!D||G.value>D.value?G:D,null);return{key:`${r}-${a}`,label:p?t.label||t.name||q.categories?.[a]||N("chart.fallback.item",{number:a+1}):q.categories?.[a]||N("chart.fallback.item",{number:a+1}),axisLabel:p?t.xLabel??t.label??t.name??q.categories?.[a]??N("chart.fallback.item",{number:a+1}):q.categories?.[a]||N("chart.fallback.item",{number:a+1}),yLabel:p?t.yLabel??null:null,totalValue:L,usedValue:S,segments:E,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},jl=e.computed(()=>{if(!gl.value)return[];const t=[];return Lt.value.forEach((a,l)=>{ne.value.has(l)||!Array.isArray(a?.data)||a.data.forEach(r=>{const p=Ia(r,t.length,a,l);p.segments.length>0&&t.push(p)})}),t}),ol="auto",Kl=(t,a,l,r=0,p=100)=>{let h=1/0,E=-1/0;if(t.forEach(L=>{L?.data?.length&&L.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(h=Math.min(h,I),E=Math.max(E,I))})}),h===1/0)return{minY:r,maxY:p};let S;if(a===ol){const L=E-h,I=L>0?L*.1:1;S=Math.max(0,h-I)}else if(typeof a=="number")S=a;else{const L=E-h,I=L>0?L*.1:1;S=Math.max(0,h-I)}let W;if(l===ol){const L=E-h,I=L>0?L*.1:2;W=E+I}else if(typeof l=="number")W=l;else{const L=E-h,I=L>0?L*.1:2;W=E+I}return{minY:S,maxY:W}},jt=e.computed(()=>{if(ll.value)return Zo();if(gl.value)return qo();if(!It.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;It.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),q.categories.length>0&&(t=Math.max(t,q.categories.length-1));const a=Kl(Fa.value.length?Fa.value:It.value,Vt.value,ue.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),qo=()=>{const t=jl.value,a=t.reduce((h,E)=>Math.max(h,E.totalValue),kt.value),l=typeof Vt.value=="number"?Vt.value:0,r=typeof ue.value=="number"?ue.value:a,p=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:p}},ko=e.computed(()=>jn.value?Kl(Ea.value,R.value,Y.value,jt.value.minY,jt.value.maxY):{minY:jt.value.minY,maxY:jt.value.maxY}),Zo=()=>{if(!It.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,l=1/0,r=-1/0,p=1/0,h=-1/0,E=!1;if(It.value.forEach((Ve,qe)=>{Ve?.data?.length&&Ve.data.forEach((fe,we)=>{let Ee,ve,Ge;if(typeof fe=="object"&&fe!==null&&!Array.isArray(fe))Ee=typeof fe.x=="number"?fe.x:we,ve=typeof fe.y=="number"?fe.y:0,Ge=typeof fe.size=="number"?fe.size:20;else if(Array.isArray(fe)&&fe.length>=3)Ee=typeof fe[0]=="number"?fe[0]:we,ve=typeof fe[1]=="number"?fe[1]:0,Ge=typeof fe[2]=="number"?fe[2]:20;else if(typeof fe=="number")Ee=we,ve=fe,Ge=pt(qe,we);else return;isFinite(Ee)&&isFinite(ve)&&isFinite(Ge)&&(t=Math.min(t,Ee),a=Math.max(a,Ee),l=Math.min(l,ve),r=Math.max(r,ve),p=Math.min(p,Ge),h=Math.max(h,Ge),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,q.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const S=a-t,W=r-l;let L,I,D,G;return ie.value!==null?L=ie.value:L=t-S*.1,be.value!==null?I=be.value:I=a+S*.1,Vt.value!==null&&typeof Vt.value=="number"?D=Vt.value:D=Math.max(0,l-W*.1),ue.value!==null&&typeof ue.value=="number"?G=ue.value:G=r+W*.1,{minX:L,maxX:I,minY:D,maxY:G,minSize:p,maxSize:h}},kl=t=>{if(ll.value){const{minX:S,maxX:W}=jt.value,L=W-S||1;return z.value.left+(t-S)/L*z.value.width}const{minX:a,maxX:l}=jt.value,r=l-a;if(l===0||r===0)return z.value.left+z.value.width/2;const p=r/de.value.scale,h=a-de.value.offsetX/z.value.width*r,E=(t-h)/p;return z.value.left+E*z.value.width},Kn=t=>{const{minY:a,maxY:l}=jt.value,r=l-a||1;return z.value.bottom-(t-a)/r*z.value.height},Co=t=>{const{minY:a,maxY:l}=ko.value,r=l-a||1;return z.value.bottom-(t-a)/r*z.value.height},En=(t,a)=>jn.value&&cl(t)==="secondary"?Co(a):Kn(a),Uo=t=>{if(!ll.value)return Ke.value||4;const{maxSize:a}=jt.value,l=Math.max(1,a),r=Math.min(1,Math.max(0,t/l));return le.value+r*(We.value-le.value)},ua=(t,a=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);ua.canvas||(ua.canvas=document.createElement("canvas"));const r=ua.canvas.getContext("2d");return r?(r.font=`${a}px ${l}`,r.measureText(t).width):t.length*(a*.62)},bo=(t,a,l=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||ua(t,l)<=a)return t;const r="..";if(ua(r,l)>=a)return r;let h=t.length;for(;h>0;){const E=`${t.slice(0,h)}${r}`;if(ua(E,l)<=a)return E;h-=1}return r},Yo=e.computed(()=>ro.value.map(t=>({y:t.y}))),wo=e.computed(()=>!gl.value||!St.value?[]:ro.value.map(t=>({y:t.y}))),so=e.computed(()=>{if(ll.value)return Xo();if(gl.value)return[];if(Ce.value==="bar"){if(ml.value){const Ne=[],{minY:Fe,maxY:Nt}=jt.value,zt=5,rn=Nt-Fe||1;for(let Cl=0;Cl<=zt;Cl++){const cn=Fe+rn*(Cl/zt),qa=$n(cn);Ne.push({x:qa,y:z.value.bottom+20,text:Zt(Math.round(cn))})}return Ne}const we=[],{maxX:Ee}=jt.value,ve=Ee+1,Ge=5,Le=(z.value.width-Ge*2)/ve;for(let Ne=0;Ne<=Ee;Ne++){const Fe=z.value.left+Ge+(Ne+.5)*Le;we.push({x:Fe,y:z.value.bottom+20,text:bo(q.categories[Ne]||N("chart.fallback.item",{number:Ne+1}),Math.max(Le-8,24))})}return we}const t=[],{minX:a,maxX:l}=jt.value,r=ie.value!==null?ie.value:a,p=be.value!==null?be.value:l,h=p-r||1,E=h/de.value.scale,S=r-de.value.offsetX/z.value.width*h,W=S+E,L=Math.max(0,Math.floor(S-2)),I=Math.min(p,Math.ceil(W+2)),D=I-L,G=z.value.width,qe=Math.floor(G/60);let fe=1;D>qe&&(fe=Math.ceil(D/qe));for(let we=L;we<=I;we+=fe)if(we>=0&&we<=p){const Ee=kl(we);Ee>=z.value.left-100&&Ee<=z.value.right+100&&t.push({x:Ee,y:z.value.bottom+20,text:q.categories[we]||`Item ${we+1}`})}return t}),Xo=()=>{const t=[],{minX:a,maxX:l}=jt.value,r=l-a||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let h=0;h<=p;h++){const E=a+r*h/p,S=kl(E);if(S>=z.value.left-10&&S<=z.value.right+10){const W=Math.round(E),L=q.categories?.[W];t.push({x:S,y:z.value.bottom+20,text:L||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},ro=e.computed(()=>{if(ml.value){const p=[],{maxX:h}=jt.value;for(let E=0;E<=h;E++)p.push({x:z.value.left-10,y:hn(E),text:bo(q.categories[E]||`Item ${E+1}`,Math.max(z.value.left-28,40))});return p}const t=[],{minY:a,maxY:l}=jt.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:z.value.left-10,y:Kn(h),text:Zt(E)})}return t}),jo=e.computed(()=>{if(!jn.value||ml.value)return[];const t=[],{minY:a,maxY:l}=ko.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:z.value.right+10,y:Co(h),text:Zt(E)})}return t}),el=t=>{const a=ce.value;if(!a||a.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return a[t%a.length]},Ko=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let l=0,r=0,p=0;const h=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(h)l=Number(h[1])/255,r=Number(h[2])/255,p=Number(h[3])/255;else{const S=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,p=Number(S[3])/255;else{const W=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let L=W[1];L.length===3&&(L=L[0]+L[0]+L[1]+L[1]+L[2]+L[2]),l=parseInt(L.slice(0,2),16)/255,r=parseInt(L.slice(2,4),16)/255,p=parseInt(L.slice(4,6),16)/255}else if(typeof document<"u"){const L=document.createElement("span");L.style.color=a,L.style.display="none",document.body.appendChild(L);const I=getComputedStyle(L).color;document.body.removeChild(L);const D=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(D)l=Number(D[1])/255,r=Number(D[2])/255,p=Number(D[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},io=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),l=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const h=Math.max(0,Math.floor(Number(l[1])*.65)),E=Math.max(0,Math.floor(Number(l[2])*.65)),S=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${h}, ${E}, ${S})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const h=Math.max(0,Math.floor(Number(r[1])*.65)),E=Math.max(0,Math.floor(Number(r[2])*.65)),S=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${h}, ${E}, ${S}, ${r[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let h=p[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),W=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[E,S,W].map(L=>L.toString(16).padStart(2,"0")).join("")}`}return a},co=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?io(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??io(a):io(a)},uo=t=>{let a=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;a+=Math.sqrt(r*r+p*p)}return a},xo=e.computed(()=>Ce.value==="line"||on.value?(on.value?q.series.filter(a=>(a.type||Ce.value)==="line"):Lt.value).map((a,l)=>{const r=q.series.findIndex(D=>D===a),p=[];let h=[];a.data.forEach((D,G)=>{D==null?h.length>0&&(p.push([...h]),h=[]):h.push({x:ml.value?$n(D):kl(G),y:ml.value?hn(G):En(a,D),index:G})}),h.length>0&&p.push(h);let E="";p.forEach(D=>{if(D.length>0){let G="";M.value?G=ia(D):G=`M ${D[0].x} ${D[0].y}`+D.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),E+=(E?" ":"")+G}});const S=p.reduce((D,G)=>D+uo(G),0),W=ne.value.has(r),L=K.value===r,I=K.value!==null&&K.value!==r;return{path:E,color:el(r),strokeDasharray:al(a),pathLength:S,seriesIndex:r,animationDelay:l*_l.value,isHighlighted:L,isDimmed:I,isHidden:W}}):[]),Eo=e.computed(()=>{if(!(Ce.value==="line"||on.value))return[];const t=on.value?q.series.filter(l=>(l.type||Ce.value)==="line"):Lt.value,a=[];return t.forEach((l,r)=>{const p=q.series.findIndex(h=>h===l);for(let h=0;h<l.data.length-1;h++){const E=l.data[h];if(E!=null){let S=-1,W=0;for(let L=h+1;L<l.data.length;L++){const I=l.data[L];if(I==null)W++;else{S=L;break}}if(W>0&&S!==-1){const L=l.data[S],I=ml.value?$n(E):kl(h),D=ml.value?hn(h):En(l,E),G=ml.value?$n(L):kl(S),Ve=ml.value?hn(S):En(l,L),qe=ne.value.has(p),fe=K.value===p,we=K.value!==null&&K.value!==p;a.push({path:`M ${I} ${D} L ${G} ${Ve}`,color:el(p),seriesIndex:p,animationDelay:r*_l.value,isHighlighted:fe,isDimmed:we,isHidden:qe,gapSize:W}),h=S-1}}}}),a}),Go=e.computed(()=>Ce.value==="line"||on.value?!bl.value||qn.value||Ft.value.hasAnimated?[]:(on.value?q.series.filter(a=>(a.type||Ce.value)==="line"):Lt.value).map((a,l)=>{const r=q.series.findIndex(W=>W===a);let p="",h=null;a.data.forEach((W,L)=>{if(W!=null){const I={x:ml.value?$n(W):kl(L),y:ml.value?hn(L):En(a,W)};h===null?p+=`M ${I.x} ${I.y}`:p+=` L ${I.x} ${I.y}`,h=I}else if(h!==null){const I=a.data.findIndex((D,G)=>G>L&&D!==null&&D!==void 0);if(I!==-1){const D={x:ml.value?$n(a.data[I]):kl(I),y:ml.value?hn(I):En(a,a.data[I])};p+=` L ${D.x} ${D.y}`,h=D}}});const E=a.data.map((W,L)=>W==null?null:{x:ml.value?$n(W):kl(L),y:ml.value?hn(L):En(a,W)}).filter(W=>W!==null),S=uo(E);return{path:p,pathLength:S,color:el(r),strokeDasharray:al(a),animationDelay:l*_l.value,seriesIndex:r}}):[]),Qo=e.computed(()=>{if(Ce.value!=="line")return[];const t=[];return Lt.value.forEach((a,l)=>{const r=K.value===l,p=K.value!==null&&K.value!==l,h=ne.value.has(l);a.data.forEach((E,S)=>{E!=null&&t.push({x:kl(S),y:En(a,E),color:el(l),value:E,label:q.categories[S]||S.toString(),seriesName:a.name,categoryIndex:S,dataIndex:S,animationDelay:(l*a.data.length+S)*(_l.value/8),isHighlighted:r,isDimmed:p,isHidden:h})})}),t}),Jo=e.computed(()=>{if(!on.value)return[];const t=[];return q.series.filter(l=>(l.type||Ce.value)==="line").forEach((l,r)=>{const p=q.series.findIndex(W=>W===l),h=K.value===p,E=K.value!==null&&K.value!==p,S=ne.value.has(p);l.data.forEach((W,L)=>{W!=null&&t.push({x:kl(L),y:En(l,W),color:el(p),value:W,label:q.categories[L]||L.toString(),seriesName:l.name,categoryIndex:L,dataIndex:L,animationDelay:(r*l.data.length+L)*(_l.value/8),isHighlighted:h,isDimmed:E,isHidden:S})})}),t}),za=e.computed(()=>{if(!ll.value)return[];const t=[];return Lt.value.forEach((a,l)=>{if(!a?.data?.length)return;const r=K.value,p=r!==null&&r===l,h=r!==null&&r!==l,E=ne.value.has(l);a.data.forEach((S,W)=>{let L,I,D,G,Ve;if(typeof S=="object"&&S!==null&&!Array.isArray(S))L=typeof S.x=="number"?S.x:W,I=typeof S.y=="number"?S.y:0,D=typeof S.size=="number"?S.size:20,G=S.label||q.categories?.[W]||`Point ${W+1}`,Ve=S.image||S.imageUrl;else if(Array.isArray(S)&&S.length>=3)L=typeof S[0]=="number"?S[0]:W,I=typeof S[1]=="number"?S[1]:0,D=typeof S[2]=="number"?S[2]:20,G=S[3]||q.categories?.[W]||`Point ${W+1}`,Ve=S[4];else if(typeof S=="number")L=W,I=S,D=pt(l,W),G=q.categories?.[W]||`Point ${W+1}`;else return;!isFinite(L)||!isFinite(I)||!isFinite(D)||t.push({x:kl(L),y:Kn(I),radius:Uo(D),originalX:L,originalY:I,originalSize:D,color:el(l),seriesName:a.name||`Series ${l+1}`,label:G,imageUrl:Ve,seriesIndex:l,dataIndex:W,categoryIndex:Math.round(L),isHighlighted:p,isDimmed:h,isHidden:E,opacity:_e.value})})}),t}),mo=e.computed(()=>Ce.value!=="area"?[]:Lt.value.map((t,a)=>{const l=[];let r=[];if(t.data.forEach((D,G)=>{D==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:kl(G),y:En(t,D),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:el(a),isHidden:ne.value.has(a)};const p=z.value.bottom+1;let h="",E="";l.forEach((D,G)=>{if(D.length===0)return;let Ve=`M ${D[0].x} ${D[0].y}`;M.value&&D.length>1?Ve=ia(D):D.slice(1).forEach(fe=>{Ve+=` L ${fe.x} ${fe.y}`}),h+=(h?" ":"")+Ve;let qe=`M ${D[0].x} ${p}`;if(qe+=` L ${D[0].x} ${D[0].y}`,M.value&&D.length>1){const fe=ia(D),we=fe.substring(fe.indexOf("C")||fe.indexOf("Q")||fe.indexOf("L"));we?qe+=" "+we:D.slice(1).forEach(Ee=>{qe+=` L ${Ee.x} ${Ee.y}`})}else D.slice(1).forEach(fe=>{qe+=` L ${fe.x} ${fe.y}`});qe+=` L ${D[D.length-1].x} ${p} Z`,E+=(E?" ":"")+qe});const S=K.value===a,W=K.value!==null&&K.value!==a,L=ne.value.has(a),I=l.reduce((D,G)=>D+uo(G),0);return{linePath:h,areaPath:E,color:el(a),pathLength:I,isHighlighted:S,isDimmed:W,isHidden:L}})),So=e.computed(()=>{if(!(["bar"].includes(Ce.value)||on.value))return[];const t=[],{maxX:a}=jt.value,l=on.value?q.series.filter(p=>(p.type||Ce.value)==="bar"):Lt.value,r=l.length;if(ml.value){const p=a+1,E=z.value.height/p,S=E*(2/3),W=Math.min(4,S/r*.15),L=S-(r-1)*W,I=Math.max(4,L/r);l.forEach((D,G)=>{const Ve=q.series.findIndex(Ee=>Ee===D),qe=K.value===Ve,fe=K.value!==null&&K.value!==Ve,we=ne.value.has(Ve);D.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.top+(ve+.5)*E-S/2+G*(I+W),Ne=z.value.left,Fe=Math.abs($n(Ee)-z.value.left);let Nt="";if(M.value&&Fe>0){const zt=Math.min(T.value,I/2,Fe/2);Nt=[`M ${Ne} ${Le}`,`L ${Ne+Fe-zt} ${Le}`,`Q ${Ne+Fe} ${Le} ${Ne+Fe} ${Le+zt}`,`L ${Ne+Fe} ${Le+I-zt}`,`Q ${Ne+Fe} ${Le+I} ${Ne+Fe-zt} ${Le+I}`,`L ${Ne} ${Le+I}`,"Z"].join(" ")}t.push({x:Ne,y:Le,width:Fe,height:I,color:el(r===1?ve:Ve),value:Ee,label:q.categories[ve]||ve.toString(),seriesName:D.name,animationDelay:(G*l.length+ve)*(_l.value/4),isHighlighted:qe,isDimmed:fe,isHidden:we,barPath:Nt,isSmooth:M.value&&Fe>0})})})}else{const p=a+1,E=z.value.width/p,S=E*.8,W=S/r,L=W*.05,I=W-L;l.forEach((D,G)=>{const Ve=q.series.findIndex(Ee=>Ee===D),qe=K.value===Ve,fe=K.value!==null&&K.value!==Ve,we=ne.value.has(Ve);D.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.left+(ve+.5)*E-S/2+G*W+L/2,Ne=Kn(Math.max(0,Ee)),Fe=Math.abs(Kn(0)-Kn(Ee));let Nt="";if(M.value&&Fe>0){const zt=Math.min(T.value,I/2,Fe/2);Nt=[`M ${Le} ${Ne+Fe}`,`L ${Le} ${Ne+zt}`,`Q ${Le} ${Ne} ${Le+zt} ${Ne}`,`L ${Le+I-zt} ${Ne}`,`Q ${Le+I} ${Ne} ${Le+I} ${Ne+zt}`,`L ${Le+I} ${Ne+Fe}`,"Z"].join(" ")}t.push({x:Le,y:Ne,width:I,height:Fe,color:el(r===1?ve:Ve),value:Ee,label:q.categories[ve]||ve.toString(),seriesName:D.name,animationDelay:(G*l.length+ve)*(_l.value/4),isHighlighted:qe,isDimmed:fe,isHidden:we,barPath:Nt,isSmooth:M.value&&Fe>0})})})}return t}),Wn=e.computed(()=>{if(!Xt.value)return[];const t=Lt.value.map((E,S)=>({series:E,originalIndex:S})).filter(({originalIndex:E})=>!ne.value.has(E));if(t.length===0)return[];let a=Ce.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ce.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(E,S,W,L,I,D)=>{const G=E+(S-E)/2,Ve=S-E,qe=ft.value+Math.cos(E)*nl.value,fe=Rt.value+Math.sin(E)*nl.value,we=ft.value+Math.cos(S)*nl.value,Ee=Rt.value+Math.sin(S)*nl.value,ve=ft.value+Math.cos(S)*ct.value,Ge=Rt.value+Math.sin(S)*ct.value,Ie=ft.value+Math.cos(E)*ct.value,Le=Rt.value+Math.sin(E)*ct.value,Ne=Ve>Math.PI?1:0,Fe=[`M ${qe} ${fe}`,`A ${nl.value} ${nl.value} 0 ${Ne} 1 ${we} ${Ee}`,`L ${ve} ${Ge}`,`A ${ct.value} ${ct.value} 0 ${Ne} 0 ${Ie} ${Le}`,"Z"].join(" "),Nt=D||el(W);return{path:Fe,color:Nt,strokeWidth:Se.value,strokeColor:co(r.length,Nt),value:I,seriesName:L,opacity:.8,isHighlighted:K.value===W,isDimmed:K.value!==null&&K.value!==W,isHidden:!1,startAngle:E,endAngle:S,midAngle:G}};if(xn.value){const{series:E,originalIndex:S}=t[0],W=Number(E?.data?.[0]??0),L=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,I=Z.value,D=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Ve=(L<=0?D:L)/100*l,qe=Number(I?.miniRadial?.thresholds?.low??33),fe=Number(I?.miniRadial?.thresholds?.medium??66),we=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",ve=I?.miniRadial?.colors?.high||"#38A169",Ge=L<=qe?we:L<=fe?Ee:ve,Ie=I?.miniRadial?.trackColor||"#E5E7EB",Le=E?.name||"Score";return r.push(p(a,a+l-.001,S+1,"Track",100,Ie)),r.push(p(a,a+Ve,S,Le,L,Ge)),r}if(t.length===1){const{series:E,originalIndex:S}=t[0],W=E.data[0]||0,L=a,I=a+l-.001,D=L+l/2,G=ft.value+Math.cos(L)*nl.value,Ve=Rt.value+Math.sin(L)*nl.value,qe=ft.value+Math.cos(I)*nl.value,fe=Rt.value+Math.sin(I)*nl.value,we=ft.value+Math.cos(I)*ct.value,Ee=Rt.value+Math.sin(I)*ct.value,ve=ft.value+Math.cos(L)*ct.value,Ge=Rt.value+Math.sin(L)*ct.value,Ie=1,Le=[`M ${G} ${Ve}`,`A ${nl.value} ${nl.value} 0 ${Ie} 1 ${qe} ${fe}`,`L ${we} ${Ee}`,`A ${ct.value} ${ct.value} 0 ${Ie} 0 ${ve} ${Ge}`,"Z"].join(" "),Ne=el(S);return r.push({path:Le,color:Ne,strokeWidth:Se.value,strokeColor:co(0,Ne),value:W,seriesName:E.name,opacity:.8,isHighlighted:K.value===S,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:I,midAngle:D}),r}if(i.value&&t.length===2){const E=t[0],S=t[1],W=Math.min(100,Math.max(0,E.series.data[0]||0)),L=W/100*l;return r.push(p(a,a+L,E.originalIndex,E.series.name,W)),r.push(p(a,a+l,S.originalIndex,S.series.name,100)),r}const h=t.reduce((E,{series:S})=>E+(S.data[0]||0),0);return h===0?[]:(t.forEach(({series:E,originalIndex:S})=>{const W=E.data[0]||0,L=W/h*l,I=a,D=a+L,G=I+L/2,Ve=ft.value+Math.cos(I)*nl.value,qe=Rt.value+Math.sin(I)*nl.value,fe=ft.value+Math.cos(D)*nl.value,we=Rt.value+Math.sin(D)*nl.value,Ee=ft.value+Math.cos(D)*ct.value,ve=Rt.value+Math.sin(D)*ct.value,Ge=ft.value+Math.cos(I)*ct.value,Ie=Rt.value+Math.sin(I)*ct.value,Le=L>Math.PI?1:0,Ne=[`M ${Ve} ${qe}`,`A ${nl.value} ${nl.value} 0 ${Le} 1 ${fe} ${we}`,`L ${Ee} ${ve}`,`A ${ct.value} ${ct.value} 0 ${Le} 0 ${Ge} ${Ie}`,"Z"].join(" "),Fe=el(S);r.push({path:Ne,color:Fe,strokeWidth:Se.value,strokeColor:co(r.length,Fe),value:W,seriesName:E.name,opacity:.8,isHighlighted:K.value===S,isDimmed:K.value!==null&&K.value!==S,isHidden:!1,startAngle:I,endAngle:D,midAngle:G}),a=D}),r)}),es=e.computed(()=>{const t=Wn.value;return i.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,l)=>({segment:a,originalIndex:l}))}),ts=e.computed(()=>{if(!Cn.value||!Xt.value)return[];const t=tn.value,a=fl.value,l=In.value,r=ln.value,p=15,h=t*1.3,E=.55,S=(D,G)=>{const Ve=ft.value+Math.cos(D.midAngle)*ct.value,qe=Rt.value+Math.sin(D.midAngle)*ct.value,fe=ft.value+Math.cos(D.midAngle)*(ct.value+a),we=Rt.value+Math.sin(D.midAngle)*(ct.value+a),ve=fe+l*(G?1:-1),Ge=G?fe+p:fe-p,Ie=we-r,Le=`${D.seriesName}: ${Zt(D.value)}`,Ne=Le.length*t*E;return{pointerStartX:Ve,pointerStartY:qe,pointerEndX:fe,pointerEndY:we,horizontalEndX:ve,horizontalEndY:we,textX:Ge,textY:Ie,text:Le,textWidth:Ne,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(fe-Ve,we-qe),horizontalLineLength:Math.hypot(ve-fe,0)}},W=(D,G)=>{const Ve=Math.abs(D.textY-G.textY)<h,qe=D.isRightSide?D.textX:D.textX-D.textWidth,fe=D.isRightSide?D.textX+D.textWidth:D.textX,we=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,ve=qe<Ee&&we<fe;return Ve&&ve},L=Wn.value.filter(D=>!D.isHidden),I=[];for(let D=0;D<L.length;D++){const G=L[D];let Ve=Math.cos(G.midAngle)>=0;if(D>0){const fe=I[D-1],we=S(G,Ve);W(fe,we)&&(Ve=!Ve)}const qe=S(G,Ve);I.push({...qe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),ls=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||_e.value||.7;return K.value===null||K.value===void 0?a:K.value!==null?t.seriesIndex===K.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},ns=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return K.value!==null?t.seriesIndex===K.value?Math.min(1,a+.1):a*.7:a},Vo=(t,a)=>{if(t)try{if(K.value===t.seriesIndex?K.value=null:K.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:q.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},as=(t,a)=>{const l=[`dss-bubble-fallback-${a}`];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(" ")},No=(t,a)=>{if(!t||(a.stopPropagation(),Oa.value=!0,K.value=t.seriesIndex,$e.value.show=!1,!tt.value))return;const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let p=a.clientX-r.left+10,h=a.clientY-r.top-10;const E=200,S=120;p+E>Pe.value&&(p=a.clientX-r.left-E-10),h+S>r.height&&(h=a.clientY-r.top-S-10),p<0&&(p=10),h<0&&(h=10);const W=b.value,L=H.value,I=W.map(D=>{const G=L[D]||D,Ve=Bo(D,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ve}`,color:t.color}:null}).filter(Boolean);je.value={show:!0,x:p,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},Bo=(t,a)=>{let l;switch(t){case"x":l=a.originalX;break;case"y":l=a.originalY;break;case"size":l=a.originalSize;break;case"label":l=a.label;break;case"seriesName":l=a.seriesName;break;default:l=a[t]||""}const r=U.value[t];if(typeof r=="function")return r(l,a);if(typeof l=="number"){const p=l.toFixed(1);return vl.value?p+vl.value:p}return l?.toString()||""},os=()=>{if(!ll.value||!$e.value.data||$e.value.data.length===0)return"Bubbles";const t=[],a=new Set;return $e.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;a.has(r)||(t.push(r),a.add(r))}else l.seriesName&&(a.has(l.seriesName)||(t.push(l.seriesName),a.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_o=(t,a)=>{t&&(Oa.value=!1,K.value=null,je.value.show=!1,je.value.bubbleData=[])},ss=(t,a)=>{const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),p=eo(t.categoryIndex),h=t.description||t.comment||"";let E=a.clientX-r.left+15,S=a.clientY-r.top-10;const W=200,L=h?80:50;E+W>Pe.value&&(E=a.clientX-r.left-W-15),S+L>Qe.value&&(S=a.clientY-r.top-L-10),E<0&&(E=10),S<0&&(S=10),Ot.value={show:!0,x:E,y:S,categoryValue:p,description:h}},rs=()=>{Ot.value.show=!1},da=e.computed(()=>q.categories.length||Math.max(...It.value.map(t=>t.data.length))),is=e.computed(()=>{let t=0;return It.value.forEach(a=>{a.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Mo=e.computed(()=>{const t=[],a=da.value;for(let l=0;l<a;l++){const r=l*2*Math.PI/a-Math.PI/2,p=ft.value+Math.cos(r)*ct.value,h=Rt.value+Math.sin(r)*ct.value;t.push({x:p,y:h,angle:r,index:l})}return t}),cs=e.computed(()=>{const t=[],a=da.value;return Mo.value.forEach((l,r)=>{const p=ct.value+15,h=r*2*Math.PI/a-Math.PI/2,E=ft.value+Math.cos(h)*p,S=Rt.value+Math.sin(h)*p+5;let W="middle",L="middle";Math.abs(Math.cos(h))>.5&&(W=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(L=Math.sin(h)>0?"hanging":"auto"),t.push({x:E,y:S,text:q.categories[r]||`Axis ${r+1}`,anchor:W,baseline:L})}),t}),us=e.ref(new Set),ds=(t,a,l)=>{const r=`current-${l}`,p=us.value.has(r),h=a.fillOpacity??Rl.value;return!p&&K.value===null?h:a.isHighlighted||p?a.isComparison?h:h+.15:a.isDimmed?h*.3:h},$o=e.computed(()=>{if(!hl.value)return[];const t=[],a=da.value;return Lt.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const h=pl(r.series)?0:1,E=pl(p.series)?0:1;return h-E}).forEach(({series:r,seriesIndex:p})=>{const h=pl(r),E=[],S=[],W=[],L=K.value===p,I=K.value!==null&&K.value!==p,D=ne.value.has(p);for(let G=0;G<a;G++){const Ve=r.data[G]||0,fe=Ve/is.value*ct.value,we=G*2*Math.PI/a-Math.PI/2,Ee=ft.value+Math.cos(we)*fe,ve=Rt.value+Math.sin(we)*fe;E.push(`${Ee},${ve}`),S.push({x:Ee,y:ve}),W.push({x:Ee,y:ve,value:Ve,label:q.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:E.join(" "),polygonPoints:S,dataPoints:W,color:xa(r,p),fillOpacity:h?sn.value.fillOpacity:Rl.value,strokeDasharray:h?al(r)||sn.value.strokeDasharray:null,pointRadius:Dn(r,h),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:L,isDimmed:I,isHidden:D,isComparison:h,seriesIndex:p})}),t}),ms=(t,a)=>{if(!a||a.length<3)return!1;let l=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const h=a[r].x,E=a[r].y,S=a[p].x,W=a[p].y;E>t.y!=W>t.y&&t.x<(S-h)*(t.y-E)/(W-E)+h&&(l=!l)}return l},ps=t=>{if(!hl.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const l=a.getBoundingClientRect(),r=te.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,h=t.clientY-r.top,E=$o.value.filter(S=>S.isHidden?!1:ms({x:p,y:h},S.polygonPoints));if(E.length>0){E.length,K.value=E[0].seriesIndex;const S=t.clientX-l.left+10,W=t.clientY-l.top-10,L=E.length>1?460:260,I=70+da.value*20;let D=S,G=W;D+L>Pe.value&&(D=t.clientX-l.left-L-10),G+I>Qe.value&&(G=t.clientY-l.top-I-10),D<0&&(D=10),G<0&&(G=10);const Ve=E.map(qe=>({seriesName:qe.seriesName,color:qe.color,points:qe.dataPoints.map(fe=>({label:fe.label,value:Zt(fe.value)}))}));je.value={show:!0,x:D,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else Ln()},Pa=e.computed(()=>{const t=Z.value;return t.logos.map((a,l)=>{const r=q.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||ne.value.has(a.seriesIndex))return null;let p,h;if(Nl.value){let S=-1,W=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){S=I,W=r.data[I];break}if(S===-1||W===null)return null;const L=r.data.map((I,D)=>I==null?null:{x:kl(D),y:En(r,I),index:D}).filter(I=>I!==null);if(t.animations.enabled&&!qn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ft.value.isAnimating||!Ft.value.hasAnimated))if(Ft.value.isAnimating){const I=Ft.value.currentFrame/Ft.value.totalFrames,D=fo(t.animations.easing,Math.min(I,1)),G=ws(L,D);p=G.x+(a.offsetX||0),h=G.y+(a.offsetY||0)}else p=L[0].x+(a.offsetX||0),h=L[0].y+(a.offsetY||0);else p=kl(S)+(a.offsetX||0),h=Kn(W)+(a.offsetY||0)}else if(Xt.value||hl.value){const S=Math.PI*2/t.logos.length*l;p=ft.value+Math.cos(S)*(ct.value+30)+(a.offsetX||0),h=Rt.value+Math.sin(S)*(ct.value+30)+(a.offsetY||0)}return{...a,x:p,y:h,seriesIndex:a.seriesIndex}}).filter(Boolean)}),vs=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),l&&(l.style.opacity="1")},fs=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},po=t=>{ne.value.has(t)?ne.value.delete(t):ne.value.add(t)},hs=e.computed(()=>{if(!je.value.show&&!(it.value&&$e.value.show&&!de.value.isZooming))return{display:"none"};let t,a;if(it.value&&$e.value.show&&!de.value.isZooming){t=$e.value.x+15,a=z.value.top;const l=ll.value?200:150;t+l>Pe.value&&(t=$e.value.x-l-15),t<0&&(t=10),a<10&&(a=10)}else t=je.value.x,a=je.value.y;return{left:t+"px",top:a+"px"}}),Gn=(t,a)=>{if(!tt.value||Va.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,h=a.clientY-r.top-10;const E=200,S=120,W=Pe.value,L=Qe.value;p+E>W&&(p=a.clientX-r.left-E-10),h+S>L&&(h=a.clientY-r.top-S-10),p<0&&(p=10),h<0&&(h=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&q.categories.includes(t.label)&&(I=q.categories.indexOf(t.label));let D=t.seriesName||t.label||"";(ml.value||Ce.value==="bar")&&t.label&&(D=t.label),t.tooltipTitle&&(D=t.tooltipTitle),je.value={show:!0,x:p,y:h,title:D,value:Zt(t.value)||"",categoryIndex:I,spiderAreas:[]}},vo=e.ref(!1),Oa=e.ref(!1),Ln=()=>{je.value.show=!1,je.value.spiderAreas=[],je.value.bubbleData=[],$e.value.show=!1,vo.value||(K.value=null)},Va=e.ref(!1),Na=(t,a)=>{Va.value=!0,je.value.show=!1,$e.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,h=a.clientY-r.top-10;const E=250;p+E>Pe.value&&(p=a.clientX-r.left-E-15),p<0&&(p=10),h<0&&(h=10),v.value={show:!0,x:p,y:h,content:t.texts,count:t.totalCount}},Ba=()=>{Va.value=!1,v.value.show=!1},Ft=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),fo=(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}},qn=e.computed(()=>kn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Do=()=>{if(!bl.value||qn.value){Ft.value.hasAnimated=!0,C.value&&(f.value=1);return}C.value&&(f.value=0),Ft.value.isAnimating=!0,Ft.value.currentFrame=0,Ft.value.totalFrames=Math.ceil(dn.value/16.67);const t=()=>{const a=Ft.value.currentFrame/Ft.value.totalFrames,l=fo(Hn.value,Math.min(a,1));gs(l),C.value&&(f.value=l),a<1?(Ft.value.currentFrame++,Ft.value.animationId=requestAnimationFrame(t)):ys()};Ft.value.animationId=requestAnimationFrame(t)},gs=t=>{const a=O.value;a&&a.style.setProperty("--dss-animation-progress",t)},ys=()=>{Ft.value.isAnimating=!1,Ft.value.hasAnimated=!0,C.value&&(f.value=1),Ft.value.animationId&&(cancelAnimationFrame(Ft.value.animationId),Ft.value.animationId=null)},ho=e.computed(()=>!Xt.value||Ft.value.hasAnimated?!0:C.value?f.value>=1:n.value?Xn.value>=1:!0),Lo=e.computed(()=>Cn.value&&ho.value),Wa=e.ref(!1);e.watch(Lo,t=>{t?(Wa.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Wa.value=!0})})):Wa.value=!1},{immediate:!0});const ks=e.computed(()=>{if(!bl.value||qn.value||Ft.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dn.value}ms`,t["--dss-animation-easing"]=Cs(Hn.value),t["--dss-stagger-delay"]=`${_l.value}ms`,t}),Cs=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",bs=()=>{if(!bl.value||qn.value)return"";const t=["dss-chart-animated"];return Ft.value.hasAnimated||t.push(`dss-animate-${yn.value}`),Ft.value.hasAnimated||(Xt.value&&Ce.value!=="semi-radial"?t.push("dss-animate-fill"):Xt.value||t.push(`dss-animate-${yn.value}`)),Ft.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>q.series,(t,a)=>{ql.value&&a&&Ft.value.hasAnimated&&(Ft.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Do(),Hl.value)}))},{deep:!0}),e.watch(()=>de.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{wn()},50)}),e.watch(()=>[de.value.scale,de.value.offsetX],()=>{!de.value.isZooming&&!de.value.isDragging&&wn()},{flush:"post"}),e.watch([Q,oe],([t,a])=>{de.value.minScale=t,de.value.maxScale=a,(de.value.scale<t||de.value.scale>a)&&ra()},{immediate:!0}),e.watch(()=>q.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>mt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Yn)}):document.removeEventListener("click",Yn)}),e.onMounted(()=>{K.value=null,C.value&&(!bl.value||qn.value)&&(f.value=1),Pn(),e.nextTick(rt),O.value&&typeof ResizeObserver<"u"&&(J=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(X&&cancelAnimationFrame(X),X=requestAnimationFrame(()=>{X=null;const{width:l,height:r}=a.contentRect;xe.value=Math.round(l),ye.value=Math.round(r),g.value&&($t.value=g.value.offsetHeight||he)}))}),J.observe(O.value)),bl.value&&!qn.value?Ce.value==="semi-radial"?setTimeout(()=>me(),Hl.value):setTimeout(()=>Do(),Hl.value):(Ft.value.hasAnimated=!0,Ce.value==="semi-radial"&&(Xn.value=1)),document.addEventListener("mousemove",To),document.addEventListener("mouseup",Ao),document.addEventListener("click",Ra)}),e.onUnmounted(()=>{pe&&(pe(),pe=null),X&&cancelAnimationFrame(X),J&&O.value&&(J.unobserve(O.value),J.disconnect(),J=null),Ft.value.animationId&&cancelAnimationFrame(Ft.value.animationId),_&&(cancelAnimationFrame(_),_=null),de.value.zoomTimeout&&clearTimeout(de.value.zoomTimeout),document.removeEventListener("mousemove",To),document.removeEventListener("mouseup",Ao),document.removeEventListener("click",Ra),document.removeEventListener("click",Yn)});const To=t=>{if(de.value.isDragging&&de.value.scale>1&&Nl.value){$e.value.show=!1;const a=t.clientX-de.value.lastMouseX,{minX:l,maxX:r}=jt.value,p=r-l||1,E=a*.8;de.value.offsetX+=E;const S=p/de.value.scale,W=p-S,L=0,I=-W/p*z.value.width,D=L;de.value.offsetX=Math.max(I,Math.min(D,de.value.offsetX)),de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY}},Ao=()=>{de.value.isDragging&&(de.value.isDragging=!1,setTimeout(()=>{!de.value.isDragging&&de.value.isZooming},100))},ws=(t,a)=>{const l=t.filter(S=>S!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||a<=0)return l[0];if(a>=1)return l[l.length-1];let r=0;const p=[];for(let S=1;S<l.length;S++){const W=l[S].x-l[S-1].x,L=l[S].y-l[S-1].y,I=Math.sqrt(W*W+L*L);p.push(I),r+=I}const h=r*a;let E=0;for(let S=0;S<p.length;S++){const W=E+p[S];if(h<=W){const L=(h-E)/p[S],I=l[S],D=l[S+1];return{x:I.x+(D.x-I.x)*L,y:I.y+(D.y-I.y)*L}}E=W}return l[l.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[bs(),{"dss-chart-fill-width":De.value,"dss-chart-fill-height":Ze.value,"dss-chart-compact":Xt.value&&!He.value}]]),style:e.normalizeStyle({width:De.value?"100%":Pe.value+"px",height:Tt.value,...De.value||Ze.value?{overflow:Xt.value?"visible":(gl.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...ks.value,cursor:ba()}),"data-chart-type":Ce.value,ref_key:"containerEl",ref:O,onWheel:sa,onMousedown:Ca,onMousemove:_a,onMouseup:ao,onMouseleave:Ga,onDblclick:ra,onContextmenu:e.withModifiers(Qa,["prevent"]),onClick:e.withModifiers(bn,["left"]),onWheelCapture:sa},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:g},[e.createElementVNode("div",jr,[Je.value?(e.openBlock(),e.createElementBlock("div",Kr,e.toDisplayString(Je.value),1)):e.createCommentVNode("",!0),ut.value?(e.openBlock(),e.createElementBlock("div",Gr,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0)]),He.value&&nt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-top":nt.value==="top","dss-legend-bottom":nt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",Jr,e.toDisplayString(l.name),1)],46,Qr))),128))],2)):e.createCommentVNode("",!0),He.value&&(nt.value==="left"||nt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":nt.value==="left","dss-legend-right":nt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",ti,e.toDisplayString(l.name),1)],46,ei))),128))],2)):e.createCommentVNode("",!0)],512),B.showAddMarkerButton&&Yt.value&&Ht.value.addMarker&&(Nl.value||ll.value)&&!gl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:no,title:e.unref(N)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:qt.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,ni),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,li)):e.createCommentVNode("",!0),e.createElementVNode("div",ai,[ll.value&&ot.value?(e.openBlock(),e.createElementBlock("div",oi,"Bubble size: "+e.toDisplayString(ot.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ke.value?void 0:Pe.value,height:ke.value?void 0:Qe.value,viewBox:et.value,preserveAspectRatio:ke.value?"xMidYMid meet":void 0,class:"dss-chart-svg","data-smooth":M.value,"data-animated":bl.value,ref_key:"svgEl",ref:te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ge.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:Pe.value,height:z.value.height*4},null,8,ii)],8,ri),n.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:o.value},[e.createElementVNode("path",{d:c.value},null,8,ui)],8,ci)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:y.value},[e.createElementVNode("path",{d:F.value},null,8,mi)],8,di)):e.createCommentVNode("",!0)]),Nl.value||ll.value?(e.openBlock(),e.createElementBlock("g",pi,[lt.value&&!gl.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Te.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:z.value.left,x2:z.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,fi))),128))],8,vi)):e.createCommentVNode("",!0),gl.value&&wo.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Te.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:z.value.left,x2:z.value.right,y1:l.y,y2:l.y,stroke:El.value,"stroke-width":Ll.value,"stroke-dasharray":Sl.value,opacity:Wl.value},null,8,gi))),128))],8,hi)):e.createCommentVNode("",!0),e.createElementVNode("g",yi,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ki),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ci),jn.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:z.value.right,x2:z.value.right,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bi)):e.createCommentVNode("",!0)]),e.createElementVNode("g",wi,[gl.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(so.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,xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ro.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,Ei))),128)),jn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(jo.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,Si))),128)):e.createCommentVNode("",!0),gt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(gt.value),9,Vi)):e.createCommentVNode("",!0),dt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(dt.value),9,Ni)):e.createCommentVNode("",!0),jn.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:Pe.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Pe.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(wt.value),9,Bi)):e.createCommentVNode("",!0)]),d.value.length>0?(e.openBlock(),e.createElementBlock("g",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Te.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,$i)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Di)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Li)):e.createCommentVNode("",!0)],8,Mi),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Ti)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,z.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=>Na(l,r),onMouseleave:Ba},null,40,Ai),e.createElementVNode("text",{x:l.x,y:Math.max(15,z.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,Hi)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Te.value},[on.value?(e.openBlock(),e.createElementBlock("g",Fi,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ml.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.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:p=>Gn(l,p),onMouseleave:Ln},null,46,Ii)):(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:p=>Gn(l,p),onMouseleave:Ln},null,46,zi))],64))),128))],2),e.createElementVNode("g",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Wi))),128)),Ke.value>0||Bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:_t(l.isHighlighted?Qt(l,Ke.value)+2:Qt(l,Ke.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:p=>Gn(l,p),onMouseleave:Ln},null,46,qi))),128)):e.createCommentVNode("",!0)])])):Ce.value==="line"?(e.openBlock(),e.createElementBlock("g",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":re.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ft.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ui))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Yi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Xi))),128)),Ke.value>0||Bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Qo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:_t(l.isHighlighted?Qt(l,Ke.value)+2:Qt(l,Ke.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:p=>Gn(l,p),onMouseleave:Ln},null,46,ji))),128)):e.createCommentVNode("",!0)])):Ce.value==="area"?(e.openBlock(),e.createElementBlock("g",Ki,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${B.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,Qi)],8,Gi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?ul.value+.2:ul.value,mask:`url(#area-mask-${r}-${B.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,Ji))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?re.value+1:re.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*_l.value}ms`})},null,14,ec))),128))])):Ce.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ml.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.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:p=>Gn(l,p),onMouseleave:Ln},null,46,tc)):(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:p=>Gn(l,p),onMouseleave:Ln},null,46,lc))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ri),it.value&&$e.value.show&&!de.value.isZooming&&!gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Te.value},[e.createElementVNode("line",{x1:$e.value.x,x2:$e.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Ut.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ac),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:$e.value.x,cy:l.y,r:_t(Ke.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,oc))),128))],8,nc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ll.value?(e.openBlock(),e.createElementBlock("g",sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(za.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",rc,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:_t(l.radius),fill:l.color,"fill-opacity":ls(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(as(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>No(l,p),onMouseleave:p=>_o(l),onClick:p=>Vo(l,p)},null,42,ic),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:ns(l)}),onLoad:p=>xl(r),onError:p=>yl(r),onMouseenter:p=>No(l,p),onMouseleave:p=>_o(l),onClick:p=>Vo(l,p)},null,46,cc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Xt.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:wa.value},[Ce.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:ft.value,cy:Rt.value,r:ct.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,dc)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ce.value,"clip-path":P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(es.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":u(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>Gn(l.segment,p),onMouseleave:Ln},null,42,pc))),128))],8,mc),mn.value&&ho.value?(e.openBlock(),e.createElementBlock("g",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.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,fc)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),nn.value&&(ho.value||n.value||xn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:k.value.x,y:k.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Ol.value,fill:w.value,class:"dss-radial-data-center"},e.toDisplayString(rl.value),9,hc)):e.createCommentVNode("",!0),Lo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Wa.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ts.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,gc),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,yc),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":tn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,kc)],6))),128))],2)):e.createCommentVNode("",!0)],8,uc)):e.createCommentVNode("",!0),hl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:wa.value},[lt.value?(e.openBlock(),e.createElementBlock("g",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:ft.value,cy:Rt.value,r:_t(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,wc))),128)),e.createElementVNode("g",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:ft.value-16,y:Rt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Ec),e.createElementVNode("text",{x:ft.value,y:Rt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(dl(r)),9,Sc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:ft.value,x2:l.x,y1:Rt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Vc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cs.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/da.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/da.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,Bc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ps,onMouseleave:Ln},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":ds("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?re.value+1:re.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*_l.value}ms`,transition:"all 0.2s ease"})},null,14,_c),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(p,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${h}`,cx:p.x,cy:p.y,r:_t(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*_l.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>Gn(p,E),onMouseleave:Ln},null,46,Mc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Cc)):e.createCommentVNode("",!0),e.createElementVNode("g",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pa.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:_t(l.width/2),fill:el(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Dc))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pa.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:p=>vs(r),onError:p=>fs(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,Lc))),128))])],8,si)),gl.value&&Gl.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(Ml.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:A,class:"dss-stepbar-scroll",onScroll:Ma},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(gn.value)},[St.value?(e.openBlock(),e.createElementBlock("div",Tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`stepbar-grid-${r}`,class:"dss-stepbar-grid-line",style:e.normalizeStyle({top:`${l.top}px`,borderTopColor:El.value,borderTopWidth:`${Ll.value}px`,borderTopStyle:"dashed",opacity:Wl.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${Kt.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,l=>(e.openBlock(),e.createBlock(Fo,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(Zn.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":vl.value,orientation:"vertical","label-position":"down","bar-height":Bl.value,"segment-order":Oe.value,"remainder-label":Xe.value,"inactive-color":xt.value,options:Sn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Vn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(An.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),en.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Pe.value+"px",height:Qe.value+"px",backgroundImage:`url('${Nn.value}')`,backgroundRepeat:"no-repeat",...Pt.value,opacity:Dl.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rn.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:Pl.value+"px",height:Pl.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Ta(l),["stop"]),onMouseenter:p=>ss(l,p),onMouseleave:rs},[e.createElementVNode("img",{src:Ja(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Hc)],44,Ac)),[[e.vShow,Jl.value]])),128)),Ot.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ot.value.x+"px",top:Ot.value.y+"px"})},[e.createElementVNode("div",Rc,e.toDisplayString(Ot.value.categoryValue),1),Ot.value.description?(e.openBlock(),e.createElementBlock("div",Fc,e.toDisplayString(Ot.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),tt.value&&(je.value.show||it.value&&$e.value.show&&!de.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":it.value&&$e.value.show&&!de.value.isZooming,"dss-spider-tooltip":hl.value&&je.value.spiderAreas&&je.value.spiderAreas.length>0}]),style:e.normalizeStyle(hs.value)},[!it.value||!$e.value.show||de.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[hl.value&&je.value.spiderAreas&&je.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",zc,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${h}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Pc,e.toDisplayString(p.label),1),e.createElementVNode("span",Oc,e.toDisplayString(p.value),1)]))),128))]))),128))])):ll.value&&je.value.bubbleData&&je.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Wc,[je.value.title?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(je.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.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",Uc,[e.createElementVNode("div",Yc,e.toDisplayString(je.value.title),1),e.createElementVNode("div",Xc,e.toDisplayString(je.value.value),1)])),je.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Dt(je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",jc,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Kc,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(je.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Gc,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Qc,[e.createElementVNode("div",Jc,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",eu,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",tu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(je.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",lu,[e.createElementVNode("div",nu,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",au,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",ou,[e.createElementVNode("div",su,e.toDisplayString(gl.value?Ka():ll.value?os():B.categories[$e.value.categoryIndex]||`Category ${$e.value.categoryIndex+1}`),1),ll.value?(e.openBlock(),e.createElementBlock("div",ru,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.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($e.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",iu,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",cu,e.toDisplayString(Zt(l.value)),1)]))),128))]),Dt($e.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",uu,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",du,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt($e.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",mu,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",pu,[e.createElementVNode("div",vu,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt($e.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",fu,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",hu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt($e.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",gu,[e.createElementVNode("div",yu,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ku,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Nl.value&&ae.value&&de.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:ra},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(de.value.scale*100))+"% "+e.toDisplayString(e.unref(N)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Xr),He.value&&nt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.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(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",bu,e.toDisplayString(l.name),1)],46,Cu))),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:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[Ht.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ha},e.toDisplayString(e.unref(N)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ht.value.addMarker&&(Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv||Ql.value.length>0)?(e.openBlock(),e.createElementBlock("div",wu)):e.createCommentVNode("",!0),Ht.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:lo},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ht.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ea},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Aa},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ql.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",xu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Eu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(aa(l)),style:e.normalizeStyle(oa(l)),onClick:p=>ta(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Un(l),class:"dss-custom-menu-content"},null,8,Vu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Nu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Su)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ze.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:an},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bu,[e.createElementVNode("h3",null,e.toDisplayString(vn.value?e.unref(N)("chart.modalMarker.viewMarker"):pn.value?e.unref(N)("chart.modalMarker.editMarker"):e.unref(N)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:an},"×")]),e.createElementVNode("div",_u,[e.createElementVNode("div",Mu,[e.createVNode(yo,{id:"dss-marker-date",mode:"single",modelValue:ze.value.date,"onUpdate:modelValue":a[1]||(a[1]=l=>ze.value.date=l),"min-date":la.value,"max-date":na.value,disabled:vn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",$u,[e.createElementVNode("label",Du,e.toDisplayString(e.unref(N)("chart.modalMarker.description")),1),vn.value?(e.openBlock(),e.createElementBlock("div",Lu,e.toDisplayString(ze.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=l=>ze.value.description=l),placeholder:e.unref(N)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Tu)),[[e.vModelText,ze.value.description]])])]),e.createElementVNode("div",Au,[e.createElementVNode("div",Hu,[pn.value&&!vn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:il},e.toDisplayString(e.unref(N)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ru,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:an},e.toDisplayString(vn.value?e.unref(N)("chart.modalMarker.close"):e.unref(N)("chart.modalMarker.cancel")),1),vn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:zn,disabled:!(ze.value.description&&ze.value.description.length)},e.toDisplayString(pn.value?e.unref(N)("chart.modalMarker.save"):e.unref(N)("chart.contextMenu.addMarker")),9,Fu))])])])])):e.createCommentVNode("",!0)],64))}}),Pu={class:"dss-modal-title"},Ou={class:"dss-modal-actions"},go={__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(B,{emit:ee}){const N=B,$=ee,se=e.ref(null),O=e.ref(null),A=e.computed(()=>{const X={"max-width":N.width};return N.height!=="auto"&&(X.height=N.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function rt(){$("close-modal")}function te(){N.backDrop&&!se.value&&$("close-modal")}function g(X){X.target.tagName==="INPUT"&&(se.value=X.target.tagName)}function xe(){setTimeout(()=>{se.value=null},300)}function ye(){const X=document.body,he=document.documentElement;O.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:he.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${O.value.scrollY}px`,X.style.width="100%",X.style.left="0",he.style.overflow="hidden"}function J(){if(!O.value)return;const X=document.body,he=document.documentElement,{bodyOverflow:Ae,bodyPosition:ge,bodyTop:Te,bodyWidth:q,htmlOverflow:Re,scrollY:Ue}=O.value;X.style.overflow=Ae||"",X.style.position=ge||"",X.style.top=Te||"",X.style.width=q||"",X.style.left="",he.style.overflow=Re||"",window.scrollTo(0,Ue||0)}return e.watch(()=>N.showModal,X=>{if(X)ye(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const he=document.getElementById("dss-modal-backdrop");he&&(he.addEventListener("focusin",g),he.addEventListener("focusout",xe))},100);else{J(),document.body.classList.remove("dss-modal-open");const he=document.getElementById("dss-modal-backdrop");he&&(he.removeEventListener("focusin",g),he.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{N.showModal&&J()}),(X,he)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.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(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:he[0]||(he[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":B.headerType,"font-size":B.titleSize})},[e.createElementVNode("h1",Pu,[e.renderSlot(X.$slots,"title",{},()=>[he[1]||(he[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),B.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:rt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[he[2]||(he[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Ou,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,B.showModal]])])):e.createCommentVNode("",!0)]))}},Wu={key:0,class:"dss-table-toolbar"},qu={class:"dss-table-toolbar-left"},Zu=["aria-expanded"],Uu={class:"dss-pagination-select-dropdown",role:"listbox"},Yu={class:"dss-table-column-visibility-label"},Xu={class:"dss-table-checkbox-wrapper"},ju=["checked","onChange"],Ku={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Gu={class:"dss-table-column-visibility-text"},Qu={class:"dss-table-toolbar-right"},Ju=["placeholder","aria-label"],ed=["aria-label"],td=["aria-label","aria-expanded"],ld={key:1,class:"dss-table-toolbar-extra"},nd={class:"dss-table-thead"},ad={key:0,class:"dss-table-th dss-table-selection-column"},od={key:0,class:"dss-table-checkbox-wrapper"},sd=["checked","indeterminate"],rd={key:0,class:"dss-table-checkbox__indeterminate"},id={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},cd=["aria-label"],ud=["onClick"],dd={class:"dss-table-th-content"},md={class:"dss-table-th-text"},pd={key:0},vd={key:1},fd={key:2},hd=["data-filter-column-key","aria-expanded","aria-label","onClick"],gd={class:"dss-table-tbody"},yd=["onClick"],kd={class:"dss-table-checkbox-wrapper"},Cd=["type","name","checked","disabled","onChange"],bd={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},wd={key:1,class:"dss-table-checkbox__dot"},xd=["onClick"],Ed=["aria-expanded","aria-label"],Sd={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Vd={key:0,class:"dss-table-expansion-row"},Nd=["colspan"],Bd=["colspan"],_d={key:1,class:"dss-table-pagination"},Md={class:"dss-table-pagination-left"},$d={key:0},Dd={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Ld={class:"dss-table-pagination-center"},Td={key:0,class:"dss-pagination-controls"},Ad=["disabled","title"],Hd=["disabled","title"],Rd=["aria-label","onKeydown"],Fd={class:"dss-pagination-of"},Id=["disabled","title"],zd=["disabled","title"],Pd={class:"dss-table-pagination-right"},Od={class:"dss-pagination-rows-label"},Wd=["aria-expanded"],qd=["aria-selected","onClick"],Zd={key:0,class:"dss-table-filter-row"},Ud=["value","placeholder"],Yd=["min","max","value"],Xd=["min","max","value"],jd={class:"dss-table-filter-double-range-values"},Kd={key:2,class:"dss-table-filter-daterange"},Gd={class:"dss-table-filter-daterange-row"},Qd={class:"dss-table-filter-daterange-label"},Jd=["value"],e1={class:"dss-table-filter-daterange-row"},t1={class:"dss-table-filter-daterange-label"},l1=["value"],n1=["value","placeholder"],a1={class:"dss-table-filter-list"},o1=["checked","onChange"],s1={class:"dss-table-filter-actions"},r1={name:"DSSTable"},i1=Object.assign(r1,{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:B=>typeof B=="object"&&B!==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(B,{emit:ee}){const{t:N,locale:$}=va.useI18n(),se=B,O=ee,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function pe(d,v){const b=Object.assign({},d);return rt(d)&&rt(v)&&Object.keys(v).forEach(H=>{rt(v[H])?H in d?b[H]=pe(d[H],v[H]):Object.assign(b,{[H]:v[H]}):Object.assign(b,{[H]:v[H]})}),b}function rt(d){return d&&typeof d=="object"&&!Array.isArray(d)}const te=e.computed(()=>pe(A,se.options)),g=e.computed(()=>{const d=te.value.table.width;return d==="auto"?null:typeof d=="number"?d:null}),xe=e.computed(()=>te.value.table.height),ye=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ye.value})),X=e.computed(()=>te.value.table.expandable===!0),he=e.computed(()=>te.value.table.expandableRowData??null),Ae=e.computed(()=>te.value.table.expandableRowCondition??null),ge=e.computed(()=>te.value.table.truncated===!0),Te=e.computed(()=>te.value.table.striped),q=e.computed(()=>te.value.table.bordered),Re=e.computed(()=>te.value.table.hoverable),Ue=e.computed(()=>te.value.table.size),Be=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const Ye=e.computed(()=>te.value.selection.enabled),Z=e.computed(()=>te.value.selection.mode),De=e.computed(()=>te.value.selection.rowCondition??null),Ze=e.computed(()=>te.value.sorting.enabled),ke=e.computed(()=>te.value.sorting.mode),et=e.computed(()=>te.value.pagination.enabled),at=e.computed(()=>te.value.pagination.rows),Pe=e.computed(()=>te.value.pagination.rowsPerPageOptions),$t=e.computed(()=>te.value.pagination.showCounter!==!1),Wt=e.computed(()=>te.value.pagination.showControlsGroup),Qe=e.computed(()=>Wt.value===!1?!1:te.value.pagination.showControls!==!1),Tt=e.computed(()=>Wt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),Ce=e.computed(()=>et.value&&($t.value||Qe.value||Tt.value)),ht=e.computed(()=>te.value.scrollable),Je=e.computed(()=>te.value.emptyMessage||N("table.emptyMessage")),ut=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),ot=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),gt=e.computed(()=>te.value.toolbar?.search!==!1),dt=e.computed(()=>ut.value||ot.value||gt.value||Gt.value),Gt=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),wt=e.ref(""),Vt=e.ref(!1),ue=e.ref(null);let R=null;function Y(){Vt.value?(R&&(clearTimeout(R),R=null),Vt.value=!1,wt.value="",O("search",""),ue.value?.blur()):(Vt.value=!0,R=setTimeout(()=>{R=null,ue.value?.focus()},80))}function ie(){wt.value||(Vt.value=!1)}function be(){wt.value="",O("search",""),ue.value?.focus()}const lt=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":q.value,"dss-table-hoverable":Re.value,[`dss-table-${Ue.value}`]:Ue.value!=="default","dss-table-truncated":ge.value})),He=(d,v)=>d?.field??d?.key??v,nt=e.ref(new Set);function Me(){const d=new Set;return se.columns.forEach((v,b)=>{v?.hidden!==!0&&d.add(He(v,b))}),d}function tt(){const d=new Set;return se.columns.forEach((v,b)=>{d.add(He(v,b))}),d}function it(d){if(!Array.isArray(d))return null;const v=tt(),b=[];return d.forEach(H=>{v.has(H)&&b.push(H)}),b}function Ut(){nt.value=Me()}const ae=e.computed(()=>{const d=it(se.columnVisibility);return d===null?null:new Set(d)}),Q=e.computed(()=>ae.value??nt.value),oe=e.computed(()=>se.columns.filter((d,v)=>Q.value.has(He(d,v)))),re=d=>{const v=se.columns.findIndex(b=>b===d);return He(d,v>=0?v:0)},Se=(d,v)=>Q.value.has(He(d,v));function Ke(d){O("update:columnVisibility",Array.from(d))}function Bt(d,v){const b=He(d,v),H=new Set(Q.value);H.has(b)?H.delete(b):H.add(b),ae.value===null&&(nt.value=H),Ke(H)}const Qt=e.ref(null),_t=e.ref(!1);function ul(d){Qt.value&&!Qt.value.contains(d.target)&&(_t.value=!1)}const M=e.computed(()=>oe.value.length+(Ye.value?1:0)+(X.value?1:0)),V=(d,v)=>d?.id??d?.key??v,T=e.ref(new Set),ce=e.ref(null),j=(d,v)=>T.value.has(V(d,v)),Oe=(d,v)=>{if(!X.value)return!1;if(typeof Ae.value=="function")return!!Ae.value(d,v);if(typeof he.value=="string"&&he.value.trim()){const b=k(d,he.value.trim());return Array.isArray(b)?b.length>0:b&&typeof b=="object"?Object.keys(b).length>0:b!=null&&b!==""}return!0},kt=(d,v,b)=>{if(b&&b.stopPropagation(),!Oe(d,v))return;const H=V(d,v),U=new Set(T.value);U.has(H)?(U.delete(H),O("row-collapse",{data:d,index:v})):(U.add(H),O("row-expand",{data:d,index:v})),T.value=U},st=(d,v)=>{if(!ge.value)return;const b=V(d,v);ce.value!==b&&(ce.value=b)},Xe=e.ref(null),xt=e.ref(0),Ct=e.ref([]),Et=d=>{if(ke.value==="single")return Xe.value===d.field?xt.value:0;{const v=Ct.value.find(b=>b.field===d.field);return v?v.order:0}},Mt=d=>{const v=Et(d);return{"dss-sort-active":v!==0,"dss-sort-asc":v===1,"dss-sort-desc":v===-1}},bt=e.ref({}),St=e.ref(null),El=e.ref(null),Wl=220,Ll=e.ref(null),Sl=e.computed(()=>oe.value.find(d=>re(d)===St.value)??null),Kt=e.computed(()=>{if(!Sl.value||Sl.value.filter!=="range")return null;const d=Sl.value,v=St.value,{min:b,max:H}=An(d),U=d.filterMin??b,ne=d.filterMax??H,K=Bl(v),vt=K.min??U,je=K.max??ne,Ot=ne-U,$e=Ot===0?0:(vt-U)/Ot*100,mt=Ot===0?100:(je-U)/Ot*100;return{rangeMin:U,rangeMax:ne,currentMin:vt,currentMax:je,minPct:$e,maxPct:mt}}),Tl=e.ref(null),Vl=e.ref("max");function At(d){const v=Tl.value,b=Kt.value;if(!v||!b)return;const H=v.getBoundingClientRect(),ne=(d.clientX-H.left)/H.width*100,K=(b.minPct+b.maxPct)/2;Vl.value=ne<K?"min":"max"}function Bl(d){return bt.value[d]??{}}function sl(d,v){bt.value={...bt.value,[d]:v}}function Al(d){const v=bt.value[d];return v?v.type==="string"?!!v.value?.trim():v.type==="range"?v.min!=null||v.max!=null:v.type==="dateRange"?!!(v.from||v.to):v.type==="list"?v.selected?.length>0:!1:!1}function Zn(d){const v={...bt.value};delete v[d],bt.value=v,St.value=null,El.value=null}function Tn(){if(!St.value){El.value=null;return}const d=Ll.value;if(!d)return;const v=d.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${St.value}"]`);if(!v)return;const b=v.getBoundingClientRect();El.value={top:b.bottom+6,left:Math.max(8,b.right-Wl)}}const Sn=e.computed(()=>{const d=String(wt.value??"").trim().toLowerCase();return d?se.data.filter(v=>oe.value.some(b=>un(Ol(v,b)).some(U=>String(U).toLowerCase().includes(d)))):se.data}),Gl=e.computed(()=>{let d=[...Sn.value];const v=(wt.value??"").trim().toLowerCase();return v&&(d=d.filter(b=>se.columns.some(H=>{if(!H||!H.field)return!1;const U=Ol(b,H);return String(U??"").toLowerCase().includes(v)}))),oe.value.forEach(b=>{const H=re(b),U=bt.value[H];if(!U)return;const ne=b.field;if(ne){if(U.type==="string"&&U.value?.trim()){const K=U.value.trim().toLowerCase();d=d.filter(vt=>{const je=Ol(vt,b);return String(je??"").toLowerCase().includes(K)})}else if(U.type==="range")d=d.filter(K=>{const vt=k(K,ne),je=Number(vt);return!(Number.isNaN(je)||U.min!=null&&je<U.min||U.max!=null&&je>U.max)});else if(U.type==="dateRange"){const K=U.from?new Date(U.from).getTime():null,vt=U.to?new Date(U.to).getTime():null;d=d.filter(je=>{const Ot=k(je,ne),$e=Ot?new Date(Ot).getTime():NaN;return!(Number.isNaN($e)||K!=null&&$e<K||vt!=null&&$e>vt)})}else if(U.type==="list"&&U.selected?.length){const K=new Set(U.selected);d=d.filter(vt=>un(Ol(vt,b)).some(Ot=>K.has(Ot)))}}}),d});function un(d){if(d==null)return[""];if(Array.isArray(d))return d.flatMap(un);if(typeof d=="object"){const v=d?.label??d?.name??d?.value??d?.title;return[v!=null?String(v):String(d)]}return[String(d)]}function Ml(d){const v=new Set;return se.data.forEach(b=>{un(Ol(b,d)).forEach(U=>v.add(U))}),Array.from(v).sort((b,H)=>String(b).localeCompare(String(H)))}function gn(d,v){if(St.value===d){St.value=null,El.value=null;return}if(St.value=d,v?.currentTarget){const b=v.currentTarget.getBoundingClientRect();El.value={top:b.bottom+6,left:Math.max(8,b.right-Wl)}}else Tn()}function Vn(d,v){sl(d,{type:"string",value:v})}function An(d){const v=d.field;if(!v)return{min:0,max:100};let b=1/0,H=-1/0;return se.data.forEach(U=>{const ne=k(U,v),K=Number(ne);Number.isNaN(K)||(b=Math.min(b,K),H=Math.max(H,K))}),{min:b===1/0?0:b,max:H===-1/0?100:H}}function bl(d,v,b){const H={...Bl(d),type:"range"},U=b===""?null:Number(b),ne=U===null||Number.isNaN(U)?null:U;H[v]=ne,ne!=null&&(v==="min"&&H.max!=null&&ne>H.max&&(H.max=ne),v==="max"&&H.min!=null&&ne<H.min&&(H.min=ne)),sl(d,H)}function yn(d,v,b){const H={...Bl(d),type:"dateRange"};H[v]=b||"",sl(d,H)}const dn=e.reactive({});function Hl(d,v){dn[d]=v}function Hn(d){const v=re(d),b=(dn[v]??"").trim().toLowerCase(),H=Ml(d);return b?H.filter(U=>String(U).toLowerCase().includes(b)):H}function _l(d,v){return(Bl(d).selected??[]).includes(v!=null?String(v):"")}function ql(d,v){const H=[...Bl(d).selected??[]],U=v!=null?String(v):"",ne=H.indexOf(U);ne>=0?H.splice(ne,1):H.push(U),sl(d,{type:"list",selected:H})}function kn(d){St.value&&!d.target.closest(".dss-table-filter-wrap")&&!d.target.closest(".dss-table-filter-dropdown")&&(St.value=null,El.value=null)}function Rl(){Tn(),Yt.value&&Zt()}const Jn=d=>{if(!(d.sortable===!1||!Ze.value))if(ke.value==="single")Xe.value===d.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(Xe.value=d.field,xt.value=1),xt.value===0&&(Xe.value=null),O("sort",{field:Xe.value,order:xt.value});else{const v=Ct.value.findIndex(b=>b.field===d.field);v>=0?Ct.value[v].order===1?Ct.value[v].order=-1:Ct.value.splice(v,1):Ct.value.push({field:d.field,order:1}),O("sort",{multiSortMeta:Ct.value})}},Zl=e.computed(()=>{if(!Ze.value)return Gl.value;let d=[...Gl.value];return ke.value==="single"&&Xe.value&&xt.value!==0?d.sort((v,b)=>{const H=k(v,Xe.value),U=k(b,Xe.value);return H===U?0:H==null?1:U==null?-1:(H<U?-1:H>U?1:0)*xt.value}):ke.value==="multiple"&&Ct.value.length>0&&d.sort((v,b)=>{for(const H of Ct.value){const U=k(v,H.field),ne=k(b,H.field);if(U===ne)continue;if(U==null)return 1;if(ne==null)return-1;const K=U<ne?-1:U>ne?1:0;if(K!==0)return K*H.order}return 0}),d}),dl=e.ref(0),$l=e.ref(at.value),Yt=e.ref(!1),Ht=e.ref(null),Ql=e.ref(null),qt=e.ref("bottom"),yt=e.ref(null),Pl=d=>{$l.value=d,Yt.value=!1,dl.value=0,O("page",{page:0,rows:$l.value})};function vl(d){Ht.value&&!Ht.value.contains(d.target)&&(Yt.value=!1)}function Zt(){const d=Ht.value,v=Ql.value;if(!d||!v)return;const b=d.querySelector(".dss-pagination-select-dropdown");if(!b)return;const H=v.getBoundingClientRect(),U=b.offsetHeight||0,K=(window.innerHeight||document.documentElement.clientHeight)-H.bottom,vt=H.top;qt.value=K<U+8&&vt>K?"top":"bottom",yt.value={width:`${Math.ceil(H.width)}px`,left:`${Math.max(0,Math.round(v.offsetLeft))}px`}}const Jl=e.computed(()=>Zl.value.length),Ul=e.computed(()=>Math.ceil(Jl.value/$l.value)),Rn=e.computed(()=>Math.max(Ul.value,1)),en=e.computed(()=>Jl.value===0?0:Jt.value+1),Dl=e.computed(()=>Yl.value),Jt=e.computed(()=>et.value?dl.value*$l.value:0),Yl=e.computed(()=>et.value?Math.min((dl.value+1)*$l.value,Jl.value):Jl.value),wl=e.computed(()=>{if(!et.value)return Zl.value;const d=Jt.value,v=Yl.value;return Zl.value.slice(d,v)}),Pt=e.ref(new Set),Fn=e.computed(()=>Zl.value.filter((d,v)=>Pt.value.has(V(d,v)))),Dt=(d,v)=>{const b=De.value;return typeof b!="function"?!0:!!b(d,v)},Fl=e.computed(()=>Zl.value.map((d,v)=>({row:d,index:v})).filter(({row:d,index:v})=>Dt(d,v))),Nn=e.computed(()=>{const d=Fl.value;return d.length===0?!1:d.every(({row:v,index:b})=>Pt.value.has(V(v,b)))}),Cn=e.computed(()=>{const d=Fl.value;if(d.length===0)return!1;const v=d.filter(({row:b,index:H})=>Pt.value.has(V(b,H))).length;return v>0&&v<d.length}),tn=(d,v)=>Pt.value.has(V(d,v)),fl=()=>{if(Nn.value)Pt.value=new Set,O("unselect-all");else{const d=new Set;Fl.value.forEach(({row:v,index:b})=>d.add(V(v,b))),Pt.value=d,O("select-all",Fn.value)}},In=(d,v)=>{if(!Dt(d,v))return;const b=V(d,v),H=new Set(Pt.value),U=H.has(b);Z.value==="single"?U?(H.delete(b),O("row-unselect",d)):(H.clear(),H.add(b),O("row-select",d)):U?(H.delete(b),O("row-unselect",d)):(H.add(b),O("row-select",d)),Pt.value=H},ln=e.ref("1"),mn=()=>{const d=Number.parseInt(String(ln.value),10);if(!Number.isFinite(d)){ln.value=String(dl.value+1);return}const v=Math.min(Rn.value,Math.max(1,d));v!==dl.value+1?Il(v-1):ln.value=String(v)},Il=d=>{d<0||d>=Ul.value||(dl.value=d,O("page",{page:d,rows:$l.value}))},nn=(d,v,b)=>{O("row-click",{data:d,index:v,originalEvent:b}),st(d,Jt.value+v)},rl=(d,v)=>{const b=Jt.value+v;return{"dss-table-row-selected":tn(d,b),"dss-table-row-even":v%2===0,"dss-table-row-odd":v%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":ce.value===V(d,b)}},Ol=(d,v)=>v.field?k(d,v.field):"",k=(d,v)=>v.split(".").reduce((b,H)=>b&&b[H],d),w=d=>{const v=d.align??Be.value;return{"dss-table-sortable":d.sortable!==!1&&Ze.value,"dss-table-align-left":v==="left","dss-table-align-center":v==="center","dss-table-align-right":v==="right",[d.className]:d.className}},x=d=>{const v={};return d.width&&(v.width=typeof d.width=="number"?`${d.width}px`:d.width),d.minWidth&&(v.minWidth=typeof d.minWidth=="number"?`${d.minWidth}px`:d.minWidth),d.maxWidth&&(v.maxWidth=typeof d.maxWidth=="number"?`${d.maxWidth}px`:d.maxWidth),v};return e.watch(()=>se.locale,d=>{d&&d!==$.value&&($.value=d)},{immediate:!0}),e.watch(at,d=>{$l.value=d,dl.value=0}),e.watch(Yt,async d=>{d&&(await e.nextTick(),Zt())}),e.watch(dl,d=>{ln.value=String(d+1)},{immediate:!0}),e.watch(wt,d=>{O("search",d??"")}),e.watch(()=>se.columns,()=>{if(ae.value===null){Ut();return}const d=it(se.columnVisibility)??[];d.length!==se.columnVisibility.length&&O("update:columnVisibility",d)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",vl),document.addEventListener("click",ul),document.addEventListener("click",kn),window.addEventListener("resize",Rl),window.addEventListener("scroll",Rl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",vl),document.removeEventListener("click",ul),document.removeEventListener("click",kn),window.removeEventListener("resize",Rl),window.removeEventListener("scroll",Rl,!0)}),(d,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Ll,style:e.normalizeStyle({width:g.value+"px",height:xe.value?xe.value+"px":"auto"})},[dt.value?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("div",qu,[ut.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:v[0]||(v[0]=b=>O("download-pdf"))},[v[22]||(v[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(N)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ot.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:v[1]||(v[1]=b=>O("download-excel"))},[v[23]||(v[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(N)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Qt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":_t.value}]),onClick:v[2]||(v[2]=b=>_t.value=!_t.value),"aria-expanded":_t.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(N)("table.columnVisibility"))+" ",1),v[24]||(v[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Zu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.columns,(b,H)=>(e.openBlock(),e.createElementBlock("li",{key:He(b,H),role:"option",class:"dss-table-column-visibility-option",onClick:v[3]||(v[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Yu,[e.createElementVNode("span",Xu,[e.createElementVNode("input",{type:"checkbox",checked:Se(b,H),onChange:U=>Bt(b,H),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ju),Se(b,H)?(e.openBlock(),e.createElementBlock("span",Ku,[...v[25]||(v[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",Gu,e.toDisplayString(b.header),1)])]))),128))],512),[[e.vShow,_t.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"header")]),e.createElementVNode("div",Qu,[gt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Vt.value||wt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:ue,"onUpdate:modelValue":v[4]||(v[4]=b=>wt.value=b),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(N)("table.searchPlaceholder"),"aria-label":e.unref(N)("table.searchTableAriaLabel"),onFocus:v[5]||(v[5]=b=>Vt.value=!0),onBlur:ie},null,40,Ju),[[e.vModelText,wt.value]]),wt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(N)("table.clearSearchAriaLabel"),onClick:be},[...v[26]||(v[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,ed)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(N)("table.searchAriaLabel"),"aria-expanded":Vt.value||!!wt.value,onMousedown:e.withModifiers(Y,["prevent"])},[...v[27]||(v[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,td)],2)):e.createCommentVNode("",!0),d.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ld,[e.renderSlot(d.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":ht.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",lt.value])},[e.createElementVNode("thead",nd,[e.createElementVNode("tr",null,[Ye.value?(e.openBlock(),e.createElementBlock("th",ad,[Z.value==="multiple"?(e.openBlock(),e.createElementBlock("span",od,[e.createElementVNode("input",{type:"checkbox",checked:Nn.value,indeterminate:Cn.value,onChange:fl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,sd),Cn.value?(e.openBlock(),e.createElementBlock("span",rd)):Nn.value?(e.openBlock(),e.createElementBlock("span",id,[...v[28]||(v[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(N)("table.expandRowAriaLabel")},null,8,cd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(b,H)=>(e.openBlock(),e.createElementBlock("th",{key:re(b),class:e.normalizeClass(["dss-table-th",w(b)]),style:e.normalizeStyle(x(b)),onClick:U=>Jn(b)},[e.createElementVNode("div",dd,[e.createElementVNode("span",md,e.toDisplayString(b.header),1),b.sortable!==!1&&Ze.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Mt(b)])},[Et(b)===0?(e.openBlock(),e.createElementBlock("span",pd,[...v[29]||(v[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)])])):Et(b)===1?(e.openBlock(),e.createElementBlock("span",vd,[...v[30]||(v[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)])])):Et(b)===-1?(e.openBlock(),e.createElementBlock("span",fd,[...v[31]||(v[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),b.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":St.value===re(b)}]),onClick:v[6]||(v[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Al(re(b))}]),"data-filter-column-key":re(b),"aria-expanded":St.value===re(b),"aria-label":e.unref(N)("table.filterColumnAriaLabel"),onClick:U=>gn(re(b),U)},[...v[32]||(v[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,hd)],2)):e.createCommentVNode("",!0)])],14,ud))),128))])]),e.createElementVNode("tbody",gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(b,H)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(b,Jt.value+H)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",rl(b,H)]),style:e.normalizeStyle(J.value),onClick:U=>nn(b,H,U)},[Ye.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:v[7]||(v[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",kd,[e.createElementVNode("input",{type:Z.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${B.tableId}`,checked:tn(b,Jt.value+H),disabled:!Dt(b,Jt.value+H),onChange:U=>In(b,Jt.value+H),class:e.normalizeClass(["dss-table-checkbox",Z.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!Dt(b,Jt.value+H)}])},null,42,Cd),Z.value==="multiple"&&tn(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("span",bd,[...v[33]||(v[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)])])):Z.value==="single"&&tn(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("span",wd)):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(U=>kt(b,Jt.value+H,U),["stop"])},[Oe(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":j(b,Jt.value+H),"aria-label":j(b,Jt.value+H)?e.unref(N)("table.collapseRowAriaLabel"):e.unref(N)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":j(b,Jt.value+H)}]),"aria-hidden":"true"},[...v[34]||(v[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,Ed)):(e.openBlock(),e.createElementBlock("span",Sd))],8,xd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(U,ne)=>(e.openBlock(),e.createElementBlock("td",{key:re(U),class:e.normalizeClass(["dss-table-td",w(U)]),style:e.normalizeStyle(x(U))},[e.renderSlot(d.$slots,`cell-${U.field}`,{data:b,column:U,rowIndex:H,isExpanded:ce.value===V(b,Jt.value+H)},()=>[e.createTextVNode(e.toDisplayString(Ol(b,U)),1)])],6))),128))],14,yd),X.value&&Oe(b,Jt.value+H)&&j(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("tr",Vd,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(d.$slots,"expansion",{data:b,rowIndex:H})],8,Nd)])):e.createCommentVNode("",!0)],64))),128)),wl.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(d.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Je.value),1)])],8,Bd)],4))])],2)],2),Ce.value?(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",Md,[$t.value?(e.openBlock(),e.createElementBlock("span",$d,e.toDisplayString(e.unref(N)("table.showingRange",{start:en.value,end:Dl.value,total:Jl.value})),1)):(e.openBlock(),e.createElementBlock("span",Dd," "))]),e.createElementVNode("div",Ld,[Qe.value?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value===0,onClick:v[8]||(v[8]=b=>Il(0)),title:e.unref(N)("table.firstPage")},[...v[35]||(v[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Ad),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value===0,onClick:v[9]||(v[9]=b=>Il(dl.value-1)),title:e.unref(N)("table.previousPage")}," ‹ ",8,Hd),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":v[10]||(v[10]=b=>ln.value=b),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(N)("table.currentPageAriaLabel"),onBlur:mn,onKeydown:e.withKeys(e.withModifiers(mn,["prevent"]),["enter"])},null,40,Rd),[[e.vModelText,ln.value]]),e.createElementVNode("span",Fd,e.toDisplayString(e.unref(N)("table.ofPages",{total:Rn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value>=Ul.value-1,onClick:v[11]||(v[11]=b=>Il(dl.value+1)),title:e.unref(N)("table.nextPage")}," › ",8,Id),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value>=Ul.value-1,onClick:v[12]||(v[12]=b=>Il(Ul.value-1)),title:e.unref(N)("table.lastPage")},[...v[36]||(v[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,zd)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pd,[Tt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ht},[e.createElementVNode("span",Od,e.toDisplayString(e.unref(N)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Yt.value}]),onClick:v[13]||(v[13]=b=>Yt.value=!Yt.value),"aria-expanded":Yt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ql},[e.createTextVNode(e.toDisplayString($l.value)+" ",1),v[37]||(v[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Wd),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":qt.value==="top"}]),style:e.normalizeStyle(yt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,b=>(e.openBlock(),e.createElementBlock("li",{key:b,role:"option","aria-selected":b===$l.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":b===$l.value}]),onClick:H=>Pl(b)},e.toDisplayString(b),11,qd))),128))],6),[[e.vShow,Yt.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(El.value?{top:El.value.top+"px",left:El.value.left+"px",width:Wl+"px"}:void 0),onClick:v[21]||(v[21]=e.withModifiers(()=>{},["stop"]))},[Sl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Sl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Zd,[e.createElementVNode("input",{type:"text",value:Bl(St.value).value??"",onInput:v[14]||(v[14]=b=>Vn(St.value,b.target.value)),class:"dss-table-filter-input",placeholder:e.unref(N)("table.search")},null,40,Ud)])):Sl.value.filter==="range"&&Kt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Kt.value.minPct+"%","--range-max-pct":Kt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Tl,class:"dss-table-filter-double-range-track",onMousemove:At,onMouseenter:At},[e.createElementVNode("input",{type:"range",min:Kt.value.rangeMin,max:Kt.value.rangeMax,value:Kt.value.currentMin,onInput:v[15]||(v[15]=b=>bl(St.value,"min",b.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,Yd),e.createElementVNode("input",{type:"range",min:Kt.value.rangeMin,max:Kt.value.rangeMax,value:Kt.value.currentMax,onInput:v[16]||(v[16]=b=>bl(St.value,"max",b.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,Xd)],544),e.createElementVNode("div",jd,e.toDisplayString(Kt.value.currentMin)+" – "+e.toDisplayString(Kt.value.currentMax),1)],4)):Sl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("div",Gd,[e.createElementVNode("label",Qd,e.toDisplayString(e.unref(N)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Bl(St.value).from??"",onInput:v[17]||(v[17]=b=>yn(St.value,"from",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Jd)]),e.createElementVNode("div",e1,[e.createElementVNode("label",t1,e.toDisplayString(e.unref(N)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Bl(St.value).to??"",onInput:v[18]||(v[18]=b=>yn(St.value,"to",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,l1)])])):Sl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:dn[St.value]??"",onInput:v[19]||(v[19]=b=>Hl(St.value,b.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(N)("table.search")},null,40,n1),e.createElementVNode("div",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Sl.value),b=>(e.openBlock(),e.createElementBlock("label",{key:b,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:_l(St.value,b),onChange:H=>ql(St.value,b)},null,40,o1),e.createElementVNode("span",null,e.toDisplayString(b),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",s1,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:v[20]||(v[20]=b=>Zn(St.value))},e.toDisplayString(e.unref(N)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,St.value&&Sl.value&&El.value]])]),_:1})]))],64))}}),c1="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",u1="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",d1="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",m1="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",p1="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",v1="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",f1={class:"dss-toolbar-left"},h1=["title"],g1=["title"],y1={class:"dss-toolbar-dropdown-wrapper"},k1=["title"],C1=["src"],b1=["src"],w1=["src"],x1=["src"],E1=["src"],S1=["src"],V1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},N1=["src"],B1=["src"],_1=["src"],M1=["src"],$1=["src"],D1=["src"],L1=["title"],T1=["title"],A1=["title"],H1=["title"],R1=["title"],F1=["title"],I1=["title"],z1=["title"],P1=["title"],O1={key:2,class:"dss-toolbar-separator"},W1=["title"],q1={key:4,class:"dss-toolbar-separator"},Z1={key:5,class:"dss-toolbar-dropdown-wrapper"},U1=["title"],Y1={class:"dss-toolbar-dropdown-ai"},X1={class:"dss-toolbar-right"},j1={key:0,class:"dss-toolbar-custom-group"},K1={key:1,class:"dss-toolbar-separator"},G1={class:"dss-link-modal-content"},Q1={class:"dss-link-modal-field"},J1={class:"dss-link-modal-label"},em=["placeholder"],tm={class:"dss-link-modal-field"},lm={class:"dss-link-modal-label"},nm=["placeholder"],am={class:"dss-image-modal-tabs"},om={key:0,class:"dss-image-tab-content"},sm={class:"dss-link-modal-content"},rm={class:"dss-link-modal-field"},im={key:0,class:"dss-link-modal-label"},cm=["src"],um={class:"dss-link-modal-field"},dm={class:"dss-link-modal-label"},mm=["placeholder"],pm={class:"dss-link-modal-field"},vm={class:"dss-link-modal-label"},fm=["placeholder"],hm={class:"dss-link-modal-field"},gm={class:"dss-link-modal-label"},ym=["placeholder"],km={key:1,class:"dss-image-tab-content"},Cm={class:"dss-link-modal-content"},bm={class:"dss-link-modal-field"},wm={class:"dss-link-modal-label"},xm=["placeholder"],Em={class:"dss-link-modal-field"},Sm={class:"dss-link-modal-label"},Vm=["placeholder"],Nm={class:"dss-link-modal-field"},Bm={class:"dss-link-modal-label"},_m=["placeholder"],Mm={class:"dss-link-modal-field"},$m={class:"dss-link-modal-label"},Dm=["placeholder"],Lm={class:"dss-text-editor-title-input-container"},Tm={key:0,class:"dss-text-editor-title-preview"},Am={key:0},Hm={key:1,class:"dss-text-editor-preview-placeholder"},Rm=["value","placeholder","disabled"],Fm={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Im={class:"dss-text-editor-description-input-container"},zm={key:0,class:"dss-text-editor-description-preview"},Pm={key:0},Om={key:1,class:"dss-text-editor-preview-placeholder"},Wm=["value","placeholder","disabled"],qm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Zm=["data-comment-id","onMouseenter"],Um=["onClick"],Ym=["src","alt"],Xm={key:1},jm=["onClick"],Km=["src","alt"],Gm={key:1},Qm=["data-has-second-user","onClick"],Jm={class:"editor-comment-marker-count"},e2={key:7,class:"dss-text-editor-textarea-wrapper"},t2=["value","placeholder","rows","disabled"],l2={class:"dss-text-editor-footer"},n2={class:"dss-text-editor-footer-content"},a2={class:"dss-text-editor-footer-stat"},o2={class:"dss-text-editor-footer-stat"},s2={key:8,class:"dss-text-editor-content-wrapper"},r2={key:0,class:"dss-comment-overlay-body"},i2={class:"dss-comment-selection-wrapper"},c2=["innerHTML"],u2={class:"dss-comment-messages-wrapper"},d2={key:0,class:"dss-comment-avatar-wrapper"},m2={class:"dss-comment-avatar"},p2=["src","alt"],v2={key:1},f2={class:"dss-comment-header"},h2={class:"dss-comment-header-text"},g2={class:"dss-comment-author"},y2={key:0,class:"dss-comment-date"},k2=["onClick","title"],C2={class:"dss-comment-overlay-inner"},b2=["placeholder","onKeydown"],w2={class:"dss-text-editor-footer"},x2={class:"dss-text-editor-footer-content"},E2={class:"dss-text-editor-footer-stat"},S2={class:"dss-text-editor-footer-stat"},V2=["title"],N2=["title"],B2={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:""},_2={class:"dss-image-popup-content"},M2={key:0,class:"dss-image-popup-no-alt-icon"},$2=["title"],D2=["title"],L2={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:""},T2={class:"dss-toolbar-left"},A2=["title"],H2=["title"],R2={class:"dss-toolbar-dropdown-wrapper"},F2=["title"],I2=["src"],z2=["src"],P2=["src"],O2=["src"],W2=["src"],q2=["src"],Z2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},U2=["title"],Y2=["title"],X2=["title"],j2=["title"],K2=["title"],G2=["title"],Q2=["title"],J2=["title"],ep=["title"],tp={key:2,class:"dss-toolbar-separator"},lp=["title"],np={key:4,class:"dss-toolbar-separator"},ap={key:5,class:"dss-toolbar-dropdown-wrapper"},op=["title"],sp={class:"dss-toolbar-dropdown-ai"},rp={key:0,class:"dss-toolbar-right"},ip={key:0,class:"dss-toolbar-separator"},cp={key:0,class:"dss-toolbar-custom-group"},up={key:1,class:"dss-toolbar-separator"},dp={name:"DSSTextEditor"},mp=Object.assign(dp,{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:B=>typeof B=="object"&&B!==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:B=>typeof B=="object"&&B!==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(B,{expose:ee,emit:N}){const{t:$,locale:se}=va.useI18n(),O={h1:c1,h2:u1,h3:d1,h4:m1,h5:p1,h6:v1},A=B,pe=N,rt=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
100
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),p=document.createElement("a");p.href=r,p.download=fn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),bn()}catch(t){console.error("Error downloading CSV:",t)}},ta=t=>{if(typeof t.action=="function"){const a={series:q.series,categories:q.categories,markers:tl.value},l={chartX:dt.value.chartX,chartY:dt.value.chartY,dataX:dt.value.mouseDataX,dataY:dt.value.mouseDataY,categoryIndex:clampedCategoryIndex||dt.value.categoryIndex};t.action(a,l)}bn()},Ha=()=>{an(),Pe.value.show=!0,Pe.value.categoryIndex=dt.value.categoryIndex,Pe.value.fromButton=!1,bn()},no=()=>{an(),Pe.value.show=!0,Pe.value.categoryIndex=0,Pe.value.fromButton=!0},Ra=t=>{if(dt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(dt.value.show=!1)}},Yn=t=>{dt.value.show&&!t.target.closest(".context-menu")&&(dt.value.show=!1)},sa=t=>{if(!Bl.value||!ae.value||gl.value)return;t.preventDefault(),t.stopPropagation(),de.value.isZooming=!0,$e.value.show=!1,de.value.zoomTimeout&&clearTimeout(de.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top;if(r<z.value.left-50||r>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){de.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,E=Math.max(de.value.minScale,Math.min(de.value.maxScale,de.value.scale*h));if(E!==de.value.scale){const{minX:S,maxX:W}=jt.value,L=W-S||1,I=L/de.value.scale,D=S-de.value.offsetX/z.value.width*L,G=(r-z.value.left)/z.value.width,Ve=D+G*I;de.value.scale=E;const qe=L/de.value.scale,fe=Ve-G*qe;de.value.offsetX=-(fe-S)/L*z.value.width,de.value.scale<=1.01&&(de.value.scale=1,de.value.offsetX=0)}de.value.zoomTimeout=setTimeout(()=>{de.value.isZooming=!1,de.value.zoomTimeout=null},300)},Ca=t=>{if(!Bl.value||!ae.value||de.value.scale<=1)return;$e.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,de.value.isDragging=!0,de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY,t.preventDefault()},ao=()=>{de.value.isDragging=!1},ra=()=>{!Bl.value||!ae.value||(de.value.scale=1,de.value.offsetX=0,de.value.isDragging=!1,de.value.zoomTimeout&&(clearTimeout(de.value.zoomTimeout),de.value.zoomTimeout=null),de.value.isZooming=!1)},ba=()=>!Bl.value||!pt.value||!ae.value?"default":de.value.isDragging?"grabbing":de.value.scale>1?"grab":"dss-crosshair",ia=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 l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],p=t[l],h=t[l+1],E=t[Math.min(l+2,t.length-1)],S=p.x+(h.x-r.x)/6*V.value,W=p.y+(h.y-r.y)/6*V.value,L=h.x-(E.x-p.x)/6*V.value,I=h.y-(E.y-p.y)/6*V.value;a+=` C ${S} ${W} ${L} ${I} ${h.x} ${h.y}`}return a},xl=e.computed(()=>{const a=Z.value?.chart?.padding,l=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let h=p+(ht.value?30:0)+60;if(hl.value){const D={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??D.left,top:r.top??D.top,right:r.right??D.right,bottom:r.bottom??D.bottom}:D}if(Xt.value){const D=!He.value,G=Cn.value,Ve=G?fl.value+In.value+Math.max(24,tn.value+16):0,qe=D?12:p;let fe=0;Je.value&&(fe+=D?8:15),ct.value&&(fe+=D?6:10);const we=Be();let Ee=qe+(D?4:16)+(G?Ve:0),ve=qe+(G?Ve:0);He.value&&nt.value==="left"?Ee+=we.legendWidth||150:He.value&&nt.value==="right"&&(ve+=we.legendWidth||150);const Ie=ye.value==="semi-radial"?G?Ve:8:G?Ve:D?8:p+80,Le=G?14:0,Ne=qe+fe+Le,Fe={left:Ee,top:Ne,right:ve,bottom:Ie};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Fe.left,top:r.top??Fe.top,right:r.right??Fe.right,bottom:r.bottom??Fe.bottom}:Fe}let E=0;Je.value&&(E+=15),ct.value&&(E+=10);const S=Be();let W=p+16+(ut.value?30:0),L=p+(xt.value?30:0);He.value&&nt.value==="left"?W+=S.legendWidth||150:He.value&&nt.value==="right"&&(L+=S.legendWidth||150),jn.value&&(L+=44),ye.value==="stepbar"&&(h=Al.value+8);const I={left:W,top:p+E,right:L,bottom:h};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??I.left,top:r.top??I.top,right:r.right??I.right,bottom:r.bottom??I.bottom}:I}),z=e.computed(()=>({left:xl.value.left,top:xl.value.top,right:ze.value-xl.value.right,bottom:Qe.value-xl.value.bottom,width:ze.value-(xl.value.left+xl.value.right),height:Qe.value-(xl.value.top+xl.value.bottom)})),Bl=e.computed(()=>["line","area","bar","stepbar"].includes(ye.value)||ft.value),on=e.computed(()=>ft.value),xn=e.computed(()=>ye.value==="mini-radial"),Xt=e.computed(()=>["radial","semi-radial","mini-radial"].includes(ye.value)),hl=e.computed(()=>ye.value==="spider"),ll=e.computed(()=>ye.value==="bubble"),gl=e.computed(()=>ye.value==="stepbar");e.watch([A,gl,()=>q.series],()=>{e.nextTick(rt)},{deep:!0});const ml=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(ye.value==="bar"||on.value)),$n=t=>{const{minY:a,maxY:l}=jt.value,r=l-a||1;return z.value.left+(t-a)/r*z.value.width},hn=t=>{const{maxX:a}=jt.value,l=a+1,p=z.value.height/l;return z.value.top+(t+.5)*p},vt=e.computed(()=>Xt.value?xl.value.left+(ze.value-xl.value.left-xl.value.right)/2:ze.value/2),yt=e.computed(()=>{if(hl.value){const t=z.value.width-80,a=z.value.height-80;return Math.min(t,a)/2}if(ye.value==="semi-radial"){const t=z.value.width/2,a=Qe.value-xl.value.top-xl.value.bottom;return Math.min(t,a)}return Math.min(z.value.width,z.value.height)/2}),wt=e.computed(()=>hl.value?Qe.value/2-40:ye.value==="semi-radial"?xl.value.top+yt.value:Xt.value?xl.value.top+(Qe.value-xl.value.top-xl.value.bottom)/2:Qe.value/2),nl=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof a=="number"&&a>=0&&a<=1?a:.45;return yt.value*l}),oo=e.computed(()=>{const t=Z.value,a=typeof q.innerSize=="number"?q.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Xt.value||hl.value)?1:1+a/100}),wa=e.computed(()=>{const t=oo.value;if(t===1||t<=0)return;const a=vt.value,l=wt.value;return`translate(${a}, ${l}) scale(${t}) translate(${-a}, ${-l})`}),Xn=e.ref(0),o=e.computed(()=>`semi-radial-fill-clip-${q.chartId}`),n=e.computed(()=>ye.value==="semi-radial"),s=e.computed(()=>n.value&&bl.value&&!qn.value),i=e.computed(()=>n.value&&bl.value&&!qn.value&&yn.value==="fill"),c=e.computed(()=>{const t=s.value?Xn.value:1,a=vt.value,l=wt.value,r=nl.value,p=yt.value,h=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;const S=a+p*Math.cos(h),W=l+p*Math.sin(h),L=a+p*Math.cos(E),I=l+p*Math.sin(E),D=a+r*Math.cos(E),G=l+r*Math.sin(E),Ve=a+r*Math.cos(h),qe=l+r*Math.sin(h),fe=t>.5?1:0;return`M ${a} ${l} L ${S} ${W} A ${p} ${p} 0 ${fe} 1 ${L} ${I} L ${D} ${G} A ${r} ${r} 0 ${fe} 1 ${Ve} ${qe} Z`}),m=e.computed(()=>{if(!(!n.value||!s.value)&&!i.value)return`url(#${o.value})`}),u=t=>{if(!(!i.value||t!==0))return`url(#${o.value})`},f=e.ref(0),y=e.computed(()=>`radial-reveal-clip-${q.chartId}`),C=e.computed(()=>ye.value==="radial"),F=e.computed(()=>{const t=C.value?f.value:1,a=vt.value,l=wt.value,r=Math.max(yt.value*1.5,ze.value,Qe.value);if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;if(t>=1){const D=a-r,G=a+r;return`M ${D} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${D} ${l} Z`}const p=-Math.PI/2,h=p+t*Math.PI*2,E=a+r*Math.cos(p),S=l+r*Math.sin(p),W=a+r*Math.cos(h),L=l+r*Math.sin(h),I=t>=.5?1:0;return`M ${a} ${l} L ${E} ${S} A ${r} ${r} 0 ${I} 1 ${W} ${L} Z`}),P=e.computed(()=>{if(m.value)return m.value;if(C.value)return`url(#${y.value})`});let _=null;const me=()=>{if(!s.value)return;Xn.value=0;const t=dn.value,a=performance.now(),l=r=>{const p=r-a,h=Math.min(1,p/t);Xn.value=fo(Hn.value,h),h<1&&(_=requestAnimationFrame(l))};_=requestAnimationFrame(l)},le=e.computed(()=>Z.value?.bubbles?.minSize||8),We=e.computed(()=>Z.value?.bubbles?.maxSize||50),_e=e.computed(()=>Z.value?.bubbles?.opacity||.7),mt=(t,a)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},El=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},yl=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Lt=e.computed(()=>q.series),It=e.computed(()=>q.series.filter((t,a)=>!ne.value.has(a))),cl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},al=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,pl=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,sn=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}}),Dn=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?sn.value.bubbleSize:Ke.value,xa=(t,a)=>pl(t)&&sn.value.usePrimaryColor?el(0):el(a),On=(t,a)=>hl.value&&pl(t)?xa(t,a):el(a),Fa=e.computed(()=>It.value.filter(t=>cl(t)==="primary")),Ea=e.computed(()=>It.value.filter(t=>cl(t)==="secondary")),jn=e.computed(()=>!ml.value&&!!Gt.value&&Ea.value.length>0),Sa=(t,a=0)=>{const l=Number(t);return Number.isFinite(l)?l:a},ca=(t,a,l)=>{if(!Array.isArray(t))return[];const r=t.map((p,h)=>{const E=p&&typeof p=="object"&&!Array.isArray(p),S=Sa(E?p.value:p,0);return S<=0?null:{key:`${l}-${h}-${E&&p.label||h}`,label:E?p.label||a?.name||`Segment ${h+1}`:a?.name||`Segment ${h+1}`,value:S,color:E?p.color||el(h):el(l),marker:E?p.marker:null,isRemainder:!1}}).filter(Boolean);return Oe.value==="asc"?r.sort((p,h)=>p.value-h.value):Oe.value==="desc"?r.sort((p,h)=>h.value-p.value):r},Ia=(t,a,l,r)=>{const p=t&&typeof t=="object"&&!Array.isArray(t),h=p?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:el(r)}],E=ca(h,l,r),S=E.reduce((D,G)=>D+G.value,0),W=Sa(p?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,kt.value),L=Math.max(W,S,1);st.value&&L>S&&E.push({key:`${r}-${a}-remainder`,label:Xe.value,value:L-S,color:Et.value,marker:null,isRemainder:!0});const I=E.filter(D=>!D.isRemainder).reduce((D,G)=>!D||G.value>D.value?G:D,null);return{key:`${r}-${a}`,label:p?t.label||t.name||q.categories?.[a]||N("chart.fallback.item",{number:a+1}):q.categories?.[a]||N("chart.fallback.item",{number:a+1}),axisLabel:p?t.xLabel??t.label??t.name??q.categories?.[a]??N("chart.fallback.item",{number:a+1}):q.categories?.[a]||N("chart.fallback.item",{number:a+1}),yLabel:p?t.yLabel??null:null,totalValue:L,usedValue:S,segments:E,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},jl=e.computed(()=>{if(!gl.value)return[];const t=[];return Lt.value.forEach((a,l)=>{ne.value.has(l)||!Array.isArray(a?.data)||a.data.forEach(r=>{const p=Ia(r,t.length,a,l);p.segments.length>0&&t.push(p)})}),t}),ol="auto",Kl=(t,a,l,r=0,p=100)=>{let h=1/0,E=-1/0;if(t.forEach(L=>{L?.data?.length&&L.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(h=Math.min(h,I),E=Math.max(E,I))})}),h===1/0)return{minY:r,maxY:p};let S;if(a===ol){const L=E-h,I=L>0?L*.1:1;S=Math.max(0,h-I)}else if(typeof a=="number")S=a;else{const L=E-h,I=L>0?L*.1:1;S=Math.max(0,h-I)}let W;if(l===ol){const L=E-h,I=L>0?L*.1:2;W=E+I}else if(typeof l=="number")W=l;else{const L=E-h,I=L>0?L*.1:2;W=E+I}return{minY:S,maxY:W}},jt=e.computed(()=>{if(ll.value)return Zo();if(gl.value)return qo();if(!It.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;It.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),q.categories.length>0&&(t=Math.max(t,q.categories.length-1));const a=Kl(Fa.value.length?Fa.value:It.value,Nt.value,ue.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),qo=()=>{const t=jl.value,a=t.reduce((h,E)=>Math.max(h,E.totalValue),kt.value),l=typeof Nt.value=="number"?Nt.value:0,r=typeof ue.value=="number"?ue.value:a,p=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:p}},ko=e.computed(()=>jn.value?Kl(Ea.value,R.value,Y.value,jt.value.minY,jt.value.maxY):{minY:jt.value.minY,maxY:jt.value.maxY}),Zo=()=>{if(!It.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,l=1/0,r=-1/0,p=1/0,h=-1/0,E=!1;if(It.value.forEach((Ve,qe)=>{Ve?.data?.length&&Ve.data.forEach((fe,we)=>{let Ee,ve,Ge;if(typeof fe=="object"&&fe!==null&&!Array.isArray(fe))Ee=typeof fe.x=="number"?fe.x:we,ve=typeof fe.y=="number"?fe.y:0,Ge=typeof fe.size=="number"?fe.size:20;else if(Array.isArray(fe)&&fe.length>=3)Ee=typeof fe[0]=="number"?fe[0]:we,ve=typeof fe[1]=="number"?fe[1]:0,Ge=typeof fe[2]=="number"?fe[2]:20;else if(typeof fe=="number")Ee=we,ve=fe,Ge=mt(qe,we);else return;isFinite(Ee)&&isFinite(ve)&&isFinite(Ge)&&(t=Math.min(t,Ee),a=Math.max(a,Ee),l=Math.min(l,ve),r=Math.max(r,ve),p=Math.min(p,Ge),h=Math.max(h,Ge),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,q.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const S=a-t,W=r-l;let L,I,D,G;return ie.value!==null?L=ie.value:L=t-S*.1,be.value!==null?I=be.value:I=a+S*.1,Nt.value!==null&&typeof Nt.value=="number"?D=Nt.value:D=Math.max(0,l-W*.1),ue.value!==null&&typeof ue.value=="number"?G=ue.value:G=r+W*.1,{minX:L,maxX:I,minY:D,maxY:G,minSize:p,maxSize:h}},kl=t=>{if(ll.value){const{minX:S,maxX:W}=jt.value,L=W-S||1;return z.value.left+(t-S)/L*z.value.width}const{minX:a,maxX:l}=jt.value,r=l-a;if(l===0||r===0)return z.value.left+z.value.width/2;const p=r/de.value.scale,h=a-de.value.offsetX/z.value.width*r,E=(t-h)/p;return z.value.left+E*z.value.width},Kn=t=>{const{minY:a,maxY:l}=jt.value,r=l-a||1;return z.value.bottom-(t-a)/r*z.value.height},Co=t=>{const{minY:a,maxY:l}=ko.value,r=l-a||1;return z.value.bottom-(t-a)/r*z.value.height},En=(t,a)=>jn.value&&cl(t)==="secondary"?Co(a):Kn(a),Uo=t=>{if(!ll.value)return Ke.value||4;const{maxSize:a}=jt.value,l=Math.max(1,a),r=Math.min(1,Math.max(0,t/l));return le.value+r*(We.value-le.value)},ua=(t,a=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);ua.canvas||(ua.canvas=document.createElement("canvas"));const r=ua.canvas.getContext("2d");return r?(r.font=`${a}px ${l}`,r.measureText(t).width):t.length*(a*.62)},bo=(t,a,l=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||ua(t,l)<=a)return t;const r="..";if(ua(r,l)>=a)return r;let h=t.length;for(;h>0;){const E=`${t.slice(0,h)}${r}`;if(ua(E,l)<=a)return E;h-=1}return r},Yo=e.computed(()=>ro.value.map(t=>({y:t.y}))),wo=e.computed(()=>!gl.value||!Vt.value?[]:ro.value.map(t=>({y:t.y}))),so=e.computed(()=>{if(ll.value)return Xo();if(gl.value)return[];if(ye.value==="bar"){if(ml.value){const Ne=[],{minY:Fe,maxY:Bt}=jt.value,zt=5,rn=Bt-Fe||1;for(let Cl=0;Cl<=zt;Cl++){const cn=Fe+rn*(Cl/zt),qa=$n(cn);Ne.push({x:qa,y:z.value.bottom+20,text:qt(Math.round(cn))})}return Ne}const we=[],{maxX:Ee}=jt.value,ve=Ee+1,Ge=5,Le=(z.value.width-Ge*2)/ve;for(let Ne=0;Ne<=Ee;Ne++){const Fe=z.value.left+Ge+(Ne+.5)*Le;we.push({x:Fe,y:z.value.bottom+20,text:bo(q.categories[Ne]||N("chart.fallback.item",{number:Ne+1}),Math.max(Le-8,24))})}return we}const t=[],{minX:a,maxX:l}=jt.value,r=ie.value!==null?ie.value:a,p=be.value!==null?be.value:l,h=p-r||1,E=h/de.value.scale,S=r-de.value.offsetX/z.value.width*h,W=S+E,L=Math.max(0,Math.floor(S-2)),I=Math.min(p,Math.ceil(W+2)),D=I-L,G=z.value.width,qe=Math.floor(G/60);let fe=1;D>qe&&(fe=Math.ceil(D/qe));for(let we=L;we<=I;we+=fe)if(we>=0&&we<=p){const Ee=kl(we);Ee>=z.value.left-100&&Ee<=z.value.right+100&&t.push({x:Ee,y:z.value.bottom+20,text:q.categories[we]||`Item ${we+1}`})}return t}),Xo=()=>{const t=[],{minX:a,maxX:l}=jt.value,r=l-a||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let h=0;h<=p;h++){const E=a+r*h/p,S=kl(E);if(S>=z.value.left-10&&S<=z.value.right+10){const W=Math.round(E),L=q.categories?.[W];t.push({x:S,y:z.value.bottom+20,text:L||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},ro=e.computed(()=>{if(ml.value){const p=[],{maxX:h}=jt.value;for(let E=0;E<=h;E++)p.push({x:z.value.left-10,y:hn(E),text:bo(q.categories[E]||`Item ${E+1}`,Math.max(z.value.left-28,40))});return p}const t=[],{minY:a,maxY:l}=jt.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:z.value.left-10,y:Kn(h),text:qt(E)})}return t}),jo=e.computed(()=>{if(!jn.value||ml.value)return[];const t=[],{minY:a,maxY:l}=ko.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:z.value.right+10,y:Co(h),text:qt(E)})}return t}),el=t=>{const a=ce.value;if(!a||a.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return a[t%a.length]},Ko=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let l=0,r=0,p=0;const h=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(h)l=Number(h[1])/255,r=Number(h[2])/255,p=Number(h[3])/255;else{const S=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,p=Number(S[3])/255;else{const W=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let L=W[1];L.length===3&&(L=L[0]+L[0]+L[1]+L[1]+L[2]+L[2]),l=parseInt(L.slice(0,2),16)/255,r=parseInt(L.slice(2,4),16)/255,p=parseInt(L.slice(4,6),16)/255}else if(typeof document<"u"){const L=document.createElement("span");L.style.color=a,L.style.display="none",document.body.appendChild(L);const I=getComputedStyle(L).color;document.body.removeChild(L);const D=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(D)l=Number(D[1])/255,r=Number(D[2])/255,p=Number(D[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},io=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),l=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const h=Math.max(0,Math.floor(Number(l[1])*.65)),E=Math.max(0,Math.floor(Number(l[2])*.65)),S=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${h}, ${E}, ${S})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const h=Math.max(0,Math.floor(Number(r[1])*.65)),E=Math.max(0,Math.floor(Number(r[2])*.65)),S=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${h}, ${E}, ${S}, ${r[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let h=p[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),W=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[E,S,W].map(L=>L.toString(16).padStart(2,"0")).join("")}`}return a},co=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?io(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??io(a):io(a)},uo=t=>{let a=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;a+=Math.sqrt(r*r+p*p)}return a},xo=e.computed(()=>ye.value==="line"||on.value?(on.value?q.series.filter(a=>(a.type||ye.value)==="line"):Lt.value).map((a,l)=>{const r=q.series.findIndex(D=>D===a),p=[];let h=[];a.data.forEach((D,G)=>{D==null?h.length>0&&(p.push([...h]),h=[]):h.push({x:ml.value?$n(D):kl(G),y:ml.value?hn(G):En(a,D),index:G})}),h.length>0&&p.push(h);let E="";p.forEach(D=>{if(D.length>0){let G="";M.value?G=ia(D):G=`M ${D[0].x} ${D[0].y}`+D.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),E+=(E?" ":"")+G}});const S=p.reduce((D,G)=>D+uo(G),0),W=ne.value.has(r),L=K.value===r,I=K.value!==null&&K.value!==r;return{path:E,color:el(r),strokeDasharray:al(a),pathLength:S,seriesIndex:r,animationDelay:l*Ml.value,isHighlighted:L,isDimmed:I,isHidden:W}}):[]),Eo=e.computed(()=>{if(!(ye.value==="line"||on.value))return[];const t=on.value?q.series.filter(l=>(l.type||ye.value)==="line"):Lt.value,a=[];return t.forEach((l,r)=>{const p=q.series.findIndex(h=>h===l);for(let h=0;h<l.data.length-1;h++){const E=l.data[h];if(E!=null){let S=-1,W=0;for(let L=h+1;L<l.data.length;L++){const I=l.data[L];if(I==null)W++;else{S=L;break}}if(W>0&&S!==-1){const L=l.data[S],I=ml.value?$n(E):kl(h),D=ml.value?hn(h):En(l,E),G=ml.value?$n(L):kl(S),Ve=ml.value?hn(S):En(l,L),qe=ne.value.has(p),fe=K.value===p,we=K.value!==null&&K.value!==p;a.push({path:`M ${I} ${D} L ${G} ${Ve}`,color:el(p),seriesIndex:p,animationDelay:r*Ml.value,isHighlighted:fe,isDimmed:we,isHidden:qe,gapSize:W}),h=S-1}}}}),a}),Go=e.computed(()=>ye.value==="line"||on.value?!bl.value||qn.value||Ft.value.hasAnimated?[]:(on.value?q.series.filter(a=>(a.type||ye.value)==="line"):Lt.value).map((a,l)=>{const r=q.series.findIndex(W=>W===a);let p="",h=null;a.data.forEach((W,L)=>{if(W!=null){const I={x:ml.value?$n(W):kl(L),y:ml.value?hn(L):En(a,W)};h===null?p+=`M ${I.x} ${I.y}`:p+=` L ${I.x} ${I.y}`,h=I}else if(h!==null){const I=a.data.findIndex((D,G)=>G>L&&D!==null&&D!==void 0);if(I!==-1){const D={x:ml.value?$n(a.data[I]):kl(I),y:ml.value?hn(I):En(a,a.data[I])};p+=` L ${D.x} ${D.y}`,h=D}}});const E=a.data.map((W,L)=>W==null?null:{x:ml.value?$n(W):kl(L),y:ml.value?hn(L):En(a,W)}).filter(W=>W!==null),S=uo(E);return{path:p,pathLength:S,color:el(r),strokeDasharray:al(a),animationDelay:l*Ml.value,seriesIndex:r}}):[]),Qo=e.computed(()=>{if(ye.value!=="line")return[];const t=[];return Lt.value.forEach((a,l)=>{const r=K.value===l,p=K.value!==null&&K.value!==l,h=ne.value.has(l);a.data.forEach((E,S)=>{E!=null&&t.push({x:kl(S),y:En(a,E),color:el(l),value:E,label:q.categories[S]||S.toString(),seriesName:a.name,categoryIndex:S,dataIndex:S,animationDelay:(l*a.data.length+S)*(Ml.value/8),isHighlighted:r,isDimmed:p,isHidden:h})})}),t}),Jo=e.computed(()=>{if(!on.value)return[];const t=[];return q.series.filter(l=>(l.type||ye.value)==="line").forEach((l,r)=>{const p=q.series.findIndex(W=>W===l),h=K.value===p,E=K.value!==null&&K.value!==p,S=ne.value.has(p);l.data.forEach((W,L)=>{W!=null&&t.push({x:kl(L),y:En(l,W),color:el(p),value:W,label:q.categories[L]||L.toString(),seriesName:l.name,categoryIndex:L,dataIndex:L,animationDelay:(r*l.data.length+L)*(Ml.value/8),isHighlighted:h,isDimmed:E,isHidden:S})})}),t}),za=e.computed(()=>{if(!ll.value)return[];const t=[];return Lt.value.forEach((a,l)=>{if(!a?.data?.length)return;const r=K.value,p=r!==null&&r===l,h=r!==null&&r!==l,E=ne.value.has(l);a.data.forEach((S,W)=>{let L,I,D,G,Ve;if(typeof S=="object"&&S!==null&&!Array.isArray(S))L=typeof S.x=="number"?S.x:W,I=typeof S.y=="number"?S.y:0,D=typeof S.size=="number"?S.size:20,G=S.label||q.categories?.[W]||`Point ${W+1}`,Ve=S.image||S.imageUrl;else if(Array.isArray(S)&&S.length>=3)L=typeof S[0]=="number"?S[0]:W,I=typeof S[1]=="number"?S[1]:0,D=typeof S[2]=="number"?S[2]:20,G=S[3]||q.categories?.[W]||`Point ${W+1}`,Ve=S[4];else if(typeof S=="number")L=W,I=S,D=mt(l,W),G=q.categories?.[W]||`Point ${W+1}`;else return;!isFinite(L)||!isFinite(I)||!isFinite(D)||t.push({x:kl(L),y:Kn(I),radius:Uo(D),originalX:L,originalY:I,originalSize:D,color:el(l),seriesName:a.name||`Series ${l+1}`,label:G,imageUrl:Ve,seriesIndex:l,dataIndex:W,categoryIndex:Math.round(L),isHighlighted:p,isDimmed:h,isHidden:E,opacity:_e.value})})}),t}),mo=e.computed(()=>ye.value!=="area"?[]:Lt.value.map((t,a)=>{const l=[];let r=[];if(t.data.forEach((D,G)=>{D==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:kl(G),y:En(t,D),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:el(a),isHidden:ne.value.has(a)};const p=z.value.bottom+1;let h="",E="";l.forEach((D,G)=>{if(D.length===0)return;let Ve=`M ${D[0].x} ${D[0].y}`;M.value&&D.length>1?Ve=ia(D):D.slice(1).forEach(fe=>{Ve+=` L ${fe.x} ${fe.y}`}),h+=(h?" ":"")+Ve;let qe=`M ${D[0].x} ${p}`;if(qe+=` L ${D[0].x} ${D[0].y}`,M.value&&D.length>1){const fe=ia(D),we=fe.substring(fe.indexOf("C")||fe.indexOf("Q")||fe.indexOf("L"));we?qe+=" "+we:D.slice(1).forEach(Ee=>{qe+=` L ${Ee.x} ${Ee.y}`})}else D.slice(1).forEach(fe=>{qe+=` L ${fe.x} ${fe.y}`});qe+=` L ${D[D.length-1].x} ${p} Z`,E+=(E?" ":"")+qe});const S=K.value===a,W=K.value!==null&&K.value!==a,L=ne.value.has(a),I=l.reduce((D,G)=>D+uo(G),0);return{linePath:h,areaPath:E,color:el(a),pathLength:I,isHighlighted:S,isDimmed:W,isHidden:L}})),So=e.computed(()=>{if(!(["bar"].includes(ye.value)||on.value))return[];const t=[],{maxX:a}=jt.value,l=on.value?q.series.filter(p=>(p.type||ye.value)==="bar"):Lt.value,r=l.length;if(ml.value){const p=a+1,E=z.value.height/p,S=E*(2/3),W=Math.min(4,S/r*.15),L=S-(r-1)*W,I=Math.max(4,L/r);l.forEach((D,G)=>{const Ve=q.series.findIndex(Ee=>Ee===D),qe=K.value===Ve,fe=K.value!==null&&K.value!==Ve,we=ne.value.has(Ve);D.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.top+(ve+.5)*E-S/2+G*(I+W),Ne=z.value.left,Fe=Math.abs($n(Ee)-z.value.left);let Bt="";if(M.value&&Fe>0){const zt=Math.min(T.value,I/2,Fe/2);Bt=[`M ${Ne} ${Le}`,`L ${Ne+Fe-zt} ${Le}`,`Q ${Ne+Fe} ${Le} ${Ne+Fe} ${Le+zt}`,`L ${Ne+Fe} ${Le+I-zt}`,`Q ${Ne+Fe} ${Le+I} ${Ne+Fe-zt} ${Le+I}`,`L ${Ne} ${Le+I}`,"Z"].join(" ")}t.push({x:Ne,y:Le,width:Fe,height:I,color:el(r===1?ve:Ve),value:Ee,label:q.categories[ve]||ve.toString(),seriesName:D.name,animationDelay:(G*l.length+ve)*(Ml.value/4),isHighlighted:qe,isDimmed:fe,isHidden:we,barPath:Bt,isSmooth:M.value&&Fe>0})})})}else{const p=a+1,E=z.value.width/p,S=E*.8,W=S/r,L=W*.05,I=W-L;l.forEach((D,G)=>{const Ve=q.series.findIndex(Ee=>Ee===D),qe=K.value===Ve,fe=K.value!==null&&K.value!==Ve,we=ne.value.has(Ve);D.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.left+(ve+.5)*E-S/2+G*W+L/2,Ne=Kn(Math.max(0,Ee)),Fe=Math.abs(Kn(0)-Kn(Ee));let Bt="";if(M.value&&Fe>0){const zt=Math.min(T.value,I/2,Fe/2);Bt=[`M ${Le} ${Ne+Fe}`,`L ${Le} ${Ne+zt}`,`Q ${Le} ${Ne} ${Le+zt} ${Ne}`,`L ${Le+I-zt} ${Ne}`,`Q ${Le+I} ${Ne} ${Le+I} ${Ne+zt}`,`L ${Le+I} ${Ne+Fe}`,"Z"].join(" ")}t.push({x:Le,y:Ne,width:I,height:Fe,color:el(r===1?ve:Ve),value:Ee,label:q.categories[ve]||ve.toString(),seriesName:D.name,animationDelay:(G*l.length+ve)*(Ml.value/4),isHighlighted:qe,isDimmed:fe,isHidden:we,barPath:Bt,isSmooth:M.value&&Fe>0})})})}return t}),Wn=e.computed(()=>{if(!Xt.value)return[];const t=Lt.value.map((E,S)=>({series:E,originalIndex:S})).filter(({originalIndex:E})=>!ne.value.has(E));if(t.length===0)return[];let a=ye.value==="semi-radial"?Math.PI:-Math.PI/2;const l=ye.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(E,S,W,L,I,D)=>{const G=E+(S-E)/2,Ve=S-E,qe=vt.value+Math.cos(E)*nl.value,fe=wt.value+Math.sin(E)*nl.value,we=vt.value+Math.cos(S)*nl.value,Ee=wt.value+Math.sin(S)*nl.value,ve=vt.value+Math.cos(S)*yt.value,Ge=wt.value+Math.sin(S)*yt.value,Ie=vt.value+Math.cos(E)*yt.value,Le=wt.value+Math.sin(E)*yt.value,Ne=Ve>Math.PI?1:0,Fe=[`M ${qe} ${fe}`,`A ${nl.value} ${nl.value} 0 ${Ne} 1 ${we} ${Ee}`,`L ${ve} ${Ge}`,`A ${yt.value} ${yt.value} 0 ${Ne} 0 ${Ie} ${Le}`,"Z"].join(" "),Bt=D||el(W);return{path:Fe,color:Bt,strokeWidth:Se.value,strokeColor:co(r.length,Bt),value:I,seriesName:L,opacity:.8,isHighlighted:K.value===W,isDimmed:K.value!==null&&K.value!==W,isHidden:!1,startAngle:E,endAngle:S,midAngle:G}};if(xn.value){const{series:E,originalIndex:S}=t[0],W=Number(E?.data?.[0]??0),L=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,I=Z.value,D=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Ve=(L<=0?D:L)/100*l,qe=Number(I?.miniRadial?.thresholds?.low??33),fe=Number(I?.miniRadial?.thresholds?.medium??66),we=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",ve=I?.miniRadial?.colors?.high||"#38A169",Ge=L<=qe?we:L<=fe?Ee:ve,Ie=I?.miniRadial?.trackColor||"#E5E7EB",Le=E?.name||"Score";return r.push(p(a,a+l-.001,S+1,"Track",100,Ie)),r.push(p(a,a+Ve,S,Le,L,Ge)),r}if(t.length===1){const{series:E,originalIndex:S}=t[0],W=E.data[0]||0,L=a,I=a+l-.001,D=L+l/2,G=vt.value+Math.cos(L)*nl.value,Ve=wt.value+Math.sin(L)*nl.value,qe=vt.value+Math.cos(I)*nl.value,fe=wt.value+Math.sin(I)*nl.value,we=vt.value+Math.cos(I)*yt.value,Ee=wt.value+Math.sin(I)*yt.value,ve=vt.value+Math.cos(L)*yt.value,Ge=wt.value+Math.sin(L)*yt.value,Ie=1,Le=[`M ${G} ${Ve}`,`A ${nl.value} ${nl.value} 0 ${Ie} 1 ${qe} ${fe}`,`L ${we} ${Ee}`,`A ${yt.value} ${yt.value} 0 ${Ie} 0 ${ve} ${Ge}`,"Z"].join(" "),Ne=el(S);return r.push({path:Le,color:Ne,strokeWidth:Se.value,strokeColor:co(0,Ne),value:W,seriesName:E.name,opacity:.8,isHighlighted:K.value===S,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:I,midAngle:D}),r}if(i.value&&t.length===2){const E=t[0],S=t[1],W=Math.min(100,Math.max(0,E.series.data[0]||0)),L=W/100*l;return r.push(p(a,a+L,E.originalIndex,E.series.name,W)),r.push(p(a,a+l,S.originalIndex,S.series.name,100)),r}const h=t.reduce((E,{series:S})=>E+(S.data[0]||0),0);return h===0?[]:(t.forEach(({series:E,originalIndex:S})=>{const W=E.data[0]||0,L=W/h*l,I=a,D=a+L,G=I+L/2,Ve=vt.value+Math.cos(I)*nl.value,qe=wt.value+Math.sin(I)*nl.value,fe=vt.value+Math.cos(D)*nl.value,we=wt.value+Math.sin(D)*nl.value,Ee=vt.value+Math.cos(D)*yt.value,ve=wt.value+Math.sin(D)*yt.value,Ge=vt.value+Math.cos(I)*yt.value,Ie=wt.value+Math.sin(I)*yt.value,Le=L>Math.PI?1:0,Ne=[`M ${Ve} ${qe}`,`A ${nl.value} ${nl.value} 0 ${Le} 1 ${fe} ${we}`,`L ${Ee} ${ve}`,`A ${yt.value} ${yt.value} 0 ${Le} 0 ${Ge} ${Ie}`,"Z"].join(" "),Fe=el(S);r.push({path:Ne,color:Fe,strokeWidth:Se.value,strokeColor:co(r.length,Fe),value:W,seriesName:E.name,opacity:.8,isHighlighted:K.value===S,isDimmed:K.value!==null&&K.value!==S,isHidden:!1,startAngle:I,endAngle:D,midAngle:G}),a=D}),r)}),es=e.computed(()=>{const t=Wn.value;return i.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,l)=>({segment:a,originalIndex:l}))}),ts=e.computed(()=>{if(!Cn.value||!Xt.value)return[];const t=tn.value,a=fl.value,l=In.value,r=ln.value,p=15,h=t*1.3,E=.55,S=(D,G)=>{const Ve=vt.value+Math.cos(D.midAngle)*yt.value,qe=wt.value+Math.sin(D.midAngle)*yt.value,fe=vt.value+Math.cos(D.midAngle)*(yt.value+a),we=wt.value+Math.sin(D.midAngle)*(yt.value+a),ve=fe+l*(G?1:-1),Ge=G?fe+p:fe-p,Ie=we-r,Le=`${D.seriesName}: ${qt(D.value)}`,Ne=Le.length*t*E;return{pointerStartX:Ve,pointerStartY:qe,pointerEndX:fe,pointerEndY:we,horizontalEndX:ve,horizontalEndY:we,textX:Ge,textY:Ie,text:Le,textWidth:Ne,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(fe-Ve,we-qe),horizontalLineLength:Math.hypot(ve-fe,0)}},W=(D,G)=>{const Ve=Math.abs(D.textY-G.textY)<h,qe=D.isRightSide?D.textX:D.textX-D.textWidth,fe=D.isRightSide?D.textX+D.textWidth:D.textX,we=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,ve=qe<Ee&&we<fe;return Ve&&ve},L=Wn.value.filter(D=>!D.isHidden),I=[];for(let D=0;D<L.length;D++){const G=L[D];let Ve=Math.cos(G.midAngle)>=0;if(D>0){const fe=I[D-1],we=S(G,Ve);W(fe,we)&&(Ve=!Ve)}const qe=S(G,Ve);I.push({...qe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),ls=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||_e.value||.7;return K.value===null||K.value===void 0?a:K.value!==null?t.seriesIndex===K.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},ns=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return K.value!==null?t.seriesIndex===K.value?Math.min(1,a+.1):a*.7:a},Vo=(t,a)=>{if(t)try{if(K.value===t.seriesIndex?K.value=null:K.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:q.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},as=(t,a)=>{const l=[`dss-bubble-fallback-${a}`];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(" ")},No=(t,a)=>{if(!t||(a.stopPropagation(),Oa.value=!0,K.value=t.seriesIndex,$e.value.show=!1,!tt.value))return;const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let p=a.clientX-r.left+10,h=a.clientY-r.top-10;const E=200,S=120;p+E>ze.value&&(p=a.clientX-r.left-E-10),h+S>r.height&&(h=a.clientY-r.top-S-10),p<0&&(p=10),h<0&&(h=10);const W=b.value,L=H.value,I=W.map(D=>{const G=L[D]||D,Ve=Bo(D,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ve}`,color:t.color}:null}).filter(Boolean);je.value={show:!0,x:p,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},Bo=(t,a)=>{let l;switch(t){case"x":l=a.originalX;break;case"y":l=a.originalY;break;case"size":l=a.originalSize;break;case"label":l=a.label;break;case"seriesName":l=a.seriesName;break;default:l=a[t]||""}const r=U.value[t];if(typeof r=="function")return r(l,a);if(typeof l=="number"){const p=l.toFixed(1);return vl.value?p+vl.value:p}return l?.toString()||""},os=()=>{if(!ll.value||!$e.value.data||$e.value.data.length===0)return"Bubbles";const t=[],a=new Set;return $e.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;a.has(r)||(t.push(r),a.add(r))}else l.seriesName&&(a.has(l.seriesName)||(t.push(l.seriesName),a.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_o=(t,a)=>{t&&(Oa.value=!1,K.value=null,je.value.show=!1,je.value.bubbleData=[])},ss=(t,a)=>{const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),p=eo(t.categoryIndex),h=t.description||t.comment||"";let E=a.clientX-r.left+15,S=a.clientY-r.top-10;const W=200,L=h?80:50;E+W>ze.value&&(E=a.clientX-r.left-W-15),S+L>Qe.value&&(S=a.clientY-r.top-L-10),E<0&&(E=10),S<0&&(S=10),Ot.value={show:!0,x:E,y:S,categoryValue:p,description:h}},rs=()=>{Ot.value.show=!1},da=e.computed(()=>q.categories.length||Math.max(...It.value.map(t=>t.data.length))),is=e.computed(()=>{let t=0;return It.value.forEach(a=>{a.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Mo=e.computed(()=>{const t=[],a=da.value;for(let l=0;l<a;l++){const r=l*2*Math.PI/a-Math.PI/2,p=vt.value+Math.cos(r)*yt.value,h=wt.value+Math.sin(r)*yt.value;t.push({x:p,y:h,angle:r,index:l})}return t}),cs=e.computed(()=>{const t=[],a=da.value;return Mo.value.forEach((l,r)=>{const p=yt.value+15,h=r*2*Math.PI/a-Math.PI/2,E=vt.value+Math.cos(h)*p,S=wt.value+Math.sin(h)*p+5;let W="middle",L="middle";Math.abs(Math.cos(h))>.5&&(W=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(L=Math.sin(h)>0?"hanging":"auto"),t.push({x:E,y:S,text:q.categories[r]||`Axis ${r+1}`,anchor:W,baseline:L})}),t}),us=e.ref(new Set),ds=(t,a,l)=>{const r=`current-${l}`,p=us.value.has(r),h=a.fillOpacity??Fl.value;return!p&&K.value===null?h:a.isHighlighted||p?a.isComparison?h:h+.15:a.isDimmed?h*.3:h},$o=e.computed(()=>{if(!hl.value)return[];const t=[],a=da.value;return Lt.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const h=pl(r.series)?0:1,E=pl(p.series)?0:1;return h-E}).forEach(({series:r,seriesIndex:p})=>{const h=pl(r),E=[],S=[],W=[],L=K.value===p,I=K.value!==null&&K.value!==p,D=ne.value.has(p);for(let G=0;G<a;G++){const Ve=r.data[G]||0,fe=Ve/is.value*yt.value,we=G*2*Math.PI/a-Math.PI/2,Ee=vt.value+Math.cos(we)*fe,ve=wt.value+Math.sin(we)*fe;E.push(`${Ee},${ve}`),S.push({x:Ee,y:ve}),W.push({x:Ee,y:ve,value:Ve,label:q.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:E.join(" "),polygonPoints:S,dataPoints:W,color:xa(r,p),fillOpacity:h?sn.value.fillOpacity:Fl.value,strokeDasharray:h?al(r)||sn.value.strokeDasharray:null,pointRadius:Dn(r,h),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:L,isDimmed:I,isHidden:D,isComparison:h,seriesIndex:p})}),t}),ms=(t,a)=>{if(!a||a.length<3)return!1;let l=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const h=a[r].x,E=a[r].y,S=a[p].x,W=a[p].y;E>t.y!=W>t.y&&t.x<(S-h)*(t.y-E)/(W-E)+h&&(l=!l)}return l},ps=t=>{if(!hl.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const l=a.getBoundingClientRect(),r=te.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,h=t.clientY-r.top,E=$o.value.filter(S=>S.isHidden?!1:ms({x:p,y:h},S.polygonPoints));if(E.length>0){E.length,K.value=E[0].seriesIndex;const S=t.clientX-l.left+10,W=t.clientY-l.top-10,L=E.length>1?460:260,I=70+da.value*20;let D=S,G=W;D+L>ze.value&&(D=t.clientX-l.left-L-10),G+I>Qe.value&&(G=t.clientY-l.top-I-10),D<0&&(D=10),G<0&&(G=10);const Ve=E.map(qe=>({seriesName:qe.seriesName,color:qe.color,points:qe.dataPoints.map(fe=>({label:fe.label,value:qt(fe.value)}))}));je.value={show:!0,x:D,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else Ln()},Pa=e.computed(()=>{const t=Z.value;return t.logos.map((a,l)=>{const r=q.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||ne.value.has(a.seriesIndex))return null;let p,h;if(Bl.value){let S=-1,W=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){S=I,W=r.data[I];break}if(S===-1||W===null)return null;const L=r.data.map((I,D)=>I==null?null:{x:kl(D),y:En(r,I),index:D}).filter(I=>I!==null);if(t.animations.enabled&&!qn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ft.value.isAnimating||!Ft.value.hasAnimated))if(Ft.value.isAnimating){const I=Ft.value.currentFrame/Ft.value.totalFrames,D=fo(t.animations.easing,Math.min(I,1)),G=xs(L,D);p=G.x+(a.offsetX||0),h=G.y+(a.offsetY||0)}else p=L[0].x+(a.offsetX||0),h=L[0].y+(a.offsetY||0);else p=kl(S)+(a.offsetX||0),h=Kn(W)+(a.offsetY||0)}else if(Xt.value||hl.value){const S=Math.PI*2/t.logos.length*l;p=vt.value+Math.cos(S)*(yt.value+30)+(a.offsetX||0),h=wt.value+Math.sin(S)*(yt.value+30)+(a.offsetY||0)}return{...a,x:p,y:h,seriesIndex:a.seriesIndex}}).filter(Boolean)}),vs=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),l&&(l.style.opacity="1")},fs=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},po=t=>{ne.value.has(t)?ne.value.delete(t):ne.value.add(t)},hs=()=>{const t=$e.value.data?.length??0,a=$e.value.data?.reduce((l,r)=>Math.max(l,String(r?.seriesName??"").length),0)??0;return Math.min(320,Math.max(150,a*6+t*12+48))},gs=e.computed(()=>{if(!je.value.show&&!(it.value&&$e.value.show&&!de.value.isZooming))return{display:"none"};let t,a;if(it.value&&$e.value.show&&!de.value.isZooming){t=$e.value.x+15,a=z.value.top;const l=ll.value?200:hs();t+l>ze.value&&(t=$e.value.x-l-15),t<0&&(t=10),a<10&&(a=10)}else t=je.value.x,a=je.value.y;return{left:t+"px",top:a+"px"}}),Gn=(t,a)=>{if(!tt.value||Va.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,h=a.clientY-r.top-10;const E=200,S=120,W=ze.value,L=Qe.value;p+E>W&&(p=a.clientX-r.left-E-10),h+S>L&&(h=a.clientY-r.top-S-10),p<0&&(p=10),h<0&&(h=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&q.categories.includes(t.label)&&(I=q.categories.indexOf(t.label));let D=t.seriesName||t.label||"";(ml.value||ye.value==="bar")&&t.label&&(D=t.label),t.tooltipTitle&&(D=t.tooltipTitle),je.value={show:!0,x:p,y:h,title:D,value:qt(t.value)||"",categoryIndex:I,spiderAreas:[]}},vo=e.ref(!1),Oa=e.ref(!1),Ln=()=>{je.value.show=!1,je.value.spiderAreas=[],je.value.bubbleData=[],$e.value.show=!1,vo.value||(K.value=null)},Va=e.ref(!1),Na=(t,a)=>{Va.value=!0,je.value.show=!1,$e.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,h=a.clientY-r.top-10;const E=250;p+E>ze.value&&(p=a.clientX-r.left-E-15),p<0&&(p=10),h<0&&(h=10),v.value={show:!0,x:p,y:h,content:t.texts,count:t.totalCount}},Ba=()=>{Va.value=!1,v.value.show=!1},Ft=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),fo=(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}},qn=e.computed(()=>kn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Do=()=>{if(!bl.value||qn.value){Ft.value.hasAnimated=!0,C.value&&(f.value=1);return}C.value&&(f.value=0),Ft.value.isAnimating=!0,Ft.value.currentFrame=0,Ft.value.totalFrames=Math.ceil(dn.value/16.67);const t=()=>{const a=Ft.value.currentFrame/Ft.value.totalFrames,l=fo(Hn.value,Math.min(a,1));ys(l),C.value&&(f.value=l),a<1?(Ft.value.currentFrame++,Ft.value.animationId=requestAnimationFrame(t)):ks()};Ft.value.animationId=requestAnimationFrame(t)},ys=t=>{const a=O.value;a&&a.style.setProperty("--dss-animation-progress",t)},ks=()=>{Ft.value.isAnimating=!1,Ft.value.hasAnimated=!0,C.value&&(f.value=1),Ft.value.animationId&&(cancelAnimationFrame(Ft.value.animationId),Ft.value.animationId=null)},ho=e.computed(()=>!Xt.value||Ft.value.hasAnimated?!0:C.value?f.value>=1:n.value?Xn.value>=1:!0),Lo=e.computed(()=>Cn.value&&ho.value),Wa=e.ref(!1);e.watch(Lo,t=>{t?(Wa.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Wa.value=!0})})):Wa.value=!1},{immediate:!0});const Cs=e.computed(()=>{if(!bl.value||qn.value||Ft.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dn.value}ms`,t["--dss-animation-easing"]=bs(Hn.value),t["--dss-stagger-delay"]=`${Ml.value}ms`,t}),bs=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ws=()=>{if(!bl.value||qn.value)return"";const t=["dss-chart-animated"];return Ft.value.hasAnimated||t.push(`dss-animate-${yn.value}`),Ft.value.hasAnimated||(Xt.value&&ye.value!=="semi-radial"?t.push("dss-animate-fill"):Xt.value||t.push(`dss-animate-${yn.value}`)),Ft.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>q.series,(t,a)=>{ql.value&&a&&Ft.value.hasAnimated&&(Ft.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Do(),Rl.value)}))},{deep:!0}),e.watch(()=>de.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{wn()},50)}),e.watch(()=>[de.value.scale,de.value.offsetX],()=>{!de.value.isZooming&&!de.value.isDragging&&wn()},{flush:"post"}),e.watch([Q,oe],([t,a])=>{de.value.minScale=t,de.value.maxScale=a,(de.value.scale<t||de.value.scale>a)&&ra()},{immediate:!0}),e.watch(()=>q.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>dt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Yn)}):document.removeEventListener("click",Yn)}),e.onMounted(()=>{K.value=null,C.value&&(!bl.value||qn.value)&&(f.value=1),Pn(),e.nextTick(rt),O.value&&typeof ResizeObserver<"u"&&(J=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(X&&cancelAnimationFrame(X),X=requestAnimationFrame(()=>{X=null;const{width:l,height:r}=a.contentRect;xe.value=Math.round(l),Ce.value=Math.round(r),g.value&&(Tt.value=g.value.offsetHeight||he)}))}),J.observe(O.value)),bl.value&&!qn.value?ye.value==="semi-radial"?setTimeout(()=>me(),Rl.value):setTimeout(()=>Do(),Rl.value):(Ft.value.hasAnimated=!0,ye.value==="semi-radial"&&(Xn.value=1)),document.addEventListener("mousemove",To),document.addEventListener("mouseup",Ao),document.addEventListener("click",Ra)}),e.onUnmounted(()=>{pe&&(pe(),pe=null),X&&cancelAnimationFrame(X),J&&O.value&&(J.unobserve(O.value),J.disconnect(),J=null),Ft.value.animationId&&cancelAnimationFrame(Ft.value.animationId),_&&(cancelAnimationFrame(_),_=null),de.value.zoomTimeout&&clearTimeout(de.value.zoomTimeout),document.removeEventListener("mousemove",To),document.removeEventListener("mouseup",Ao),document.removeEventListener("click",Ra),document.removeEventListener("click",Yn)});const To=t=>{if(de.value.isDragging&&de.value.scale>1&&Bl.value){$e.value.show=!1;const a=t.clientX-de.value.lastMouseX,{minX:l,maxX:r}=jt.value,p=r-l||1,E=a*.8;de.value.offsetX+=E;const S=p/de.value.scale,W=p-S,L=0,I=-W/p*z.value.width,D=L;de.value.offsetX=Math.max(I,Math.min(D,de.value.offsetX)),de.value.lastMouseX=t.clientX,de.value.lastMouseY=t.clientY}},Ao=()=>{de.value.isDragging&&(de.value.isDragging=!1,setTimeout(()=>{!de.value.isDragging&&de.value.isZooming},100))},xs=(t,a)=>{const l=t.filter(S=>S!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||a<=0)return l[0];if(a>=1)return l[l.length-1];let r=0;const p=[];for(let S=1;S<l.length;S++){const W=l[S].x-l[S-1].x,L=l[S].y-l[S-1].y,I=Math.sqrt(W*W+L*L);p.push(I),r+=I}const h=r*a;let E=0;for(let S=0;S<p.length;S++){const W=E+p[S];if(h<=W){const L=(h-E)/p[S],I=l[S],D=l[S+1];return{x:I.x+(D.x-I.x)*L,y:I.y+(D.y-I.y)*L}}E=W}return l[l.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ws(),{"dss-chart-fill-width":De.value,"dss-chart-fill-height":Ye.value,"dss-chart-compact":Xt.value&&!He.value}]]),style:e.normalizeStyle({width:De.value?"100%":ze.value+"px",height:At.value,...De.value||Ye.value?{overflow:Xt.value?"visible":(gl.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...Cs.value,cursor:ba()}),"data-chart-type":ye.value,ref_key:"containerEl",ref:O,onWheel:sa,onMousedown:Ca,onMousemove:_a,onMouseup:ao,onMouseleave:Ga,onDblclick:ra,onContextmenu:e.withModifiers(Qa,["prevent"]),onClick:e.withModifiers(bn,["left"]),onWheelCapture:sa},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:g},[e.createElementVNode("div",Kr,[Je.value?(e.openBlock(),e.createElementBlock("div",Gr,e.toDisplayString(Je.value),1)):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("div",Qr,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0)]),He.value&&nt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-top":nt.value==="top","dss-legend-bottom":nt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",ei,e.toDisplayString(l.name),1)],46,Jr))),128))],2)):e.createCommentVNode("",!0),He.value&&(nt.value==="left"||nt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":nt.value==="left","dss-legend-right":nt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",li,e.toDisplayString(l.name),1)],46,ti))),128))],2)):e.createCommentVNode("",!0)],512),B.showAddMarkerButton&&Yt.value&&Rt.value.addMarker&&(Bl.value||ll.value)&&!gl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:no,title:e.unref(N)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Wt.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,ai),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,ni)):e.createCommentVNode("",!0),e.createElementVNode("div",oi,[ll.value&&ot.value?(e.openBlock(),e.createElementBlock("div",si,"Bubble size: "+e.toDisplayString(ot.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ke.value?void 0:ze.value,height:ke.value?void 0:Qe.value,viewBox:et.value,preserveAspectRatio:ke.value?"xMidYMid meet":void 0,class:"dss-chart-svg","data-smooth":M.value,"data-animated":bl.value,ref_key:"svgEl",ref:te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ge.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:ze.value,height:z.value.height*4},null,8,ci)],8,ii),n.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:o.value},[e.createElementVNode("path",{d:c.value},null,8,di)],8,ui)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:y.value},[e.createElementVNode("path",{d:F.value},null,8,pi)],8,mi)):e.createCommentVNode("",!0)]),Bl.value||ll.value?(e.openBlock(),e.createElementBlock("g",vi,[lt.value&&!gl.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Te.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:z.value.left,x2:z.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,hi))),128))],8,fi)):e.createCommentVNode("",!0),gl.value&&wo.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Te.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:z.value.left,x2:z.value.right,y1:l.y,y2:l.y,stroke:Sl.value,"stroke-width":Tl.value,"stroke-dasharray":Vl.value,opacity:Wl.value},null,8,yi))),128))],8,gi)):e.createCommentVNode("",!0),e.createElementVNode("g",ki,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ci),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bi),jn.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:z.value.right,x2:z.value.right,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,wi)):e.createCommentVNode("",!0)]),e.createElementVNode("g",xi,[gl.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(so.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,Ei))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ro.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,Si))),128)),jn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(jo.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,Vi))),128)):e.createCommentVNode("",!0),ht.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(ht.value),9,Ni)):e.createCommentVNode("",!0),ut.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(ut.value),9,Bi)):e.createCommentVNode("",!0),jn.value&&xt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:ze.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${ze.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(xt.value),9,_i)):e.createCommentVNode("",!0)]),d.value.length>0?(e.openBlock(),e.createElementBlock("g",Mi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Te.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Di)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Li)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Ti)):e.createCommentVNode("",!0)],8,$i),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Na(l,r),onMouseleave:Ba},null,40,Ai)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,z.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=>Na(l,r),onMouseleave:Ba},null,40,Hi),e.createElementVNode("text",{x:l.x,y:Math.max(15,z.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,Ri)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Te.value},[on.value?(e.openBlock(),e.createElementBlock("g",Ii,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ml.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.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:p=>Gn(l,p),onMouseleave:Ln},null,46,zi)):(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:p=>Gn(l,p),onMouseleave:Ln},null,46,Pi))],64))),128))],2),e.createElementVNode("g",Oi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Wi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,qi))),128)),Ke.value>0||_t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:Mt(l.isHighlighted?Qt(l,Ke.value)+2:Qt(l,Ke.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:p=>Gn(l,p),onMouseleave:Ln},null,46,Zi))),128)):e.createCommentVNode("",!0)])])):ye.value==="line"?(e.openBlock(),e.createElementBlock("g",Ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":re.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ft.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Yi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,Xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?re.value+2:re.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,ji))),128)),Ke.value>0||_t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Qo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:Mt(l.isHighlighted?Qt(l,Ke.value)+2:Qt(l,Ke.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:p=>Gn(l,p),onMouseleave:Ln},null,46,Ki))),128)):e.createCommentVNode("",!0)])):ye.value==="area"?(e.openBlock(),e.createElementBlock("g",Gi,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${B.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,Ji)],8,Qi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?ul.value+.2:ul.value,mask:`url(#area-mask-${r}-${B.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,ec))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?re.value+1:re.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*Ml.value}ms`})},null,14,tc))),128))])):ye.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ml.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.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:p=>Gn(l,p),onMouseleave:Ln},null,46,lc)):(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:p=>Gn(l,p),onMouseleave:Ln},null,46,nc))],64))),128))],2)):e.createCommentVNode("",!0)],8,Fi),it.value&&$e.value.show&&!de.value.isZooming&&!gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Te.value},[e.createElementVNode("line",{x1:$e.value.x,x2:$e.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Ut.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,oc),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:$e.value.x,cy:l.y,r:Mt(Ke.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,sc))),128))],8,ac)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ll.value?(e.openBlock(),e.createElementBlock("g",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(za.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",ic,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:Mt(l.radius),fill:l.color,"fill-opacity":ls(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(as(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>No(l,p),onMouseleave:p=>_o(l),onClick:p=>Vo(l,p)},null,42,cc),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:ns(l)}),onLoad:p=>El(r),onError:p=>yl(r),onMouseenter:p=>No(l,p),onMouseleave:p=>_o(l),onClick:p=>Vo(l,p)},null,46,uc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Xt.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:wa.value},[ye.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:vt.value,cy:wt.value,r:yt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,mc)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ye.value,"clip-path":P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(es.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":u(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>Gn(l.segment,p),onMouseleave:Ln},null,42,vc))),128))],8,pc),mn.value&&ho.value?(e.openBlock(),e.createElementBlock("g",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.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,hc)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),nn.value&&(ho.value||n.value||xn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:k.value.x,y:k.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Ol.value,fill:w.value,class:"dss-radial-data-center"},e.toDisplayString(rl.value),9,gc)):e.createCommentVNode("",!0),Lo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Wa.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ts.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,yc),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,kc),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":tn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Cc)],6))),128))],2)):e.createCommentVNode("",!0)],8,dc)):e.createCommentVNode("",!0),hl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:wa.value},[lt.value?(e.openBlock(),e.createElementBlock("g",wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:vt.value,cy:wt.value,r:Mt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,xc))),128)),e.createElementVNode("g",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:vt.value-16,y:wt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Sc),e.createElementVNode("text",{x:vt.value,y:wt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(dl(r)),9,Vc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:vt.value,x2:l.x,y1:wt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Nc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cs.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/da.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/da.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,_c))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ps,onMouseleave:Ln},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":ds("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?re.value+1:re.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*Ml.value}ms`,transition:"all 0.2s ease"})},null,14,Mc),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(p,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${h}`,cx:p.x,cy:p.y,r:Mt(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*Ml.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>Gn(p,E),onMouseleave:Ln},null,46,$c))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,bc)):e.createCommentVNode("",!0),e.createElementVNode("g",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pa.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:Mt(l.width/2),fill:el(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Lc))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pa.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:p=>vs(r),onError:p=>fs(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,Tc))),128))])],8,ri)),gl.value&&Gl.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle($l.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:A,class:"dss-stepbar-scroll",onScroll:Ma},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(gn.value)},[Vt.value?(e.openBlock(),e.createElementBlock("div",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`stepbar-grid-${r}`,class:"dss-stepbar-grid-line",style:e.normalizeStyle({top:`${l.top}px`,borderTopColor:Sl.value,borderTopWidth:`${Tl.value}px`,borderTopStyle:"dashed",opacity:Wl.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${Kt.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,l=>(e.openBlock(),e.createBlock(Fo,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(Zn.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":vl.value,orientation:"vertical","label-position":"down","bar-height":_l.value,"segment-order":Oe.value,"remainder-label":Xe.value,"inactive-color":Et.value,options:Sn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Vn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(An.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),en.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ze.value+"px",height:Qe.value+"px",backgroundImage:`url('${Nn.value}')`,backgroundRepeat:"no-repeat",...Pt.value,opacity:Ll.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rn.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:Pl.value+"px",height:Pl.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Ta(l),["stop"]),onMouseenter:p=>ss(l,p),onMouseleave:rs},[e.createElementVNode("img",{src:Ja(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Rc)],44,Hc)),[[e.vShow,Jl.value]])),128)),Ot.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ot.value.x+"px",top:Ot.value.y+"px"})},[e.createElementVNode("div",Fc,e.toDisplayString(Ot.value.categoryValue),1),Ot.value.description?(e.openBlock(),e.createElementBlock("div",Ic,e.toDisplayString(Ot.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),tt.value&&(je.value.show||it.value&&$e.value.show&&!de.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":it.value&&$e.value.show&&!de.value.isZooming,"dss-spider-tooltip":hl.value&&je.value.spiderAreas&&je.value.spiderAreas.length>0}]),style:e.normalizeStyle(gs.value)},[!it.value||!$e.value.show||de.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[hl.value&&je.value.spiderAreas&&je.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Pc,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${h}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Oc,e.toDisplayString(p.label),1),e.createElementVNode("span",Wc,e.toDisplayString(p.value),1)]))),128))]))),128))])):ll.value&&je.value.bubbleData&&je.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",qc,[je.value.title?(e.openBlock(),e.createElementBlock("div",Zc,e.toDisplayString(je.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Uc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.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",Yc,[e.createElementVNode("div",Xc,e.toDisplayString(je.value.title),1),e.createElementVNode("div",jc,e.toDisplayString(je.value.value),1)])),je.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Dt(je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Kc,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Gc,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(je.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Qc,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Jc,[e.createElementVNode("div",eu,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",tu,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",lu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(je.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",nu,[e.createElementVNode("div",au,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ou,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",su,[e.createElementVNode("div",ru,e.toDisplayString(gl.value?Ka():ll.value?os():B.categories[$e.value.categoryIndex]||`Category ${$e.value.categoryIndex+1}`),1),ll.value?(e.openBlock(),e.createElementBlock("div",iu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.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($e.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",cu,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",uu,e.toDisplayString(qt(l.value)),1)]))),128))]),Dt($e.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",du,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",mu,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt($e.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",pu,[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,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",vu,[e.createElementVNode("div",fu,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt($e.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hu,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",gu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt($e.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",yu,[e.createElementVNode("div",ku,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Cu,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Bl.value&&ae.value&&de.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:ra},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(de.value.scale*100))+"% "+e.toDisplayString(e.unref(N)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,jr),He.value&&nt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.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(q.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ne.value.has(r),"dss-legend-hovered":K.value===r,"dss-legend-dimmed":K.value!==null&&K.value!==r}]),onClick:p=>po(r),onMouseenter:p=>ya(r),onMouseleave:ka,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":hl.value&&pl(l)}]),style:e.normalizeStyle({backgroundColor:hl.value&&pl(l)?"transparent":On(l,r),borderColor:On(l,r)})},null,6),e.createElementVNode("span",wu,e.toDisplayString(l.name),1)],46,bu))),128))],2)):e.createCommentVNode("",!0),dt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:dt.value.x+"px",top:dt.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:Ha},e.toDisplayString(e.unref(N)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Rt.value.addMarker&&(Rt.value.downloadSvg||Rt.value.downloadPng||Rt.value.downloadCsv||Ql.value.length>0)?(e.openBlock(),e.createElementBlock("div",xu)):e.createCommentVNode("",!0),Rt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:lo},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Rt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ea},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Rt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Aa},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ql.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",Eu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Su)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(aa(l)),style:e.normalizeStyle(oa(l)),onClick:p=>ta(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Un(l),class:"dss-custom-menu-content"},null,8,Nu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Bu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Vu)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Pe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:an},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_u,[e.createElementVNode("h3",null,e.toDisplayString(vn.value?e.unref(N)("chart.modalMarker.viewMarker"):pn.value?e.unref(N)("chart.modalMarker.editMarker"):e.unref(N)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:an},"×")]),e.createElementVNode("div",Mu,[e.createElementVNode("div",$u,[e.createVNode(yo,{id:"dss-marker-date",mode:"single",modelValue:Pe.value.date,"onUpdate:modelValue":a[1]||(a[1]=l=>Pe.value.date=l),"min-date":la.value,"max-date":na.value,disabled:vn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Du,[e.createElementVNode("label",Lu,e.toDisplayString(e.unref(N)("chart.modalMarker.description")),1),vn.value?(e.openBlock(),e.createElementBlock("div",Tu,e.toDisplayString(Pe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=l=>Pe.value.description=l),placeholder:e.unref(N)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Au)),[[e.vModelText,Pe.value.description]])])]),e.createElementVNode("div",Hu,[e.createElementVNode("div",Ru,[pn.value&&!vn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:il},e.toDisplayString(e.unref(N)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fu,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:an},e.toDisplayString(vn.value?e.unref(N)("chart.modalMarker.close"):e.unref(N)("chart.modalMarker.cancel")),1),vn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:zn,disabled:!(Pe.value.description&&Pe.value.description.length)},e.toDisplayString(pn.value?e.unref(N)("chart.modalMarker.save"):e.unref(N)("chart.contextMenu.addMarker")),9,Iu))])])])])):e.createCommentVNode("",!0)],64))}}),Ou={class:"dss-modal-title"},Wu={class:"dss-modal-actions"},go={__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(B,{emit:ee}){const N=B,$=ee,se=e.ref(null),O=e.ref(null),A=e.computed(()=>{const X={"max-width":N.width};return N.height!=="auto"&&(X.height=N.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function rt(){$("close-modal")}function te(){N.backDrop&&!se.value&&$("close-modal")}function g(X){X.target.tagName==="INPUT"&&(se.value=X.target.tagName)}function xe(){setTimeout(()=>{se.value=null},300)}function Ce(){const X=document.body,he=document.documentElement;O.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:he.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${O.value.scrollY}px`,X.style.width="100%",X.style.left="0",he.style.overflow="hidden"}function J(){if(!O.value)return;const X=document.body,he=document.documentElement,{bodyOverflow:Ae,bodyPosition:ge,bodyTop:Te,bodyWidth:q,htmlOverflow:Re,scrollY:Ze}=O.value;X.style.overflow=Ae||"",X.style.position=ge||"",X.style.top=Te||"",X.style.width=q||"",X.style.left="",he.style.overflow=Re||"",window.scrollTo(0,Ze||0)}return e.watch(()=>N.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const he=document.getElementById("dss-modal-backdrop");he&&(he.addEventListener("focusin",g),he.addEventListener("focusout",xe))},100);else{J(),document.body.classList.remove("dss-modal-open");const he=document.getElementById("dss-modal-backdrop");he&&(he.removeEventListener("focusin",g),he.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{N.showModal&&J()}),(X,he)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.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(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:he[0]||(he[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":B.headerType,"font-size":B.titleSize})},[e.createElementVNode("h1",Ou,[e.renderSlot(X.$slots,"title",{},()=>[he[1]||(he[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),B.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:rt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[he[2]||(he[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Wu,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,B.showModal]])])):e.createCommentVNode("",!0)]))}},qu={key:0,class:"dss-table-toolbar"},Zu={class:"dss-table-toolbar-left"},Uu=["aria-expanded"],Yu={class:"dss-pagination-select-dropdown",role:"listbox"},Xu={class:"dss-table-column-visibility-label"},ju={class:"dss-table-checkbox-wrapper"},Ku=["checked","onChange"],Gu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Qu={class:"dss-table-column-visibility-text"},Ju={class:"dss-table-toolbar-right"},ed=["placeholder","aria-label"],td=["aria-label"],ld=["aria-label","aria-expanded"],nd={key:1,class:"dss-table-toolbar-extra"},ad={class:"dss-table-thead"},od={key:0,class:"dss-table-th dss-table-selection-column"},sd={key:0,class:"dss-table-checkbox-wrapper"},rd=["checked","indeterminate"],id={key:0,class:"dss-table-checkbox__indeterminate"},cd={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ud=["aria-label"],dd=["onClick"],md={class:"dss-table-th-content"},pd={class:"dss-table-th-text"},vd={key:0},fd={key:1},hd={key:2},gd=["data-filter-column-key","aria-expanded","aria-label","onClick"],yd={class:"dss-table-tbody"},kd=["onClick"],Cd={class:"dss-table-checkbox-wrapper"},bd=["type","name","checked","disabled","onChange"],wd={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},xd={key:1,class:"dss-table-checkbox__dot"},Ed=["onClick"],Sd=["aria-expanded","aria-label"],Vd={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Nd={key:0,class:"dss-table-expansion-row"},Bd=["colspan"],_d=["colspan"],Md={key:1,class:"dss-table-pagination"},$d={class:"dss-table-pagination-left"},Dd={key:0},Ld={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Td={class:"dss-table-pagination-center"},Ad={key:0,class:"dss-pagination-controls"},Hd=["disabled","title"],Rd=["disabled","title"],Fd=["aria-label","onKeydown"],Id={class:"dss-pagination-of"},zd=["disabled","title"],Pd=["disabled","title"],Od={class:"dss-table-pagination-right"},Wd={class:"dss-pagination-rows-label"},qd=["aria-expanded"],Zd=["aria-selected","onClick"],Ud={key:0,class:"dss-table-filter-row"},Yd=["value","placeholder"],Xd=["min","max","value"],jd=["min","max","value"],Kd={class:"dss-table-filter-double-range-values"},Gd={key:2,class:"dss-table-filter-daterange"},Qd={class:"dss-table-filter-daterange-row"},Jd={class:"dss-table-filter-daterange-label"},e1=["value"],t1={class:"dss-table-filter-daterange-row"},l1={class:"dss-table-filter-daterange-label"},n1=["value"],a1=["value","placeholder"],o1={class:"dss-table-filter-list"},s1=["checked","onChange"],r1={class:"dss-table-filter-actions"},i1={name:"DSSTable"},c1=Object.assign(i1,{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:B=>typeof B=="object"&&B!==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(B,{emit:ee}){const{t:N,locale:$}=va.useI18n(),se=B,O=ee,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function pe(d,v){const b=Object.assign({},d);return rt(d)&&rt(v)&&Object.keys(v).forEach(H=>{rt(v[H])?H in d?b[H]=pe(d[H],v[H]):Object.assign(b,{[H]:v[H]}):Object.assign(b,{[H]:v[H]})}),b}function rt(d){return d&&typeof d=="object"&&!Array.isArray(d)}const te=e.computed(()=>pe(A,se.options)),g=e.computed(()=>{const d=te.value.table.width;return d==="auto"?null:typeof d=="number"?d:null}),xe=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),he=e.computed(()=>te.value.table.expandableRowData??null),Ae=e.computed(()=>te.value.table.expandableRowCondition??null),ge=e.computed(()=>te.value.table.truncated===!0),Te=e.computed(()=>te.value.table.striped),q=e.computed(()=>te.value.table.bordered),Re=e.computed(()=>te.value.table.hoverable),Ze=e.computed(()=>te.value.table.size),Be=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const Ue=e.computed(()=>te.value.selection.enabled),Z=e.computed(()=>te.value.selection.mode),De=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ke=e.computed(()=>te.value.sorting.mode),et=e.computed(()=>te.value.pagination.enabled),at=e.computed(()=>te.value.pagination.rows),ze=e.computed(()=>te.value.pagination.rowsPerPageOptions),Tt=e.computed(()=>te.value.pagination.showCounter!==!1),Zt=e.computed(()=>te.value.pagination.showControlsGroup),Qe=e.computed(()=>Zt.value===!1?!1:te.value.pagination.showControls!==!1),At=e.computed(()=>Zt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),ye=e.computed(()=>et.value&&(Tt.value||Qe.value||At.value)),ft=e.computed(()=>te.value.scrollable),Je=e.computed(()=>te.value.emptyMessage||N("table.emptyMessage")),ct=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),ot=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),ht=e.computed(()=>te.value.toolbar?.search!==!1),ut=e.computed(()=>ct.value||ot.value||ht.value||Gt.value),Gt=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),xt=e.ref(""),Nt=e.ref(!1),ue=e.ref(null);let R=null;function Y(){Nt.value?(R&&(clearTimeout(R),R=null),Nt.value=!1,xt.value="",O("search",""),ue.value?.blur()):(Nt.value=!0,R=setTimeout(()=>{R=null,ue.value?.focus()},80))}function ie(){xt.value||(Nt.value=!1)}function be(){xt.value="",O("search",""),ue.value?.focus()}const lt=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":q.value,"dss-table-hoverable":Re.value,[`dss-table-${Ze.value}`]:Ze.value!=="default","dss-table-truncated":ge.value})),He=(d,v)=>d?.field??d?.key??v,nt=e.ref(new Set);function Me(){const d=new Set;return se.columns.forEach((v,b)=>{v?.hidden!==!0&&d.add(He(v,b))}),d}function tt(){const d=new Set;return se.columns.forEach((v,b)=>{d.add(He(v,b))}),d}function it(d){if(!Array.isArray(d))return null;const v=tt(),b=[];return d.forEach(H=>{v.has(H)&&b.push(H)}),b}function Ut(){nt.value=Me()}const ae=e.computed(()=>{const d=it(se.columnVisibility);return d===null?null:new Set(d)}),Q=e.computed(()=>ae.value??nt.value),oe=e.computed(()=>se.columns.filter((d,v)=>Q.value.has(He(d,v)))),re=d=>{const v=se.columns.findIndex(b=>b===d);return He(d,v>=0?v:0)},Se=(d,v)=>Q.value.has(He(d,v));function Ke(d){O("update:columnVisibility",Array.from(d))}function _t(d,v){const b=He(d,v),H=new Set(Q.value);H.has(b)?H.delete(b):H.add(b),ae.value===null&&(nt.value=H),Ke(H)}const Qt=e.ref(null),Mt=e.ref(!1);function ul(d){Qt.value&&!Qt.value.contains(d.target)&&(Mt.value=!1)}const M=e.computed(()=>oe.value.length+(Ue.value?1:0)+(X.value?1:0)),V=(d,v)=>d?.id??d?.key??v,T=e.ref(new Set),ce=e.ref(null),j=(d,v)=>T.value.has(V(d,v)),Oe=(d,v)=>{if(!X.value)return!1;if(typeof Ae.value=="function")return!!Ae.value(d,v);if(typeof he.value=="string"&&he.value.trim()){const b=k(d,he.value.trim());return Array.isArray(b)?b.length>0:b&&typeof b=="object"?Object.keys(b).length>0:b!=null&&b!==""}return!0},kt=(d,v,b)=>{if(b&&b.stopPropagation(),!Oe(d,v))return;const H=V(d,v),U=new Set(T.value);U.has(H)?(U.delete(H),O("row-collapse",{data:d,index:v})):(U.add(H),O("row-expand",{data:d,index:v})),T.value=U},st=(d,v)=>{if(!ge.value)return;const b=V(d,v);ce.value!==b&&(ce.value=b)},Xe=e.ref(null),Et=e.ref(0),Ct=e.ref([]),St=d=>{if(ke.value==="single")return Xe.value===d.field?Et.value:0;{const v=Ct.value.find(b=>b.field===d.field);return v?v.order:0}},$t=d=>{const v=St(d);return{"dss-sort-active":v!==0,"dss-sort-asc":v===1,"dss-sort-desc":v===-1}},bt=e.ref({}),Vt=e.ref(null),Sl=e.ref(null),Wl=220,Tl=e.ref(null),Vl=e.computed(()=>oe.value.find(d=>re(d)===Vt.value)??null),Kt=e.computed(()=>{if(!Vl.value||Vl.value.filter!=="range")return null;const d=Vl.value,v=Vt.value,{min:b,max:H}=An(d),U=d.filterMin??b,ne=d.filterMax??H,K=_l(v),pt=K.min??U,je=K.max??ne,Ot=ne-U,$e=Ot===0?0:(pt-U)/Ot*100,dt=Ot===0?100:(je-U)/Ot*100;return{rangeMin:U,rangeMax:ne,currentMin:pt,currentMax:je,minPct:$e,maxPct:dt}}),Al=e.ref(null),Nl=e.ref("max");function Ht(d){const v=Al.value,b=Kt.value;if(!v||!b)return;const H=v.getBoundingClientRect(),ne=(d.clientX-H.left)/H.width*100,K=(b.minPct+b.maxPct)/2;Nl.value=ne<K?"min":"max"}function _l(d){return bt.value[d]??{}}function sl(d,v){bt.value={...bt.value,[d]:v}}function Hl(d){const v=bt.value[d];return v?v.type==="string"?!!v.value?.trim():v.type==="range"?v.min!=null||v.max!=null:v.type==="dateRange"?!!(v.from||v.to):v.type==="list"?v.selected?.length>0:!1:!1}function Zn(d){const v={...bt.value};delete v[d],bt.value=v,Vt.value=null,Sl.value=null}function Tn(){if(!Vt.value){Sl.value=null;return}const d=Tl.value;if(!d)return;const v=d.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Vt.value}"]`);if(!v)return;const b=v.getBoundingClientRect();Sl.value={top:b.bottom+6,left:Math.max(8,b.right-Wl)}}const Sn=e.computed(()=>{const d=String(xt.value??"").trim().toLowerCase();return d?se.data.filter(v=>oe.value.some(b=>un(Ol(v,b)).some(U=>String(U).toLowerCase().includes(d)))):se.data}),Gl=e.computed(()=>{let d=[...Sn.value];const v=(xt.value??"").trim().toLowerCase();return v&&(d=d.filter(b=>se.columns.some(H=>{if(!H||!H.field)return!1;const U=Ol(b,H);return String(U??"").toLowerCase().includes(v)}))),oe.value.forEach(b=>{const H=re(b),U=bt.value[H];if(!U)return;const ne=b.field;if(ne){if(U.type==="string"&&U.value?.trim()){const K=U.value.trim().toLowerCase();d=d.filter(pt=>{const je=Ol(pt,b);return String(je??"").toLowerCase().includes(K)})}else if(U.type==="range")d=d.filter(K=>{const pt=k(K,ne),je=Number(pt);return!(Number.isNaN(je)||U.min!=null&&je<U.min||U.max!=null&&je>U.max)});else if(U.type==="dateRange"){const K=U.from?new Date(U.from).getTime():null,pt=U.to?new Date(U.to).getTime():null;d=d.filter(je=>{const Ot=k(je,ne),$e=Ot?new Date(Ot).getTime():NaN;return!(Number.isNaN($e)||K!=null&&$e<K||pt!=null&&$e>pt)})}else if(U.type==="list"&&U.selected?.length){const K=new Set(U.selected);d=d.filter(pt=>un(Ol(pt,b)).some(Ot=>K.has(Ot)))}}}),d});function un(d){if(d==null)return[""];if(Array.isArray(d))return d.flatMap(un);if(typeof d=="object"){const v=d?.label??d?.name??d?.value??d?.title;return[v!=null?String(v):String(d)]}return[String(d)]}function $l(d){const v=new Set;return se.data.forEach(b=>{un(Ol(b,d)).forEach(U=>v.add(U))}),Array.from(v).sort((b,H)=>String(b).localeCompare(String(H)))}function gn(d,v){if(Vt.value===d){Vt.value=null,Sl.value=null;return}if(Vt.value=d,v?.currentTarget){const b=v.currentTarget.getBoundingClientRect();Sl.value={top:b.bottom+6,left:Math.max(8,b.right-Wl)}}else Tn()}function Vn(d,v){sl(d,{type:"string",value:v})}function An(d){const v=d.field;if(!v)return{min:0,max:100};let b=1/0,H=-1/0;return se.data.forEach(U=>{const ne=k(U,v),K=Number(ne);Number.isNaN(K)||(b=Math.min(b,K),H=Math.max(H,K))}),{min:b===1/0?0:b,max:H===-1/0?100:H}}function bl(d,v,b){const H={..._l(d),type:"range"},U=b===""?null:Number(b),ne=U===null||Number.isNaN(U)?null:U;H[v]=ne,ne!=null&&(v==="min"&&H.max!=null&&ne>H.max&&(H.max=ne),v==="max"&&H.min!=null&&ne<H.min&&(H.min=ne)),sl(d,H)}function yn(d,v,b){const H={..._l(d),type:"dateRange"};H[v]=b||"",sl(d,H)}const dn=e.reactive({});function Rl(d,v){dn[d]=v}function Hn(d){const v=re(d),b=(dn[v]??"").trim().toLowerCase(),H=$l(d);return b?H.filter(U=>String(U).toLowerCase().includes(b)):H}function Ml(d,v){return(_l(d).selected??[]).includes(v!=null?String(v):"")}function ql(d,v){const H=[..._l(d).selected??[]],U=v!=null?String(v):"",ne=H.indexOf(U);ne>=0?H.splice(ne,1):H.push(U),sl(d,{type:"list",selected:H})}function kn(d){Vt.value&&!d.target.closest(".dss-table-filter-wrap")&&!d.target.closest(".dss-table-filter-dropdown")&&(Vt.value=null,Sl.value=null)}function Fl(){Tn(),Yt.value&&qt()}const Jn=d=>{if(!(d.sortable===!1||!Ye.value))if(ke.value==="single")Xe.value===d.field?Et.value=Et.value===1?-1:Et.value===-1?0:1:(Xe.value=d.field,Et.value=1),Et.value===0&&(Xe.value=null),O("sort",{field:Xe.value,order:Et.value});else{const v=Ct.value.findIndex(b=>b.field===d.field);v>=0?Ct.value[v].order===1?Ct.value[v].order=-1:Ct.value.splice(v,1):Ct.value.push({field:d.field,order:1}),O("sort",{multiSortMeta:Ct.value})}},Zl=e.computed(()=>{if(!Ye.value)return Gl.value;let d=[...Gl.value];return ke.value==="single"&&Xe.value&&Et.value!==0?d.sort((v,b)=>{const H=k(v,Xe.value),U=k(b,Xe.value);return H===U?0:H==null?1:U==null?-1:(H<U?-1:H>U?1:0)*Et.value}):ke.value==="multiple"&&Ct.value.length>0&&d.sort((v,b)=>{for(const H of Ct.value){const U=k(v,H.field),ne=k(b,H.field);if(U===ne)continue;if(U==null)return 1;if(ne==null)return-1;const K=U<ne?-1:U>ne?1:0;if(K!==0)return K*H.order}return 0}),d}),dl=e.ref(0),Dl=e.ref(at.value),Yt=e.ref(!1),Rt=e.ref(null),Ql=e.ref(null),Wt=e.ref("bottom"),gt=e.ref(null),Pl=d=>{Dl.value=d,Yt.value=!1,dl.value=0,O("page",{page:0,rows:Dl.value})};function vl(d){Rt.value&&!Rt.value.contains(d.target)&&(Yt.value=!1)}function qt(){const d=Rt.value,v=Ql.value;if(!d||!v)return;const b=d.querySelector(".dss-pagination-select-dropdown");if(!b)return;const H=v.getBoundingClientRect(),U=b.offsetHeight||0,K=(window.innerHeight||document.documentElement.clientHeight)-H.bottom,pt=H.top;Wt.value=K<U+8&&pt>K?"top":"bottom",gt.value={width:`${Math.ceil(H.width)}px`,left:`${Math.max(0,Math.round(v.offsetLeft))}px`}}const Jl=e.computed(()=>Zl.value.length),Ul=e.computed(()=>Math.ceil(Jl.value/Dl.value)),Rn=e.computed(()=>Math.max(Ul.value,1)),en=e.computed(()=>Jl.value===0?0:Jt.value+1),Ll=e.computed(()=>Yl.value),Jt=e.computed(()=>et.value?dl.value*Dl.value:0),Yl=e.computed(()=>et.value?Math.min((dl.value+1)*Dl.value,Jl.value):Jl.value),wl=e.computed(()=>{if(!et.value)return Zl.value;const d=Jt.value,v=Yl.value;return Zl.value.slice(d,v)}),Pt=e.ref(new Set),Fn=e.computed(()=>Zl.value.filter((d,v)=>Pt.value.has(V(d,v)))),Dt=(d,v)=>{const b=De.value;return typeof b!="function"?!0:!!b(d,v)},Il=e.computed(()=>Zl.value.map((d,v)=>({row:d,index:v})).filter(({row:d,index:v})=>Dt(d,v))),Nn=e.computed(()=>{const d=Il.value;return d.length===0?!1:d.every(({row:v,index:b})=>Pt.value.has(V(v,b)))}),Cn=e.computed(()=>{const d=Il.value;if(d.length===0)return!1;const v=d.filter(({row:b,index:H})=>Pt.value.has(V(b,H))).length;return v>0&&v<d.length}),tn=(d,v)=>Pt.value.has(V(d,v)),fl=()=>{if(Nn.value)Pt.value=new Set,O("unselect-all");else{const d=new Set;Il.value.forEach(({row:v,index:b})=>d.add(V(v,b))),Pt.value=d,O("select-all",Fn.value)}},In=(d,v)=>{if(!Dt(d,v))return;const b=V(d,v),H=new Set(Pt.value),U=H.has(b);Z.value==="single"?U?(H.delete(b),O("row-unselect",d)):(H.clear(),H.add(b),O("row-select",d)):U?(H.delete(b),O("row-unselect",d)):(H.add(b),O("row-select",d)),Pt.value=H},ln=e.ref("1"),mn=()=>{const d=Number.parseInt(String(ln.value),10);if(!Number.isFinite(d)){ln.value=String(dl.value+1);return}const v=Math.min(Rn.value,Math.max(1,d));v!==dl.value+1?zl(v-1):ln.value=String(v)},zl=d=>{d<0||d>=Ul.value||(dl.value=d,O("page",{page:d,rows:Dl.value}))},nn=(d,v,b)=>{O("row-click",{data:d,index:v,originalEvent:b}),st(d,Jt.value+v)},rl=(d,v)=>{const b=Jt.value+v;return{"dss-table-row-selected":tn(d,b),"dss-table-row-even":v%2===0,"dss-table-row-odd":v%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":ce.value===V(d,b)}},Ol=(d,v)=>v.field?k(d,v.field):"",k=(d,v)=>v.split(".").reduce((b,H)=>b&&b[H],d),w=d=>{const v=d.align??Be.value;return{"dss-table-sortable":d.sortable!==!1&&Ye.value,"dss-table-align-left":v==="left","dss-table-align-center":v==="center","dss-table-align-right":v==="right",[d.className]:d.className}},x=d=>{const v={};return d.width&&(v.width=typeof d.width=="number"?`${d.width}px`:d.width),d.minWidth&&(v.minWidth=typeof d.minWidth=="number"?`${d.minWidth}px`:d.minWidth),d.maxWidth&&(v.maxWidth=typeof d.maxWidth=="number"?`${d.maxWidth}px`:d.maxWidth),v};return e.watch(()=>se.locale,d=>{d&&d!==$.value&&($.value=d)},{immediate:!0}),e.watch(at,d=>{Dl.value=d,dl.value=0}),e.watch(Yt,async d=>{d&&(await e.nextTick(),qt())}),e.watch(dl,d=>{ln.value=String(d+1)},{immediate:!0}),e.watch(xt,d=>{O("search",d??"")}),e.watch(()=>se.columns,()=>{if(ae.value===null){Ut();return}const d=it(se.columnVisibility)??[];d.length!==se.columnVisibility.length&&O("update:columnVisibility",d)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",vl),document.addEventListener("click",ul),document.addEventListener("click",kn),window.addEventListener("resize",Fl),window.addEventListener("scroll",Fl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",vl),document.removeEventListener("click",ul),document.removeEventListener("click",kn),window.removeEventListener("resize",Fl),window.removeEventListener("scroll",Fl,!0)}),(d,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Tl,style:e.normalizeStyle({width:g.value+"px",height:xe.value?xe.value+"px":"auto"})},[ut.value?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",Zu,[ct.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:v[0]||(v[0]=b=>O("download-pdf"))},[v[22]||(v[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(N)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ot.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:v[1]||(v[1]=b=>O("download-excel"))},[v[23]||(v[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(N)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Qt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Mt.value}]),onClick:v[2]||(v[2]=b=>Mt.value=!Mt.value),"aria-expanded":Mt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(N)("table.columnVisibility"))+" ",1),v[24]||(v[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Uu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.columns,(b,H)=>(e.openBlock(),e.createElementBlock("li",{key:He(b,H),role:"option",class:"dss-table-column-visibility-option",onClick:v[3]||(v[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Xu,[e.createElementVNode("span",ju,[e.createElementVNode("input",{type:"checkbox",checked:Se(b,H),onChange:U=>_t(b,H),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ku),Se(b,H)?(e.openBlock(),e.createElementBlock("span",Gu,[...v[25]||(v[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",Qu,e.toDisplayString(b.header),1)])]))),128))],512),[[e.vShow,Mt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"header")]),e.createElementVNode("div",Ju,[ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Nt.value||xt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:ue,"onUpdate:modelValue":v[4]||(v[4]=b=>xt.value=b),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(N)("table.searchPlaceholder"),"aria-label":e.unref(N)("table.searchTableAriaLabel"),onFocus:v[5]||(v[5]=b=>Nt.value=!0),onBlur:ie},null,40,ed),[[e.vModelText,xt.value]]),xt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(N)("table.clearSearchAriaLabel"),onClick:be},[...v[26]||(v[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,td)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(N)("table.searchAriaLabel"),"aria-expanded":Nt.value||!!xt.value,onMousedown:e.withModifiers(Y,["prevent"])},[...v[27]||(v[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,ld)],2)):e.createCommentVNode("",!0),d.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",nd,[e.renderSlot(d.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":ft.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",lt.value])},[e.createElementVNode("thead",ad,[e.createElementVNode("tr",null,[Ue.value?(e.openBlock(),e.createElementBlock("th",od,[Z.value==="multiple"?(e.openBlock(),e.createElementBlock("span",sd,[e.createElementVNode("input",{type:"checkbox",checked:Nn.value,indeterminate:Cn.value,onChange:fl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,rd),Cn.value?(e.openBlock(),e.createElementBlock("span",id)):Nn.value?(e.openBlock(),e.createElementBlock("span",cd,[...v[28]||(v[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(N)("table.expandRowAriaLabel")},null,8,ud)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(b,H)=>(e.openBlock(),e.createElementBlock("th",{key:re(b),class:e.normalizeClass(["dss-table-th",w(b)]),style:e.normalizeStyle(x(b)),onClick:U=>Jn(b)},[e.createElementVNode("div",md,[e.createElementVNode("span",pd,e.toDisplayString(b.header),1),b.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",$t(b)])},[St(b)===0?(e.openBlock(),e.createElementBlock("span",vd,[...v[29]||(v[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(b)===1?(e.openBlock(),e.createElementBlock("span",fd,[...v[30]||(v[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(b)===-1?(e.openBlock(),e.createElementBlock("span",hd,[...v[31]||(v[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),b.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Vt.value===re(b)}]),onClick:v[6]||(v[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(re(b))}]),"data-filter-column-key":re(b),"aria-expanded":Vt.value===re(b),"aria-label":e.unref(N)("table.filterColumnAriaLabel"),onClick:U=>gn(re(b),U)},[...v[32]||(v[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,gd)],2)):e.createCommentVNode("",!0)])],14,dd))),128))])]),e.createElementVNode("tbody",yd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(b,H)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(b,Jt.value+H)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",rl(b,H)]),style:e.normalizeStyle(J.value),onClick:U=>nn(b,H,U)},[Ue.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:v[7]||(v[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Cd,[e.createElementVNode("input",{type:Z.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${B.tableId}`,checked:tn(b,Jt.value+H),disabled:!Dt(b,Jt.value+H),onChange:U=>In(b,Jt.value+H),class:e.normalizeClass(["dss-table-checkbox",Z.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!Dt(b,Jt.value+H)}])},null,42,bd),Z.value==="multiple"&&tn(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("span",wd,[...v[33]||(v[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)])])):Z.value==="single"&&tn(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("span",xd)):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(U=>kt(b,Jt.value+H,U),["stop"])},[Oe(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":j(b,Jt.value+H),"aria-label":j(b,Jt.value+H)?e.unref(N)("table.collapseRowAriaLabel"):e.unref(N)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":j(b,Jt.value+H)}]),"aria-hidden":"true"},[...v[34]||(v[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,Sd)):(e.openBlock(),e.createElementBlock("span",Vd))],8,Ed)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(U,ne)=>(e.openBlock(),e.createElementBlock("td",{key:re(U),class:e.normalizeClass(["dss-table-td",w(U)]),style:e.normalizeStyle(x(U))},[e.renderSlot(d.$slots,`cell-${U.field}`,{data:b,column:U,rowIndex:H,isExpanded:ce.value===V(b,Jt.value+H)},()=>[e.createTextVNode(e.toDisplayString(Ol(b,U)),1)])],6))),128))],14,kd),X.value&&Oe(b,Jt.value+H)&&j(b,Jt.value+H)?(e.openBlock(),e.createElementBlock("tr",Nd,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(d.$slots,"expansion",{data:b,rowIndex:H})],8,Bd)])):e.createCommentVNode("",!0)],64))),128)),wl.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(d.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Je.value),1)])],8,_d)],4))])],2)],2),ye.value?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",$d,[Tt.value?(e.openBlock(),e.createElementBlock("span",Dd,e.toDisplayString(e.unref(N)("table.showingRange",{start:en.value,end:Ll.value,total:Jl.value})),1)):(e.openBlock(),e.createElementBlock("span",Ld," "))]),e.createElementVNode("div",Td,[Qe.value?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value===0,onClick:v[8]||(v[8]=b=>zl(0)),title:e.unref(N)("table.firstPage")},[...v[35]||(v[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Hd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value===0,onClick:v[9]||(v[9]=b=>zl(dl.value-1)),title:e.unref(N)("table.previousPage")}," ‹ ",8,Rd),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":v[10]||(v[10]=b=>ln.value=b),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(N)("table.currentPageAriaLabel"),onBlur:mn,onKeydown:e.withKeys(e.withModifiers(mn,["prevent"]),["enter"])},null,40,Fd),[[e.vModelText,ln.value]]),e.createElementVNode("span",Id,e.toDisplayString(e.unref(N)("table.ofPages",{total:Rn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value>=Ul.value-1,onClick:v[11]||(v[11]=b=>zl(dl.value+1)),title:e.unref(N)("table.nextPage")}," › ",8,zd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dl.value>=Ul.value-1,onClick:v[12]||(v[12]=b=>zl(Ul.value-1)),title:e.unref(N)("table.lastPage")},[...v[36]||(v[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Pd)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Od,[At.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Rt},[e.createElementVNode("span",Wd,e.toDisplayString(e.unref(N)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Yt.value}]),onClick:v[13]||(v[13]=b=>Yt.value=!Yt.value),"aria-expanded":Yt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ql},[e.createTextVNode(e.toDisplayString(Dl.value)+" ",1),v[37]||(v[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,qd),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":Wt.value==="top"}]),style:e.normalizeStyle(gt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,b=>(e.openBlock(),e.createElementBlock("li",{key:b,role:"option","aria-selected":b===Dl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":b===Dl.value}]),onClick:H=>Pl(b)},e.toDisplayString(b),11,Zd))),128))],6),[[e.vShow,Yt.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(Sl.value?{top:Sl.value.top+"px",left:Sl.value.left+"px",width:Wl+"px"}:void 0),onClick:v[21]||(v[21]=e.withModifiers(()=>{},["stop"]))},[Vl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Vl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("input",{type:"text",value:_l(Vt.value).value??"",onInput:v[14]||(v[14]=b=>Vn(Vt.value,b.target.value)),class:"dss-table-filter-input",placeholder:e.unref(N)("table.search")},null,40,Yd)])):Vl.value.filter==="range"&&Kt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Kt.value.minPct+"%","--range-max-pct":Kt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Al,class:"dss-table-filter-double-range-track",onMousemove:Ht,onMouseenter:Ht},[e.createElementVNode("input",{type:"range",min:Kt.value.rangeMin,max:Kt.value.rangeMax,value:Kt.value.currentMin,onInput:v[15]||(v[15]=b=>bl(Vt.value,"min",b.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Nl.value==="min"?2:1})},null,44,Xd),e.createElementVNode("input",{type:"range",min:Kt.value.rangeMin,max:Kt.value.rangeMax,value:Kt.value.currentMax,onInput:v[16]||(v[16]=b=>bl(Vt.value,"max",b.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Nl.value==="max"?2:1})},null,44,jd)],544),e.createElementVNode("div",Kd,e.toDisplayString(Kt.value.currentMin)+" – "+e.toDisplayString(Kt.value.currentMax),1)],4)):Vl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(N)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:_l(Vt.value).from??"",onInput:v[17]||(v[17]=b=>yn(Vt.value,"from",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,e1)]),e.createElementVNode("div",t1,[e.createElementVNode("label",l1,e.toDisplayString(e.unref(N)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:_l(Vt.value).to??"",onInput:v[18]||(v[18]=b=>yn(Vt.value,"to",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,n1)])])):Vl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:dn[Vt.value]??"",onInput:v[19]||(v[19]=b=>Rl(Vt.value,b.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(N)("table.search")},null,40,a1),e.createElementVNode("div",o1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Vl.value),b=>(e.openBlock(),e.createElementBlock("label",{key:b,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ml(Vt.value,b),onChange:H=>ql(Vt.value,b)},null,40,s1),e.createElementVNode("span",null,e.toDisplayString(b),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",r1,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:v[20]||(v[20]=b=>Zn(Vt.value))},e.toDisplayString(e.unref(N)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Vt.value&&Vl.value&&Sl.value]])]),_:1})]))],64))}}),u1="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",d1="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",m1="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",p1="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",v1="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",f1="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",h1={class:"dss-toolbar-left"},g1=["title"],y1=["title"],k1={class:"dss-toolbar-dropdown-wrapper"},C1=["title"],b1=["src"],w1=["src"],x1=["src"],E1=["src"],S1=["src"],V1=["src"],N1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},B1=["src"],_1=["src"],M1=["src"],$1=["src"],D1=["src"],L1=["src"],T1=["title"],A1=["title"],H1=["title"],R1=["title"],F1=["title"],I1=["title"],z1=["title"],P1=["title"],O1=["title"],W1={key:2,class:"dss-toolbar-separator"},q1=["title"],Z1={key:4,class:"dss-toolbar-separator"},U1={key:5,class:"dss-toolbar-dropdown-wrapper"},Y1=["title"],X1={class:"dss-toolbar-dropdown-ai"},j1={class:"dss-toolbar-right"},K1={key:0,class:"dss-toolbar-custom-group"},G1={key:1,class:"dss-toolbar-separator"},Q1={class:"dss-link-modal-content"},J1={class:"dss-link-modal-field"},em={class:"dss-link-modal-label"},tm=["placeholder"],lm={class:"dss-link-modal-field"},nm={class:"dss-link-modal-label"},am=["placeholder"],om={class:"dss-image-modal-tabs"},sm={key:0,class:"dss-image-tab-content"},rm={class:"dss-link-modal-content"},im={class:"dss-link-modal-field"},cm={key:0,class:"dss-link-modal-label"},um=["src"],dm={class:"dss-link-modal-field"},mm={class:"dss-link-modal-label"},pm=["placeholder"],vm={class:"dss-link-modal-field"},fm={class:"dss-link-modal-label"},hm=["placeholder"],gm={class:"dss-link-modal-field"},ym={class:"dss-link-modal-label"},km=["placeholder"],Cm={key:1,class:"dss-image-tab-content"},bm={class:"dss-link-modal-content"},wm={class:"dss-link-modal-field"},xm={class:"dss-link-modal-label"},Em=["placeholder"],Sm={class:"dss-link-modal-field"},Vm={class:"dss-link-modal-label"},Nm=["placeholder"],Bm={class:"dss-link-modal-field"},_m={class:"dss-link-modal-label"},Mm=["placeholder"],$m={class:"dss-link-modal-field"},Dm={class:"dss-link-modal-label"},Lm=["placeholder"],Tm={class:"dss-text-editor-title-input-container"},Am={key:0,class:"dss-text-editor-title-preview"},Hm={key:0},Rm={key:1,class:"dss-text-editor-preview-placeholder"},Fm=["value","placeholder","disabled"],Im={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},zm={class:"dss-text-editor-description-input-container"},Pm={key:0,class:"dss-text-editor-description-preview"},Om={key:0},Wm={key:1,class:"dss-text-editor-preview-placeholder"},qm=["value","placeholder","disabled"],Zm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Um=["data-comment-id","onMouseenter"],Ym=["onClick"],Xm=["src","alt"],jm={key:1},Km=["onClick"],Gm=["src","alt"],Qm={key:1},Jm=["data-has-second-user","onClick"],e2={class:"editor-comment-marker-count"},t2={key:7,class:"dss-text-editor-textarea-wrapper"},l2=["value","placeholder","rows","disabled"],n2={class:"dss-text-editor-footer"},a2={class:"dss-text-editor-footer-content"},o2={class:"dss-text-editor-footer-stat"},s2={class:"dss-text-editor-footer-stat"},r2={key:8,class:"dss-text-editor-content-wrapper"},i2={key:0,class:"dss-comment-overlay-body"},c2={class:"dss-comment-selection-wrapper"},u2=["innerHTML"],d2={class:"dss-comment-messages-wrapper"},m2={key:0,class:"dss-comment-avatar-wrapper"},p2={class:"dss-comment-avatar"},v2=["src","alt"],f2={key:1},h2={class:"dss-comment-header"},g2={class:"dss-comment-header-text"},y2={class:"dss-comment-author"},k2={key:0,class:"dss-comment-date"},C2=["onClick","title"],b2={class:"dss-comment-overlay-inner"},w2=["placeholder","onKeydown"],x2={class:"dss-text-editor-footer"},E2={class:"dss-text-editor-footer-content"},S2={class:"dss-text-editor-footer-stat"},V2={class:"dss-text-editor-footer-stat"},N2=["title"],B2=["title"],_2={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:""},M2={class:"dss-image-popup-content"},$2={key:0,class:"dss-image-popup-no-alt-icon"},D2=["title"],L2=["title"],T2={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:""},A2={class:"dss-toolbar-left"},H2=["title"],R2=["title"],F2={class:"dss-toolbar-dropdown-wrapper"},I2=["title"],z2=["src"],P2=["src"],O2=["src"],W2=["src"],q2=["src"],Z2=["src"],U2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Y2=["title"],X2=["title"],j2=["title"],K2=["title"],G2=["title"],Q2=["title"],J2=["title"],ep=["title"],tp=["title"],lp={key:2,class:"dss-toolbar-separator"},np=["title"],ap={key:4,class:"dss-toolbar-separator"},op={key:5,class:"dss-toolbar-dropdown-wrapper"},sp=["title"],rp={class:"dss-toolbar-dropdown-ai"},ip={key:0,class:"dss-toolbar-right"},cp={key:0,class:"dss-toolbar-separator"},up={key:0,class:"dss-toolbar-custom-group"},dp={key:1,class:"dss-toolbar-separator"},mp={name:"DSSTextEditor"},pp=Object.assign(mp,{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:B=>typeof B=="object"&&B!==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:B=>typeof B=="object"&&B!==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(B,{expose:ee,emit:N}){const{t:$,locale:se}=va.useI18n(),O={h1:u1,h2:d1,h3:m1,h4:p1,h5:v1,h6:f1},A=B,pe=N,rt=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
101
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"/>
102
- </svg>`,g=e.ref(null),xe=e.ref(null),ye=e.ref(!1),J=e.ref(!1),X=e.ref(!1),he=e.ref(""),Ae=e.ref({}),ge=e.ref(!1),Te=e.ref(!1),q=e.ref(""),Re=e.ref(""),Ue=e.ref(null),Be=e.ref(null),Ye=e.ref(null),Z=e.ref(null),De=e.ref(""),Ze=e.ref(!1),ke=e.ref({}),et=e.ref(!1),at=e.ref({}),Pe=e.ref(null),$t=e.ref(null),Wt=e.ref(!1),Qe=e.ref(""),Tt=e.ref(null),Ce=e.ref(""),ht=e.ref(""),Je=e.ref(""),ut=e.ref(null),ot=e.ref(null),gt=e.ref(null),dt=e.ref(null),Gt=e.ref(null),wt=e.ref(!1),Vt=e.ref(""),ue=e.ref({}),R=e.ref(!1),Y=e.ref("upload"),ie=e.ref(""),be=e.ref(null),lt=e.ref(null),He=e.ref([]),nt=e.ref([]),Me=e.ref(null),tt=e.ref(!1),it=e.ref(""),Ut=e.ref(""),ae=e.ref(""),Q=e.ref(""),oe=e.ref(""),re=e.ref(""),Se=e.ref(null),Ke=e.ref(null),Bt=e.ref(null),Qt=e.ref(!1),_t=e.ref(null),ul=e.ref(!1),M=e.ref(!1),V=e.ref(null),T=e.ref("p"),ce=e.ref(!1),j=e.ref([]),Oe=e.ref(null),kt=e.ref(null),st=e.ref(null),Xe=e.ref(!1),xt=e.ref(0),Ct=100,Et=e.ref(null),Mt=e.computed(()=>!!A.commentUser),bt=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":Mt.value&&w.value!==null})),St=e.computed(()=>({})),El=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),Wl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),Ll=e.computed(()=>A.richText&&nt.value.length>0),Sl=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&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 A.modelValue}),Kt=e.computed(()=>{const o=Sl.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),Tl=e.computed(()=>Sl.value.length),Vl=e.computed(()=>dt.value!==null&&Y.value==="upload"&&Ce.value&&Ce.value.startsWith("data:")),At=e.computed(()=>A.titlePlaceholder||$("textEditor.placeholders.title")),Bl=e.computed(()=>A.descriptionPlaceholder||$("textEditor.placeholders.description")),sl=e.computed(()=>A.placeholder||$("textEditor.placeholders.startTyping")),Al=o=>rt&&rt[o]!==void 0,Zn=o=>{for(let n=o+1;n<A.customToolbarSlots.length;n++)if(Al(A.customToolbarSlots[n]))return!0;return!1},Tn=o=>{for(let n=o+1;n<A.customToolbarSlots.length;n++){const s=A.customToolbarSlots[n];if(Al(s)&&Sn(s))return!0}return!1},Sn=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,Gl=e.computed(()=>A.customToolbarSlots.some(o=>Al(o)&&Sn(o))),un=e.computed(()=>Al("title-slot")),Ml=e.computed(()=>Al("description-slot")),gn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},Vn=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},An=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},bl=o=>{try{const n=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`${n} ${i} ${c}`}catch{return""}},yn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=$("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"},dn=o=>{const n=o.target.value;pe("update:modelValue",n),pe("change",n)},Hl=()=>{if(!Se.value)return;const o=Se.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")},Hn=()=>{ul.value=!0,Hl()},_l=()=>{ul.value=!1,ql()},ql=()=>{if(!Se.value)return;const o=Se.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 n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},kn=o=>{const s=o.target.value;ul.value&&Hl(),pe("update:title",s),pe("title-change",s),Bt.value="title",A.richText&&(tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,qt()},500))},Rl=()=>{if(!Ke.value)return;const o=Ke.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const 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")},Jn=()=>{M.value=!0,Rl()},Zl=()=>{M.value=!1,dl()},dl=()=>{if(!Ke.value)return;const o=Ke.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},$l=o=>{const s=o.target.value;M.value&&Rl(),pe("update:description",s),pe("description-change",s),Bt.value="description",A.richText&&(tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,qt()},500))},Yt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(g.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Ht=o=>{if(!(!o||!g.value))try{const n=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(g.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{g.value.focus();return}let i=0;const c=[g.value];let m=null,u=!1,f=!1;for(;!f&&(m=c.pop());)if(m.nodeType===3){const y=i+m.length;!u&&o.start>=i&&o.start<=y&&(s.setStart(m,o.start-i),u=!0),u&&o.end>=i&&o.end<=y&&(s.setEnd(m,o.end-i),f=!0),i=y}else{let y=m.childNodes.length;for(;y--;)c.push(m.childNodes[y])}n.removeAllRanges(),n.addRange(s)}catch{g.value.focus()}},Ql=()=>{if(!g.value)return;g.value.focus();const o=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let m=c.childNodes.length-1;m>=0;m--){const u=c.childNodes[m],f=s(u);if(f)return f}return c},i=s(g.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);o.removeAllRanges(),o.addRange(n)},qt=(o=!1)=>{if(!g.value)return;const n=g.value.innerHTML,s=A.title||"",i=A.description||"";if(!o&&n===it.value&&s===ae.value&&i===Q.value)return;const c={content:Ut.value||it.value,title:oe.value!==void 0?oe.value:ae.value,description:re.value!==void 0?re.value:Q.value},m=He.value.length>0?He.value[He.value.length-1]:null;let u=!0;m&&(typeof m=="string"?u=c.content!==m:u=c.content!==m.content||c.title!==m.title||c.description!==m.description),u&&(He.value.push(c),He.value.length>50&&He.value.shift(),nt.value=[]),it.value=n,ae.value=s,Q.value=i,Ut.value=n,oe.value=s,re.value=i},yt=o=>{if(!g.value)return;Pl(),g.value&&An(g.value);let n=null;g.value&&(g.value.querySelector("p")||(n=Yt(),vl()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&V.value&&(V.value=null),J.value=!0;const i=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=gn(i);pe("update:modelValue",c),pe("change",c),Bt.value="editor",tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,qt(),Ca(),ra()},500),e.nextTick(()=>{n&&Ht(n),Pl();const m=["bold","italic","underline"],u=window.getSelection(),f=u.rangeCount>0?u.getRangeAt(0):null,y=f&&f.collapsed;if(m.forEach(C=>{try{if(y&&V.value?.command===C){ke.value[C]=V.value.state;return}if(C==="bold")if(f){const F=f.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F;let _=!1;if(P&&((P.tagName==="STRONG"||P.tagName==="B"||P.closest&&P.closest("strong, b"))&&(_=!0),!_&&P.style&&parseInt(P.style.fontWeight)>=600&&(_=!0),!_))try{const me=window.getComputedStyle(P);parseInt(me.fontWeight)>=600&&(_=!0)}catch{}ke.value[C]=_}else ke.value.hasOwnProperty(C)||(ke.value[C]=!1);else if(C==="italic")if(f){const F=f.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F,_=P&&(P.tagName==="EM"||P.tagName==="I"||P.closest&&P.closest("em, i"));ke.value[C]=!!_}else{const F=document.queryCommandState(C);ke.value[C]=F}else{const F=document.queryCommandState(C);ke.value[C]=F}}catch{}}),rl(),Zt(),Dl(),il(),Bn(),ft("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const C=o.data||"";C&&C.length===1&&setTimeout(()=>ra(C),0),(C===" "||C===`
103
- `||/[.,;:!?]/.test(C))&&setTimeout(()=>{Ca()},100)}J.value=!1})},Pl=()=>{if(!g.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.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 m=c.querySelector("img");if(i!==m&&!m?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,f=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==m||c.contains(f)&&f!==m){const y=document.createRange();y.setStartAfter(c),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}}}},vl=()=>{if(!g.value)return;const o=g.value;if(o.querySelector&&o.querySelector("p"))return;const n=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 m=c,u=m.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,m)),i.appendChild(m)}})},Zt=()=>{if(g.value&&!Qt.value){Qt.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),g.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()}),g.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const m=i.getAttribute("src")||i.src||"";if(c){const C=m.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),F=c===m||c===C;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||F||F)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let f=i.parentElement;const y=f&&f.classList.contains("dss-image-wrapper");if(y){const C=f.querySelector(".dss-image-no-alt-icon");C&&C.remove()}else{const C=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;C&&C.remove()}if(u){y?f.setAttribute("contenteditable","false"):(f=document.createElement("span"),f.className="dss-image-wrapper",f.setAttribute("contenteditable","false"),i.parentNode.insertBefore(f,i),f.appendChild(i));const C=document.createElement("div");C.className="dss-image-no-alt-icon",C.setAttribute("contenteditable","false"),C.innerHTML=te,f.appendChild(C)}else if(y&&f.children.length===1){const C=f.parentNode;C.insertBefore(i,f),C.removeChild(f)}})}finally{Qt.value=!1}}},Jl=o=>{Ca(),pe("blur",o),an()},Ul=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),Me.value&&(clearTimeout(Me.value),Me.value=null),tt.value&&(qt(),tt.value=!1);const o=Bt.value==="title",n=Bt.value==="description",s=Bt.value==="editor";if(He.value.length===0){o&&Se.value?Se.value.focus():n&&Ke.value?Ke.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{yt()});return}const i={content:g.value.innerHTML,title:A.title||"",description:A.description||""};nt.value.push(i);const c=He.value.pop();if(c!==void 0){J.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",f=typeof c=="object"&&c.description||"";g.value.innerHTML=m,it.value=m,ae.value=u,Q.value=f,Ut.value=m,oe.value=u,re.value=f,e.nextTick(()=>{rl(),fl(),wn(),il();const y=gn(m);pe("update:modelValue",y),pe("update:title",u),pe("update:description",f),pe("change",y),pe("title-change",u),pe("description-change",f),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Se.value){Se.value.focus();const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Hl()}}else if(n){if(Ke.value){Ke.value.focus();const C=f.length;Ke.value.setSelectionRange(C,C)}}else if(s)Ql();else if(Se.value&&document.activeElement===Se.value){const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Hl()}else if(Ke.value&&document.activeElement===Ke.value){const C=f.length;Ke.value.setSelectionRange(C,C)}else g.value&&Ql()},10)})})}},Rn=()=>{if(A.disabled||!A.richText||!g.value)return;Dt();const o=Bt.value==="title",n=Bt.value==="description",s=Bt.value==="editor";if(nt.value.length===0){o&&Se.value?Se.value.focus():n&&Ke.value?Ke.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{yt()});return}const i={content:g.value.innerHTML,title:A.title||"",description:A.description||""};He.value.push(i);const c=nt.value.pop();if(c!==void 0){J.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",f=typeof c=="object"&&c.description||"";g.value.innerHTML=m,it.value=m,ae.value=u,Q.value=f,Ut.value=m,oe.value=u,re.value=f,e.nextTick(()=>{rl(),fl(),wn(),il();const y=gn(m);pe("update:modelValue",y),pe("update:title",u),pe("update:description",f),pe("change",y),pe("title-change",u),pe("description-change",f),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Se.value){Se.value.focus();const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Hl()}}else if(n){if(Ke.value){Ke.value.focus();const C=f.length;Ke.value.setSelectionRange(C,C)}}else if(s)Ql();else if(Se.value&&document.activeElement===Se.value){const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Hl()}else if(Ke.value&&document.activeElement===Ke.value){const C=f.length;Ke.value.setSelectionRange(C,C)}else g.value&&Ql()},10)})})}},en=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const m=document.createDocumentFragment();for(;i.firstChild;)m.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(m,i)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const m=document.createElement("b");for(m.style.fontWeight="600";i.firstChild;)m.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(m,i)}}),g.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Dl=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Jt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.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 m;for(;m=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(m))){if(m.nodeType===3){let u=m.parentElement;for(;u&&u!==g.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(m.nodeType===1){const u=m;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(()=>{Dl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Dl()});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),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Dl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Dl()})}return!0},Yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.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 m;for(;m=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(m))){if(m.nodeType===3){let u=m.parentElement;for(;u&&u!==g.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(m.nodeType===1){const u=m;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),m=c.startContainer;let u=m.nodeType===3?m.parentElement:m;for(;u&&u!==g.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const f=u.style.fontWeight;if(f==="normal"||f==="400"){const y=document.createElement("b");y.style.fontWeight="600";const C=document.createDocumentFragment();for(;u.firstChild;)C.appendChild(u.firstChild);y.appendChild(C),u.parentNode&&u.parentNode.replaceChild(y,u),c.setStart(y,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===g.value){const f=document.createElement("b");f.style.fontWeight="600",f.innerHTML="<br>",c.insertNode(f),c.setStart(f,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),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{en()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{en()})}return!0},wl=(o,n=null)=>{if(A.disabled||!A.richText||!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt(),Dt(),g.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const m=s.getRangeAt(0);!m.collapsed&&zn(m)&&(i=Yt())}if(o==="createLink"&&n){const m=window.getSelection();if(m.rangeCount>0){const u=m.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const y=document.createTextNode(n);u.insertNode(y),u.selectNodeContents(y)}}}if(o==="bold"){const m=Yl();ke.value.bold=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"bold",state:m}),e.nextTick(()=>{i&&(Ht(i),e.nextTick(()=>{const f=Pt("bold");ke.value.bold=f})),yt(),fl(),il()});return}if(o==="italic"){const m=Jt();ke.value.italic=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"italic",state:m}),e.nextTick(()=>{i&&(Ht(i),e.nextTick(()=>{const f=Pt("italic");ke.value.italic=f})),yt(),Dl(),fl(),il()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(i&&Ht(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Pt("bold");ke.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Pt("italic");ke.value.italic=u});else{const u=document.queryCommandState(o);ke.value[o]=u}else{const u=document.queryCommandState(o);ke.value[o]=u}}catch{ke.value.hasOwnProperty(o)?ke.value[o]=!ke.value[o]:ke.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const y=u.getRangeAt(0),C=y.commonAncestorContainer.nodeType===1?y.commonAncestorContainer.closest("a"):y.commonAncestorContainer.parentElement?.closest("a");C&&(!C.getAttribute("href")||C.getAttribute("href")==="")&&C.setAttribute("href",n)}g.value.querySelectorAll("a").forEach(y=>{const C=y.getAttribute("href");(!C||C===""||C==="#")&&y.setAttribute("href",n)})}yt(),fl(),il()})},Pt=(o,n=null)=>{if(A.disabled||!g.value)return!1;try{if(o==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const m=window.getSelection();if(m.rangeCount>0){const f=m.getRangeAt(0).commonAncestorContainer;return!!(f.nodeType===1?f.tagName==="BLOCKQUOTE"?f:f.closest("blockquote"):f.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.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 f=c.commonAncestorContainer,y=f.nodeType===3?f.parentElement:f;if(y&&((y.tagName==="STRONG"||y.tagName==="B"||y.closest&&y.closest("strong, b"))&&(u=!0),!u&&y.style&&parseInt(y.style.fontWeight)>=600&&(u=!0),!u))try{const C=window.getComputedStyle(y);parseInt(C.fontWeight)>=600&&(u=!0)}catch{}return ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=u,u)}else{const f=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(f){const C=document.createTreeWalker(f,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;y=!0;let _=F.parentElement;for(;_&&_!==g.value;){if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}_=_.parentElement}}else if(F.nodeType===1){const P=F;if(P.tagName==="STRONG"||P.tagName==="B"){u=!0;break}if(P.style&&parseInt(P.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ke.value[o]=u&&y,u&&y}}if(o==="italic"){let u=!1;if(c.collapsed){const f=c.commonAncestorContainer,y=f.nodeType===3?f.parentElement:f;if(y&&((y.tagName==="EM"||y.tagName==="I"||y.closest&&y.closest("em, i"))&&(u=!0),!u&&y.style&&y.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(y).fontStyle==="italic"&&(u=!0)}catch{}return ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=u,u)}else{const f=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(f){const C=document.createTreeWalker(f,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;y=!0;let _=F.parentElement;for(;_&&_!==g.value;){if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}_=_.parentElement}}else if(F.nodeType===1){const P=F;if(P.tagName==="EM"||P.tagName==="I"){u=!0;break}if(P.style&&P.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[o]=u&&y,u&&y}}const m=document.queryCommandState(o);return c.collapsed&&ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=m,m)}return ke.value.hasOwnProperty(o)?ke.value[o]:!1}catch{return ke.value.hasOwnProperty(o)?ke.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fn=o=>{A.disabled||!A.richText||(xe.value=xe.value===o?null:o,o==="askAi"&&($t.value=null))},Dt=()=>{xe.value=null,be.value=null},Fl=o=>{wl("formatBlock",o),Dt()},Nn=o=>{if(!o||!g.value)return o;const n=We=>{let _e=We.nodeType===Node.TEXT_NODE?We.parentElement:We;for(;_e&&_e!==g.value;){const pt=_e.tagName;if(pt==="P"){const xl=_e.parentElement;if(xl===g.value||xl.tagName==="BLOCKQUOTE")return _e}if(pt==="BLOCKQUOTE")break;_e=_e.parentElement}return null},s=n(o.startContainer),i=n(o.endContainer);if(!s||!i)return o;const c=[],m=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:We=>{const _e=We.tagName;if(_e==="P"){const pt=We.parentElement;if(pt===g.value||pt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return _e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=m.nextNode();)c.push(u);const f=c.indexOf(s),y=c.indexOf(i);if(f===-1||y===-1)return o;const C=Math.min(f,y),F=Math.max(f,y),P=c.slice(C,F+1);if(P.length===0)return o;const _=P[0],me=P[P.length-1],le=document.createRange();return le.setStartBefore(_),le.setEndAfter(me),le},Cn=()=>{if(A.disabled||!A.richText||!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt(),Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&zn(n)&&(n=Nn(n),o.removeAllRanges(),o.addRange(n));let s=null;!n.collapsed&&zn(n)&&(s=Yt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(y=>{if(y.nodeType===Node.ELEMENT_NODE)if(y.tagName==="P"||y.tagName==="DIV")u.insertBefore(y,c);else{const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}else if(y.nodeType===Node.TEXT_NODE&&y.textContent.trim()){const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),f=n.extractContents();u.appendChild(f),n.insertNode(u);const y=[],C=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:_=>_.parentNode===u&&_.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let F;for(;F=C.nextNode();)y.push(F);if(y.forEach(_=>{const me=document.createElement("p");_.parentNode.insertBefore(me,_),me.appendChild(_)}),u.querySelectorAll("p, div").forEach(_=>{_.textContent.trim()===""&&!_.querySelector("img")&&(_.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const _=document.createElement("p");_.innerHTML="<br>",u.appendChild(_)}}e.nextTick(()=>{s&&Ht(s),wn(),yt(),il()})},tn=()=>{if(!g.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||!g.value.contains(i))return;const c=F=>{if(!F)return!1;const P=F.textContent||"",me=(F.innerHTML||"").trim();return P.trim()===""||me===""||me==="<br>"||me==="<br/>"||me==="<p></p>"||me==="<p><br></p>"||me==="<p><br/></p>"||me==="<p> </p>"||me==="<p><br> </p>"||me==="<div></div>"||me==="<div><br></div>"||me==="<div><br/></div>"};let m=null;for(s.nodeType===3?m=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?m=s:m=s.closest("p, div"),m&&i.contains(m)&&c(m)&&m.remove();i.lastChild;){const F=i.lastChild;if(F.nodeType===1&&F.tagName==="BR")F.remove();else if(F.nodeType===3)if((F.textContent||"").trim()==="")F.remove();else break;else break}if(i.children.length>0)for(let F=i.children.length-1;F>=0;F--){const P=i.children[F];if((P.tagName==="P"||P.tagName==="DIV")&&c(P))P.remove();else break}let u=i.innerHTML;const f=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==f&&(i.innerHTML=u);const y=document.createElement("p");y.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(y,i.nextSibling):i.parentNode.appendChild(y):g.value&&g.value.appendChild(y);const C=document.createRange();C.selectNodeContents(y),C.collapse(!0),o.removeAllRanges(),o.addRange(C),e.nextTick(()=>{wn(),yt()})},fl=()=>{if(!g.value){ye.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");ye.value=!!i}else ye.value=!1}catch{ye.value=!1}},In=()=>{if(!g.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Z.value=Yt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),q.value="",Re.value=s,De.value="",Ye.value=null,Te.value=!0,Dt(),e.nextTick(()=>{Ue.value&&Ue.value.focus()})},ln=()=>{if(!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt();const o=window.getSelection();let n=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&Ye.value&&(n=Ye.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),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}Ye.value=null}else wl("unlink");ye.value=!1,Dt(),e.nextTick(()=>{yt(),fl()})},mn=()=>{A.disabled||!A.richText||g.value&&(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt(),Dt(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{rl(),yt(),il()}))},Il=()=>{A.disabled||!A.richText||g.value&&(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt(),Dt(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{rl(),yt(),il()}))},nn=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},rl=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=nn(s);i!==null&&Array.from(n.children).filter(m=>m.tagName==="LI").forEach(m=>{m.setAttribute("data-parent-num",String(i))})}})},Ol=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{rl(),yt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const m=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${m}`);u||(u=document.createElement(m),c.appendChild(u));const f=nn(c);u.appendChild(s),f!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(f)),rl();const y=document.createRange();y.selectNodeContents(s),y.collapse(!1),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{yt(),il()})}else document.execCommand("indent",!1),e.nextTick(()=>{rl(),yt(),il()})},k=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{rl(),yt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const m=c.parentElement;if(m&&(m.tagName==="OL"||m.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),m.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),rl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{yt(),il()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{rl(),yt(),il()})},w=e.ref(null),x=e.ref(null),d=e.ref({}),v=e.ref(""),b=e.ref(null),H=e.ref("");e.ref("");const U=e.ref(null);e.ref("");const ne=e.ref([]),K=e.ref(!1),vt=e.ref(!1),je=o=>{if(!o)return"";const n=o.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ot=()=>{if(!A.commentUser||A.disabled||!A.richText||!g.value)return;if(w.value!==null){w.value=null,v.value="",H.value="",U.value=null,ne.value=[],ct(!0);return}Dt(),g.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!zn(n))return;H.value=je(n)||"",U.value=Yt();const s=n.getBoundingClientRect(),i=g.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),m=s.bottom-c.top,f=Math.max(m+8,0);d.value={top:`${f}px`,bottom:"auto"},w.value=Date.now(),e.nextTick(()=>{if(v.value="",b.value){const C=b.value;C.style.height="auto",C.style.height=`${C.scrollHeight}px`,C.focus()}const y=i.querySelector(".dss-comment-overlay");if(y&&i){const C=i.querySelector(".dss-text-editor-footer");if(C){const F=i.getBoundingClientRect(),P=y.getBoundingClientRect(),_=C.getBoundingClientRect(),me=P.bottom-F.top,le=_.top-F.top,We=8;if(me>le-We){const _e=_.height;d.value={bottom:`${_e+We}px`,top:"auto"}}else d.value={top:`${f}px`,bottom:"auto"}}}})},$e=()=>{if(!v.value.trim())return;const o=v.value.trim(),n=new Date,s={text:o,selectionText:H.value,selectionRange:U.value,commentId:w.value,user:A.commentUser||null,createdAt:n.toISOString()};ne.value=[...ne.value,s],pe("comment-submitted",s),la(s),U.value&&!de(U.value)&&ze(w.value,U.value),v.value="",e.nextTick(()=>{if(b.value){const i=b.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}ft("sendComment")})},mt=(o,n)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(ne.value=ne.value.filter((s,i)=>i!==n),w.value!==null&&g.value){const s=String(w.value),i=g.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&ne.value.length>0){const c=[],m=new Set;ne.value.forEach(u=>{u.user&&u.user.id&&!m.has(u.user.id)&&(m.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(ne.value.length))}else i&&ne.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:n,commentId:w.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));pe("update:comments",s)}e.nextTick(()=>{ft("deleteComment")})}},de=o=>{if(!o||!g.value)return!1;try{const n=tl(o);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},tl=o=>{if(!o||!g.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return g.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let s=0;const i=[g.value];let c=null,m=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const f=s+c.length;!m&&o.start>=s&&o.start<=f&&(n.setStart(c,o.start-s),m=!0),m&&o.end>=s&&o.end<=f&&(n.setEnd(c,o.end-s),u=!0),s=f}else{let f=c.childNodes.length;for(;f--;)i.push(c.childNodes[f])}return m?n:null}catch{return null}},ze=(o,n)=>{if(!(!o||!n||!g.value))try{const s=tl(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const f=c.closest("[data-comment], [data-fake-comment]");if(f){f.getAttribute("data-comment")!==String(o)&&f.getAttribute("data-fake-comment")!==String(o)&&f.setAttribute("data-comment",String(o));return}}const m=document.createElement("span");m.setAttribute("data-comment",String(o));try{const f=s.startContainer,y=s.endContainer,C=s.startOffset,F=s.endOffset,P=f.nodeType===3?f.parentNode:f,_=y.nodeType===3?y.parentNode:y;if(P===_&&C===0&&F===(y.nodeType===3?y.length:_.childNodes.length)&&(P.tagName==="P"||P.tagName==="DIV"||P.tagName==="H1"||P.tagName==="H2"||P.tagName==="H3"||P.tagName==="H4"||P.tagName==="H5"||P.tagName==="H6")){const le=s.extractContents();m.appendChild(le),s.insertNode(m)}else s.surroundContents(m)}catch{const y=s.extractContents();m.appendChild(y),s.insertNode(m)}const u=g.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{ft("wrapSelectionWithCommentMarker"),yt()})}catch{}},la=o=>{if(!o||!o.commentId)return;const n=Array.isArray(A.comments)?[...A.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=n.findIndex(m=>typeof m.conversation_id=="string"&&m.conversation_id.startsWith("comment-")?null:Number(m.conversation_id)===Number(s)||m.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 m=n[i];if(m.conversation||(m.conversation=[]),m.conversation.push(c),m.updated_at=o.createdAt,!m.article_id&&n.length>0){const u=n.find(f=>f.article_id);u&&(m.article_id=u.article_id)}}else{const m=o.selectionRange,u=n.length>0&&n.find(y=>y.article_id)?.article_id||null,f={conversation_id:s,article_id:u,selection_range:m?{start:m.start||0,end:m.end||0,type:m.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(f)}K.value=!0,pe("update:comments",n)},na=(o,n=[])=>{if(!A.commentUser||A.disabled||!A.richText||!g.value)return;const s=g.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;Dt(),s.focus();const c=document.createRange();c.selectNodeContents(i);const m=window.getSelection();m&&(m.removeAllRanges(),m.addRange(c)),H.value=i.innerHTML||"",U.value=Yt();const u=c.getBoundingClientRect(),f=s.parentElement;if(f){const F=f.getBoundingClientRect(),P=u.bottom-F.top,me=Math.max(P+8,0);d.value={top:`${me}px`,bottom:"auto"}}const y=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let C=[];if(y&&A.comments&&Array.isArray(A.comments)){const F=A.comments.find(P=>String(P.conversation_id)===String(y));if(F&&F.conversation&&Array.isArray(F.conversation)){const P=F.conversation.map(_=>({id:_.id||_.commentary_id,commentary_id:_.id||_.commentary_id,conversation_id:F.id||F.conversation_id,text:_.text,user:_.user,createdAt:_.created_at||_.createdAt,updated_at:_.updated_at||_.updatedAt}));C.push(...P)}}C.length===0&&Array.isArray(n)&&n.length>0&&(C=n.slice()),C.sort((F,P)=>{const _=We=>{if(!We)return 0;const _e=new Date(We).getTime();return isNaN(_e)?0:_e},me=_(F.createdAt),le=_(P.createdAt);return me===le?0:me-le}),ne.value=C,ct(!0),w.value=y||null,i&&(x.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(v.value="",b.value){const F=b.value;F.style.height="auto",F.style.height=`${F.scrollHeight}px`,F.focus()}if(f){const F=f.querySelector(".dss-comment-overlay");if(F){const P=f.querySelector(".dss-text-editor-footer");if(P){const _=f.getBoundingClientRect(),me=F.getBoundingClientRect(),le=P.getBoundingClientRect(),We=me.bottom-_.top,_e=le.top-_.top,pt=8;if(We>_e-pt){const xl=le.height;d.value={bottom:`${xl+pt}px`,top:"auto"}}}}}ft("openCommentOverlayForSelector")})},pn=e.ref(null),vn=e.ref(0),ya=o=>{if(!(A.disabled||!A.richText)){if(o.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&&g.value&&g.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 f=document.createElement("p");f.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(f,u.nextSibling):c.appendChild(f),setTimeout(()=>{tn()},50);return}}}if(o.key.length===1||o.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 m=c.closest(".dss-image-wrapper");if(m){const u=m.querySelector("img");if(c!==u&&!u?.contains(c)){const f=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,y=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(m.contains(f)&&f!==u||m.contains(y)&&y!==u){o.preventDefault();const C=document.createRange();C.setStartAfter(m),C.collapse(!0),n.removeAllRanges(),n.addRange(C);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const m=s.startContainer;let u=m;m.nodeType===3&&(s.startOffset===0?u=m.previousSibling||m.parentNode:u=m.parentNode);const f=u.previousSibling;f&&(f.classList&&f.classList.contains("dss-image-wrapper")?c=f:f.tagName==="IMG"&&(i=f,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const m=s.startContainer;let u=m;m.nodeType===3&&(s.startOffset===m.length?u=m.nextSibling||m.parentNode:u=m.parentNode);const f=u.nextSibling;f&&(f.classList&&f.classList.contains("dss-image-wrapper")?c=f:f.tagName==="IMG"&&(i=f,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const m=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(m.nodeType===1&&m.tagName==="IMG"?(i=m,c=i.closest(".dss-image-wrapper")):(i=m.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const y=c.contains(u)||u===c,C=c.contains(f)||f===c,P=s.cloneContents().textContent?.trim()||"",_=c.textContent?.trim()||"";(!y||!C||P.length>_.length)&&(c=null,i=null)}}if(c){o.preventDefault(),o.stopPropagation();const m=c.parentNode;if(m){const u=document.createTextNode("");m.insertBefore(u,c),c.remove();const f=document.createRange();f.setStartAfter(u),f.collapse(!0),n.removeAllRanges(),n.addRange(f),e.nextTick(()=>{yt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?k():Ol();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,f=y=>{if(!y)return!1;let C=y.previousSibling;for(;C;){if(C.classList&&C.classList.contains("dss-image-wrapper")||C.tagName==="IMG"||C.querySelector&&C.querySelector(".dss-image-wrapper")||C.querySelector&&C.querySelector("img"))return!0;C=C.previousSibling}const F=y.parentElement;return F&&F!==g.value?f(F):!1};if(u.nodeType===3){const y=u.parentElement;if(y&&(f(y)||f(u))){const C=y.closest("p, div");if(C&&C!==g.value){o.preventDefault(),o.stopPropagation();let F=null;const P=s.startOffset;P<u.length&&(F=u.splitText(P));const _=document.createElement("p");if(F?_.appendChild(F):_.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}C.nextSibling?C.parentNode.insertBefore(_,C.nextSibling):C.parentNode.appendChild(_);const me=document.createRange();F?me.setStart(F,0):me.setStart(_,0),me.collapse(!0),n.removeAllRanges(),n.addRange(me),e.nextTick(()=>{yt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.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 f=le=>{if(!le)return!1;const We=le.textContent||"",pt=(le.innerHTML||"").trim(),xl=pt.replace(/<br\s*\/?>/gi,"").trim();return We.trim()===""||pt===""||xl===""||pt==="<br>"||pt==="<br/>"||pt==="<p></p>"||pt==="<p><br></p>"||pt==="<p><br/></p>"||pt==="<p> </p>"||pt==="<p><br> </p>"||pt==="<div></div>"||pt==="<div><br></div>"||pt==="<div><br/></div>"},y=c.lastChild,C=y&&y.nodeType===1&&y.tagName==="BR",F=s.startContainer,P=F.nodeType===3?F.parentElement:F,_=P===c||P&&P.parentElement===c;if(u&&f(u)||C&&_){o.preventDefault(),setTimeout(()=>{tn()},50);return}}}}if(o.key===" "){const n=Date.now(),s=n-vn.value;if(pn.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(m){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((m.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Ol();return}}}}pn.value=" ",vn.value=n}else pn.value=o.key}},ka=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let f=i.getRangeAt(0).commonAncestorContainer;f.nodeType===3&&(f=f.parentNode),c=f.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const m=u=>{const y=new DOMParser().parseFromString(u,"text/html");let C=g.value.querySelector("h1")?1:0;if(y.querySelectorAll("h1").forEach(P=>{if(C>0){const _=y.createElement("p");_.innerHTML=P.innerHTML,P.parentNode.replaceChild(_,P)}else C++}),c){const P=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],_=Array.from(y.body.children).filter(me=>P.includes(me.tagName));if(_.length===1){const me=_[0].tagName,le=c.tagName,We=c.textContent.trim()===""&&!c.querySelector("img");let _e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?_e=!0:We||(me===le||me==="P")&&(_e=!0),_e)return _[0].innerHTML.trim()}}return y.body.innerHTML.trim()};if(n){const u=m(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const f=m(s);document.execCommand("insertHTML",!1,f)}else document.execCommand("insertText",!1,s);yt()},_a=o=>{if(xe.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&Dt()}if(et.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=g.value&&s.closest(".dss-text-editor-content");!i&&!c&&an()}if($t.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Ta()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(be.value=null),!g.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ce.value=!i.collapsed&&zn(i)}else ce.value=!1}if(w.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),f=o.clientX,y=o.clientY;i=f>=u.left&&f<=u.right&&y>=u.top&&y<=u.bottom}const c=n.closest(".dss-toolbar-button"),m=c&&c.getAttribute("title")==="Comment";!i&&!m&&(w.value=null,v.value="",H.value="",U.value=null,ne.value=[],ct(!0))}},Ma=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),lt.value&&(clearTimeout(lt.value),lt.value=null),be.value=n},$a=o=>{const n=o.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}lt.value&&clearTimeout(lt.value),lt.value=setTimeout(()=>{be.value=null,lt.value=null},150)},Ka=o=>{be.value=null};let Ga=0;const Qa=o=>{if(!o)return;const n=Array.from(o.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(f=>f.tagName==="DIV"?f.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(f.children).filter(C=>C.tagName==="BUTTON"||C.tagName==="DIV").length>0:!1),m=s.nextElementSibling,u=m&&!m.classList.contains("dss-toolbar-dropdown-submenu")&&!m.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&m.tagName==="DIV"&&!m.classList.contains("dss-toolbar-dropdown-item")&&Array.from(m.children).some(f=>f.tagName==="BUTTON"||f.tagName==="DIV");if(c||u){const f=`submenu-auto-${++Ga}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",f);let y=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),y=c):u&&(m.classList.add("dss-toolbar-dropdown-submenu"),y=m),y&&(y.setAttribute("data-submenu-id",f),y.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?y.dataset.originalParentRef="inside":y.dataset.originalParentRef="sibling",Array.from(y.children).forEach(F=>{(F.tagName==="BUTTON"||F.tagName==="DIV")&&!F.classList.contains("dss-toolbar-dropdown-item")&&F.classList.add("dss-toolbar-dropdown-item")}))}})},bn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qa(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const m=c._subMenuHandlers;m&&(c.removeEventListener("mouseenter",m.enter),c.removeEventListener("mouseleave",m.leave));const u=y=>{const C=c.getAttribute("data-submenu-id");C&&Ma(y,C)},f=$a;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",f),c._subMenuHandlers={enter:u,leave:f}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const m=c._subMenuHandlers;m&&(c.removeEventListener("mouseenter",m.enter),c.removeEventListener("mouseleave",m.leave));const u=C=>{const F=c.getAttribute("data-submenu-id");F&&Ma(C,F)},f=$a;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",f),c._subMenuHandlers={enter:u,leave:f},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(C=>{C.addEventListener("click",Ka)})})})};let Un=null;const aa=()=>{if(be.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${be.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${be.value}"]`);o&&n&&Xn(o,n)}if(et.value&&il(),A.richText){if(Un!==null)return;Un=setTimeout(()=>{Un=null,ft("handleWindowResize")},150)}},oa=()=>{if(!A.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")})})},Ja=()=>{const o=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};o.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(()=>{ul.value?Hl():ql(),M.value?Rl():dl()})}),e.nextTick(()=>{Ja()}),A.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",_a),window.addEventListener("resize",aa);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,aa()},150))};window.addEventListener("scroll",n,!0),g.value._windowScrollHandler=n,g.value._windowScrollTimeout=o,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const s=g.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,aa()},150))};s&&(s.addEventListener("scroll",c),g.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{bn(),oa()}),g.value.addEventListener("click",f=>{const y=f.target;y.closest("a")&&!A.disabled&&f.preventDefault();const F=y.closest(".dss-image-no-alt-icon"),P=y.closest(".dss-image-wrapper");if(F||P&&y===P){f.preventDefault(),f.stopPropagation();const _=window.getSelection(),me=document.createRange();me.setStartAfter(P),me.collapse(!0),_.removeAllRanges(),_.addRange(me)}else P&&y.tagName!=="IMG"&&(f.preventDefault(),e.nextTick(()=>{const _=window.getSelection();if(_.rangeCount>0){const le=_.getRangeAt(0).commonAncestorContainer,We=le.nodeType===3?le.parentElement:le;if(P.contains(We)&&We!==P.querySelector("img")){const _e=document.createRange();_e.setStartAfter(P),_e.collapse(!0),_.removeAllRanges(),_.addRange(_e)}}else{const me=document.createRange();me.setStartAfter(P),me.collapse(!0),_.addRange(me)}}))},!0),g.value.addEventListener("mousedown",f=>{const y=f.target,C=y.closest(".dss-image-no-alt-icon"),F=y.closest(".dss-image-wrapper");if(C||F&&y.tagName!=="IMG"){f.preventDefault();const P=window.getSelection(),_=document.createRange();F&&(_.setStartAfter(F),_.collapse(!0),P.removeAllRanges(),P.addRange(_))}},!0),g.value.addEventListener("paste",f=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(C=>{if(!C.closest(".dss-image-wrapper"))C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="";else{const P=C.getAttribute("alt")||C.alt||"";if(P){const _=C.getAttribute("src")||C.src||"",me=_.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=P===_||P===me;(P.startsWith("http://")||P.startsWith("https://")||P.startsWith("data:")||le||le)&&(C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="")}}}),Zt()})}),g.value.addEventListener("dragstart",f=>{const y=f.target,C=y.tagName==="IMG"?y:y.closest("img"),F=C?.closest(".dss-image-wrapper");C&&g.value.contains(C)&&(_t.value=F||C,f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",f=>{_t.value&&(f.preventDefault(),f.stopPropagation(),f.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",f=>{_t.value&&(f.preventDefault(),f.stopPropagation())}),g.value.addEventListener("drop",f=>{if(!_t.value||!g.value)return;f.preventDefault(),f.stopPropagation();const y=_t.value,C=y.classList?.contains("dss-image-wrapper"),F=C?y.querySelector("img"):y,P=C?y:F?.closest(".dss-image-wrapper");if(!F||!g.value.contains(F)){_t.value=null;return}let _=null;const me=f.clientX,le=f.clientY;if(document.caretRangeFromPoint)_=document.caretRangeFromPoint(me,le);else{const Lt=window.getSelection();Lt.rangeCount>0?_=Lt.getRangeAt(0).cloneRange():(_=document.createRange(),_.selectNodeContents(g.value),_.collapse(!1))}if(!_){_t.value=null;return}const We=_.commonAncestorContainer,_e=We.nodeType===3?We.parentElement:We;if(_e?.closest(".dss-image-wrapper")===P||P&&P.contains(_e)){_t.value=null;return}if(P&&(_e===P||P.contains(_e))){_t.value=null;return}const xl=F.getAttribute("src");let yl=null;P?yl=P.cloneNode(!0):yl=F.cloneNode(!0);try{let Lt=_.startContainer;if(Lt.nodeType===3&&(Lt=Lt.parentElement),P&&(Lt===P||P.contains(Lt))){const al=document.createRange();al.setStartAfter(P),al.collapse(!0),_=al}_.insertNode(yl);const It=document.createRange();It.setStartAfter(yl),It.collapse(!0);const cl=window.getSelection();cl.removeAllRanges(),cl.addRange(It)}catch{if(g.value.childNodes.length===0){const It=document.createElement("p");It.appendChild(yl),g.value.appendChild(It)}else{const It=g.value.lastChild;if(It&&It.nodeType===1)It.appendChild(yl);else{const cl=document.createElement("p");cl.appendChild(yl),g.value.appendChild(cl)}}}P?P.remove():F.remove(),_t.value=null,e.nextTick(()=>{const Lt=g.value.querySelectorAll("img");let It=!1;Lt.forEach(cl=>{if(cl.getAttribute("src")===xl)if(!It)It=!0;else{const al=cl.closest(".dss-image-wrapper");al?al.remove():cl.remove()}}),Zt(),yt()})}),g.value.addEventListener("dragend",f=>{_t.value=null});let m=null;const u=new MutationObserver(f=>{f.forEach(y=>{y.addedNodes.forEach(C=>{if(C.nodeType===1){C.tagName==="IMG"&&(C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="");const F=C.querySelectorAll&&C.querySelectorAll("img");F&&F.forEach(P=>{P.removeAttribute("alt"),P.removeAttribute("data-alt"),P.setAttribute("alt",""),P.setAttribute("data-alt",""),P.alt=""})}})}),m&&clearTimeout(m),m=setTimeout(()=>{Zt(),oa(),m=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const f=document.querySelector(".dss-text-editor-toolbar");if(f){const y=new MutationObserver(()=>{e.nextTick(()=>{oa()})});y.observe(f,{childList:!0,subtree:!0}),f._toolbarMutationObserver=y}}),A.modelValue){const f=Vn(A.modelValue);g.value.innerHTML=f,vl()}e.nextTick(()=>{const f=g.value.innerHTML||"",y=A.title||"",C=A.description||"";it.value=f,ae.value=y,Q.value=C,oe.value=y,re.value=C,rl(),Zt(),Dl(),Bn(),wa(),hl()}),fl(),wn(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",_a),window.removeEventListener("resize",aa),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Un!==null&&(clearTimeout(Un),Un=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),Me.value&&clearTimeout(Me.value),lt.value&&clearTimeout(lt.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Oe.value&&Oe.value.disconnect(),kt.value!==null&&(cancelAnimationFrame(kt.value),kt.value=null),st.value!==null&&(clearTimeout(st.value),st.value=null),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),ct(!0),g.value&&g.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=g.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const eo=o=>{const n=o.target,s=n.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const m=window.getSelection();m.removeAllRanges(),m.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,f=u.nodeType===3?u.parentElement:u;if(i.contains(f)&&f!==i.querySelector("img")){const y=document.createRange();y.setStartAfter(i),y.collapse(!0),c.removeAllRanges(),c.addRange(y)}}Zt(),fl(),wn(),il(),Bn()}):e.nextTick(()=>{Zt(),fl(),wn(),il(),Bn()})},Da=()=>{Pl();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);ce.value=!s.collapsed&&zn(s),!s.collapsed&&V.value&&(V.value=null)}else ce.value=!1;if(Zt(),fl(),wn(),il(),Bn(),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(),ce.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 m=c.commonAncestorContainer,u=m.nodeType===3?m.parentElement:m;let f=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(f=!0),!f&&u.style&&parseInt(u.style.fontWeight)>=600&&(f=!0),!f))try{const y=window.getComputedStyle(u);parseInt(y.fontWeight)>=600&&(f=!0)}catch{}ke.value[s]=f}else{const m=document.queryCommandState(s);ke.value[s]=m}}}catch{}})},Bn=()=>{if(!A.richText||A.disabled||!g.value){T.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){T.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!g.value.contains(i)){T.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){T.value="p";return}const m=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(m)?T.value=m:T.value="p"}catch{T.value="p"}},wn=()=>{if(!g.value){Ze.value=!1;return}try{const o=window.getSelection();let n=!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");n=!!(c&&g.value.contains(c))}Ze.value=n}catch{Ze.value=!1}},zn=o=>{if(!o||!g.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?g.value.contains(s):!1},an=()=>{et.value=!1},il=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){et.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){et.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!zn(n)){et.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){et.value=!1;return}const i=g.value;if(!i){et.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){et.value=!1;return}const m=40,u=8,f=s.top-m/2+15;let y=s.left+s.width/2;const C=window.innerWidth||document.documentElement.clientWidth||0;let F=0;Pe.value&&(F=Pe.value.getBoundingClientRect().width);const P=(F||320)/2;let _=c.left+P,me=c.right-P;if(me<_){const le=c.left+c.width/2;_=le,me=le}if(C>0){const le=P+u,We=C-P-u;if(_=Math.max(_,le),me=Math.min(me,We),me<_){const _e=C/2;_=_e,me=_e}}y<_?y=_:y>me&&(y=me),at.value={position:"fixed",top:`${Math.max(f,8)}px`,left:`${y}px`,transform:"translate(-50%, -100%)",zIndex:10003},et.value=!0},La=o=>{A.disabled||!A.richText||($t.value=$t.value===o?null:o,o==="askAi"&&(xe.value=null))},Ta=()=>{$t.value=null,be.value=null},_n=o=>{Fl(o),Ta()};let Pn=null,fn=null,Mn=null,Xl=null;const to=o=>{if(A.disabled||!A.richText){ea(),ta();return}const n=o.target,s=n.closest("a"),i=n.closest("img");if(Pn&&(clearTimeout(Pn),Pn=null),Mn&&(clearTimeout(Mn),Mn=null),s&&s!==fn){ta(),fn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Ye.value=s,he.value=c,X.value=!0,ge.value=!0,Aa(s)}else!s&&fn?(fn=null,Pn=setTimeout(()=>{ge.value||ea()},150)):s&&s===fn&&Aa(s);if(i&&i!==Xl){ea(),Xl=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let m=i.getAttribute("data-alt");m===null&&(m=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",m),dt.value=i,Vt.value=c.trim()||$("textEditor.image.noAlt"),wt.value=!0,R.value=!0,Ha(i)}else!i&&Xl?(Xl=null,Mn=setTimeout(()=>{R.value||ta()},150)):i&&i===Xl&&Ha(i)},lo=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(fn=null,Xl=null,Pn&&(clearTimeout(Pn),Pn=null),Mn&&(clearTimeout(Mn),Mn=null),ea(),ta())},ea=()=>{ge.value=!1,setTimeout(()=>{ge.value||(X.value=!1,he.value="",Te.value||(Ye.value=null))},100)},Aa=o=>{if(!o||!g.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,m=n.left+n.width/2;Ae.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},ta=()=>{R.value=!1,setTimeout(()=>{R.value||(wt.value=!1,Vt.value="",Wt.value||(dt.value=null))},100)},Ha=o=>{if(!o||!g.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,m=n.left+n.width/2;ue.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},no=()=>{if(!he.value||!Ye.value)return;let n=Ye.value.getAttribute("href")||he.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ra=()=>{if(Ye.value){const o=Ye.value.textContent||"",n=Ye.value.getAttribute("href")||"",s=Ye.value;q.value=n,Re.value=o,De.value=o,ge.value=!1,X.value=!1,he.value="",Ye.value=s,Te.value=!0}else if(ye.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||"",m=i.getAttribute("href")||"";q.value=m,Re.value=c,De.value=c,Ye.value=i,Te.value=!0}}}else{Z.value=Yt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),q.value="",Re.value=n,De.value="",Ye.value=null,Te.value=!0}e.nextTick(()=>{Ue.value&&(Ue.value.focus(),Ue.value.select())})},Yn=()=>{Te.value=!1,q.value="",Re.value="",De.value="",Ye.value=null,Z.value=null},sa=()=>{if(!q.value.trim()){Yn();return}if(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt(),Re.value.trim()||(Re.value=q.value.trim()),Ye.value&&g.value&&g.value.contains(Ye.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Ye.value;if(n.setAttribute("href",q.value.trim()),Re.value.trim()!==De.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=Re.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),o.removeAllRanges(),o.addRange(s),yt()}else if(g.value){g.value.focus();const o=window.getSelection();o.removeAllRanges(),Z.value&&Ht(Z.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=q.value.trim(),s.textContent=Re.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),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(g.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,m=document.createElement("a");if(m.href=q.value.trim(),m.textContent=Re.value.trim(),m.style.color="#60afdf",m.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==g.value){let f=u.nextElementSibling;if(f&&(f.innerHTML==="<br>"||f.innerHTML==="<br/>"||f.textContent.trim()==="")){f.textContent="",f.appendChild(m);const y=document.createTextNode(" ");f.appendChild(y);const C=document.createRange();C.setStartAfter(m),C.collapse(!0),o.removeAllRanges(),o.addRange(C)}else{if(n.startOffset>0){const C=s.textContent.substring(0,n.startOffset),F=C[C.length-1];if(F&&F!==" "&&F!==" "&&F!==`
102
+ </svg>`,g=e.ref(null),xe=e.ref(null),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(!1),he=e.ref(""),Ae=e.ref({}),ge=e.ref(!1),Te=e.ref(!1),q=e.ref(""),Re=e.ref(""),Ze=e.ref(null),Be=e.ref(null),Ue=e.ref(null),Z=e.ref(null),De=e.ref(""),Ye=e.ref(!1),ke=e.ref({}),et=e.ref(!1),at=e.ref({}),ze=e.ref(null),Tt=e.ref(null),Zt=e.ref(!1),Qe=e.ref(""),At=e.ref(null),ye=e.ref(""),ft=e.ref(""),Je=e.ref(""),ct=e.ref(null),ot=e.ref(null),ht=e.ref(null),ut=e.ref(null),Gt=e.ref(null),xt=e.ref(!1),Nt=e.ref(""),ue=e.ref({}),R=e.ref(!1),Y=e.ref("upload"),ie=e.ref(""),be=e.ref(null),lt=e.ref(null),He=e.ref([]),nt=e.ref([]),Me=e.ref(null),tt=e.ref(!1),it=e.ref(""),Ut=e.ref(""),ae=e.ref(""),Q=e.ref(""),oe=e.ref(""),re=e.ref(""),Se=e.ref(null),Ke=e.ref(null),_t=e.ref(null),Qt=e.ref(!1),Mt=e.ref(null),ul=e.ref(!1),M=e.ref(!1),V=e.ref(null),T=e.ref("p"),ce=e.ref(!1),j=e.ref([]),Oe=e.ref(null),kt=e.ref(null),st=e.ref(null),Xe=e.ref(!1),Et=e.ref(0),Ct=100,St=e.ref(null),$t=e.computed(()=>!!A.commentUser),bt=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":$t.value&&w.value!==null})),Vt=e.computed(()=>({})),Sl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),Wl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),Tl=e.computed(()=>A.richText&&nt.value.length>0),Vl=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&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 A.modelValue}),Kt=e.computed(()=>{const o=Vl.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),Al=e.computed(()=>Vl.value.length),Nl=e.computed(()=>ut.value!==null&&Y.value==="upload"&&ye.value&&ye.value.startsWith("data:")),Ht=e.computed(()=>A.titlePlaceholder||$("textEditor.placeholders.title")),_l=e.computed(()=>A.descriptionPlaceholder||$("textEditor.placeholders.description")),sl=e.computed(()=>A.placeholder||$("textEditor.placeholders.startTyping")),Hl=o=>rt&&rt[o]!==void 0,Zn=o=>{for(let n=o+1;n<A.customToolbarSlots.length;n++)if(Hl(A.customToolbarSlots[n]))return!0;return!1},Tn=o=>{for(let n=o+1;n<A.customToolbarSlots.length;n++){const s=A.customToolbarSlots[n];if(Hl(s)&&Sn(s))return!0}return!1},Sn=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,Gl=e.computed(()=>A.customToolbarSlots.some(o=>Hl(o)&&Sn(o))),un=e.computed(()=>Hl("title-slot")),$l=e.computed(()=>Hl("description-slot")),gn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},Vn=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},An=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},bl=o=>{try{const n=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`${n} ${i} ${c}`}catch{return""}},yn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=$("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"},dn=o=>{const n=o.target.value;pe("update:modelValue",n),pe("change",n)},Rl=()=>{if(!Se.value)return;const o=Se.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")},Hn=()=>{ul.value=!0,Rl()},Ml=()=>{ul.value=!1,ql()},ql=()=>{if(!Se.value)return;const o=Se.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 n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},kn=o=>{const s=o.target.value;ul.value&&Rl(),pe("update:title",s),pe("title-change",s),_t.value="title",A.richText&&(tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,Wt()},500))},Fl=()=>{if(!Ke.value)return;const o=Ke.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const 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")},Jn=()=>{M.value=!0,Fl()},Zl=()=>{M.value=!1,dl()},dl=()=>{if(!Ke.value)return;const o=Ke.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},Dl=o=>{const s=o.target.value;M.value&&Fl(),pe("update:description",s),pe("description-change",s),_t.value="description",A.richText&&(tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,Wt()},500))},Yt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(g.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Rt=o=>{if(!(!o||!g.value))try{const n=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(g.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{g.value.focus();return}let i=0;const c=[g.value];let m=null,u=!1,f=!1;for(;!f&&(m=c.pop());)if(m.nodeType===3){const y=i+m.length;!u&&o.start>=i&&o.start<=y&&(s.setStart(m,o.start-i),u=!0),u&&o.end>=i&&o.end<=y&&(s.setEnd(m,o.end-i),f=!0),i=y}else{let y=m.childNodes.length;for(;y--;)c.push(m.childNodes[y])}n.removeAllRanges(),n.addRange(s)}catch{g.value.focus()}},Ql=()=>{if(!g.value)return;g.value.focus();const o=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let m=c.childNodes.length-1;m>=0;m--){const u=c.childNodes[m],f=s(u);if(f)return f}return c},i=s(g.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);o.removeAllRanges(),o.addRange(n)},Wt=(o=!1)=>{if(!g.value)return;const n=g.value.innerHTML,s=A.title||"",i=A.description||"";if(!o&&n===it.value&&s===ae.value&&i===Q.value)return;const c={content:Ut.value||it.value,title:oe.value!==void 0?oe.value:ae.value,description:re.value!==void 0?re.value:Q.value},m=He.value.length>0?He.value[He.value.length-1]:null;let u=!0;m&&(typeof m=="string"?u=c.content!==m:u=c.content!==m.content||c.title!==m.title||c.description!==m.description),u&&(He.value.push(c),He.value.length>50&&He.value.shift(),nt.value=[]),it.value=n,ae.value=s,Q.value=i,Ut.value=n,oe.value=s,re.value=i},gt=o=>{if(!g.value)return;Pl(),g.value&&An(g.value);let n=null;g.value&&(g.value.querySelector("p")||(n=Yt(),vl()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&V.value&&(V.value=null),J.value=!0;const i=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=gn(i);pe("update:modelValue",c),pe("change",c),_t.value="editor",tt.value||(Ut.value=it.value,oe.value=ae.value,re.value=Q.value),Me.value&&clearTimeout(Me.value),tt.value=!0,Me.value=setTimeout(()=>{tt.value=!1,Wt(),Ca(),ra()},500),e.nextTick(()=>{n&&Rt(n),Pl();const m=["bold","italic","underline"],u=window.getSelection(),f=u.rangeCount>0?u.getRangeAt(0):null,y=f&&f.collapsed;if(m.forEach(C=>{try{if(y&&V.value?.command===C){ke.value[C]=V.value.state;return}if(C==="bold")if(f){const F=f.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F;let _=!1;if(P&&((P.tagName==="STRONG"||P.tagName==="B"||P.closest&&P.closest("strong, b"))&&(_=!0),!_&&P.style&&parseInt(P.style.fontWeight)>=600&&(_=!0),!_))try{const me=window.getComputedStyle(P);parseInt(me.fontWeight)>=600&&(_=!0)}catch{}ke.value[C]=_}else ke.value.hasOwnProperty(C)||(ke.value[C]=!1);else if(C==="italic")if(f){const F=f.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F,_=P&&(P.tagName==="EM"||P.tagName==="I"||P.closest&&P.closest("em, i"));ke.value[C]=!!_}else{const F=document.queryCommandState(C);ke.value[C]=F}else{const F=document.queryCommandState(C);ke.value[C]=F}}catch{}}),rl(),qt(),Ll(),il(),Bn(),vt("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const C=o.data||"";C&&C.length===1&&setTimeout(()=>ra(C),0),(C===" "||C===`
103
+ `||/[.,;:!?]/.test(C))&&setTimeout(()=>{Ca()},100)}J.value=!1})},Pl=()=>{if(!g.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.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 m=c.querySelector("img");if(i!==m&&!m?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,f=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==m||c.contains(f)&&f!==m){const y=document.createRange();y.setStartAfter(c),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}}}},vl=()=>{if(!g.value)return;const o=g.value;if(o.querySelector&&o.querySelector("p"))return;const n=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 m=c,u=m.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,m)),i.appendChild(m)}})},qt=()=>{if(g.value&&!Qt.value){Qt.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),g.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()}),g.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const m=i.getAttribute("src")||i.src||"";if(c){const C=m.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),F=c===m||c===C;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||F||F)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let f=i.parentElement;const y=f&&f.classList.contains("dss-image-wrapper");if(y){const C=f.querySelector(".dss-image-no-alt-icon");C&&C.remove()}else{const C=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;C&&C.remove()}if(u){y?f.setAttribute("contenteditable","false"):(f=document.createElement("span"),f.className="dss-image-wrapper",f.setAttribute("contenteditable","false"),i.parentNode.insertBefore(f,i),f.appendChild(i));const C=document.createElement("div");C.className="dss-image-no-alt-icon",C.setAttribute("contenteditable","false"),C.innerHTML=te,f.appendChild(C)}else if(y&&f.children.length===1){const C=f.parentNode;C.insertBefore(i,f),C.removeChild(f)}})}finally{Qt.value=!1}}},Jl=o=>{Ca(),pe("blur",o),an()},Ul=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),Me.value&&(clearTimeout(Me.value),Me.value=null),tt.value&&(Wt(),tt.value=!1);const o=_t.value==="title",n=_t.value==="description",s=_t.value==="editor";if(He.value.length===0){o&&Se.value?Se.value.focus():n&&Ke.value?Ke.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{gt()});return}const i={content:g.value.innerHTML,title:A.title||"",description:A.description||""};nt.value.push(i);const c=He.value.pop();if(c!==void 0){J.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",f=typeof c=="object"&&c.description||"";g.value.innerHTML=m,it.value=m,ae.value=u,Q.value=f,Ut.value=m,oe.value=u,re.value=f,e.nextTick(()=>{rl(),fl(),wn(),il();const y=gn(m);pe("update:modelValue",y),pe("update:title",u),pe("update:description",f),pe("change",y),pe("title-change",u),pe("description-change",f),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Se.value){Se.value.focus();const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Rl()}}else if(n){if(Ke.value){Ke.value.focus();const C=f.length;Ke.value.setSelectionRange(C,C)}}else if(s)Ql();else if(Se.value&&document.activeElement===Se.value){const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Rl()}else if(Ke.value&&document.activeElement===Ke.value){const C=f.length;Ke.value.setSelectionRange(C,C)}else g.value&&Ql()},10)})})}},Rn=()=>{if(A.disabled||!A.richText||!g.value)return;Dt();const o=_t.value==="title",n=_t.value==="description",s=_t.value==="editor";if(nt.value.length===0){o&&Se.value?Se.value.focus():n&&Ke.value?Ke.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{gt()});return}const i={content:g.value.innerHTML,title:A.title||"",description:A.description||""};He.value.push(i);const c=nt.value.pop();if(c!==void 0){J.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",f=typeof c=="object"&&c.description||"";g.value.innerHTML=m,it.value=m,ae.value=u,Q.value=f,Ut.value=m,oe.value=u,re.value=f,e.nextTick(()=>{rl(),fl(),wn(),il();const y=gn(m);pe("update:modelValue",y),pe("update:title",u),pe("update:description",f),pe("change",y),pe("title-change",u),pe("description-change",f),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Se.value){Se.value.focus();const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Rl()}}else if(n){if(Ke.value){Ke.value.focus();const C=f.length;Ke.value.setSelectionRange(C,C)}}else if(s)Ql();else if(Se.value&&document.activeElement===Se.value){const C=u.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(C,C),Rl()}else if(Ke.value&&document.activeElement===Ke.value){const C=f.length;Ke.value.setSelectionRange(C,C)}else g.value&&Ql()},10)})})}},en=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const m=document.createDocumentFragment();for(;i.firstChild;)m.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(m,i)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const m=document.createElement("b");for(m.style.fontWeight="600";i.firstChild;)m.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(m,i)}}),g.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Ll=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Jt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.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 m;for(;m=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(m))){if(m.nodeType===3){let u=m.parentElement;for(;u&&u!==g.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(m.nodeType===1){const u=m;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(()=>{Ll()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Ll()});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),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Ll()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Ll()})}return!0},Yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.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 m;for(;m=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(m))){if(m.nodeType===3){let u=m.parentElement;for(;u&&u!==g.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(m.nodeType===1){const u=m;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),m=c.startContainer;let u=m.nodeType===3?m.parentElement:m;for(;u&&u!==g.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const f=u.style.fontWeight;if(f==="normal"||f==="400"){const y=document.createElement("b");y.style.fontWeight="600";const C=document.createDocumentFragment();for(;u.firstChild;)C.appendChild(u.firstChild);y.appendChild(C),u.parentNode&&u.parentNode.replaceChild(y,u),c.setStart(y,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===g.value){const f=document.createElement("b");f.style.fontWeight="600",f.innerHTML="<br>",c.insertNode(f),c.setStart(f,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),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{en()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{en()})}return!0},wl=(o,n=null)=>{if(A.disabled||!A.richText||!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt(),Dt(),g.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const m=s.getRangeAt(0);!m.collapsed&&zn(m)&&(i=Yt())}if(o==="createLink"&&n){const m=window.getSelection();if(m.rangeCount>0){const u=m.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const y=document.createTextNode(n);u.insertNode(y),u.selectNodeContents(y)}}}if(o==="bold"){const m=Yl();ke.value.bold=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"bold",state:m}),e.nextTick(()=>{i&&(Rt(i),e.nextTick(()=>{const f=Pt("bold");ke.value.bold=f})),gt(),fl(),il()});return}if(o==="italic"){const m=Jt();ke.value.italic=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"italic",state:m}),e.nextTick(()=>{i&&(Rt(i),e.nextTick(()=>{const f=Pt("italic");ke.value.italic=f})),gt(),Ll(),fl(),il()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(i&&Rt(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Pt("bold");ke.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Pt("italic");ke.value.italic=u});else{const u=document.queryCommandState(o);ke.value[o]=u}else{const u=document.queryCommandState(o);ke.value[o]=u}}catch{ke.value.hasOwnProperty(o)?ke.value[o]=!ke.value[o]:ke.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const y=u.getRangeAt(0),C=y.commonAncestorContainer.nodeType===1?y.commonAncestorContainer.closest("a"):y.commonAncestorContainer.parentElement?.closest("a");C&&(!C.getAttribute("href")||C.getAttribute("href")==="")&&C.setAttribute("href",n)}g.value.querySelectorAll("a").forEach(y=>{const C=y.getAttribute("href");(!C||C===""||C==="#")&&y.setAttribute("href",n)})}gt(),fl(),il()})},Pt=(o,n=null)=>{if(A.disabled||!g.value)return!1;try{if(o==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const m=window.getSelection();if(m.rangeCount>0){const f=m.getRangeAt(0).commonAncestorContainer;return!!(f.nodeType===1?f.tagName==="BLOCKQUOTE"?f:f.closest("blockquote"):f.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.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 f=c.commonAncestorContainer,y=f.nodeType===3?f.parentElement:f;if(y&&((y.tagName==="STRONG"||y.tagName==="B"||y.closest&&y.closest("strong, b"))&&(u=!0),!u&&y.style&&parseInt(y.style.fontWeight)>=600&&(u=!0),!u))try{const C=window.getComputedStyle(y);parseInt(C.fontWeight)>=600&&(u=!0)}catch{}return ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=u,u)}else{const f=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(f){const C=document.createTreeWalker(f,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;y=!0;let _=F.parentElement;for(;_&&_!==g.value;){if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}_=_.parentElement}}else if(F.nodeType===1){const P=F;if(P.tagName==="STRONG"||P.tagName==="B"){u=!0;break}if(P.style&&parseInt(P.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ke.value[o]=u&&y,u&&y}}if(o==="italic"){let u=!1;if(c.collapsed){const f=c.commonAncestorContainer,y=f.nodeType===3?f.parentElement:f;if(y&&((y.tagName==="EM"||y.tagName==="I"||y.closest&&y.closest("em, i"))&&(u=!0),!u&&y.style&&y.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(y).fontStyle==="italic"&&(u=!0)}catch{}return ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=u,u)}else{const f=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(f){const C=document.createTreeWalker(f,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;y=!0;let _=F.parentElement;for(;_&&_!==g.value;){if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}_=_.parentElement}}else if(F.nodeType===1){const P=F;if(P.tagName==="EM"||P.tagName==="I"){u=!0;break}if(P.style&&P.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[o]=u&&y,u&&y}}const m=document.queryCommandState(o);return c.collapsed&&ke.value.hasOwnProperty(o)?ke.value[o]:(ke.value[o]=m,m)}return ke.value.hasOwnProperty(o)?ke.value[o]:!1}catch{return ke.value.hasOwnProperty(o)?ke.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fn=o=>{A.disabled||!A.richText||(xe.value=xe.value===o?null:o,o==="askAi"&&(Tt.value=null))},Dt=()=>{xe.value=null,be.value=null},Il=o=>{wl("formatBlock",o),Dt()},Nn=o=>{if(!o||!g.value)return o;const n=We=>{let _e=We.nodeType===Node.TEXT_NODE?We.parentElement:We;for(;_e&&_e!==g.value;){const mt=_e.tagName;if(mt==="P"){const El=_e.parentElement;if(El===g.value||El.tagName==="BLOCKQUOTE")return _e}if(mt==="BLOCKQUOTE")break;_e=_e.parentElement}return null},s=n(o.startContainer),i=n(o.endContainer);if(!s||!i)return o;const c=[],m=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:We=>{const _e=We.tagName;if(_e==="P"){const mt=We.parentElement;if(mt===g.value||mt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return _e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=m.nextNode();)c.push(u);const f=c.indexOf(s),y=c.indexOf(i);if(f===-1||y===-1)return o;const C=Math.min(f,y),F=Math.max(f,y),P=c.slice(C,F+1);if(P.length===0)return o;const _=P[0],me=P[P.length-1],le=document.createRange();return le.setStartBefore(_),le.setEndAfter(me),le},Cn=()=>{if(A.disabled||!A.richText||!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt(),Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&zn(n)&&(n=Nn(n),o.removeAllRanges(),o.addRange(n));let s=null;!n.collapsed&&zn(n)&&(s=Yt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(y=>{if(y.nodeType===Node.ELEMENT_NODE)if(y.tagName==="P"||y.tagName==="DIV")u.insertBefore(y,c);else{const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}else if(y.nodeType===Node.TEXT_NODE&&y.textContent.trim()){const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),f=n.extractContents();u.appendChild(f),n.insertNode(u);const y=[],C=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:_=>_.parentNode===u&&_.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let F;for(;F=C.nextNode();)y.push(F);if(y.forEach(_=>{const me=document.createElement("p");_.parentNode.insertBefore(me,_),me.appendChild(_)}),u.querySelectorAll("p, div").forEach(_=>{_.textContent.trim()===""&&!_.querySelector("img")&&(_.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const _=document.createElement("p");_.innerHTML="<br>",u.appendChild(_)}}e.nextTick(()=>{s&&Rt(s),wn(),gt(),il()})},tn=()=>{if(!g.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||!g.value.contains(i))return;const c=F=>{if(!F)return!1;const P=F.textContent||"",me=(F.innerHTML||"").trim();return P.trim()===""||me===""||me==="<br>"||me==="<br/>"||me==="<p></p>"||me==="<p><br></p>"||me==="<p><br/></p>"||me==="<p> </p>"||me==="<p><br> </p>"||me==="<div></div>"||me==="<div><br></div>"||me==="<div><br/></div>"};let m=null;for(s.nodeType===3?m=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?m=s:m=s.closest("p, div"),m&&i.contains(m)&&c(m)&&m.remove();i.lastChild;){const F=i.lastChild;if(F.nodeType===1&&F.tagName==="BR")F.remove();else if(F.nodeType===3)if((F.textContent||"").trim()==="")F.remove();else break;else break}if(i.children.length>0)for(let F=i.children.length-1;F>=0;F--){const P=i.children[F];if((P.tagName==="P"||P.tagName==="DIV")&&c(P))P.remove();else break}let u=i.innerHTML;const f=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==f&&(i.innerHTML=u);const y=document.createElement("p");y.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(y,i.nextSibling):i.parentNode.appendChild(y):g.value&&g.value.appendChild(y);const C=document.createRange();C.selectNodeContents(y),C.collapse(!0),o.removeAllRanges(),o.addRange(C),e.nextTick(()=>{wn(),gt()})},fl=()=>{if(!g.value){Ce.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");Ce.value=!!i}else Ce.value=!1}catch{Ce.value=!1}},In=()=>{if(!g.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Z.value=Yt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),q.value="",Re.value=s,De.value="",Ue.value=null,Te.value=!0,Dt(),e.nextTick(()=>{Ze.value&&Ze.value.focus()})},ln=()=>{if(!g.value)return;tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt();const o=window.getSelection();let n=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&Ue.value&&(n=Ue.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),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}Ue.value=null}else wl("unlink");Ce.value=!1,Dt(),e.nextTick(()=>{gt(),fl()})},mn=()=>{A.disabled||!A.richText||g.value&&(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt(),Dt(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{rl(),gt(),il()}))},zl=()=>{A.disabled||!A.richText||g.value&&(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt(),Dt(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{rl(),gt(),il()}))},nn=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},rl=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=nn(s);i!==null&&Array.from(n.children).filter(m=>m.tagName==="LI").forEach(m=>{m.setAttribute("data-parent-num",String(i))})}})},Ol=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{rl(),gt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const m=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${m}`);u||(u=document.createElement(m),c.appendChild(u));const f=nn(c);u.appendChild(s),f!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(f)),rl();const y=document.createRange();y.selectNodeContents(s),y.collapse(!1),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{gt(),il()})}else document.execCommand("indent",!1),e.nextTick(()=>{rl(),gt(),il()})},k=()=>{if(A.disabled||!A.richText||!g.value)return;Dt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{rl(),gt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const m=c.parentElement;if(m&&(m.tagName==="OL"||m.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),m.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),rl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{gt(),il()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{rl(),gt(),il()})},w=e.ref(null),x=e.ref(null),d=e.ref({}),v=e.ref(""),b=e.ref(null),H=e.ref("");e.ref("");const U=e.ref(null);e.ref("");const ne=e.ref([]),K=e.ref(!1),pt=e.ref(!1),je=o=>{if(!o)return"";const n=o.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ot=()=>{if(!A.commentUser||A.disabled||!A.richText||!g.value)return;if(w.value!==null){w.value=null,v.value="",H.value="",U.value=null,ne.value=[],wt(!0);return}Dt(),g.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!zn(n))return;H.value=je(n)||"",U.value=Yt();const s=n.getBoundingClientRect(),i=g.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),m=s.bottom-c.top,f=Math.max(m+8,0);d.value={top:`${f}px`,bottom:"auto"},w.value=Date.now(),e.nextTick(()=>{if(v.value="",b.value){const C=b.value;C.style.height="auto",C.style.height=`${C.scrollHeight}px`,C.focus()}const y=i.querySelector(".dss-comment-overlay");if(y&&i){const C=i.querySelector(".dss-text-editor-footer");if(C){const F=i.getBoundingClientRect(),P=y.getBoundingClientRect(),_=C.getBoundingClientRect(),me=P.bottom-F.top,le=_.top-F.top,We=8;if(me>le-We){const _e=_.height;d.value={bottom:`${_e+We}px`,top:"auto"}}else d.value={top:`${f}px`,bottom:"auto"}}}})},$e=()=>{if(!v.value.trim())return;const o=v.value.trim(),n=new Date,s={text:o,selectionText:H.value,selectionRange:U.value,commentId:w.value,user:A.commentUser||null,createdAt:n.toISOString()};ne.value=[...ne.value,s],pe("comment-submitted",s),la(s),U.value&&!de(U.value)&&Pe(w.value,U.value),v.value="",e.nextTick(()=>{if(b.value){const i=b.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}vt("sendComment")})},dt=(o,n)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(ne.value=ne.value.filter((s,i)=>i!==n),w.value!==null&&g.value){const s=String(w.value),i=g.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&ne.value.length>0){const c=[],m=new Set;ne.value.forEach(u=>{u.user&&u.user.id&&!m.has(u.user.id)&&(m.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(ne.value.length))}else i&&ne.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:n,commentId:w.value}),A.comments&&Array.isArray(A.comments)){const s=A.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")})}},de=o=>{if(!o||!g.value)return!1;try{const n=tl(o);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},tl=o=>{if(!o||!g.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return g.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let s=0;const i=[g.value];let c=null,m=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const f=s+c.length;!m&&o.start>=s&&o.start<=f&&(n.setStart(c,o.start-s),m=!0),m&&o.end>=s&&o.end<=f&&(n.setEnd(c,o.end-s),u=!0),s=f}else{let f=c.childNodes.length;for(;f--;)i.push(c.childNodes[f])}return m?n:null}catch{return null}},Pe=(o,n)=>{if(!(!o||!n||!g.value))try{const s=tl(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const f=c.closest("[data-comment], [data-fake-comment]");if(f){f.getAttribute("data-comment")!==String(o)&&f.getAttribute("data-fake-comment")!==String(o)&&f.setAttribute("data-comment",String(o));return}}const m=document.createElement("span");m.setAttribute("data-comment",String(o));try{const f=s.startContainer,y=s.endContainer,C=s.startOffset,F=s.endOffset,P=f.nodeType===3?f.parentNode:f,_=y.nodeType===3?y.parentNode:y;if(P===_&&C===0&&F===(y.nodeType===3?y.length:_.childNodes.length)&&(P.tagName==="P"||P.tagName==="DIV"||P.tagName==="H1"||P.tagName==="H2"||P.tagName==="H3"||P.tagName==="H4"||P.tagName==="H5"||P.tagName==="H6")){const le=s.extractContents();m.appendChild(le),s.insertNode(m)}else s.surroundContents(m)}catch{const y=s.extractContents();m.appendChild(y),s.insertNode(m)}const u=g.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{vt("wrapSelectionWithCommentMarker"),gt()})}catch{}},la=o=>{if(!o||!o.commentId)return;const n=Array.isArray(A.comments)?[...A.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=n.findIndex(m=>typeof m.conversation_id=="string"&&m.conversation_id.startsWith("comment-")?null:Number(m.conversation_id)===Number(s)||m.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 m=n[i];if(m.conversation||(m.conversation=[]),m.conversation.push(c),m.updated_at=o.createdAt,!m.article_id&&n.length>0){const u=n.find(f=>f.article_id);u&&(m.article_id=u.article_id)}}else{const m=o.selectionRange,u=n.length>0&&n.find(y=>y.article_id)?.article_id||null,f={conversation_id:s,article_id:u,selection_range:m?{start:m.start||0,end:m.end||0,type:m.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(f)}K.value=!0,pe("update:comments",n)},na=(o,n=[])=>{if(!A.commentUser||A.disabled||!A.richText||!g.value)return;const s=g.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;Dt(),s.focus();const c=document.createRange();c.selectNodeContents(i);const m=window.getSelection();m&&(m.removeAllRanges(),m.addRange(c)),H.value=i.innerHTML||"",U.value=Yt();const u=c.getBoundingClientRect(),f=s.parentElement;if(f){const F=f.getBoundingClientRect(),P=u.bottom-F.top,me=Math.max(P+8,0);d.value={top:`${me}px`,bottom:"auto"}}const y=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let C=[];if(y&&A.comments&&Array.isArray(A.comments)){const F=A.comments.find(P=>String(P.conversation_id)===String(y));if(F&&F.conversation&&Array.isArray(F.conversation)){const P=F.conversation.map(_=>({id:_.id||_.commentary_id,commentary_id:_.id||_.commentary_id,conversation_id:F.id||F.conversation_id,text:_.text,user:_.user,createdAt:_.created_at||_.createdAt,updated_at:_.updated_at||_.updatedAt}));C.push(...P)}}C.length===0&&Array.isArray(n)&&n.length>0&&(C=n.slice()),C.sort((F,P)=>{const _=We=>{if(!We)return 0;const _e=new Date(We).getTime();return isNaN(_e)?0:_e},me=_(F.createdAt),le=_(P.createdAt);return me===le?0:me-le}),ne.value=C,wt(!0),w.value=y||null,i&&(x.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(v.value="",b.value){const F=b.value;F.style.height="auto",F.style.height=`${F.scrollHeight}px`,F.focus()}if(f){const F=f.querySelector(".dss-comment-overlay");if(F){const P=f.querySelector(".dss-text-editor-footer");if(P){const _=f.getBoundingClientRect(),me=F.getBoundingClientRect(),le=P.getBoundingClientRect(),We=me.bottom-_.top,_e=le.top-_.top,mt=8;if(We>_e-mt){const El=le.height;d.value={bottom:`${El+mt}px`,top:"auto"}}}}}vt("openCommentOverlayForSelector")})},pn=e.ref(null),vn=e.ref(0),ya=o=>{if(!(A.disabled||!A.richText)){if(o.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&&g.value&&g.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 f=document.createElement("p");f.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(f,u.nextSibling):c.appendChild(f),setTimeout(()=>{tn()},50);return}}}if(o.key.length===1||o.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 m=c.closest(".dss-image-wrapper");if(m){const u=m.querySelector("img");if(c!==u&&!u?.contains(c)){const f=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,y=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(m.contains(f)&&f!==u||m.contains(y)&&y!==u){o.preventDefault();const C=document.createRange();C.setStartAfter(m),C.collapse(!0),n.removeAllRanges(),n.addRange(C);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const m=s.startContainer;let u=m;m.nodeType===3&&(s.startOffset===0?u=m.previousSibling||m.parentNode:u=m.parentNode);const f=u.previousSibling;f&&(f.classList&&f.classList.contains("dss-image-wrapper")?c=f:f.tagName==="IMG"&&(i=f,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const m=s.startContainer;let u=m;m.nodeType===3&&(s.startOffset===m.length?u=m.nextSibling||m.parentNode:u=m.parentNode);const f=u.nextSibling;f&&(f.classList&&f.classList.contains("dss-image-wrapper")?c=f:f.tagName==="IMG"&&(i=f,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const m=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(m.nodeType===1&&m.tagName==="IMG"?(i=m,c=i.closest(".dss-image-wrapper")):(i=m.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const y=c.contains(u)||u===c,C=c.contains(f)||f===c,P=s.cloneContents().textContent?.trim()||"",_=c.textContent?.trim()||"";(!y||!C||P.length>_.length)&&(c=null,i=null)}}if(c){o.preventDefault(),o.stopPropagation();const m=c.parentNode;if(m){const u=document.createTextNode("");m.insertBefore(u,c),c.remove();const f=document.createRange();f.setStartAfter(u),f.collapse(!0),n.removeAllRanges(),n.addRange(f),e.nextTick(()=>{gt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?k():Ol();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,f=y=>{if(!y)return!1;let C=y.previousSibling;for(;C;){if(C.classList&&C.classList.contains("dss-image-wrapper")||C.tagName==="IMG"||C.querySelector&&C.querySelector(".dss-image-wrapper")||C.querySelector&&C.querySelector("img"))return!0;C=C.previousSibling}const F=y.parentElement;return F&&F!==g.value?f(F):!1};if(u.nodeType===3){const y=u.parentElement;if(y&&(f(y)||f(u))){const C=y.closest("p, div");if(C&&C!==g.value){o.preventDefault(),o.stopPropagation();let F=null;const P=s.startOffset;P<u.length&&(F=u.splitText(P));const _=document.createElement("p");if(F?_.appendChild(F):_.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}C.nextSibling?C.parentNode.insertBefore(_,C.nextSibling):C.parentNode.appendChild(_);const me=document.createRange();F?me.setStart(F,0):me.setStart(_,0),me.collapse(!0),n.removeAllRanges(),n.addRange(me),e.nextTick(()=>{gt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.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 f=le=>{if(!le)return!1;const We=le.textContent||"",mt=(le.innerHTML||"").trim(),El=mt.replace(/<br\s*\/?>/gi,"").trim();return We.trim()===""||mt===""||El===""||mt==="<br>"||mt==="<br/>"||mt==="<p></p>"||mt==="<p><br></p>"||mt==="<p><br/></p>"||mt==="<p> </p>"||mt==="<p><br> </p>"||mt==="<div></div>"||mt==="<div><br></div>"||mt==="<div><br/></div>"},y=c.lastChild,C=y&&y.nodeType===1&&y.tagName==="BR",F=s.startContainer,P=F.nodeType===3?F.parentElement:F,_=P===c||P&&P.parentElement===c;if(u&&f(u)||C&&_){o.preventDefault(),setTimeout(()=>{tn()},50);return}}}}if(o.key===" "){const n=Date.now(),s=n-vn.value;if(pn.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(m){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((m.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Ol();return}}}}pn.value=" ",vn.value=n}else pn.value=o.key}},ka=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Wt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let f=i.getRangeAt(0).commonAncestorContainer;f.nodeType===3&&(f=f.parentNode),c=f.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const m=u=>{const y=new DOMParser().parseFromString(u,"text/html");let C=g.value.querySelector("h1")?1:0;if(y.querySelectorAll("h1").forEach(P=>{if(C>0){const _=y.createElement("p");_.innerHTML=P.innerHTML,P.parentNode.replaceChild(_,P)}else C++}),c){const P=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],_=Array.from(y.body.children).filter(me=>P.includes(me.tagName));if(_.length===1){const me=_[0].tagName,le=c.tagName,We=c.textContent.trim()===""&&!c.querySelector("img");let _e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?_e=!0:We||(me===le||me==="P")&&(_e=!0),_e)return _[0].innerHTML.trim()}}return y.body.innerHTML.trim()};if(n){const u=m(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const f=m(s);document.execCommand("insertHTML",!1,f)}else document.execCommand("insertText",!1,s);gt()},_a=o=>{if(xe.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&Dt()}if(et.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=g.value&&s.closest(".dss-text-editor-content");!i&&!c&&an()}if(Tt.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Ta()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(be.value=null),!g.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ce.value=!i.collapsed&&zn(i)}else ce.value=!1}if(w.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),f=o.clientX,y=o.clientY;i=f>=u.left&&f<=u.right&&y>=u.top&&y<=u.bottom}const c=n.closest(".dss-toolbar-button"),m=c&&c.getAttribute("title")==="Comment";!i&&!m&&(w.value=null,v.value="",H.value="",U.value=null,ne.value=[],wt(!0))}},Ma=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),lt.value&&(clearTimeout(lt.value),lt.value=null),be.value=n},$a=o=>{const n=o.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}lt.value&&clearTimeout(lt.value),lt.value=setTimeout(()=>{be.value=null,lt.value=null},150)},Ka=o=>{be.value=null};let Ga=0;const Qa=o=>{if(!o)return;const n=Array.from(o.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(f=>f.tagName==="DIV"?f.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(f.children).filter(C=>C.tagName==="BUTTON"||C.tagName==="DIV").length>0:!1),m=s.nextElementSibling,u=m&&!m.classList.contains("dss-toolbar-dropdown-submenu")&&!m.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&m.tagName==="DIV"&&!m.classList.contains("dss-toolbar-dropdown-item")&&Array.from(m.children).some(f=>f.tagName==="BUTTON"||f.tagName==="DIV");if(c||u){const f=`submenu-auto-${++Ga}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",f);let y=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),y=c):u&&(m.classList.add("dss-toolbar-dropdown-submenu"),y=m),y&&(y.setAttribute("data-submenu-id",f),y.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?y.dataset.originalParentRef="inside":y.dataset.originalParentRef="sibling",Array.from(y.children).forEach(F=>{(F.tagName==="BUTTON"||F.tagName==="DIV")&&!F.classList.contains("dss-toolbar-dropdown-item")&&F.classList.add("dss-toolbar-dropdown-item")}))}})},bn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qa(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const m=c._subMenuHandlers;m&&(c.removeEventListener("mouseenter",m.enter),c.removeEventListener("mouseleave",m.leave));const u=y=>{const C=c.getAttribute("data-submenu-id");C&&Ma(y,C)},f=$a;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",f),c._subMenuHandlers={enter:u,leave:f}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const m=c._subMenuHandlers;m&&(c.removeEventListener("mouseenter",m.enter),c.removeEventListener("mouseleave",m.leave));const u=C=>{const F=c.getAttribute("data-submenu-id");F&&Ma(C,F)},f=$a;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",f),c._subMenuHandlers={enter:u,leave:f},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(C=>{C.addEventListener("click",Ka)})})})};let Un=null;const aa=()=>{if(be.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${be.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${be.value}"]`);o&&n&&Xn(o,n)}if(et.value&&il(),A.richText){if(Un!==null)return;Un=setTimeout(()=>{Un=null,vt("handleWindowResize")},150)}},oa=()=>{if(!A.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")})})},Ja=()=>{const o=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};o.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(()=>{ul.value?Rl():ql(),M.value?Fl():dl()})}),e.nextTick(()=>{Ja()}),A.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",_a),window.addEventListener("resize",aa);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,aa()},150))};window.addEventListener("scroll",n,!0),g.value._windowScrollHandler=n,g.value._windowScrollTimeout=o,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const s=g.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,aa()},150))};s&&(s.addEventListener("scroll",c),g.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{bn(),oa()}),g.value.addEventListener("click",f=>{const y=f.target;y.closest("a")&&!A.disabled&&f.preventDefault();const F=y.closest(".dss-image-no-alt-icon"),P=y.closest(".dss-image-wrapper");if(F||P&&y===P){f.preventDefault(),f.stopPropagation();const _=window.getSelection(),me=document.createRange();me.setStartAfter(P),me.collapse(!0),_.removeAllRanges(),_.addRange(me)}else P&&y.tagName!=="IMG"&&(f.preventDefault(),e.nextTick(()=>{const _=window.getSelection();if(_.rangeCount>0){const le=_.getRangeAt(0).commonAncestorContainer,We=le.nodeType===3?le.parentElement:le;if(P.contains(We)&&We!==P.querySelector("img")){const _e=document.createRange();_e.setStartAfter(P),_e.collapse(!0),_.removeAllRanges(),_.addRange(_e)}}else{const me=document.createRange();me.setStartAfter(P),me.collapse(!0),_.addRange(me)}}))},!0),g.value.addEventListener("mousedown",f=>{const y=f.target,C=y.closest(".dss-image-no-alt-icon"),F=y.closest(".dss-image-wrapper");if(C||F&&y.tagName!=="IMG"){f.preventDefault();const P=window.getSelection(),_=document.createRange();F&&(_.setStartAfter(F),_.collapse(!0),P.removeAllRanges(),P.addRange(_))}},!0),g.value.addEventListener("paste",f=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(C=>{if(!C.closest(".dss-image-wrapper"))C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="";else{const P=C.getAttribute("alt")||C.alt||"";if(P){const _=C.getAttribute("src")||C.src||"",me=_.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=P===_||P===me;(P.startsWith("http://")||P.startsWith("https://")||P.startsWith("data:")||le||le)&&(C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="")}}}),qt()})}),g.value.addEventListener("dragstart",f=>{const y=f.target,C=y.tagName==="IMG"?y:y.closest("img"),F=C?.closest(".dss-image-wrapper");C&&g.value.contains(C)&&(Mt.value=F||C,f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",f=>{Mt.value&&(f.preventDefault(),f.stopPropagation(),f.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",f=>{Mt.value&&(f.preventDefault(),f.stopPropagation())}),g.value.addEventListener("drop",f=>{if(!Mt.value||!g.value)return;f.preventDefault(),f.stopPropagation();const y=Mt.value,C=y.classList?.contains("dss-image-wrapper"),F=C?y.querySelector("img"):y,P=C?y:F?.closest(".dss-image-wrapper");if(!F||!g.value.contains(F)){Mt.value=null;return}let _=null;const me=f.clientX,le=f.clientY;if(document.caretRangeFromPoint)_=document.caretRangeFromPoint(me,le);else{const Lt=window.getSelection();Lt.rangeCount>0?_=Lt.getRangeAt(0).cloneRange():(_=document.createRange(),_.selectNodeContents(g.value),_.collapse(!1))}if(!_){Mt.value=null;return}const We=_.commonAncestorContainer,_e=We.nodeType===3?We.parentElement:We;if(_e?.closest(".dss-image-wrapper")===P||P&&P.contains(_e)){Mt.value=null;return}if(P&&(_e===P||P.contains(_e))){Mt.value=null;return}const El=F.getAttribute("src");let yl=null;P?yl=P.cloneNode(!0):yl=F.cloneNode(!0);try{let Lt=_.startContainer;if(Lt.nodeType===3&&(Lt=Lt.parentElement),P&&(Lt===P||P.contains(Lt))){const al=document.createRange();al.setStartAfter(P),al.collapse(!0),_=al}_.insertNode(yl);const It=document.createRange();It.setStartAfter(yl),It.collapse(!0);const cl=window.getSelection();cl.removeAllRanges(),cl.addRange(It)}catch{if(g.value.childNodes.length===0){const It=document.createElement("p");It.appendChild(yl),g.value.appendChild(It)}else{const It=g.value.lastChild;if(It&&It.nodeType===1)It.appendChild(yl);else{const cl=document.createElement("p");cl.appendChild(yl),g.value.appendChild(cl)}}}P?P.remove():F.remove(),Mt.value=null,e.nextTick(()=>{const Lt=g.value.querySelectorAll("img");let It=!1;Lt.forEach(cl=>{if(cl.getAttribute("src")===El)if(!It)It=!0;else{const al=cl.closest(".dss-image-wrapper");al?al.remove():cl.remove()}}),qt(),gt()})}),g.value.addEventListener("dragend",f=>{Mt.value=null});let m=null;const u=new MutationObserver(f=>{f.forEach(y=>{y.addedNodes.forEach(C=>{if(C.nodeType===1){C.tagName==="IMG"&&(C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="");const F=C.querySelectorAll&&C.querySelectorAll("img");F&&F.forEach(P=>{P.removeAttribute("alt"),P.removeAttribute("data-alt"),P.setAttribute("alt",""),P.setAttribute("data-alt",""),P.alt=""})}})}),m&&clearTimeout(m),m=setTimeout(()=>{qt(),oa(),m=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const f=document.querySelector(".dss-text-editor-toolbar");if(f){const y=new MutationObserver(()=>{e.nextTick(()=>{oa()})});y.observe(f,{childList:!0,subtree:!0}),f._toolbarMutationObserver=y}}),A.modelValue){const f=Vn(A.modelValue);g.value.innerHTML=f,vl()}e.nextTick(()=>{const f=g.value.innerHTML||"",y=A.title||"",C=A.description||"";it.value=f,ae.value=y,Q.value=C,oe.value=y,re.value=C,rl(),qt(),Ll(),Bn(),wa(),hl()}),fl(),wn(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",_a),window.removeEventListener("resize",aa),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Un!==null&&(clearTimeout(Un),Un=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),Me.value&&clearTimeout(Me.value),lt.value&&clearTimeout(lt.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Oe.value&&Oe.value.disconnect(),kt.value!==null&&(cancelAnimationFrame(kt.value),kt.value=null),st.value!==null&&(clearTimeout(st.value),st.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),wt(!0),g.value&&g.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=g.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const eo=o=>{const n=o.target,s=n.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const m=window.getSelection();m.removeAllRanges(),m.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,f=u.nodeType===3?u.parentElement:u;if(i.contains(f)&&f!==i.querySelector("img")){const y=document.createRange();y.setStartAfter(i),y.collapse(!0),c.removeAllRanges(),c.addRange(y)}}qt(),fl(),wn(),il(),Bn()}):e.nextTick(()=>{qt(),fl(),wn(),il(),Bn()})},Da=()=>{Pl();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);ce.value=!s.collapsed&&zn(s),!s.collapsed&&V.value&&(V.value=null)}else ce.value=!1;if(qt(),fl(),wn(),il(),Bn(),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(),ce.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 m=c.commonAncestorContainer,u=m.nodeType===3?m.parentElement:m;let f=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(f=!0),!f&&u.style&&parseInt(u.style.fontWeight)>=600&&(f=!0),!f))try{const y=window.getComputedStyle(u);parseInt(y.fontWeight)>=600&&(f=!0)}catch{}ke.value[s]=f}else{const m=document.queryCommandState(s);ke.value[s]=m}}}catch{}})},Bn=()=>{if(!A.richText||A.disabled||!g.value){T.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){T.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!g.value.contains(i)){T.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){T.value="p";return}const m=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(m)?T.value=m:T.value="p"}catch{T.value="p"}},wn=()=>{if(!g.value){Ye.value=!1;return}try{const o=window.getSelection();let n=!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");n=!!(c&&g.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},zn=o=>{if(!o||!g.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?g.value.contains(s):!1},an=()=>{et.value=!1},il=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){et.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){et.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!zn(n)){et.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){et.value=!1;return}const i=g.value;if(!i){et.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){et.value=!1;return}const m=40,u=8,f=s.top-m/2+15;let y=s.left+s.width/2;const C=window.innerWidth||document.documentElement.clientWidth||0;let F=0;ze.value&&(F=ze.value.getBoundingClientRect().width);const P=(F||320)/2;let _=c.left+P,me=c.right-P;if(me<_){const le=c.left+c.width/2;_=le,me=le}if(C>0){const le=P+u,We=C-P-u;if(_=Math.max(_,le),me=Math.min(me,We),me<_){const _e=C/2;_=_e,me=_e}}y<_?y=_:y>me&&(y=me),at.value={position:"fixed",top:`${Math.max(f,8)}px`,left:`${y}px`,transform:"translate(-50%, -100%)",zIndex:10003},et.value=!0},La=o=>{A.disabled||!A.richText||(Tt.value=Tt.value===o?null:o,o==="askAi"&&(xe.value=null))},Ta=()=>{Tt.value=null,be.value=null},_n=o=>{Il(o),Ta()};let Pn=null,fn=null,Mn=null,Xl=null;const to=o=>{if(A.disabled||!A.richText){ea(),ta();return}const n=o.target,s=n.closest("a"),i=n.closest("img");if(Pn&&(clearTimeout(Pn),Pn=null),Mn&&(clearTimeout(Mn),Mn=null),s&&s!==fn){ta(),fn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Ue.value=s,he.value=c,X.value=!0,ge.value=!0,Aa(s)}else!s&&fn?(fn=null,Pn=setTimeout(()=>{ge.value||ea()},150)):s&&s===fn&&Aa(s);if(i&&i!==Xl){ea(),Xl=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let m=i.getAttribute("data-alt");m===null&&(m=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",m),ut.value=i,Nt.value=c.trim()||$("textEditor.image.noAlt"),xt.value=!0,R.value=!0,Ha(i)}else!i&&Xl?(Xl=null,Mn=setTimeout(()=>{R.value||ta()},150)):i&&i===Xl&&Ha(i)},lo=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(fn=null,Xl=null,Pn&&(clearTimeout(Pn),Pn=null),Mn&&(clearTimeout(Mn),Mn=null),ea(),ta())},ea=()=>{ge.value=!1,setTimeout(()=>{ge.value||(X.value=!1,he.value="",Te.value||(Ue.value=null))},100)},Aa=o=>{if(!o||!g.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,m=n.left+n.width/2;Ae.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},ta=()=>{R.value=!1,setTimeout(()=>{R.value||(xt.value=!1,Nt.value="",Zt.value||(ut.value=null))},100)},Ha=o=>{if(!o||!g.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,m=n.left+n.width/2;ue.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},no=()=>{if(!he.value||!Ue.value)return;let n=Ue.value.getAttribute("href")||he.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ra=()=>{if(Ue.value){const o=Ue.value.textContent||"",n=Ue.value.getAttribute("href")||"",s=Ue.value;q.value=n,Re.value=o,De.value=o,ge.value=!1,X.value=!1,he.value="",Ue.value=s,Te.value=!0}else if(Ce.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||"",m=i.getAttribute("href")||"";q.value=m,Re.value=c,De.value=c,Ue.value=i,Te.value=!0}}}else{Z.value=Yt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),q.value="",Re.value=n,De.value="",Ue.value=null,Te.value=!0}e.nextTick(()=>{Ze.value&&(Ze.value.focus(),Ze.value.select())})},Yn=()=>{Te.value=!1,q.value="",Re.value="",De.value="",Ue.value=null,Z.value=null},sa=()=>{if(!q.value.trim()){Yn();return}if(tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt(),Re.value.trim()||(Re.value=q.value.trim()),Ue.value&&g.value&&g.value.contains(Ue.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Ue.value;if(n.setAttribute("href",q.value.trim()),Re.value.trim()!==De.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=Re.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),o.removeAllRanges(),o.addRange(s),gt()}else if(g.value){g.value.focus();const o=window.getSelection();o.removeAllRanges(),Z.value&&Rt(Z.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=q.value.trim(),s.textContent=Re.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),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(g.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,m=document.createElement("a");if(m.href=q.value.trim(),m.textContent=Re.value.trim(),m.style.color="#60afdf",m.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==g.value){let f=u.nextElementSibling;if(f&&(f.innerHTML==="<br>"||f.innerHTML==="<br/>"||f.textContent.trim()==="")){f.textContent="",f.appendChild(m);const y=document.createTextNode(" ");f.appendChild(y);const C=document.createRange();C.setStartAfter(m),C.collapse(!0),o.removeAllRanges(),o.addRange(C)}else{if(n.startOffset>0){const C=s.textContent.substring(0,n.startOffset),F=C[C.length-1];if(F&&F!==" "&&F!==" "&&F!==`
104
104
  `){const P=document.createTextNode(" ");n.insertNode(P),n.setStartAfter(P)}}n.insertNode(m);const y=document.createTextNode(" ");n.setStartAfter(m),n.insertNode(y),n.setStartAfter(y),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}}else{if(i&&n.startOffset>0){const f=s.textContent.substring(0,n.startOffset),y=f[f.length-1];if(y&&y!==" "&&y!==" "&&y!==`
105
- `){const C=document.createTextNode(" ");n.insertNode(C),n.setStartAfter(C)}}n.insertNode(m);const u=document.createTextNode(" ");n.setStartAfter(m),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}yt()}e.nextTick(()=>{fl(),Yn()})},Ca=()=>{if(!g.value||J.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Yt());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(g.value,NodeFilter.SHOW_TEXT,{acceptNode:f=>{const y=f.parentElement;return!y||y.closest("a")||y.closest(".dss-image-wrapper")||!f.textContent||f.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let m;for(;m=i.nextNode();)c.push(m);let u=!1;for(let f=c.length-1;f>=0;f--){const y=c[f],C=y.textContent;s.lastIndex=0;const F=[...C.matchAll(s)];if(F.length===0)continue;const P=F.filter(le=>{const We=le[0],_e=le.index;if(_e>0&&C[_e-1]==="@"||_e+We.length<C.length&&C[_e+We.length]==="@")return!1;const pt=y.parentElement;return!(pt&&pt.closest("a"))});if(P.length===0)continue;if(P.length===1&&P[0][0]===C.trim()){const le=P[0][0],We=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,_e=document.createElement("a");_e.href=We,_e.textContent=le,_e.style.color="#60afdf",_e.style.textDecoration="underline",y.parentNode&&(y.parentNode.replaceChild(_e,y),u=!0);continue}let _=0;const me=document.createDocumentFragment();if(P.forEach(le=>{const We=le.index,_e=le[0];if(We>_){const yl=C.substring(_,We);yl&&me.appendChild(document.createTextNode(yl))}const pt=_e.startsWith("http://")||_e.startsWith("https://")?_e:`https://${_e}`,xl=document.createElement("a");xl.href=pt,xl.textContent=_e,xl.style.color="#60afdf",xl.style.textDecoration="underline",me.appendChild(xl),_=We+_e.length}),_<C.length){const le=C.substring(_);le&&me.appendChild(document.createTextNode(le))}y.parentNode&&me.childNodes.length>0&&(y.parentNode.replaceChild(me,y),u=!0)}u&&n&&e.nextTick(()=>{Ht(n),fl()})},ao=()=>{if(!g.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const m=c.parentElement;return!m||m.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 m=s[c],u=m.textContent,f=[...u.matchAll(o)];if(f.length===0)continue;let y=0;const C=document.createDocumentFragment();f.forEach(F=>{const P=F.index,_=F[0].startsWith("<u>")?"u":"ins",me=F[1]||F[2]||"";P>y&&C.appendChild(document.createTextNode(u.substring(y,P)));const le=document.createElement(_);le.textContent=me,C.appendChild(le),y=P+F[0].length}),y<u.length&&C.appendChild(document.createTextNode(u.substring(y))),m.parentNode&&C.childNodes.length>0&&m.parentNode.replaceChild(C,m)}},ra=o=>{if(!g.value||J.value)return;if(!o){ao();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===g.value||!g.value.contains(c))return;const m=()=>{let yl="",Lt=0,It=!1;const cl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:pl=>pl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let al=0;for(;cl.nextNode();){const pl=cl.currentNode,sn=pl.textContent||"",Dn=al;if(al+=sn.length,pl===i.startContainer){yl+=sn.substring(0,i.startOffset),Lt=Dn+i.startOffset,It=!0;break}yl+=sn}return It||(Lt=yl.length),{textBeforeCursor:yl,cursorCharOffset:Lt}},{textBeforeCursor:u}=m();if(!u.length)return;let f=null,y=null;if(u.endsWith("**")&&(f=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(f=u.match(/__(.+?)__$/s))?y="strong":u.endsWith("*")&&!u.endsWith("**")&&(f=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(f=u.match(new RegExp("(?<!_)_([^_]+)_$")))?y="em":o===">"&&((f=u.match(/<u>(.+?)<\/u>$/s))||(f=u.match(/<ins>(.+?)<\/ins>$/s)))&&(y=f[0].startsWith("<u>")?"u":"ins",f[0].startsWith("<u>"),f[0].startsWith("<u>")),!f||!f[1])return;const C=f[0],F=f[1],P=u.length-C.length,me=(yl=>{let Lt=0;const It=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:al=>al.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let cl;for(;cl=It.nextNode();){const al=(cl.textContent||"").length;if(Lt+al>=yl)return{node:cl,offset:yl-Lt};Lt+=al}return null})(P);if(!me)return;const le=document.createRange();le.setStart(me.node,me.offset),le.setEnd(i.endContainer,i.endOffset);const We=document.createElement(y);We.textContent=F,le.deleteContents(),le.insertNode(We);const _e=window.getSelection(),pt=document.createRange();pt.setStartAfter(We),pt.collapse(!0),_e.removeAllRanges(),_e.addRange(pt);const xl=Yt();e.nextTick(()=>{yt(),xl&&Ht(xl)})},ba=()=>{g.value&&(Gt.value=Yt(),Qe.value="",Ce.value="",ie.value="",ht.value="",Je.value="",Tt.value=null,dt.value=null,Y.value="upload",Wt.value=!0,Dt(),e.nextTick(()=>{ut.value&&ut.value.focus(),ot.value&&(ot.value.value="")}))},ia=o=>{const n=o.target?.files?.[0];if(!n){Tt.value=null,Ce.value="";return}Tt.value=n;const s=new FileReader;s.onload=i=>{Ce.value=i.target?.result||""},s.readAsDataURL(n)},zl=()=>{ot.value&&ot.value.click()},z=()=>{ht.value&&(Je.value="")},Nl=()=>{Je.value&&(ht.value="")},on=()=>{let o=dt.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";dt.value=o,Qe.value=n.trim()===""||n.trim()==="Image"?"":n;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(ie.value=s,Ce.value="",Y.value="url"):(Ce.value=s,ie.value="",Y.value="upload");const c=o.style.width||o.getAttribute("width")||"",m=o.style.height||o.getAttribute("height")||"";ht.value=c.endsWith("px")?c.replace("px",""):c,Je.value=m.endsWith("px")?m.replace("px",""):m,Gt.value=null}else{ba();return}Wt.value=!0,R.value=!1,wt.value=!1,e.nextTick(()=>{Y.value==="url"&&gt.value?(gt.value.focus(),gt.value.select()):ut.value&&(ut.value.focus(),ut.value.select()),ot.value&&(ot.value.value="")})},xn=()=>{Wt.value=!1,Qe.value="",Ce.value="",ie.value="",ht.value="",Je.value="",Tt.value=null,dt.value=null,Gt.value=null,Y.value="upload"},Xt=()=>{const o=(Qe.value||"").trim(),n=g.value?._mutationObserver;n&&n.disconnect(),tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),qt(),tt.value=!1):qt();const s=Y.value==="url"?ie.value.trim():Ce.value;if(dt.value&&g.value&&g.value.contains(dt.value)){s&&(dt.value.src=s),dt.value.setAttribute("alt",o),dt.value.setAttribute("data-alt",o),ht.value?(dt.value.style.width=`${ht.value}px`,dt.value.setAttribute("width",ht.value)):(dt.value.style.removeProperty("width"),dt.value.removeAttribute("width")),Je.value?(dt.value.style.height=`${Je.value}px`,dt.value.setAttribute("height",Je.value)):(dt.value.style.removeProperty("height"),dt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(dt.value),c.collapse(!0),i.addRange(c)}yt()}else{if(!s){n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),xn();return}if(g.value){g.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let m=null;if(Gt.value&&(Ht(Gt.value),c&&c.rangeCount>0&&(m=c.getRangeAt(0))),!m&&c&&c.rangeCount>0&&(m=c.getRangeAt(0)),!m&&g.value){if(m=document.createRange(),g.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",g.value.appendChild(C),m.setStart(C,0),m.collapse(!0)}else m.selectNodeContents(g.value),m.collapse(!1);c&&(c.removeAllRanges(),c.addRange(m))}if(!m){xn();return}const u=m.commonAncestorContainer,f=u.nodeType===3?u.parentElement:u;if(!g.value.contains(f)){if(m=document.createRange(),g.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",g.value.appendChild(C),m.setStart(C,0),m.collapse(!0)}else m.selectNodeContents(g.value),m.collapse(!1);c&&(c.removeAllRanges(),c.addRange(m))}const y=document.createElement("img");y.src=s,y.setAttribute("alt",o),y.setAttribute("data-alt",o),ht.value&&(y.style.width=`${ht.value}px`,y.setAttribute("width",ht.value)),Je.value&&(y.style.height=`${Je.value}px`,y.setAttribute("height",Je.value));try{m.insertNode(y),m.setStartAfter(y),m.collapse(!0),c&&(c.removeAllRanges(),c.addRange(m))}catch{if(g.value){if(g.value.childNodes.length===0){const P=document.createElement("p");g.value.appendChild(P),P.appendChild(y)}else{const P=g.value.lastChild;if(P&&P.nodeType===1)P.appendChild(y);else{const _=document.createElement("p");g.value.appendChild(_),_.appendChild(y)}}const F=document.createRange();F.setStartAfter(y),F.collapse(!0),c&&(c.removeAllRanges(),c.addRange(F))}}dt.value=y,yt()}}e.nextTick(()=>{n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),fl(),il(),xn()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&g.value&&!J.value){const n=Vn(o||""),i=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const m=Yt();g.value.innerHTML=n,e.nextTick(()=>{vl();const u=g.value.innerHTML||"",f=A.title||"",y=A.description||"";it.value=u,ae.value=f,Q.value=y,Ut.value=u,oe.value=f,re.value=y,He.value=[],nt.value=[],Me.value&&(clearTimeout(Me.value),Me.value=null),tt.value=!1,m&&Ht(m),rl(),Zt(),Dl(),fl(),il(),Bn(),ft("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(il(),e.nextTick(()=>{wa()})):(an(),j.value=[],Oe.value&&(Oe.value.disconnect(),Oe.value=null)),Bn()}),e.watch(()=>A.floatingToolbar,o=>{o?il():an()}),e.watch(()=>A.disabled,o=>{o&&an(),Bn()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{M.value?Rl():dl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{ul.value?Hl():ql()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{oa()})},{deep:!0}),e.watch(()=>A.comments,(o,n)=>{if(A.commentUser){if(K.value){K.value=!1;return}vt.value||A.richText&&g.value&&e.nextTick(()=>{hl()})}},{deep:!0,immediate:!1});const hl=()=>{if(A.commentUser&&!vt.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!g.value)){vt.value=!0;try{const o=new Set,n=A.comments.filter(u=>{const f=String(u.conversation_id||u.id);return o.has(f)?!1:(o.add(f),!0)}),s=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const f=u.parentNode;if(f){for(;u.firstChild;)f.insertBefore(u.firstChild,u);f.removeChild(u)}});let c=0;const m=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const f=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!f)return;const y=String(f);if(m.has(y))return;const C=g.value.querySelector(`[data-comment="${y}"]`);if(C){hn(C,u),m.add(y);return}try{const F=$n(u.selection_range,u.selection_text);if(F&&!F.collapsed){const P=F.commonAncestorContainer,_=P.nodeType===3?P.parentElement:P;if(_){const We=_.closest("[data-comment], [data-fake-comment]");if(We){const _e=We.getAttribute("data-comment")||We.getAttribute("data-fake-comment");if(String(_e)===String(f)){We.setAttribute("data-comment",y),We.removeAttribute("data-fake-comment"),hn(We,u),m.add(y);return}else return}}const me=g.value.querySelector(`[data-comment="${y}"]`);if(me){hn(me,u),m.add(y);return}const le=document.createElement("span");le.setAttribute("data-comment",y),hn(le,u);try{F.surroundContents(le),c++,m.add(y)}catch{try{const _e=document.createRange();_e.setStart(F.startContainer,F.startOffset),_e.setEnd(F.endContainer,F.endOffset),ll(_e),_e.surroundContents(le),c++,m.add(y)}catch{try{const pt=F.extractContents();le.appendChild(pt),F.insertNode(le),c++,m.add(y)}catch(pt){console.warn("Failed to create comment marker:",pt)}}}}}catch{}}),e.nextTick(()=>{ft("restoreCommentsFromModel"),yt(),vt.value=!1})}catch{vt.value=!1}}},ll=o=>{if(!o||!g.value)return o;try{const n=["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&&n.includes(u.tagName)&&(i===0&&!gl(s)||o.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&o.setStartBefore(s);let c=o.endContainer,m=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(m===c.length&&!ml(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&m<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},gl=o=>{let n=o.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},ml=o=>{let n=o.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},$n=(o,n)=>{if(!o||!g.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=[g.value];let m=null,u=!1,f=!1;for(;!f&&(m=c.pop());)if(m.nodeType===3){const y=i+m.length;!u&&o.start>=i&&o.start<=y&&(s.setStart(m,o.start-i),u=!0),u&&o.end>=i&&o.end<=y&&(s.setEnd(m,o.end-i),f=!0),i=y}else{let y=m.childNodes.length;for(;y--;)c.push(m.childNodes[y])}return u?ll(s):null}}catch{return null}return null},hn=(o,n)=>{if(!o||!n)return;const s=n.conversation||[],i=new Set,c=[],m=f=>{f&&f.id&&!i.has(f.id)&&(i.add(f.id),c.push(f))};s.length>0&&s.forEach(f=>{f.user&&m(f.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")},ft=(o="unknown")=>{if(!A.commentUser||!A.richText||!g.value){j.value=[];return}Date.now()-xt.value<Ct&&kt.value!==null||kt.value===null&&(kt.value=requestAnimationFrame(()=>{if(kt.value=null,xt.value=Date.now(),Xe.value)return;Xe.value=!0;const s={},i=g.value;if(!i){Xe.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Xe.value=!1;return}const m=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],f=new Set;m.forEach(_=>{const me=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");me&&_.tagName==="SPAN"&&(f.has(me)||(u.push(_),f.add(me)))}),m.forEach(_=>{const me=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");!me||f.has(me)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(_.tagName)?_.querySelector(`span[data-comment="${me}"], span[data-fake-comment="${me}"]`)||(u.push(_),f.add(me)):_.tagName!=="SPAN"&&(u.push(_),f.add(me)))});const y=c.getBoundingClientRect(),C=i.getBoundingClientRect();u.forEach((_,me)=>{let le=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const jl=_.textContent?.trim(),ol=A.comments?.find(Kl=>(typeof Kl.conversation_id=="string"&&Kl.conversation_id.startsWith("comment-")?null:Kl.conversation_id)&&Kl.selection_text?.trim()===jl);ol?(le=String(ol.conversation_id),_.setAttribute("data-comment",le),_.removeAttribute("data-fake-comment")):(le=String(Date.now()),_.setAttribute("data-comment",le),_.removeAttribute("data-fake-comment"))}const We=_.getBoundingClientRect(),_e=window.getComputedStyle(_),pt=parseFloat(_e.lineHeight)||parseFloat(_e.fontSize)*1.2,Lt=We.top-C.top+pt/2-15,cl=C.top-y.top+Lt;let al=null,pl=null,sn=0;const Dn=[],xa=new Set;if(le&&A.comments){const jl=A.comments.find(ol=>String(ol.conversation_id||ol.id)===String(le));if(jl){const ol=jl.conversation||[];ol.length>0?(ol.forEach(Kl=>{Kl.user&&Kl.user.id&&!xa.has(Kl.user.id)&&(xa.add(Kl.user.id),Dn.push(Kl.user))}),sn=ol.length):(sn=0,al=null,pl=null),Dn.length>0?al=Dn[0]:al=null,Dn.length>1?pl=Dn[1]:pl=null}}const On=We.top+pt/2-15,Fa=On+30,Ea=5,Sa=Fa>C.top+Ea&&On<C.bottom-Ea?1:0;j.value.find(jl=>jl.id===le);let ca=_;if(!ca&&le&&g.value){const jl=String(le);ca=g.value.querySelector(`[data-comment="${jl}"], [data-fake-comment="${jl}"]`)}const Ia=Dn.length;s[le]?(s[le].top=cl,s[le].opacity=Sa,s[le].element=ca,s[le].firstUser=al,s[le].secondUser=pl,s[le].totalCount=sn,s[le].uniqueUserCount=Ia):s[le]={id:le,top:cl,opacity:Sa,element:ca,firstUser:al,secondUser:pl,totalCount:sn,uniqueUserCount:Ia}});const F=Object.values(s).map(_=>{const me=Math.max(0,(_.uniqueUserCount??0)-2);if(!_.element&&_.id&&g.value){const We=String(_.id);_.element=g.value.querySelector(`[data-comment="${We}"], [data-fake-comment="${We}"]`)}return{..._,firstUser:_.firstUser||null,secondUser:_.secondUser||null,totalCount:_.totalCount,additionalCount:me}});(j.value.length!==F.length||F.some((_,me)=>{const le=j.value[me];if(!le)return!0;const We=(le.firstUser?.id||null)!==(_.firstUser?.id||null),_e=(le.secondUser?.id||null)!==(_.secondUser?.id||null);return le.id!==_.id||Math.abs(le.top-_.top)>1||le.opacity!==_.opacity||le.totalCount!==_.totalCount||le.additionalCount!==_.additionalCount||We||_e||le.element!==_.element}))&&(j.value=F),Xe.value=!1}))},Rt=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&g.value){const s=String(o.id);n=g.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(ct(),x.value=n,n.classList.add("editor-comment-highlighted"))},ct=(o=!1)=>{!o&&w.value!==null&&x.value&&(x.value.getAttribute("data-comment")||x.value.getAttribute("data-fake-comment"))===w.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),x.value&&(x.value.classList.remove("editor-comment-highlighted"),x.value=null))},nl=o=>{if(!o||!o.element)return;ct(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;pe("comment-marker-clicked",{commentId:n,selector:s,element:o.element})},oo=()=>{ct()},wa=()=>{!A.richText||!g.value||(Oe.value&&Oe.value.disconnect(),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),Oe.value=new MutationObserver(()=>{Et.value===null&&(Et.value=setTimeout(()=>{Et.value=null,e.nextTick(()=>{ft("MutationObserver")})},200))}),Oe.value.observe(g.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),ft("setupCommentMarkersObserver-initial"))},Xn=(o,n)=>{if(!o||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const m=o.getBoundingClientRect(),u=window.innerWidth,f=window.innerHeight;if(m.right>u){const y=s.left-m.width-4;o.style.left=`${y}px`}if(m.bottom>f){const y=Math.max(8,f-m.height-8);o.style.top=`${y}px`}m.top<0&&(o.style.top="8px")};return e.watch(()=>be.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 m=s.parentNode;s.dataset.originalParentRef=m===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Xn(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(()=>[xe.value,$t.value],()=>{xe.value==="askAi"||$t.value==="askAi"?e.nextTick(()=>{bn()}):(be.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 m=i.closest(".dss-toolbar-dropdown");m&&m.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>A.locale,o=>{o&&o!==se.value&&(se.value=o)},{immediate:!0}),ee({openCommentOverlayForSelector:na,updateCommentMarkers:ft,restoreCommentsFromModel:hl}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Mt.value},bt.value]]),style:e.normalizeStyle(St.value)},[B.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",f1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ul,title:e.unref($)("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,h1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Ll.value}]),onClick:Rn,title:e.unref($)("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,g1),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",y1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Fn("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,C1)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,b1)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,w1)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,x1)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,E1)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,S1)):(e.openBlock(),e.createElementBlock("svg",V1,[...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,k1),xe.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=>Fl("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,N1),e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Fl("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,B1),e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Fl("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,_1),e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Fl("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,M1),e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Fl("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,$1),e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Fl("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,D1),e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Fl("<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($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("bold")}]),onClick:n[9]||(n[9]=s=>wl("bold")),title:e.unref($)("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,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("italic")}]),onClick:n[10]||(n[10]=s=>wl("italic")),title:e.unref($)("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,T1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("underline")}]),onClick:n[11]||(n[11]=s=>wl("underline")),title:e.unref($)("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,A1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze.value}]),onClick:Cn,title:e.unref($)("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,H1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ln,title:e.unref($)("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,F1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:In,title:e.unref($)("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,R1)),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":Pt("insertUnorderedList")}]),onClick:mn,title:e.unref($)("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,I1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("insertOrderedList")}]),onClick:Il,title:e.unref($)("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,z1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ba,title:e.unref($)("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,P1),Mt.value&&ce.value?(e.openBlock(),e.createElementBlock("div",O1)):e.createCommentVNode("",!0),Mt.value&&ce.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:Ot},[...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,W1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",q1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",Z1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Fn("askAi")),title:e.unref($)("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",Y1,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,U1),xe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",X1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)?(e.openBlock(),e.createElementBlock("div",j1,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&i<B.customToolbarSlots.length-1&&Zn(i)?(e.openBlock(),e.createElementBlock("div",K1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(xe.value==="paragraph"||xe.value==="askAi")&&B.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Dt})):e.createCommentVNode("",!0),e.createVNode(go,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:Yn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",G1,[e.createElementVNode("div",Q1,[e.createElementVNode("label",J1,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Be,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>Re.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(sa,["enter"])},null,40,em),[[e.vModelText,Re.value]])]),e.createElementVNode("div",tm,[e.createElementVNode("label",lm,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ue,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>q.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(sa,["enter"])},null,40,nm),[[e.vModelText,q.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Yn},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:sa},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(go,{showModal:Wt.value,width:"500px",height:"80vh",onCloseModal:xn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(dt.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",am,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Y.value==="upload"}]),onClick:n[17]||(n[17]=s=>Y.value="upload")},e.toDisplayString(e.unref($)("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":Y.value==="url"}]),onClick:n[18]||(n[18]=s=>Y.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",om,[e.createElementVNode("div",sm,[e.createElementVNode("div",rm,[Vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",im,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),Vl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:zl},[e.createElementVNode("img",{src:Ce.value,alt:"Preview",class:"dss-image-preview-image"},null,8,cm),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:ot,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ia},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ot,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ia},null,544))]),e.createElementVNode("div",um,[e.createElementVNode("label",dm,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:ut,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>Qe.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Xt,["enter"])},null,40,mm),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",pm,[e.createElementVNode("label",vm,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>ht.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:z},null,40,fm),[[e.vModelText,ht.value]])]),e.createElementVNode("div",hm,[e.createElementVNode("label",gm,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:Nl},null,40,ym),[[e.vModelText,Je.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",km,[e.createElementVNode("div",Cm,[e.createElementVNode("div",bm,[e.createElementVNode("label",wm,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:gt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ie.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Xt,["enter"])},null,40,xm),[[e.vModelText,ie.value]])]),e.createElementVNode("div",Em,[e.createElementVNode("label",Sm,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>Qe.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Xt,["enter"])},null,40,Vm),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",Nm,[e.createElementVNode("label",Bm,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>ht.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:z},null,40,_m),[[e.vModelText,ht.value]])]),e.createElementVNode("div",Mm,[e.createElementVNode("label",$m,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:Nl},null,40,Dm),[[e.vModelText,Je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:xn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xt},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),B.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":un.value&&ul.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",Lm,[ul.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Tm,[B.title?(e.openBlock(),e.createElementBlock("span",Am,e.toDisplayString(B.title),1)):(e.openBlock(),e.createElementBlock("span",Hm,e.toDisplayString(At.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:B.title,onInput:kn,onFocus:Hn,onBlur:_l,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ul.value}]),placeholder:At.value,disabled:B.disabled,rows:"1"},null,42,Rm)])],2)):e.createCommentVNode("",!0),B.showTitle&&un.value&&ul.value?(e.openBlock(),e.createElementBlock("div",Fm,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),B.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ml.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",Im,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zm,[B.description?(e.openBlock(),e.createElementBlock("span",Pm,e.toDisplayString(B.description),1)):(e.openBlock(),e.createElementBlock("span",Om,e.toDisplayString(Bl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:B.description,onInput:$l,onFocus:Jn,onBlur:Zl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Bl.value,disabled:B.disabled,rows:"1"},null,42,Wm)])],2)):e.createCommentVNode("",!0),B.showDescription&&Ml.value&&M.value?(e.openBlock(),e.createElementBlock("div",qm,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),Mt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(j.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":w.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=>Rt(s),onMouseleave:oo},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>nl(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,Ym)):(e.openBlock(),e.createElementBlock("span",Xm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,Um)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>nl(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Km)):(e.openBlock(),e.createElementBlock("span",Gm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,jm)):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=>nl(s),["stop"])},[e.createElementVNode("span",Jm,"+"+e.toDisplayString(s.additionalCount),1)],12,Qm)):e.createCommentVNode("",!0)],46,Zm))),128)):e.createCommentVNode("",!0),B.richText?(e.openBlock(),e.createElementBlock("div",s2,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":B.disabled,"dss-text-editor-fixed-height":B.fixedHeight}]),style:e.normalizeStyle(Wl.value),onInput:yt,onBlur:Jl,onClick:eo,onMouseup:Da,onKeyup:Da,onKeydown:ya,onPaste:ka,onMousemove:to,onMouseleave:lo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Mt.value&&w.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(d.value)},[H.value||ne.value.length>0?(e.openBlock(),e.createElementBlock("div",r2,[e.createElementVNode("div",i2,[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:H.value},null,8,c2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",u2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.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",d2,[e.createElementVNode("div",m2,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,p2)):(e.openBlock(),e.createElementBlock("span",v2,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",f2,[e.createElementVNode("div",h2,[e.createElementVNode("div",g2,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",y2,e.toDisplayString(bl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":yn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!yn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>mt(s,i),["stop"]),title:e.unref($)("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,k2)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",C2,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:b,"onUpdate:modelValue":n[26]||(n[26]=s=>v.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers($e,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(b.value){const s=b.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,b2),[[e.vModelText,v.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers($e,["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",w2,[e.createElementVNode("div",x2,[e.createElementVNode("span",E2,e.toDisplayString(Kt.value)+" "+e.toDisplayString(Kt.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",S2,e.toDisplayString(Tl.value)+" "+e.toDisplayString(Tl.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("textarea",{value:B.modelValue,onInput:dn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":B.fixedHeight}]),placeholder:sl.value,rows:B.rows,disabled:B.disabled,style:e.normalizeStyle(El.value)},null,46,t2),e.createElementVNode("div",l2,[e.createElementVNode("div",n2,[e.createElementVNode("span",a2,e.toDisplayString(Kt.value)+" "+e.toDisplayString(Kt.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",o2,e.toDisplayString(Tl.value)+" "+e.toDisplayString(Tl.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&he.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Ae.value),onMouseenter:n[28]||(n[28]=s=>ge.value=!0),onMouseleave:ea},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(no,["stop"]),title:he.value},e.toDisplayString(he.value),9,V2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ra,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",B2,[...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,N2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[wt.value&&Vt.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ue.value),onMouseenter:n[29]||(n[29]=s=>R.value=!0),onMouseleave:ta},[e.createElementVNode("div",_2,[Vt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",M2,[...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:Vt.value},e.toDisplayString(Vt.value),9,$2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(on,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",L2,[...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,D2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.floatingToolbar&&B.richText&&et.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Pe,class:"dss-floating-toolbar",style:e.normalizeStyle(at.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",T2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ul,["stop"]),title:e.unref($)("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,A2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Ll.value}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref($)("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,H2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",R2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>La("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,I2)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,z2)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,P2)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,O2)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,W2)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,q2)):(e.openBlock(),e.createElementBlock("svg",Z2,[...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,F2),$t.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=>_n("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>_n("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>_n("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>_n("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>_n("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>_n("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>_n("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("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":Pt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>wl("bold"),["stop"])),title:e.unref($)("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,U2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>wl("italic"),["stop"])),title:e.unref($)("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,Y2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>wl("underline"),["stop"])),title:e.unref($)("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,X2),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":Ze.value}]),onClick:e.withModifiers(Cn,["stop"]),title:e.unref($)("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,j2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ln,["stop"]),title:e.unref($)("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,G2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(In,["stop"]),title:e.unref($)("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,K2)),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":Pt("insertUnorderedList")}]),onClick:e.withModifiers(mn,["stop"]),title:e.unref($)("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,Q2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("insertOrderedList")}]),onClick:e.withModifiers(Il,["stop"]),title:e.unref($)("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,J2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ba,["stop"]),title:e.unref($)("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,ep),Mt.value?(e.openBlock(),e.createElementBlock("div",tp)):e.createCommentVNode("",!0),Mt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ot,["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,lp)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",np)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",ap,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>La("askAi"),["stop"])),title:e.unref($)("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",sp,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,op),$t.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Gl.value?(e.openBlock(),e.createElementBlock("div",rp,[B.askAi&&Gl.value?(e.openBlock(),e.createElementBlock("div",ip)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)&&Sn(s)?(e.openBlock(),e.createElementBlock("div",cp,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&Sn(s)&&i<B.customToolbarSlots.length-1&&Tn(i)?(e.openBlock(),e.createElementBlock("div",up)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),pp={class:"dss-color-picker__section-title"},vp={class:"dss-color-picker__presets-row"},fp=["title","onClick"],hp={key:1,class:"dss-color-picker__section"},gp={class:"dss-color-picker__presets-row"},yp=["title","onClick"],kp={key:2,class:"dss-color-picker__section"},Cp={class:"dss-color-picker__section-header"},bp={class:"dss-color-picker__presets-row"},wp=["title","onClick"],xp=["onClick"],Ep={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Sp=["title","onClick"],Vp={class:"dss-color-picker__input-row"},Np=["value"],Bp={__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(B,{emit:ee}){function N(ae){const Q=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ae);if(!Q)return{h:0,s:0,l:50};const oe=parseInt(Q[1],16)/255,re=parseInt(Q[2],16)/255,Se=parseInt(Q[3],16)/255,Ke=Math.max(oe,re,Se),Bt=Math.min(oe,re,Se);let Qt=0,_t=0;const ul=(Ke+Bt)/2;if(Ke!==Bt){const M=Ke-Bt;switch(_t=ul>.5?M/(2-Ke-Bt):M/(Ke+Bt),Ke){case oe:Qt=((re-Se)/M+(re<Se?6:0))/6;break;case re:Qt=((Se-oe)/M+2)/6;break;case Se:Qt=((oe-re)/M+4)/6;break}}return{h:Qt*360,s:_t*100,l:ul*100}}function $(ae,Q,oe){Q/=100,oe/=100;const re=Q*Math.min(oe,1-oe),Se=Ke=>{const Bt=(Ke+ae/30)%12,Qt=oe-re*Math.max(Math.min(Bt-3,9-Bt,1),-1);return Math.round(255*Qt).toString(16).padStart(2,"0")};return`#${Se(0)}${Se(8)}${Se(4)}`}function se(ae){const Q=ae.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Q)return null;let oe=Q[1];return oe.length===3&&(oe=oe.split("").map(re=>re+re).join("")),"#"+oe}function O(ae){const Q=ae.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Q)return null;const oe=Math.max(0,Math.min(255,Number.parseInt(Q[1],10))),re=Math.max(0,Math.min(255,Number.parseInt(Q[2],10))),Se=Math.max(0,Math.min(255,Number.parseInt(Q[3],10)));return`#${oe.toString(16).padStart(2,"0")}${re.toString(16).padStart(2,"0")}${Se.toString(16).padStart(2,"0")}`}function A(ae){if(typeof ae!="string")return null;const Q=ae.trim();return se(Q)||O(Q)}function pe(ae,Q,oe){Q/=100,oe/=100;const re=oe+Q*Math.min(oe,1-oe),Se=re===0?0:2-2*oe/re;return{h:ae,s:Se*100,v:re*100}}function rt(ae,Q,oe){Q/=100,oe/=100;const re=oe*(1-Q/2),Se=re===0||re===1?0:(oe-re)/Math.min(re,1-re);return{h:ae,s:Se*100,l:re*100}}const te=B,g=ee,xe=e.ref(!1),ye=e.ref(!1),J=e.ref(!1),X=e.ref(-1),he=e.ref(-1),Ae=e.ref(null),ge=e.ref(null),Te=e.ref(null),q=e.ref(null),Re=e.ref({top:0,left:0}),Ue=e.ref(N(te.modelValue||"#b8a5de")),Be=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),Ye=e.computed(()=>!te.disableCustomColors),Z=e.computed(()=>Be.value?0:te.initialPresetCount!=null?te.initialPresetCount:he.value<0?null:he.value),De=e.computed(()=>{const ae=Z.value;return ae==null?!0:Math.max(0,te.presetColors.length-ae)<te.max}),Ze=e.computed(()=>!!(ye.value||X.value>=0||!ke.value&&te.presetColors.length===0));e.computed(()=>{const ae=Z.value;return ae!=null&&te.presetColors.length>ae});const ke=e.computed(()=>Be.value||Z.value!=null),et=e.computed(()=>{const ae=Z.value;return ae==null?[]:te.presetColors.slice(0,ae)}),at=e.computed(()=>{const ae=Z.value;return ae==null?[]:te.presetColors.slice(ae)});function Pe(ae){const Q=Z.value;return Q!=null?Q+ae:-1}function $t(ae){const Q=Z.value;return Q!=null&&ae>=Q}function Wt(ae){$t(ae)&&(X.value=ae,Ue.value=N(te.presetColors[ae]),ye.value=!0,e.nextTick(()=>q.value?.focus()))}function Qe(ae){if(!$t(ae))return;const Q=te.presetColors.filter((Se,Ke)=>Ke!==ae);g("update:presetColors",Q);const oe=se(te.modelValue),re=se(te.presetColors[ae]);if(oe&&re&&oe.toLowerCase()===re.toLowerCase()){const Se=Q[Math.max(0,ae-1)]||Q[0];Se&&g("update:modelValue",Se)}}function Tt(){J.value=!J.value,J.value||(X.value=-1,ye.value=!1)}function Ce(){if(!Ye.value||X.value<0)return;const ae=ot.value,Q=se(ae);if(Q){const oe=[...te.presetColors];oe[X.value]=Q,g("update:presetColors",oe),g("update:modelValue",Q),X.value=-1,ye.value=!1}}function ht(){te.disabled||!Ye.value||(X.value=-1,ye.value=!ye.value,ye.value&&(R(),e.nextTick(()=>q.value?.focus())))}function Je(ae){const Q=A(ae),oe=A(te.modelValue);return Q&&oe&&Q.toLowerCase()===oe.toLowerCase()}function ut(){if(te.disabled||!Ye.value||!De.value)return;const ae=ot.value,Q=se(ae);if(Q){const oe=[...te.presetColors,Q];g("update:presetColors",oe),g("update:modelValue",Q);const re=Z.value??he.value;re>=0&&oe.length-re>=te.max&&(ye.value=!1)}}const ot=e.computed(()=>{const{h:ae,s:Q,l:oe}=Ue.value;return $(ae,Q,oe)}),gt=e.computed(()=>ot.value.toLowerCase()),dt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Ue.value.h}, 100%, 50%))`})),Gt=e.computed(()=>{const ae=pe(Ue.value.h,Ue.value.s,Ue.value.l);return{left:`${ae.s}%`,bottom:`${ae.v}%`,transform:"translate(-50%, 50%)"}}),wt=e.computed(()=>({left:`${Ue.value.h/360*100}%`,transform:"translateX(-50%)"})),Vt=e.computed(()=>({position:"fixed",left:`${Re.value.left}px`,top:`${Re.value.top}px`,zIndex:1002}));function ue(){if(!Ae.value||!xe.value)return;const ae=Ae.value.getBoundingClientRect(),Q=window.innerHeight||document.documentElement.clientHeight;let oe=ae.bottom+4;const re=ge.value;re&&oe+re.offsetHeight>Q-8&&(oe=ae.top-4-re.offsetHeight),Re.value={top:oe,left:ae.left}}function R(){const ae=te.modelValue||"#b8a5de",Q=A(ae);Q&&(Ue.value=N(Q))}function Y(){g("update:modelValue",ot.value)}function ie(){te.disabled||(xe.value=!xe.value,xe.value&&(R(),e.nextTick(()=>{ue(),q.value?.focus()})))}function be(){const ae=ot.value,Q=se(ae);if(Q){if(X.value>=0){const oe=[...te.presetColors];oe[X.value]=Q,g("update:presetColors",oe),g("update:modelValue",Q)}else if(Ye.value&&(te.presetColors.length>0||Be.value)&&ye.value&&De.value&&!te.presetColors.some(re=>se(re)?.toLowerCase()===Q.toLowerCase())){const re=[...te.presetColors,Q];g("update:presetColors",re),g("update:modelValue",Q)}}xe.value=!1,ye.value=!1,J.value=!1,X.value=-1}function lt(ae){if(!Te.value)return;const Q=Te.value.getBoundingClientRect(),oe=re=>{const Se=Math.max(0,Math.min(1,(re.clientX-Q.left)/Q.width)),Ke=Math.max(0,Math.min(1,1-(re.clientY-Q.top)/Q.height)),Bt={h:Ue.value.h,s:Se*100,v:Ke*100};Ue.value=rt(Bt.h,Bt.s,Bt.v)};oe(ae),document.addEventListener("mousemove",oe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",oe),Y()},{once:!0})}function He(ae){if(!ae.currentTarget)return;const oe=ae.currentTarget.getBoundingClientRect(),re=Se=>{const Ke=Math.max(0,Math.min(1,(Se.clientX-oe.left)/oe.width));Ue.value={...Ue.value,h:Ke*360}};re(ae),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),Y()},{once:!0})}function nt(ae){const Q=ae.target.value,oe=A(Q);oe&&(Ue.value=N(oe),g("update:modelValue",oe))}function Me(ae){if(te.disabled)return;const Q=A(ae);Q&&(Ue.value=N(Q),g("update:modelValue",Q))}let tt=null,it=null;function Ut(){tt&&(document.removeEventListener("keydown",tt),tt=null),it&&(window.removeEventListener("resize",it),it=null)}return e.watch(xe,ae=>{if(Ut(),ae){if(!Be.value&&te.initialPresetCount==null){const Q=te.presetColors.length;Q>0&&(he.value<0||Q<he.value)&&(he.value=Q)}tt=Q=>{Q.key==="Escape"&&be()},it=ue,document.addEventListener("keydown",tt),window.addEventListener("resize",it)}}),e.watch(()=>te.modelValue,()=>{xe.value&&R()},{immediate:!1}),e.watch(at,ae=>{ae.length===0&&(J.value=!1,X.value=-1,ye.value=!1)}),e.onBeforeUnmount(Ut),(ae,Q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":B.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:Ae,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":xe.value}]),onClick:ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ot.value})},[...Q[0]||(Q[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(be,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ge,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Vt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Be.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.presetGroups,(oe,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",pp,e.toDisplayString(oe.title),1),e.createElementVNode("div",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.colors,(Se,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(Se)}]),style:e.normalizeStyle({backgroundColor:Se,"--dss-preset-color":Se}),title:Se,onClick:e.withModifiers(Bt=>Me(Se),["stop"])},null,14,fp))),128))])]))),128)):et.value.length?(e.openBlock(),e.createElementBlock("div",hp,[Q[1]||(Q[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,(oe,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(oe)}]),style:e.normalizeStyle({backgroundColor:oe,"--dss-preset-color":oe}),title:oe,onClick:e.withModifiers(Se=>Me(oe),["stop"])},null,14,yp))),128))])])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock("div",kp,[e.createElementVNode("div",Cp,[Q[3]||(Q[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),at.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(Tt,["stop"])},[...Q[2]||(Q[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(oe,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,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&&Je(oe),"dss-color-picker__preset-bubble--editing":J.value&&X.value===Pe(re)}]),style:e.normalizeStyle({backgroundColor:X.value===Pe(re)?ot.value:oe,"--dss-preset-color":X.value===Pe(re)?ot.value:oe}),title:X.value===Pe(re)?ot.value:oe,onClick:e.withModifiers(Se=>J.value?Wt(Pe(re)):Me(oe),["stop"])},null,14,wp),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(Se=>Qe(Pe(re)),["stop"])},[...Q[4]||(Q[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,xp)):e.createCommentVNode("",!0)],2))),128)),De.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):B.presetColors.length?(e.openBlock(),e.createElementBlock("div",Ep,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.presetColors,(oe,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(oe)}]),style:e.normalizeStyle({backgroundColor:oe,"--dss-preset-color":oe}),title:oe,onClick:e.withModifiers(Se=>Me(oe),["stop"])},null,14,Sp))),128)),Ye.value&&De.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ze.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Te,onMousedown:lt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(dt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Gt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:He},[Q[5]||(Q[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(wt.value)},null,4)],32),e.createElementVNode("div",Vp,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:q,type:"text",class:"dss-color-picker__hex-input",value:gt.value,onInput:nt},null,40,Np)]),Ye.value&&ke.value&&(B.presetColors.length||Be.value)&&De.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:ut}," Save color ")):e.createCommentVNode("",!0),Ye.value&&ke.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ce}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:be}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},_p={key:0,class:"dss-loader"},Mp={key:0,class:"dss-loader-label"},$p={key:1,class:"dss-loader"},Dp={key:0,class:"dss-loader-label"},Lp={key:2,class:"dss-loader"},Tp={key:0,class:"dss-loader-label"},Ap={key:3,class:"dss-loader"},Hp={key:0,class:"dss-loader-label"},Rp={key:4,class:"dss-loader"},Fp={key:0,class:"dss-loader-label"},Ip={key:5,class:"dss-loader dss-loader--inline"},zp={class:"dss-loader-inline-text"},Pp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(B){const ee=B,N=e.computed(()=>ee.size==="small"?"dss-loaders--size-small":ee.size==="large"?"dss-loaders--size-large":ee.size==="medium"||ee.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>{const se={};if(!(ee.size==="small"||ee.size==="medium"||ee.size==="large"||ee.size==null)){const O=typeof ee.size=="number"?`${ee.size}px`:String(ee.size);se["--dss-loader-size"]=O}return ee.color&&(se["--dss-loader-accent"]=ee.color,se["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),se});return(se,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",N.value]),style:e.normalizeStyle($.value)},[B.type==="spinner"?(e.openBlock(),e.createElementBlock("div",_p,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",Mp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="dots"?(e.openBlock(),e.createElementBlock("div",$p,[O[1]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Dp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="battery"?(e.openBlock(),e.createElementBlock("div",Lp,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",Tp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Ap,[O[3]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Hp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="bars"?(e.openBlock(),e.createElementBlock("div",Rp,[O[4]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Fp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="inline"?(e.openBlock(),e.createElementBlock("div",Ip,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",zp,[e.renderSlot(se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ro="dss-skeleton-item",Op={__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:B=>["single","multiple"].includes(B)},targetClass:{type:String,default:Ro},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(B){const ee=B,N=e.computed(()=>{const O={"dss-skeleton--loading":ee.loading,"dss-skeleton--static":!ee.shimmer,"dss-skeleton--multiple":ee.mode==="multiple","dss-skeleton--dark":ee.darkMode};return ee.mode==="multiple"&&ee.targetClass!==Ro&&(O[`dss-skeleton--target-${ee.targetClass}`]=!0),O}),$=e.computed(()=>{const O={};return ee.borderRadius&&(O.borderRadius=ee.borderRadius),O}),se=e.computed(()=>{const O={};return ee.borderRadius&&(O["--dss-skeleton-border-radius"]=ee.borderRadius),ee.darkMode?(O["--dss-skeleton-bg"]=ee.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=ee.shimmerDark||"#3e3f41",O):(ee.bgColor&&(O["--dss-skeleton-bg"]=ee.bgColor),ee.shimmerColor&&(O["--dss-skeleton-shimmer"]=ee.shimmerColor),O)});return(O,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",N.value]),style:e.normalizeStyle(se.value)},[B.loading&&B.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle($.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":B.loading&&B.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},Wp={key:0,class:"dss-dnd-column-header"},qp={class:"dss-dnd-column-title"},Zp={class:"dss-dnd-column-count"},Up=["data-column"],Yp={key:0,class:"dss-dnd-indicator"},Xp=["onPointerdown"],jp=["onPointerdown"],Kp={class:"dss-dnd-item-content"},Gp={class:"dss-dnd-item-default"},Qp={key:0,class:"dss-dnd-empty"},Jp={name:"DSSDnd"},e0=Object.assign(Jp,{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(B,{emit:ee}){const N=B,$=ee,se=e.useSlots(),O=e.computed(()=>!!se["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},pe=e.computed(()=>({...A,...N.options})),rt=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(ue){if(!pe.value.ColColor||!ue)return{};const R=ue.background||ue.color;return R?{background:R}:{}}const g=e.ref(null),xe=e.ref(null),ye=e.ref(!1),J=e.ref(-1),X=e.ref(null);let he=null,Ae=null,ge=null,Te=null,q=0,Re=0,Ue="",Be=null;const Ye=5,Z=e.computed(()=>{const ue={};for(const R of N.columns)ue[R.value]=N.items.filter(Y=>Y[N.columnKey]===R.value).sort((Y,ie)=>(Y[N.positionKey]??0)-(ie[N.positionKey]??0));return ue}),De=e.computed(()=>{const ue={},R=!!g.value,Y=g.value?.[N.itemKey],ie=xe.value,be=J.value;for(const lt of N.columns){const He=Z.value[lt.value]||[],nt=[],Me=ie==lt.value;let tt=0;for(let it=0;it<He.length;it++){const Ut=He[it],ae=R&&Ut[N.itemKey]===Y;!ae&&Me&&be===tt&&nt.push({type:"indicator",key:`ind-${tt}`}),ae||tt++,nt.push({type:"item",item:Ut,isDragged:ae,key:`item-${Ut[N.itemKey]}`})}Me&&be>=tt&&nt.push({type:"indicator",key:"ind-end"}),ue[lt.value]=nt}return ue});function Ze(ue,R){const ie=(Z.value[ue]||[]).filter(He=>He[N.itemKey]!==g.value?.[N.itemKey]);if(ie.length===0)return 1;if(R<=0){const He=ie[0][N.positionKey];return He!=null&&He>0?He/2:.5}if(R>=ie.length){const He=ie[ie.length-1][N.positionKey];return(He??0)+1}const be=ie[R-1][N.positionKey]??0,lt=ie[R][N.positionKey]??0;return(be+lt)/2}function ke(ue,R,Y){ge&&ge.remove();const ie=ue.getBoundingClientRect(),be=ue.cloneNode(!0);be.classList.add("dss-dnd-ghost"),be.style.cssText=`
105
+ `){const C=document.createTextNode(" ");n.insertNode(C),n.setStartAfter(C)}}n.insertNode(m);const u=document.createTextNode(" ");n.setStartAfter(m),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}gt()}e.nextTick(()=>{fl(),Yn()})},Ca=()=>{if(!g.value||J.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Yt());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(g.value,NodeFilter.SHOW_TEXT,{acceptNode:f=>{const y=f.parentElement;return!y||y.closest("a")||y.closest(".dss-image-wrapper")||!f.textContent||f.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let m;for(;m=i.nextNode();)c.push(m);let u=!1;for(let f=c.length-1;f>=0;f--){const y=c[f],C=y.textContent;s.lastIndex=0;const F=[...C.matchAll(s)];if(F.length===0)continue;const P=F.filter(le=>{const We=le[0],_e=le.index;if(_e>0&&C[_e-1]==="@"||_e+We.length<C.length&&C[_e+We.length]==="@")return!1;const mt=y.parentElement;return!(mt&&mt.closest("a"))});if(P.length===0)continue;if(P.length===1&&P[0][0]===C.trim()){const le=P[0][0],We=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,_e=document.createElement("a");_e.href=We,_e.textContent=le,_e.style.color="#60afdf",_e.style.textDecoration="underline",y.parentNode&&(y.parentNode.replaceChild(_e,y),u=!0);continue}let _=0;const me=document.createDocumentFragment();if(P.forEach(le=>{const We=le.index,_e=le[0];if(We>_){const yl=C.substring(_,We);yl&&me.appendChild(document.createTextNode(yl))}const mt=_e.startsWith("http://")||_e.startsWith("https://")?_e:`https://${_e}`,El=document.createElement("a");El.href=mt,El.textContent=_e,El.style.color="#60afdf",El.style.textDecoration="underline",me.appendChild(El),_=We+_e.length}),_<C.length){const le=C.substring(_);le&&me.appendChild(document.createTextNode(le))}y.parentNode&&me.childNodes.length>0&&(y.parentNode.replaceChild(me,y),u=!0)}u&&n&&e.nextTick(()=>{Rt(n),fl()})},ao=()=>{if(!g.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const m=c.parentElement;return!m||m.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 m=s[c],u=m.textContent,f=[...u.matchAll(o)];if(f.length===0)continue;let y=0;const C=document.createDocumentFragment();f.forEach(F=>{const P=F.index,_=F[0].startsWith("<u>")?"u":"ins",me=F[1]||F[2]||"";P>y&&C.appendChild(document.createTextNode(u.substring(y,P)));const le=document.createElement(_);le.textContent=me,C.appendChild(le),y=P+F[0].length}),y<u.length&&C.appendChild(document.createTextNode(u.substring(y))),m.parentNode&&C.childNodes.length>0&&m.parentNode.replaceChild(C,m)}},ra=o=>{if(!g.value||J.value)return;if(!o){ao();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===g.value||!g.value.contains(c))return;const m=()=>{let yl="",Lt=0,It=!1;const cl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:pl=>pl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let al=0;for(;cl.nextNode();){const pl=cl.currentNode,sn=pl.textContent||"",Dn=al;if(al+=sn.length,pl===i.startContainer){yl+=sn.substring(0,i.startOffset),Lt=Dn+i.startOffset,It=!0;break}yl+=sn}return It||(Lt=yl.length),{textBeforeCursor:yl,cursorCharOffset:Lt}},{textBeforeCursor:u}=m();if(!u.length)return;let f=null,y=null;if(u.endsWith("**")&&(f=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(f=u.match(/__(.+?)__$/s))?y="strong":u.endsWith("*")&&!u.endsWith("**")&&(f=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(f=u.match(new RegExp("(?<!_)_([^_]+)_$")))?y="em":o===">"&&((f=u.match(/<u>(.+?)<\/u>$/s))||(f=u.match(/<ins>(.+?)<\/ins>$/s)))&&(y=f[0].startsWith("<u>")?"u":"ins",f[0].startsWith("<u>"),f[0].startsWith("<u>")),!f||!f[1])return;const C=f[0],F=f[1],P=u.length-C.length,me=(yl=>{let Lt=0;const It=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:al=>al.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let cl;for(;cl=It.nextNode();){const al=(cl.textContent||"").length;if(Lt+al>=yl)return{node:cl,offset:yl-Lt};Lt+=al}return null})(P);if(!me)return;const le=document.createRange();le.setStart(me.node,me.offset),le.setEnd(i.endContainer,i.endOffset);const We=document.createElement(y);We.textContent=F,le.deleteContents(),le.insertNode(We);const _e=window.getSelection(),mt=document.createRange();mt.setStartAfter(We),mt.collapse(!0),_e.removeAllRanges(),_e.addRange(mt);const El=Yt();e.nextTick(()=>{gt(),El&&Rt(El)})},ba=()=>{g.value&&(Gt.value=Yt(),Qe.value="",ye.value="",ie.value="",ft.value="",Je.value="",At.value=null,ut.value=null,Y.value="upload",Zt.value=!0,Dt(),e.nextTick(()=>{ct.value&&ct.value.focus(),ot.value&&(ot.value.value="")}))},ia=o=>{const n=o.target?.files?.[0];if(!n){At.value=null,ye.value="";return}At.value=n;const s=new FileReader;s.onload=i=>{ye.value=i.target?.result||""},s.readAsDataURL(n)},xl=()=>{ot.value&&ot.value.click()},z=()=>{ft.value&&(Je.value="")},Bl=()=>{Je.value&&(ft.value="")},on=()=>{let o=ut.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";ut.value=o,Qe.value=n.trim()===""||n.trim()==="Image"?"":n;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(ie.value=s,ye.value="",Y.value="url"):(ye.value=s,ie.value="",Y.value="upload");const c=o.style.width||o.getAttribute("width")||"",m=o.style.height||o.getAttribute("height")||"";ft.value=c.endsWith("px")?c.replace("px",""):c,Je.value=m.endsWith("px")?m.replace("px",""):m,Gt.value=null}else{ba();return}Zt.value=!0,R.value=!1,xt.value=!1,e.nextTick(()=>{Y.value==="url"&&ht.value?(ht.value.focus(),ht.value.select()):ct.value&&(ct.value.focus(),ct.value.select()),ot.value&&(ot.value.value="")})},xn=()=>{Zt.value=!1,Qe.value="",ye.value="",ie.value="",ft.value="",Je.value="",At.value=null,ut.value=null,Gt.value=null,Y.value="upload"},Xt=()=>{const o=(Qe.value||"").trim(),n=g.value?._mutationObserver;n&&n.disconnect(),tt.value?(Me.value&&(clearTimeout(Me.value),Me.value=null),Wt(),tt.value=!1):Wt();const s=Y.value==="url"?ie.value.trim():ye.value;if(ut.value&&g.value&&g.value.contains(ut.value)){s&&(ut.value.src=s),ut.value.setAttribute("alt",o),ut.value.setAttribute("data-alt",o),ft.value?(ut.value.style.width=`${ft.value}px`,ut.value.setAttribute("width",ft.value)):(ut.value.style.removeProperty("width"),ut.value.removeAttribute("width")),Je.value?(ut.value.style.height=`${Je.value}px`,ut.value.setAttribute("height",Je.value)):(ut.value.style.removeProperty("height"),ut.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ut.value),c.collapse(!0),i.addRange(c)}gt()}else{if(!s){n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),xn();return}if(g.value){g.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let m=null;if(Gt.value&&(Rt(Gt.value),c&&c.rangeCount>0&&(m=c.getRangeAt(0))),!m&&c&&c.rangeCount>0&&(m=c.getRangeAt(0)),!m&&g.value){if(m=document.createRange(),g.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",g.value.appendChild(C),m.setStart(C,0),m.collapse(!0)}else m.selectNodeContents(g.value),m.collapse(!1);c&&(c.removeAllRanges(),c.addRange(m))}if(!m){xn();return}const u=m.commonAncestorContainer,f=u.nodeType===3?u.parentElement:u;if(!g.value.contains(f)){if(m=document.createRange(),g.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",g.value.appendChild(C),m.setStart(C,0),m.collapse(!0)}else m.selectNodeContents(g.value),m.collapse(!1);c&&(c.removeAllRanges(),c.addRange(m))}const y=document.createElement("img");y.src=s,y.setAttribute("alt",o),y.setAttribute("data-alt",o),ft.value&&(y.style.width=`${ft.value}px`,y.setAttribute("width",ft.value)),Je.value&&(y.style.height=`${Je.value}px`,y.setAttribute("height",Je.value));try{m.insertNode(y),m.setStartAfter(y),m.collapse(!0),c&&(c.removeAllRanges(),c.addRange(m))}catch{if(g.value){if(g.value.childNodes.length===0){const P=document.createElement("p");g.value.appendChild(P),P.appendChild(y)}else{const P=g.value.lastChild;if(P&&P.nodeType===1)P.appendChild(y);else{const _=document.createElement("p");g.value.appendChild(_),_.appendChild(y)}}const F=document.createRange();F.setStartAfter(y),F.collapse(!0),c&&(c.removeAllRanges(),c.addRange(F))}}ut.value=y,gt()}}e.nextTick(()=>{n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),fl(),il(),xn()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&g.value&&!J.value){const n=Vn(o||""),i=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const m=Yt();g.value.innerHTML=n,e.nextTick(()=>{vl();const u=g.value.innerHTML||"",f=A.title||"",y=A.description||"";it.value=u,ae.value=f,Q.value=y,Ut.value=u,oe.value=f,re.value=y,He.value=[],nt.value=[],Me.value&&(clearTimeout(Me.value),Me.value=null),tt.value=!1,m&&Rt(m),rl(),qt(),Ll(),fl(),il(),Bn(),vt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(il(),e.nextTick(()=>{wa()})):(an(),j.value=[],Oe.value&&(Oe.value.disconnect(),Oe.value=null)),Bn()}),e.watch(()=>A.floatingToolbar,o=>{o?il():an()}),e.watch(()=>A.disabled,o=>{o&&an(),Bn()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{M.value?Fl():dl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{ul.value?Rl():ql()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{oa()})},{deep:!0}),e.watch(()=>A.comments,(o,n)=>{if(A.commentUser){if(K.value){K.value=!1;return}pt.value||A.richText&&g.value&&e.nextTick(()=>{hl()})}},{deep:!0,immediate:!1});const hl=()=>{if(A.commentUser&&!pt.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!g.value)){pt.value=!0;try{const o=new Set,n=A.comments.filter(u=>{const f=String(u.conversation_id||u.id);return o.has(f)?!1:(o.add(f),!0)}),s=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const f=u.parentNode;if(f){for(;u.firstChild;)f.insertBefore(u.firstChild,u);f.removeChild(u)}});let c=0;const m=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const f=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!f)return;const y=String(f);if(m.has(y))return;const C=g.value.querySelector(`[data-comment="${y}"]`);if(C){hn(C,u),m.add(y);return}try{const F=$n(u.selection_range,u.selection_text);if(F&&!F.collapsed){const P=F.commonAncestorContainer,_=P.nodeType===3?P.parentElement:P;if(_){const We=_.closest("[data-comment], [data-fake-comment]");if(We){const _e=We.getAttribute("data-comment")||We.getAttribute("data-fake-comment");if(String(_e)===String(f)){We.setAttribute("data-comment",y),We.removeAttribute("data-fake-comment"),hn(We,u),m.add(y);return}else return}}const me=g.value.querySelector(`[data-comment="${y}"]`);if(me){hn(me,u),m.add(y);return}const le=document.createElement("span");le.setAttribute("data-comment",y),hn(le,u);try{F.surroundContents(le),c++,m.add(y)}catch{try{const _e=document.createRange();_e.setStart(F.startContainer,F.startOffset),_e.setEnd(F.endContainer,F.endOffset),ll(_e),_e.surroundContents(le),c++,m.add(y)}catch{try{const mt=F.extractContents();le.appendChild(mt),F.insertNode(le),c++,m.add(y)}catch(mt){console.warn("Failed to create comment marker:",mt)}}}}}catch{}}),e.nextTick(()=>{vt("restoreCommentsFromModel"),gt(),pt.value=!1})}catch{pt.value=!1}}},ll=o=>{if(!o||!g.value)return o;try{const n=["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&&n.includes(u.tagName)&&(i===0&&!gl(s)||o.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&o.setStartBefore(s);let c=o.endContainer,m=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(m===c.length&&!ml(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&m<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},gl=o=>{let n=o.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},ml=o=>{let n=o.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},$n=(o,n)=>{if(!o||!g.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=[g.value];let m=null,u=!1,f=!1;for(;!f&&(m=c.pop());)if(m.nodeType===3){const y=i+m.length;!u&&o.start>=i&&o.start<=y&&(s.setStart(m,o.start-i),u=!0),u&&o.end>=i&&o.end<=y&&(s.setEnd(m,o.end-i),f=!0),i=y}else{let y=m.childNodes.length;for(;y--;)c.push(m.childNodes[y])}return u?ll(s):null}}catch{return null}return null},hn=(o,n)=>{if(!o||!n)return;const s=n.conversation||[],i=new Set,c=[],m=f=>{f&&f.id&&!i.has(f.id)&&(i.add(f.id),c.push(f))};s.length>0&&s.forEach(f=>{f.user&&m(f.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(!A.commentUser||!A.richText||!g.value){j.value=[];return}Date.now()-Et.value<Ct&&kt.value!==null||kt.value===null&&(kt.value=requestAnimationFrame(()=>{if(kt.value=null,Et.value=Date.now(),Xe.value)return;Xe.value=!0;const s={},i=g.value;if(!i){Xe.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Xe.value=!1;return}const m=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],f=new Set;m.forEach(_=>{const me=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");me&&_.tagName==="SPAN"&&(f.has(me)||(u.push(_),f.add(me)))}),m.forEach(_=>{const me=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");!me||f.has(me)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(_.tagName)?_.querySelector(`span[data-comment="${me}"], span[data-fake-comment="${me}"]`)||(u.push(_),f.add(me)):_.tagName!=="SPAN"&&(u.push(_),f.add(me)))});const y=c.getBoundingClientRect(),C=i.getBoundingClientRect();u.forEach((_,me)=>{let le=_.getAttribute("data-comment")||_.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const jl=_.textContent?.trim(),ol=A.comments?.find(Kl=>(typeof Kl.conversation_id=="string"&&Kl.conversation_id.startsWith("comment-")?null:Kl.conversation_id)&&Kl.selection_text?.trim()===jl);ol?(le=String(ol.conversation_id),_.setAttribute("data-comment",le),_.removeAttribute("data-fake-comment")):(le=String(Date.now()),_.setAttribute("data-comment",le),_.removeAttribute("data-fake-comment"))}const We=_.getBoundingClientRect(),_e=window.getComputedStyle(_),mt=parseFloat(_e.lineHeight)||parseFloat(_e.fontSize)*1.2,Lt=We.top-C.top+mt/2-15,cl=C.top-y.top+Lt;let al=null,pl=null,sn=0;const Dn=[],xa=new Set;if(le&&A.comments){const jl=A.comments.find(ol=>String(ol.conversation_id||ol.id)===String(le));if(jl){const ol=jl.conversation||[];ol.length>0?(ol.forEach(Kl=>{Kl.user&&Kl.user.id&&!xa.has(Kl.user.id)&&(xa.add(Kl.user.id),Dn.push(Kl.user))}),sn=ol.length):(sn=0,al=null,pl=null),Dn.length>0?al=Dn[0]:al=null,Dn.length>1?pl=Dn[1]:pl=null}}const On=We.top+mt/2-15,Fa=On+30,Ea=5,Sa=Fa>C.top+Ea&&On<C.bottom-Ea?1:0;j.value.find(jl=>jl.id===le);let ca=_;if(!ca&&le&&g.value){const jl=String(le);ca=g.value.querySelector(`[data-comment="${jl}"], [data-fake-comment="${jl}"]`)}const Ia=Dn.length;s[le]?(s[le].top=cl,s[le].opacity=Sa,s[le].element=ca,s[le].firstUser=al,s[le].secondUser=pl,s[le].totalCount=sn,s[le].uniqueUserCount=Ia):s[le]={id:le,top:cl,opacity:Sa,element:ca,firstUser:al,secondUser:pl,totalCount:sn,uniqueUserCount:Ia}});const F=Object.values(s).map(_=>{const me=Math.max(0,(_.uniqueUserCount??0)-2);if(!_.element&&_.id&&g.value){const We=String(_.id);_.element=g.value.querySelector(`[data-comment="${We}"], [data-fake-comment="${We}"]`)}return{..._,firstUser:_.firstUser||null,secondUser:_.secondUser||null,totalCount:_.totalCount,additionalCount:me}});(j.value.length!==F.length||F.some((_,me)=>{const le=j.value[me];if(!le)return!0;const We=(le.firstUser?.id||null)!==(_.firstUser?.id||null),_e=(le.secondUser?.id||null)!==(_.secondUser?.id||null);return le.id!==_.id||Math.abs(le.top-_.top)>1||le.opacity!==_.opacity||le.totalCount!==_.totalCount||le.additionalCount!==_.additionalCount||We||_e||le.element!==_.element}))&&(j.value=F),Xe.value=!1}))},yt=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&g.value){const s=String(o.id);n=g.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(wt(),x.value=n,n.classList.add("editor-comment-highlighted"))},wt=(o=!1)=>{!o&&w.value!==null&&x.value&&(x.value.getAttribute("data-comment")||x.value.getAttribute("data-fake-comment"))===w.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),x.value&&(x.value.classList.remove("editor-comment-highlighted"),x.value=null))},nl=o=>{if(!o||!o.element)return;wt(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;pe("comment-marker-clicked",{commentId:n,selector:s,element:o.element})},oo=()=>{wt()},wa=()=>{!A.richText||!g.value||(Oe.value&&Oe.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),Oe.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{vt("MutationObserver")})},200))}),Oe.value.observe(g.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"))},Xn=(o,n)=>{if(!o||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const m=o.getBoundingClientRect(),u=window.innerWidth,f=window.innerHeight;if(m.right>u){const y=s.left-m.width-4;o.style.left=`${y}px`}if(m.bottom>f){const y=Math.max(8,f-m.height-8);o.style.top=`${y}px`}m.top<0&&(o.style.top="8px")};return e.watch(()=>be.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 m=s.parentNode;s.dataset.originalParentRef=m===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Xn(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(()=>[xe.value,Tt.value],()=>{xe.value==="askAi"||Tt.value==="askAi"?e.nextTick(()=>{bn()}):(be.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 m=i.closest(".dss-toolbar-dropdown");m&&m.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>A.locale,o=>{o&&o!==se.value&&(se.value=o)},{immediate:!0}),ee({openCommentOverlayForSelector:na,updateCommentMarkers:vt,restoreCommentsFromModel:hl}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":$t.value},bt.value]]),style:e.normalizeStyle(Vt.value)},[B.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",h1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ul,title:e.unref($)("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,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Tl.value}]),onClick:Rn,title:e.unref($)("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,y1),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",k1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Fn("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,b1)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,w1)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,x1)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,E1)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,S1)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,V1)):(e.openBlock(),e.createElementBlock("svg",N1,[...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,C1),xe.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=>Il("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,B1),e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Il("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,_1),e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Il("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,M1),e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Il("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,$1),e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Il("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,D1),e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Il("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,L1),e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Il("<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($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("bold")}]),onClick:n[9]||(n[9]=s=>wl("bold")),title:e.unref($)("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,T1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("italic")}]),onClick:n[10]||(n[10]=s=>wl("italic")),title:e.unref($)("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,A1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("underline")}]),onClick:n[11]||(n[11]=s=>wl("underline")),title:e.unref($)("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,H1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Cn,title:e.unref($)("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,R1),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:ln,title:e.unref($)("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,I1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:In,title:e.unref($)("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,F1)),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":Pt("insertUnorderedList")}]),onClick:mn,title:e.unref($)("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,z1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("insertOrderedList")}]),onClick:zl,title:e.unref($)("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,P1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ba,title:e.unref($)("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,O1),$t.value&&ce.value?(e.openBlock(),e.createElementBlock("div",W1)):e.createCommentVNode("",!0),$t.value&&ce.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:Ot},[...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,q1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",Z1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",U1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Fn("askAi")),title:e.unref($)("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",X1,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,Y1),xe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",K1,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<B.customToolbarSlots.length-1&&Zn(i)?(e.openBlock(),e.createElementBlock("div",G1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(xe.value==="paragraph"||xe.value==="askAi")&&B.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Dt})):e.createCommentVNode("",!0),e.createVNode(go,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:Yn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Q1,[e.createElementVNode("div",J1,[e.createElementVNode("label",em,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Be,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>Re.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(sa,["enter"])},null,40,tm),[[e.vModelText,Re.value]])]),e.createElementVNode("div",lm,[e.createElementVNode("label",nm,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ze,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>q.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(sa,["enter"])},null,40,am),[[e.vModelText,q.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Yn},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:sa},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(go,{showModal:Zt.value,width:"500px",height:"80vh",onCloseModal:xn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ut.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",om,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Y.value==="upload"}]),onClick:n[17]||(n[17]=s=>Y.value="upload")},e.toDisplayString(e.unref($)("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":Y.value==="url"}]),onClick:n[18]||(n[18]=s=>Y.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",sm,[e.createElementVNode("div",rm,[e.createElementVNode("div",im,[Nl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",cm,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),Nl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:xl},[e.createElementVNode("img",{src:ye.value,alt:"Preview",class:"dss-image-preview-image"},null,8,um),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:ot,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ia},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ot,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ia},null,544))]),e.createElementVNode("div",dm,[e.createElementVNode("label",mm,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:ct,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>Qe.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Xt,["enter"])},null,40,pm),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",vm,[e.createElementVNode("label",fm,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:z},null,40,hm),[[e.vModelText,ft.value]])]),e.createElementVNode("div",gm,[e.createElementVNode("label",ym,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:Bl},null,40,km),[[e.vModelText,Je.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",bm,[e.createElementVNode("div",wm,[e.createElementVNode("label",xm,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:ht,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ie.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Xt,["enter"])},null,40,Em),[[e.vModelText,ie.value]])]),e.createElementVNode("div",Sm,[e.createElementVNode("label",Vm,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>Qe.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Xt,["enter"])},null,40,Nm),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",Bm,[e.createElementVNode("label",_m,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:z},null,40,Mm),[[e.vModelText,ft.value]])]),e.createElementVNode("div",$m,[e.createElementVNode("label",Dm,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(Xt,["enter"]),onInput:Bl},null,40,Lm),[[e.vModelText,Je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:xn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xt},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),B.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":un.value&&ul.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",Tm,[ul.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Am,[B.title?(e.openBlock(),e.createElementBlock("span",Hm,e.toDisplayString(B.title),1)):(e.openBlock(),e.createElementBlock("span",Rm,e.toDisplayString(Ht.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:B.title,onInput:kn,onFocus:Hn,onBlur:Ml,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ul.value}]),placeholder:Ht.value,disabled:B.disabled,rows:"1"},null,42,Fm)])],2)):e.createCommentVNode("",!0),B.showTitle&&un.value&&ul.value?(e.openBlock(),e.createElementBlock("div",Im,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),B.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":$l.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",zm,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Pm,[B.description?(e.openBlock(),e.createElementBlock("span",Om,e.toDisplayString(B.description),1)):(e.openBlock(),e.createElementBlock("span",Wm,e.toDisplayString(_l.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:B.description,onInput:Dl,onFocus:Jn,onBlur:Zl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:_l.value,disabled:B.disabled,rows:"1"},null,42,qm)])],2)):e.createCommentVNode("",!0),B.showDescription&&$l.value&&M.value?(e.openBlock(),e.createElementBlock("div",Zm,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),$t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(j.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":w.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=>yt(s),onMouseleave:oo},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>nl(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,Xm)):(e.openBlock(),e.createElementBlock("span",jm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,Ym)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>nl(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Gm)):(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,Km)):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=>nl(s),["stop"])},[e.createElementVNode("span",e2,"+"+e.toDisplayString(s.additionalCount),1)],12,Jm)):e.createCommentVNode("",!0)],46,Um))),128)):e.createCommentVNode("",!0),B.richText?(e.openBlock(),e.createElementBlock("div",r2,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":B.disabled,"dss-text-editor-fixed-height":B.fixedHeight}]),style:e.normalizeStyle(Wl.value),onInput:gt,onBlur:Jl,onClick:eo,onMouseup:Da,onKeyup:Da,onKeydown:ya,onPaste:ka,onMousemove:to,onMouseleave:lo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[$t.value&&w.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(d.value)},[H.value||ne.value.length>0?(e.openBlock(),e.createElementBlock("div",i2,[e.createElementVNode("div",c2,[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:H.value},null,8,u2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",d2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.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",m2,[e.createElementVNode("div",p2,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,v2)):(e.openBlock(),e.createElementBlock("span",f2,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",h2,[e.createElementVNode("div",g2,[e.createElementVNode("div",y2,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",k2,e.toDisplayString(bl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":yn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!yn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>dt(s,i),["stop"]),title:e.unref($)("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,C2)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",b2,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:b,"onUpdate:modelValue":n[26]||(n[26]=s=>v.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers($e,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(b.value){const s=b.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,w2),[[e.vModelText,v.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers($e,["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",x2,[e.createElementVNode("div",E2,[e.createElementVNode("span",S2,e.toDisplayString(Kt.value)+" "+e.toDisplayString(Kt.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",V2,e.toDisplayString(Al.value)+" "+e.toDisplayString(Al.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",t2,[e.createElementVNode("textarea",{value:B.modelValue,onInput:dn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":B.fixedHeight}]),placeholder:sl.value,rows:B.rows,disabled:B.disabled,style:e.normalizeStyle(Sl.value)},null,46,l2),e.createElementVNode("div",n2,[e.createElementVNode("div",a2,[e.createElementVNode("span",o2,e.toDisplayString(Kt.value)+" "+e.toDisplayString(Kt.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",s2,e.toDisplayString(Al.value)+" "+e.toDisplayString(Al.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&he.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Ae.value),onMouseenter:n[28]||(n[28]=s=>ge.value=!0),onMouseleave:ea},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(no,["stop"]),title:he.value},e.toDisplayString(he.value),9,N2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ra,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",_2,[...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,B2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xt.value&&Nt.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ue.value),onMouseenter:n[29]||(n[29]=s=>R.value=!0),onMouseleave:ta},[e.createElementVNode("div",M2,[Nt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",$2,[...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:Nt.value},e.toDisplayString(Nt.value),9,D2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(on,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",T2,[...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,L2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.floatingToolbar&&B.richText&&et.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ze,class:"dss-floating-toolbar",style:e.normalizeStyle(at.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",A2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ul,["stop"]),title:e.unref($)("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,H2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Tl.value}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref($)("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,R2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",F2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>La("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,z2)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,P2)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,O2)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,W2)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,q2)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Z2)):(e.openBlock(),e.createElementBlock("svg",U2,[...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,I2),Tt.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=>_n("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>_n("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>_n("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>_n("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>_n("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>_n("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>_n("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("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":Pt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>wl("bold"),["stop"])),title:e.unref($)("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,Y2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>wl("italic"),["stop"])),title:e.unref($)("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,X2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>wl("underline"),["stop"])),title:e.unref($)("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,j2),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(Cn,["stop"]),title:e.unref($)("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,K2),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(ln,["stop"]),title:e.unref($)("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,Q2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(In,["stop"]),title:e.unref($)("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,G2)),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":Pt("insertUnorderedList")}]),onClick:e.withModifiers(mn,["stop"]),title:e.unref($)("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,J2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Pt("insertOrderedList")}]),onClick:e.withModifiers(zl,["stop"]),title:e.unref($)("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,ep),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ba,["stop"]),title:e.unref($)("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,tp),$t.value?(e.openBlock(),e.createElementBlock("div",lp)):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ot,["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,np)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",ap)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",op,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>La("askAi"),["stop"])),title:e.unref($)("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",rp,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,sp),Tt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Gl.value?(e.openBlock(),e.createElementBlock("div",ip,[B.askAi&&Gl.value?(e.openBlock(),e.createElementBlock("div",cp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&Sn(s)?(e.openBlock(),e.createElementBlock("div",up,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&Sn(s)&&i<B.customToolbarSlots.length-1&&Tn(i)?(e.openBlock(),e.createElementBlock("div",dp)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),vp={class:"dss-color-picker__section-title"},fp={class:"dss-color-picker__presets-row"},hp=["title","onClick"],gp={key:1,class:"dss-color-picker__section"},yp={class:"dss-color-picker__presets-row"},kp=["title","onClick"],Cp={key:2,class:"dss-color-picker__section"},bp={class:"dss-color-picker__section-header"},wp={class:"dss-color-picker__presets-row"},xp=["title","onClick"],Ep=["onClick"],Sp={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Vp=["title","onClick"],Np={class:"dss-color-picker__input-row"},Bp=["value"],_p={__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(B,{emit:ee}){function N(ae){const Q=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ae);if(!Q)return{h:0,s:0,l:50};const oe=parseInt(Q[1],16)/255,re=parseInt(Q[2],16)/255,Se=parseInt(Q[3],16)/255,Ke=Math.max(oe,re,Se),_t=Math.min(oe,re,Se);let Qt=0,Mt=0;const ul=(Ke+_t)/2;if(Ke!==_t){const M=Ke-_t;switch(Mt=ul>.5?M/(2-Ke-_t):M/(Ke+_t),Ke){case oe:Qt=((re-Se)/M+(re<Se?6:0))/6;break;case re:Qt=((Se-oe)/M+2)/6;break;case Se:Qt=((oe-re)/M+4)/6;break}}return{h:Qt*360,s:Mt*100,l:ul*100}}function $(ae,Q,oe){Q/=100,oe/=100;const re=Q*Math.min(oe,1-oe),Se=Ke=>{const _t=(Ke+ae/30)%12,Qt=oe-re*Math.max(Math.min(_t-3,9-_t,1),-1);return Math.round(255*Qt).toString(16).padStart(2,"0")};return`#${Se(0)}${Se(8)}${Se(4)}`}function se(ae){const Q=ae.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Q)return null;let oe=Q[1];return oe.length===3&&(oe=oe.split("").map(re=>re+re).join("")),"#"+oe}function O(ae){const Q=ae.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Q)return null;const oe=Math.max(0,Math.min(255,Number.parseInt(Q[1],10))),re=Math.max(0,Math.min(255,Number.parseInt(Q[2],10))),Se=Math.max(0,Math.min(255,Number.parseInt(Q[3],10)));return`#${oe.toString(16).padStart(2,"0")}${re.toString(16).padStart(2,"0")}${Se.toString(16).padStart(2,"0")}`}function A(ae){if(typeof ae!="string")return null;const Q=ae.trim();return se(Q)||O(Q)}function pe(ae,Q,oe){Q/=100,oe/=100;const re=oe+Q*Math.min(oe,1-oe),Se=re===0?0:2-2*oe/re;return{h:ae,s:Se*100,v:re*100}}function rt(ae,Q,oe){Q/=100,oe/=100;const re=oe*(1-Q/2),Se=re===0||re===1?0:(oe-re)/Math.min(re,1-re);return{h:ae,s:Se*100,l:re*100}}const te=B,g=ee,xe=e.ref(!1),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(-1),he=e.ref(-1),Ae=e.ref(null),ge=e.ref(null),Te=e.ref(null),q=e.ref(null),Re=e.ref({top:0,left:0}),Ze=e.ref(N(te.modelValue||"#b8a5de")),Be=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),Ue=e.computed(()=>!te.disableCustomColors),Z=e.computed(()=>Be.value?0:te.initialPresetCount!=null?te.initialPresetCount:he.value<0?null:he.value),De=e.computed(()=>{const ae=Z.value;return ae==null?!0:Math.max(0,te.presetColors.length-ae)<te.max}),Ye=e.computed(()=>!!(Ce.value||X.value>=0||!ke.value&&te.presetColors.length===0));e.computed(()=>{const ae=Z.value;return ae!=null&&te.presetColors.length>ae});const ke=e.computed(()=>Be.value||Z.value!=null),et=e.computed(()=>{const ae=Z.value;return ae==null?[]:te.presetColors.slice(0,ae)}),at=e.computed(()=>{const ae=Z.value;return ae==null?[]:te.presetColors.slice(ae)});function ze(ae){const Q=Z.value;return Q!=null?Q+ae:-1}function Tt(ae){const Q=Z.value;return Q!=null&&ae>=Q}function Zt(ae){Tt(ae)&&(X.value=ae,Ze.value=N(te.presetColors[ae]),Ce.value=!0,e.nextTick(()=>q.value?.focus()))}function Qe(ae){if(!Tt(ae))return;const Q=te.presetColors.filter((Se,Ke)=>Ke!==ae);g("update:presetColors",Q);const oe=se(te.modelValue),re=se(te.presetColors[ae]);if(oe&&re&&oe.toLowerCase()===re.toLowerCase()){const Se=Q[Math.max(0,ae-1)]||Q[0];Se&&g("update:modelValue",Se)}}function At(){J.value=!J.value,J.value||(X.value=-1,Ce.value=!1)}function ye(){if(!Ue.value||X.value<0)return;const ae=ot.value,Q=se(ae);if(Q){const oe=[...te.presetColors];oe[X.value]=Q,g("update:presetColors",oe),g("update:modelValue",Q),X.value=-1,Ce.value=!1}}function ft(){te.disabled||!Ue.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(R(),e.nextTick(()=>q.value?.focus())))}function Je(ae){const Q=A(ae),oe=A(te.modelValue);return Q&&oe&&Q.toLowerCase()===oe.toLowerCase()}function ct(){if(te.disabled||!Ue.value||!De.value)return;const ae=ot.value,Q=se(ae);if(Q){const oe=[...te.presetColors,Q];g("update:presetColors",oe),g("update:modelValue",Q);const re=Z.value??he.value;re>=0&&oe.length-re>=te.max&&(Ce.value=!1)}}const ot=e.computed(()=>{const{h:ae,s:Q,l:oe}=Ze.value;return $(ae,Q,oe)}),ht=e.computed(()=>ot.value.toLowerCase()),ut=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Ze.value.h}, 100%, 50%))`})),Gt=e.computed(()=>{const ae=pe(Ze.value.h,Ze.value.s,Ze.value.l);return{left:`${ae.s}%`,bottom:`${ae.v}%`,transform:"translate(-50%, 50%)"}}),xt=e.computed(()=>({left:`${Ze.value.h/360*100}%`,transform:"translateX(-50%)"})),Nt=e.computed(()=>({position:"fixed",left:`${Re.value.left}px`,top:`${Re.value.top}px`,zIndex:1002}));function ue(){if(!Ae.value||!xe.value)return;const ae=Ae.value.getBoundingClientRect(),Q=window.innerHeight||document.documentElement.clientHeight;let oe=ae.bottom+4;const re=ge.value;re&&oe+re.offsetHeight>Q-8&&(oe=ae.top-4-re.offsetHeight),Re.value={top:oe,left:ae.left}}function R(){const ae=te.modelValue||"#b8a5de",Q=A(ae);Q&&(Ze.value=N(Q))}function Y(){g("update:modelValue",ot.value)}function ie(){te.disabled||(xe.value=!xe.value,xe.value&&(R(),e.nextTick(()=>{ue(),q.value?.focus()})))}function be(){const ae=ot.value,Q=se(ae);if(Q){if(X.value>=0){const oe=[...te.presetColors];oe[X.value]=Q,g("update:presetColors",oe),g("update:modelValue",Q)}else if(Ue.value&&(te.presetColors.length>0||Be.value)&&Ce.value&&De.value&&!te.presetColors.some(re=>se(re)?.toLowerCase()===Q.toLowerCase())){const re=[...te.presetColors,Q];g("update:presetColors",re),g("update:modelValue",Q)}}xe.value=!1,Ce.value=!1,J.value=!1,X.value=-1}function lt(ae){if(!Te.value)return;const Q=Te.value.getBoundingClientRect(),oe=re=>{const Se=Math.max(0,Math.min(1,(re.clientX-Q.left)/Q.width)),Ke=Math.max(0,Math.min(1,1-(re.clientY-Q.top)/Q.height)),_t={h:Ze.value.h,s:Se*100,v:Ke*100};Ze.value=rt(_t.h,_t.s,_t.v)};oe(ae),document.addEventListener("mousemove",oe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",oe),Y()},{once:!0})}function He(ae){if(!ae.currentTarget)return;const oe=ae.currentTarget.getBoundingClientRect(),re=Se=>{const Ke=Math.max(0,Math.min(1,(Se.clientX-oe.left)/oe.width));Ze.value={...Ze.value,h:Ke*360}};re(ae),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),Y()},{once:!0})}function nt(ae){const Q=ae.target.value,oe=A(Q);oe&&(Ze.value=N(oe),g("update:modelValue",oe))}function Me(ae){if(te.disabled)return;const Q=A(ae);Q&&(Ze.value=N(Q),g("update:modelValue",Q))}let tt=null,it=null;function Ut(){tt&&(document.removeEventListener("keydown",tt),tt=null),it&&(window.removeEventListener("resize",it),it=null)}return e.watch(xe,ae=>{if(Ut(),ae){if(!Be.value&&te.initialPresetCount==null){const Q=te.presetColors.length;Q>0&&(he.value<0||Q<he.value)&&(he.value=Q)}tt=Q=>{Q.key==="Escape"&&be()},it=ue,document.addEventListener("keydown",tt),window.addEventListener("resize",it)}}),e.watch(()=>te.modelValue,()=>{xe.value&&R()},{immediate:!1}),e.watch(at,ae=>{ae.length===0&&(J.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount(Ut),(ae,Q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":B.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:Ae,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":xe.value}]),onClick:ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ot.value})},[...Q[0]||(Q[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(be,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ge,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Nt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Be.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.presetGroups,(oe,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",vp,e.toDisplayString(oe.title),1),e.createElementVNode("div",fp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.colors,(Se,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(Se)}]),style:e.normalizeStyle({backgroundColor:Se,"--dss-preset-color":Se}),title:Se,onClick:e.withModifiers(_t=>Me(Se),["stop"])},null,14,hp))),128))])]))),128)):et.value.length?(e.openBlock(),e.createElementBlock("div",gp,[Q[1]||(Q[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",yp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,(oe,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(oe)}]),style:e.normalizeStyle({backgroundColor:oe,"--dss-preset-color":oe}),title:oe,onClick:e.withModifiers(Se=>Me(oe),["stop"])},null,14,kp))),128))])])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("div",bp,[Q[3]||(Q[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),at.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(At,["stop"])},[...Q[2]||(Q[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",wp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(oe,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,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&&Je(oe),"dss-color-picker__preset-bubble--editing":J.value&&X.value===ze(re)}]),style:e.normalizeStyle({backgroundColor:X.value===ze(re)?ot.value:oe,"--dss-preset-color":X.value===ze(re)?ot.value:oe}),title:X.value===ze(re)?ot.value:oe,onClick:e.withModifiers(Se=>J.value?Zt(ze(re)):Me(oe),["stop"])},null,14,xp),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(Se=>Qe(ze(re)),["stop"])},[...Q[4]||(Q[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Ep)):e.createCommentVNode("",!0)],2))),128)),De.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(ft,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):B.presetColors.length?(e.openBlock(),e.createElementBlock("div",Sp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.presetColors,(oe,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Je(oe)}]),style:e.normalizeStyle({backgroundColor:oe,"--dss-preset-color":oe}),title:oe,onClick:e.withModifiers(Se=>Me(oe),["stop"])},null,14,Vp))),128)),Ue.value&&De.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(ft,["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:Te,onMousedown:lt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ut.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Gt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:He},[Q[5]||(Q[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(xt.value)},null,4)],32),e.createElementVNode("div",Np,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:q,type:"text",class:"dss-color-picker__hex-input",value:ht.value,onInput:nt},null,40,Bp)]),Ue.value&&ke.value&&(B.presetColors.length||Be.value)&&De.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:ct}," Save color ")):e.createCommentVNode("",!0),Ue.value&&ke.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:ye}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:be}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Mp={key:0,class:"dss-loader"},$p={key:0,class:"dss-loader-label"},Dp={key:1,class:"dss-loader"},Lp={key:0,class:"dss-loader-label"},Tp={key:2,class:"dss-loader"},Ap={key:0,class:"dss-loader-label"},Hp={key:3,class:"dss-loader"},Rp={key:0,class:"dss-loader-label"},Fp={key:4,class:"dss-loader"},Ip={key:0,class:"dss-loader-label"},zp={key:5,class:"dss-loader dss-loader--inline"},Pp={class:"dss-loader-inline-text"},Op={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(B){const ee=B,N=e.computed(()=>ee.size==="small"?"dss-loaders--size-small":ee.size==="large"?"dss-loaders--size-large":ee.size==="medium"||ee.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>{const se={};if(!(ee.size==="small"||ee.size==="medium"||ee.size==="large"||ee.size==null)){const O=typeof ee.size=="number"?`${ee.size}px`:String(ee.size);se["--dss-loader-size"]=O}return ee.color&&(se["--dss-loader-accent"]=ee.color,se["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),se});return(se,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",N.value]),style:e.normalizeStyle($.value)},[B.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Mp,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",$p,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="dots"?(e.openBlock(),e.createElementBlock("div",Dp,[O[1]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Lp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="battery"?(e.openBlock(),e.createElementBlock("div",Tp,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",Ap,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Hp,[O[3]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Rp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="bars"?(e.openBlock(),e.createElementBlock("div",Fp,[O[4]||(O[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)),B.label?(e.openBlock(),e.createElementBlock("span",Ip,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="inline"?(e.openBlock(),e.createElementBlock("div",zp,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Pp,[e.renderSlot(se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ro="dss-skeleton-item",Wp={__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:B=>["single","multiple"].includes(B)},targetClass:{type:String,default:Ro},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(B){const ee=B,N=e.computed(()=>{const O={"dss-skeleton--loading":ee.loading,"dss-skeleton--static":!ee.shimmer,"dss-skeleton--multiple":ee.mode==="multiple","dss-skeleton--dark":ee.darkMode};return ee.mode==="multiple"&&ee.targetClass!==Ro&&(O[`dss-skeleton--target-${ee.targetClass}`]=!0),O}),$=e.computed(()=>{const O={};return ee.borderRadius&&(O.borderRadius=ee.borderRadius),O}),se=e.computed(()=>{const O={};return ee.borderRadius&&(O["--dss-skeleton-border-radius"]=ee.borderRadius),ee.darkMode?(O["--dss-skeleton-bg"]=ee.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=ee.shimmerDark||"#3e3f41",O):(ee.bgColor&&(O["--dss-skeleton-bg"]=ee.bgColor),ee.shimmerColor&&(O["--dss-skeleton-shimmer"]=ee.shimmerColor),O)});return(O,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",N.value]),style:e.normalizeStyle(se.value)},[B.loading&&B.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle($.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":B.loading&&B.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},qp={key:0,class:"dss-dnd-column-header"},Zp={class:"dss-dnd-column-title"},Up={class:"dss-dnd-column-count"},Yp=["data-column"],Xp={key:0,class:"dss-dnd-indicator"},jp=["onPointerdown"],Kp=["onPointerdown"],Gp={class:"dss-dnd-item-content"},Qp={class:"dss-dnd-item-default"},Jp={key:0,class:"dss-dnd-empty"},e0={name:"DSSDnd"},t0=Object.assign(e0,{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(B,{emit:ee}){const N=B,$=ee,se=e.useSlots(),O=e.computed(()=>!!se["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},pe=e.computed(()=>({...A,...N.options})),rt=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(ue){if(!pe.value.ColColor||!ue)return{};const R=ue.background||ue.color;return R?{background:R}:{}}const g=e.ref(null),xe=e.ref(null),Ce=e.ref(!1),J=e.ref(-1),X=e.ref(null);let he=null,Ae=null,ge=null,Te=null,q=0,Re=0,Ze="",Be=null;const Ue=5,Z=e.computed(()=>{const ue={};for(const R of N.columns)ue[R.value]=N.items.filter(Y=>Y[N.columnKey]===R.value).sort((Y,ie)=>(Y[N.positionKey]??0)-(ie[N.positionKey]??0));return ue}),De=e.computed(()=>{const ue={},R=!!g.value,Y=g.value?.[N.itemKey],ie=xe.value,be=J.value;for(const lt of N.columns){const He=Z.value[lt.value]||[],nt=[],Me=ie==lt.value;let tt=0;for(let it=0;it<He.length;it++){const Ut=He[it],ae=R&&Ut[N.itemKey]===Y;!ae&&Me&&be===tt&&nt.push({type:"indicator",key:`ind-${tt}`}),ae||tt++,nt.push({type:"item",item:Ut,isDragged:ae,key:`item-${Ut[N.itemKey]}`})}Me&&be>=tt&&nt.push({type:"indicator",key:"ind-end"}),ue[lt.value]=nt}return ue});function Ye(ue,R){const ie=(Z.value[ue]||[]).filter(He=>He[N.itemKey]!==g.value?.[N.itemKey]);if(ie.length===0)return 1;if(R<=0){const He=ie[0][N.positionKey];return He!=null&&He>0?He/2:.5}if(R>=ie.length){const He=ie[ie.length-1][N.positionKey];return(He??0)+1}const be=ie[R-1][N.positionKey]??0,lt=ie[R][N.positionKey]??0;return(be+lt)/2}function ke(ue,R,Y){ge&&ge.remove();const ie=ue.getBoundingClientRect(),be=ue.cloneNode(!0);be.classList.add("dss-dnd-ghost"),be.style.cssText=`
106
106
  position: fixed;
107
107
  left: ${R-q}px;
108
108
  top: ${Y-Re}px;
@@ -116,5 +116,5 @@
116
116
  background-color: ${pe.value.dragSourceBackground};
117
117
  font-family: 'Work Sans', sans-serif;
118
118
  cursor: grabbing;
119
- `,document.body.appendChild(be),ge=be}function et(ue,R){ge&&(ge.style.left=`${ue-q}px`,ge.style.top=`${R-Re}px`)}function at(ue){ue.classList.add("dss-dnd-item--dragging"),ue.style.background=pe.value.dragSourceBackground,ue.style.borderColor=pe.value.dragSourceBorder,ue.style.transform="scale(0.97)"}function Pe(ue){ue.classList.remove("dss-dnd-item--dragging"),ue.style.background="",ue.style.borderColor="",ue.style.transform=""}function $t(ue,R){return document.elementFromPoint(ue,R)?.closest(".dss-dnd-column-body")??null}function Wt(ue,R){return!!document.elementFromPoint(ue,R)?.closest("[data-dss-dnd-delete-zone]")}function Qe(ue,R){if(O.value&&Wt(ue,R)){ye.value=!0,xe.value=null,J.value=-1;return}ye.value=!1;const Y=$t(ue,R),ie=Y?.getAttribute("data-column")??null;if(!ie){xe.value=null,J.value=-1;return}xe.value=ie;const be=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let lt=be.length;for(let He=0;He<be.length;He++){const nt=be[He].getBoundingClientRect();if(R<nt.top+nt.height/2){lt=He;break}}J.value=lt}function Tt(ue){ue.preventDefault(),et(ue.clientX,ue.clientY),!he&&(he=requestAnimationFrame(()=>{he=null,Qe(ue.clientX,ue.clientY)}))}function Ce(ue){window.removeEventListener("pointermove",Tt),window.removeEventListener("pointerup",Ce),window.removeEventListener("pointercancel",Ce),Te?.releasePointerCapture?.(ue.pointerId),Pe(Te),Te=null;const R=O.value&&Wt(ue.clientX,ue.clientY);if(g.value&&R)$("delete",{item:g.value});else{const ie=$t(ue.clientX,ue.clientY)?.getAttribute("data-column")??null;if(g.value&&ie){const be=g.value[N.columnKey],lt=ie,nt=(Z.value[lt]||[]).filter(Ut=>Ut[N.itemKey]!==g.value[N.itemKey]),Me=Math.max(0,Math.min(J.value,nt.length)),tt=Ze(lt,Me),it=g.value[N.itemKey];$("move",{item:g.value,from:be,to:lt,position:tt,index:Me}),Ae&&clearTimeout(Ae),X.value={id:it,from:be,to:lt},Ae=setTimeout(()=>{X.value=null},3500)}}ge&&(ge.remove(),ge=null),Ue!==null&&(document.body.style.cursor=Ue,Ue=""),Vt()}function ht(ue,R){ue.preventDefault();const Y=ue.target.closest(".dss-dnd-item");if(!Y)return;const ie=Y.getBoundingClientRect();q=ue.clientX-ie.left,Re=ue.clientY-ie.top,Ue=document.body.style.cursor,document.body.style.cursor="grabbing",g.value=R,Te=Y,ke(Y,ue.clientX,ue.clientY),requestAnimationFrame(()=>at(Y)),Y.setPointerCapture?.(ue.pointerId),window.addEventListener("pointermove",Tt),window.addEventListener("pointerup",Ce,{once:!0}),window.addEventListener("pointercancel",Ce,{once:!0})}function Je(){Be&&(window.removeEventListener("pointermove",ut),window.removeEventListener("pointerup",ot),window.removeEventListener("pointercancel",ot),Be=null)}function ut(ue){if(!Be||ue.pointerId!==Be.pointerId)return;const R=ue.clientX-Be.startX,Y=ue.clientY-Be.startY;if(Math.abs(R)>=Ye||Math.abs(Y)>=Ye){const ie=Be.item;Je(),ht(ue,ie)}}function ot(ue){!Be||ue.pointerId!==Be.pointerId||Je()}function gt(ue,R){Je(),Be={item:R,startX:ue.clientX,startY:ue.clientY,pointerId:ue.pointerId},window.addEventListener("pointermove",ut),window.addEventListener("pointerup",ot),window.addEventListener("pointercancel",ot)}function dt(ue,R){pe.value.useHandle||gt(ue,R)}function Gt(ue,R){gt(ue,R)}function wt(){he&&(cancelAnimationFrame(he),he=null)}function Vt(){wt(),g.value=null,xe.value=null,ye.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{wt(),Je(),Ae&&clearTimeout(Ae),ge&&(ge.remove(),ge=null)}),(ue,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(rt.value)},[O.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":ye.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(ue.$slots,"delete-zone",{isDragging:!!g.value,isOver:ye.value})],2),[[e.vShow,!!g.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.columns,Y=>(e.openBlock(),e.createElementBlock("div",{key:Y.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":xe.value==Y.value},Y.class||""]]),style:e.normalizeStyle(te(Y))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",Wp,[e.renderSlot(ue.$slots,"column-header",{column:Y,items:Z.value[Y.value]||[]},()=>[e.createElementVNode("span",qp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",Zp,e.toDisplayString((Z.value[Y.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Y.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value[Y.value],ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie.key},[ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Yp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ie.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:be=>dt(be,ie.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(be=>Gt(be,ie.item),["stop"])},[e.renderSlot(ue.$slots,"handle",{},()=>[R[0]||(R[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,jp)):e.createCommentVNode("",!0),e.createElementVNode("div",Kp,[e.renderSlot(ue.$slots,"item",{item:ie.item,column:Y,justDropped:X.value?.id===ie.item[B.itemKey],droppedFrom:X.value?.id===ie.item[B.itemKey]?X.value.from:null,droppedTo:X.value?.id===ie.item[B.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",Gp,e.toDisplayString(ie.item[B.itemKey]),1)])])],42,Xp))],64))),128)),(Z.value[Y.value]||[]).length===0&&xe.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Qp,[e.renderSlot(ue.$slots,"empty",{column:Y},()=>[R[1]||(R[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Up)],6))),128))],6))}}),t0={name:"DSSConfetti"},l0=Object.assign(t0,{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(B){const ee=B,N=e.ref(null),$=e.ref(!1);let se=[],O=null,A=null;function pe(J,X){const he=[];for(let Ae=0;Ae<ee.count;Ae++)he.push(rt(J));return he}function rt(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ee.colors[Math.floor(Math.random()*ee.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,he,Ae){J.clearRect(0,0,X,he);for(const ge of se)J.save(),J.globalAlpha=ge.opacity*Ae,J.beginPath(),J.lineWidth=ge.r,J.strokeStyle=ge.color,J.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),J.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),J.stroke(),J.restore()}function g(J,X,he){const Ae=.3+he*.7;for(let ge=0;ge<se.length;ge++){const Te=se[ge];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*Ae,Te.x+=Math.sin(Te.d)*.5*Ae,Te.tilt=Math.sin(Te.tiltAngle)*15,he>=.99&&Te.y>X+20&&(se[ge]=rt(J))}}function xe(){$.value=!0,e.nextTick(()=>{const J=N.value;if(!J)return;const X=J.getContext("2d"),he=J.parentElement;if(!he)return;const Ae=he.getBoundingClientRect();J.width=Ae.width,J.height=Ae.height,se=pe(J.width,J.height);const ge=Date.now(),Te=ge+ee.duration,q=()=>{const Re=Date.now(),Ue=Re-ge;if(Re<Te){let Be=1;Ue>ee.fadeStart&&(Be=1-(Ue-ee.fadeStart)/(ee.duration-ee.fadeStart)),te(X,J.width,J.height,Be),g(J.width,J.height,Be),O=requestAnimationFrame(q)}else ye()};q()})}function ye(){O&&(cancelAnimationFrame(O),O=null),se=[],$.value=!1}return e.watch(()=>ee.trigger,J=>{J&&(A&&clearTimeout(A),A=setTimeout(xe,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ye(),A&&clearTimeout(A)}),(J,X)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:N,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),n0={class:"dss-filter-global-inner"},a0=["placeholder","value"],o0=["title"],s0={key:0,class:"dss-filter-funnel-badge"},r0={key:1,class:"dss-filter-sortby"},i0=["value"],c0=["value"],u0=["disabled","title"],d0={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"},m0={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"},p0={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"},v0={class:"dss-filter-panel"},f0={key:0,class:"dss-filter-empty"},h0={class:"dss-filter-row-prefix"},g0={class:"dss-filter-cell"},y0=["onClick"],k0={class:"dss-filter-trigger-text"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={key:0,class:"dss-filter-cell"},S0=["onClick"],V0={class:"dss-filter-trigger-text"},N0={class:"dss-filter-popup-list"},B0=["onClick"],_0={key:1,class:"dss-filter-cell dss-filter-cell--value"},M0=["placeholder","onUpdate:modelValue"],$0={key:1,class:"dss-filter-date-wrap"},D0=["placeholder","onUpdate:modelValue"],L0=["placeholder","value","onInput","step"],T0={key:4,class:"dss-filter-between"},A0=["placeholder","value","onInput","step"],H0={class:"dss-filter-between-sep"},R0=["placeholder","value","onInput","step"],F0={key:5,class:"dss-filter-multiselect"},I0=["onClick"],z0={class:"dss-filter-trigger-text"},P0=["placeholder"],O0={class:"dss-filter-popup-list dss-filter-popup-list--check"},W0=["onClick"],q0=["checked"],Z0={key:0,class:"dss-filter-popup-empty"},U0=["onClick"],Y0={class:"dss-filter-foot"},X0={class:"dss-filter-cell"},j0=["placeholder"],K0={class:"dss-filter-popup-list"},G0=["onClick"],Q0={key:0,class:"dss-filter-popup-divider"},J0=["onClick"],e9=["placeholder"],t9={class:"dss-filter-popup-list"},l9=["onClick"],n9={key:0,class:"dss-filter-popup-empty"},a9=["placeholder"],o9={class:"dss-filter-popup-list"},s9=["onClick"],r9={key:0,class:"dss-filter-popup-empty"},i9={name:"DSSFilter"},c9=Object.assign(i9,{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(B,{expose:ee,emit:N}){const{t:$}=va.useI18n(),se=B,O=N,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({...A,...se.options})),rt={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"]),g=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),ye=e.ref([]),J=e.ref(null),X=e.ref(!1),he=e.ref(null),Ae=e.ref(""),ge=e.ref(null),Te=e.ref(""),q=e.ref("asc");let Re=1;function Ue(M){const V=M.find(T=>T&&typeof T=="object");if(!V)return null;for(const T of g)if(T in V&&typeof V[T]=="string")return T;return Object.keys(V).find(T=>typeof V[T]=="string")||null}function Be(M,V){const T=V.filter(ce=>ce!=null&&ce!=="NULL");if(T.length===0)return null;if(T.every(ce=>Array.isArray(ce))){const ce=T.flatMap(Oe=>Oe).filter(Oe=>Oe!=null);return ce.length===0?null:typeof ce.find(Oe=>Oe!=null)=="object"?"arraySelect":"arrayText"}return T.every(ce=>typeof ce=="boolean")?"boolean":T.every(ce=>typeof ce=="number")?new Set(T).size<=pe.value.maxUniqueForEnum?"select":"range":T.every(ce=>typeof ce=="string")?new Set(T).size<=pe.value.maxUniqueForSelect?"select":"text":T.some(ce=>typeof ce=="object"&&!Array.isArray(ce))?null:"text"}const Ye=e.computed(()=>{if(!se.data?.length)return[];const M=new Set;for(const j of se.data)if(j&&typeof j=="object")for(const Oe of Object.keys(j))M.add(Oe);const V=new Set(se.exclude),T=[];for(const j of M){if(V.has(j))continue;const Oe=se.config[j]||{},kt=se.data.map(Et=>Et?.[j]),st=Oe.type||Be(j,kt);if(!st)continue;const Xe=Oe.filterMode||"contain",xt=Xe==="date"?"date":Xe==="string"?"text":st,Ct={key:j,label:Oe.label||_t(j),type:xt,filterMode:Xe};if(st==="select"){const Et=kt.filter(Mt=>Mt!=null&&Mt!=="NULL");Ct.uniqueValues=[...new Set(Et)].sort((Mt,bt)=>typeof Mt=="number"&&typeof bt=="number"?Mt-bt:String(Mt).localeCompare(String(bt)))}else if(st==="range"||st==="int"){const Et=kt.filter(Mt=>typeof Mt=="number");Ct.min=Math.min(...Et),Ct.max=Math.max(...Et)}else if(st==="arraySelect"){const Et=Oe.displayKey||Ue(kt.flatMap(Mt=>Array.isArray(Mt)?Mt:[]));if(Ct.displayKey=Et,Array.isArray(Oe.uniqueValues)&&Oe.uniqueValues.length>0)Ct.uniqueValues=Oe.uniqueValues.map(Mt=>String(Mt));else{const Mt=kt.flatMap(bt=>Array.isArray(bt)?bt:[]).filter(bt=>bt!=null).map(bt=>Et&&typeof bt=="object"?bt[Et]:String(bt)).filter(bt=>bt!=null&&bt!=="");Ct.uniqueValues=[...new Set(Mt)].sort((bt,St)=>String(bt).localeCompare(String(St)))}}T.push(Ct)}const ce=se.config._order;return ce&&T.sort((j,Oe)=>{const kt=ce.indexOf(j.key),st=ce.indexOf(Oe.key);return kt===-1&&st===-1?0:kt===-1?1:st===-1?-1:kt-st}),T}),Z=e.computed(()=>{const M={};for(const V of Ye.value)M[V.key]=V;return M}),De=e.computed(()=>Array.isArray(se.config.groups)&&se.config.groups.length>0),Ze=e.computed(()=>{if(!De.value)return[];const M=new Set(Ye.value.map(V=>V.key));return se.config.groups.map(V=>({...V,keys:V.keys.filter(T=>M.has(T))})).filter(V=>V.keys.length>0)}),ke=e.computed(()=>{if(!De.value)return[];const M=new Set(se.config.groups.flatMap(V=>V.keys));return Ye.value.filter(V=>!M.has(V.key))}),et=e.computed(()=>{if(!ge.value)return[];const M=new Set(ge.value.keys),V=Ye.value.filter(ce=>M.has(ce.key));if(!Ae.value)return V;const T=Ae.value.toLowerCase();return V.filter(ce=>ce.label.toLowerCase().includes(T))}),at=e.computed(()=>{if(!Ae.value)return Ye.value;const M=Ae.value.toLowerCase();return Ye.value.filter(V=>V.label.toLowerCase().includes(M))}),Pe=e.computed(()=>Ye.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),$t=e.computed(()=>Te.value?q.value==="asc"?"Ascending":"Descending":"No sort selected");function Wt(M){J.value===M?Qe():(J.value=M,Ae.value="",ge.value=null)}function Qe(){J.value=null,Ae.value="",ge.value=null}function Tt(M){const V=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!V&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&Qe(),X.value&&he.value&&!he.value.contains(M.target)&&(V||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Tt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Tt));function Ce(M){return Z.value[M]?.label||_t(M)}function ht(M){return Z.value[M.key]?.filterMode||"contain"}function Je(M){return $(`filter.operators.${M}`)}function ut(M){const V=Z.value[M.key];return(rt[V?.type]||rt.text).map(T=>({...T,label:$(`filter.operators.${T.value}`)}))}function ot(M){return te.has(M)}function gt(M){const V=Z.value[M.key];return V?V.type==="date"?"date":V.type==="boolean"?"boolean":V.type==="text"||V.type==="arrayText"?"text":V.type==="select"||V.type==="arraySelect"?"multiselect":V.type==="range"||V.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function dt(M){return rt[M]?.[0]?.value||"contains"}function Gt(M,V){return te.has(V)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&V==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function wt(M){return Z.value[M.key]?.uniqueValues||[]}function Vt(M){const V=wt(M);if(!Ae.value)return V;const T=Ae.value.toLowerCase();return V.filter(ce=>String(ce).toLowerCase().includes(T))}function ue(M){const V=M.value;return!V||V.length===0?$("filter.select"):V.length<=2?V.join(", "):$("filter.selectedCount",{count:V.length})}function R(M){const V=Z.value[M],T=V?.filterMode||"contain",ce=V?.type||"text",j=T==="string"?"contains":dt(ce);ye.value.push(e.reactive({id:Re++,key:M,operator:j,value:Gt(ce,j)})),Qe()}function Y(M){ye.value=ye.value.filter(V=>V.id!==M)}function ie(M,V){const ce=Z.value[V]?.type||"text";M.key=V,M.operator=dt(ce),M.value=Gt(ce,M.operator),Qe()}function be(M,V){const T=gt(M);M.operator=V;const ce=gt(M);if(T!==ce||te.has(V)){const j=Z.value[M.key];M.value=Gt(j?.type||"text",V)}Qe()}function lt(M,V){const T=V.target.value;M.value=T===""?null:Number(T)}function He(M,V,T){const ce=T.target.value,j=ce===""?null:Number(ce);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[V]:isNaN(j)?null:j}}function nt(M,V){const T=M.value||[],ce=T.indexOf(V);M.value=ce>=0?T.filter(j=>j!==V):[...T,V]}function Me(){ye.value=[],xe.value="",Qe()}function tt(M){xe.value=M.target.value}function it(M){Te.value=M.target.value}function Ut(){q.value=q.value==="asc"?"desc":"asc"}const ae=e.computed(()=>{if(!se.data)return[];let M=se.data;if(xe.value){const V=xe.value.toLowerCase();M=M.filter(T=>{for(const ce of Object.keys(T)){const j=T[ce];if(typeof j=="string"&&j.toLowerCase().includes(V)||typeof j=="number"&&String(j).includes(V)||Array.isArray(j)&&j.some(Oe=>Oe!=null&&(typeof Oe=="string"?Oe.toLowerCase().includes(V):typeof Oe=="object"?Object.values(Oe).some(kt=>typeof kt=="string"&&kt.toLowerCase().includes(V)):!1)))return!0}return!1})}for(const V of ye.value){if(!re(V))continue;const T=Z.value[V.key];T&&(M=M.filter(ce=>Se(ce,V,T)))}if(se.showSortBy&&Te.value){const V=Te.value,T=q.value==="asc"?1:-1;M=[...M].sort((ce,j)=>Q(ce?.[V],j?.[V])*T)}return M});function Q(M,V){const T=oe(M),ce=oe(V);return T==null&&ce==null?0:T==null?1:ce==null?-1:typeof T=="number"&&typeof ce=="number"?T-ce:String(T).localeCompare(String(ce),void 0,{numeric:!0,sensitivity:"base"})}function oe(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function re(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 Se(M,V,T){const ce=M?.[V.key],j=V.value,Oe=V.operator;if(Oe==="is_empty")return Qt(ce);if(Oe==="is_not_empty")return!Qt(ce);const kt=T.type;if(kt==="text"||kt==="arrayText"){const st=kt==="arrayText"&&Array.isArray(ce)?ce.filter(Ct=>Ct!=null).map(String).join(" "):ce!=null?String(ce):"",Xe=String(j).toLowerCase(),xt=st.toLowerCase();switch(Oe){case"contains":return xt.includes(Xe);case"not_contains":return!xt.includes(Xe);case"equals":return xt===Xe;case"not_equals":return xt!==Xe;case"starts_with":return xt.startsWith(Xe);case"ends_with":return xt.endsWith(Xe);default:return!0}}if(kt==="select")switch(Oe){case"is_any_of":return j.includes(ce);case"is_none_of":return!j.includes(ce);default:return!0}if(kt==="range"||kt==="int"){const st=typeof ce=="number"?ce:Number(ce);if(typeof st!="number"||isNaN(st))return!1;if(Oe==="between"){const xt=j?.min!=null?Number(j.min):null,Ct=j?.max!=null?Number(j.max):null,Et=xt!=null&&!isNaN(xt)?xt:null,Mt=Ct!=null&&!isNaN(Ct)?Ct:null;return(Et==null||st>=Et)&&(Mt==null||st<=Mt)}const Xe=typeof j=="number"&&!isNaN(j)?j:Number(j);if(Oe==="contains"||Oe==="not_contains"){const xt=String(st),Ct=String(j??"").toLowerCase(),Et=xt.toLowerCase().includes(Ct);return Oe==="contains"?Et:!Et}if(typeof Xe!="number"||isNaN(Xe))return!1;switch(Oe){case"eq":return st===Xe;case"neq":return st!==Xe;case"gt":return st>Xe;case"gte":return st>=Xe;case"lt":return st<Xe;case"lte":return st<=Xe;default:return!0}}if(kt==="arraySelect"){if(!Array.isArray(ce))return!1;const st=ce.filter(Xe=>Xe!=null).map(Xe=>T.displayKey&&typeof Xe=="object"?Xe[T.displayKey]:String(Xe));switch(Oe){case"contains_any":return st.some(Xe=>j.includes(Xe));case"contains_all":return j.every(Xe=>st.includes(Xe));case"not_contains_any":return!st.some(Xe=>j.includes(Xe));default:return!0}}if(kt==="date"){const st=Ke(j);if(!st||isNaN(st.getTime()))return!1;const Xe=Ke(ce);if(!Xe||isNaN(Xe.getTime()))return!1;const xt=Bt(Xe),Ct=Bt(st);switch(Oe){case"eq":return xt===Ct;case"before":return xt<Ct;case"after":return xt>Ct;default:return!0}}if(kt==="boolean"){const st=ce===!0||ce==="true"||ce===1,Xe=ce===!1||ce==="false"||ce===0;switch(Oe){case"is_true":return st;case"is_false":return Xe;default:return!0}}return!0}function Ke(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 V=new Date(M);return isNaN(V.getTime())?null:V}return null}function Bt(M){const V=M.getFullYear(),T=String(M.getMonth()+1).padStart(2,"0"),ce=String(M.getDate()).padStart(2,"0");return`${V}-${T}-${ce}`}function Qt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(V=>V==null))}e.watch(ae,M=>O("update:modelValue",M),{immediate:!0}),e.watch(()=>se.data,()=>{ye.value=[],xe.value="",X.value=!1,Te.value="",q.value="asc",Qe()});function _t(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,V=>V.toUpperCase())}function ul(){const M=V=>{if(V==null)return V;if(V instanceof Date)return{_type:"Date",value:V.toISOString(),local:V.toLocaleDateString()};if(Array.isArray(V))return V.map(M);if(typeof V=="object"&&!Array.isArray(V)){const T={};for(const ce of Object.keys(V))T[ce]=M(V[ce]);return T}return V};return{globalSearch:xe.value,rows:ye.value.map(V=>({key:V.key,operator:V.operator,value:M(V.value),defType:Z.value[V.key]?.type,defFilterMode:Z.value[V.key]?.filterMode})),filteredCount:ae.value?.length??0}}return ee({getDebugState:ul}),(M,V)=>(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:he},[e.createElementVNode("div",n0,[V[20]||(V[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($)("filter.searchAcrossFields"),value:xe.value,onInput:tt},null,40,a0),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:V[0]||(V[0]=T=>xe.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||ye.value.length>0,"dss-filter-funnel-btn--with-sort":se.showSortBy}]),onClick:V[1]||(V[1]=T=>X.value=!X.value),type:"button",title:X.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[V[14]||(V[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)),ye.value.length>0?(e.openBlock(),e.createElementBlock("span",s0,e.toDisplayString(ye.value.length),1)):e.createCommentVNode("",!0)],10,o0),se.showSortBy?(e.openBlock(),e.createElementBlock("div",r0,[V[19]||(V[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:Te.value,onChange:it},[V[15]||(V[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,T=>(e.openBlock(),e.createElementBlock("option",{key:T.key,value:T.key},e.toDisplayString(T.label),9,c0))),128))],40,i0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Ut,disabled:!Te.value,title:$t.value},[Te.value?q.value==="asc"?(e.openBlock(),e.createElementBlock("svg",m0,[...V[17]||(V[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",p0,[...V[18]||(V[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",d0,[...V[16]||(V[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,u0)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:V[13]||(V[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",v0,[ye.value.length===0?(e.openBlock(),e.createElementBlock("div",f0,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(T,ce)=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"dss-filter-row"},[e.createElementVNode("span",h0,e.toDisplayString(ce===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",g0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Wt(`${T.id}:field`),["stop"])},[e.createElementVNode("span",k0,e.toDisplayString(Ce(T.key)),1),V[21]||(V[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,y0),J.value===`${T.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[3]||(V[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[2]||(V[2]=j=>Ae.value=j),placeholder:e.unref($)("filter.searchAttributes")},null,8,C0),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j.key,class:"dss-filter-popup-item",onClick:Oe=>ie(T,j.key)},e.toDisplayString(j.label),9,w0))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),ht(T)==="contain"||ht(T)==="date"?(e.openBlock(),e.createElementBlock("div",E0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Wt(`${T.id}:op`),["stop"])},[e.createElementVNode("span",V0,e.toDisplayString(Je(T.operator)),1),V[22]||(V[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,S0),J.value===`${T.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[4]||(V[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",N0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut(T),j=>(e.openBlock(),e.createElementBlock("li",{key:j.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:T.operator===j.value}]),onClick:Oe=>be(T,j.value)},e.toDisplayString(j.label),11,B0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ot(T.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_0,[ht(T)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":j=>T.value=j},null,8,M0)),[[e.vModelText,T.value]]):ht(T)==="date"?(e.openBlock(),e.createElementBlock("div",$0,[e.createVNode(yo,{mode:"single",modelValue:T.value,"onUpdate:modelValue":j=>T.value=j},null,8,["modelValue","onUpdate:modelValue"])])):gt(T)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":j=>T.value=j},null,8,D0)),[[e.vModelText,T.value]]):gt(T)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:T.value,onInput:j=>lt(T,j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,L0)):gt(T)==="between"?(e.openBlock(),e.createElementBlock("div",T0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:T.value?.min,onInput:j=>He(T,"min",j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,A0),e.createElementVNode("span",H0,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:T.value?.max,onInput:j=>He(T,"max",j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,R0)])):gt(T)==="multiselect"?(e.openBlock(),e.createElementBlock("div",F0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Wt(`${T.id}:val`),["stop"])},[e.createElementVNode("span",z0,e.toDisplayString(ue(T)),1),V[23]||(V[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,I0),J.value===`${T.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[6]||(V[6]=e.withModifiers(()=>{},["stop"]))},[wt(T).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[5]||(V[5]=j=>Ae.value=j),placeholder:e.unref($)("filter.search")},null,8,P0)),[[e.vModelText,Ae.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",O0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt(T),j=>(e.openBlock(),e.createElementBlock("li",{key:j,class:"dss-filter-popup-item",onClick:Oe=>nt(T,j)},[e.createElementVNode("input",{type:"checkbox",checked:(T.value||[]).includes(j),tabindex:"-1"},null,8,q0),e.createElementVNode("span",null,e.toDisplayString(j),1)],8,W0))),128)),Vt(T).length===0?(e.openBlock(),e.createElementBlock("li",Z0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:j=>Y(T.id)},[...V[24]||(V[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,U0)]))),128)),e.createElementVNode("div",Y0,[e.createElementVNode("div",X0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:V[7]||(V[7]=e.withModifiers(T=>Wt("add"),["stop"]))},e.toDisplayString(e.unref($)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:V[12]||(V[12]=e.withModifiers(()=>{},["stop"]))},[De.value&&!ge.value&&!Ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[8]||(V[8]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,j0),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",K0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ce=>ge.value=T},[e.createElementVNode("span",null,e.toDisplayString(T.label),1),V[25]||(V[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,G0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",Q0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,J0))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:V[9]||(V[9]=T=>ge.value=null)},[V[26]||(V[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(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[10]||(V[10]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,e9),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",t9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,l9))),128)),et.value.length===0?(e.openBlock(),e.createElementBlock("li",n9,e.toDisplayString(e.unref($)("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":V[11]||(V[11]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,a9),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",o9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,s9))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",r9,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ye.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Me},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),u9={class:"dss-pill-field__pills"},d9=["data-value"],m9=["disabled"],p9={class:"dss-pill-field__pill-text"},v9={key:0,class:"dss-pill-field__pill-actions"},f9=["onClick"],h9=["onClick"],g9=["placeholder","disabled"],y9=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(B,{emit:ee}){const N=B,$=ee,se=e.ref(""),O=e.ref([...N.modelValue]),A=e.ref(null);let pe=null;const rt=e.ref(null),te=e.ref(""),g=e.ref(null),xe=e.ref(null),ye=e.computed(()=>{if(!xe.value)return;const{width:De,height:Ze}=xe.value;return{minWidth:`${De}px`,height:`${Ze}px`}});function J(De,Ze){rt.value===Ze&&(g.value=De)}function X(){rt.value=null,te.value="",xe.value=null,g.value=null}const he=e.computed(()=>new Set(O.value.map(De=>De.trim()).filter(Boolean)));function Ae(De){A.value=De,pe&&clearTimeout(pe),pe=setTimeout(()=>{A.value=null,pe=null},900)}function ge(De){const Ze=De.trim();return Ze?he.value.has(Ze)?(Ae(Ze),!1):(O.value=[...O.value,Ze],$("update:modelValue",[...O.value]),!0):!1}function Te(De){const Ze=De.split(/\r?\n/g).map(Pe=>Pe.trim()).filter(Boolean);if(!Ze.length)return;const ke=new Set(O.value.map(Pe=>Pe.trim()).filter(Boolean)),et=[...O.value];let at=null;for(const Pe of Ze){if(ke.has(Pe)){at??=Pe;continue}ke.add(Pe),et.push(Pe)}et.length!==O.value.length&&(O.value=et,$("update:modelValue",[...O.value])),at&&Ae(at)}function q(De){N.disabled||(rt.value===De&&X(),O.value=O.value.filter((Ze,ke)=>ke!==De),$("update:modelValue",[...O.value]))}async function Re(De,Ze){if(N.disabled)return;const ke=Ze.currentTarget.closest(".dss-pill-field__pill");ke&&(xe.value={width:ke.offsetWidth,height:ke.offsetHeight}),rt.value=De,te.value=O.value[De]??"",await e.nextTick();const et=g.value;if(!et)return;et.focus();const at=et.value.length;et.setSelectionRange(at,at)}function Ue(){X()}function Be(){if(N.disabled||rt.value===null)return;const De=rt.value,Ze=O.value[De]??"",ke=te.value.trim();if(X(),ke!==Ze&&he.value.has(ke)){Ae(ke);return}if(!ke){O.value=O.value.filter((at,Pe)=>Pe!==De),$("update:modelValue",[...O.value]);return}const et=O.value.map((at,Pe)=>Pe===De?ke:at);O.value=et,$("update:modelValue",[...O.value])}function Ye(De){De.preventDefault(),!N.disabled&&(ge(se.value),se.value="")}function Z(De){if(N.disabled)return;const Ze=De.clipboardData?.getData("text")??"";!Ze.includes(`
120
- `)&&!Ze.includes("\r")||(De.preventDefault(),Te(Ze),se.value="")}return e.watch(()=>N.modelValue,De=>{O.value=Array.isArray(De)?[...De]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),(De,Ze)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":De.disabled}])},[e.createElementVNode("div",u9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(ke,et)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===ke,"dss-pill-field__pill--editing":rt.value===et}]),style:e.normalizeStyle(rt.value===et&&xe.value?ye.value:void 0)},[rt.value===et?(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:at=>J(at,et),"onUpdate:modelValue":Ze[0]||(Ze[0]=at=>te.value=at),class:"dss-pill-field__pill-edit",type:"text",disabled:De.disabled,onKeydown:[e.withKeys(Be,["enter"]),e.withKeys(Ue,["esc"])],onBlur:Be},null,40,m9),[[e.vModelText,te.value]])],8,d9)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",p9,e.toDisplayString(ke),1),De.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",v9,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:at=>Re(et,at)},[...Ze[2]||(Ze[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,f9),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:at=>q(et)}," × ",8,h9)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ze[1]||(Ze[1]=ke=>se.value=ke),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":De.placeholder,disabled:De.disabled,onPaste:Z,onKeydown:e.withKeys(Ye,["enter"])},null,40,g9),[[e.vModelText,se.value]])])],2))}}),k9={key:0,class:"dss-title dss-title--separator"},C9={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:B=>["main","separator","subtitle"].includes(B)},h:{type:Number,default:null,validator:B=>B===null||Number.isInteger(B)&&B>=1&&B<=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(B,{expose:ee,emit:N}){const $=B,se=N,O=e.ref(null),A=e.computed(()=>`dss-title--${$.type}`),pe=e.computed(()=>$.h!=null?`dss-title--h${$.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>$.h!=null?`h${$.h}`:rt[$.type]??"div"),g=e.computed(()=>$.editable?"plaintext-only":void 0),xe=e.computed(()=>{const ge={};return $.size!=null&&(ge.fontSize=typeof $.size=="number"?`${$.size}px`:$.size),$.weight!=null&&(ge.fontWeight=$.weight),$.color!=null&&(ge.color=$.color),Object.keys(ge).length?ge:void 0}),ye=e.computed(()=>$.editable?{input:X,keydown:he,paste:Ae}:{}),J=()=>{const ge=O.value;!$.editable||!ge||document.activeElement!==ge&&(ge.innerText=$.modelValue??"")},X=ge=>{const Te=ge.target.innerText;se("update:modelValue",Te),se("change",Te)},he=ge=>{ge.key==="Enter"&&ge.preventDefault()},Ae=ge=>{ge.preventDefault();const Te=(ge.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Te)};return e.watch(()=>$.modelValue,()=>{J()}),e.watch(()=>$.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),ee({focus:()=>O.value?.focus()}),(ge,Te)=>B.type==="separator"?(e.openBlock(),e.createElementBlock("div",k9,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",pe.value,{"dss-title--editable":B.editable}],style:xe.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[A.value,pe.value,{"dss-title--editable":B.editable}]],style:xe.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},b9={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"}},w9={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"},x9={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"}},E9={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",clear:"Clear date",comparison:{compareTo:"Compare to",active:"Comparison",previousPeriod:"Previous period",previousYear:"Previous year",custom:"Custom"},quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",lastMonth:"Last 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",in7Days:"In 7 days",in14Days:"In 14 days",in30Days:"In 30 days"}},S9={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"}},fa={chart:b9,table:w9,filter:x9,datepicker:E9,textEditor:S9},V9={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"}},N9={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"},B9={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"}},_9={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",clear:"Effacer la date",comparison:{compareTo:"Comparer à",active:"Comparaison",previousPeriod:"Période précédente",previousYear:"Année précédente",custom:"Personnalisée"},quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",lastMonth:"Mois dernier",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",in7Days:"Dans 7 jours",in14Days:"Dans 14 jours",in30Days:"Dans 30 jours"}},M9={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"}},ha={chart:V9,table:N9,filter:B9,datepicker:_9,textEditor:M9},$9={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"}},D9={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"},L9={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},T9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",clear:"Datum wissen",comparison:{compareTo:"Vergelijken met",active:"Vergelijking",previousPeriod:"Vorige periode",previousYear:"Vorig jaar",custom:"Aangepast"},quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",lastMonth:"Vorige 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",in7Days:"Over 7 dagen",in14Days:"Over 14 dagen",in30Days:"Over 30 dagen"}},A9={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"}},ga={chart:$9,table:D9,filter:L9,datepicker:T9,textEditor:A9},Za={en:fa,fr:ha,nl:ga};function Io(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Za).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Za[N])})}const Ua={en:{textEditor:fa.textEditor},fr:{textEditor:ha.textEditor},nl:{textEditor:ga.textEditor}};function zo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Ua).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Ua[N])})}const Ya={en:{table:fa.table},fr:{table:ha.table},nl:{table:ga.table}};function Po(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Ya).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Ya[N])})}const Xa={en:{datepicker:fa.datepicker},fr:{datepicker:ha.datepicker},nl:{datepicker:ga.datepicker}};function Oo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Xa).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Xa[N])})}const ja={en:{filter:fa.filter},fr:{filter:ha.filter},nl:{filter:ga.filter}};function Wo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(ja).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,ja[N])})}const H9={chart:Za,textEditor:Ua,table:Ya,datepicker:Xa,filter:ja};function R9(B){!B||!B.global||(Io(B),zo(B),Po(B),Oo(B),Wo(B))}const F9={en:{...fa},fr:{...ha},nl:{...ga}};va.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F9});exports.DSSChart=zu;exports.DSSChartMessages=Za;exports.DSSColorPicker=Bp;exports.DSSConfetti=l0;exports.DSSDatepicker=yo;exports.DSSDatepickerMessages=Xa;exports.DSSDnd=e0;exports.DSSFilter=c9;exports.DSSFilterMessages=ja;exports.DSSLoader=Pp;exports.DSSMessages=H9;exports.DSSModal=go;exports.DSSPillField=y9;exports.DSSSkeleton=Op;exports.DSSStepBar=Fo;exports.DSSTable=i1;exports.DSSTableMessages=Ya;exports.DSSTextEditor=mp;exports.DSSTextEditorMessages=Ua;exports.DSSTitle=C9;exports.addDSSChartTranslations=Io;exports.addDSSDatepickerTranslations=Oo;exports.addDSSFilterTranslations=Wo;exports.addDSSTableTranslations=Po;exports.addDSSTextEditorTranslations=zo;exports.addDSSTranslations=R9;
119
+ `,document.body.appendChild(be),ge=be}function et(ue,R){ge&&(ge.style.left=`${ue-q}px`,ge.style.top=`${R-Re}px`)}function at(ue){ue.classList.add("dss-dnd-item--dragging"),ue.style.background=pe.value.dragSourceBackground,ue.style.borderColor=pe.value.dragSourceBorder,ue.style.transform="scale(0.97)"}function ze(ue){ue.classList.remove("dss-dnd-item--dragging"),ue.style.background="",ue.style.borderColor="",ue.style.transform=""}function Tt(ue,R){return document.elementFromPoint(ue,R)?.closest(".dss-dnd-column-body")??null}function Zt(ue,R){return!!document.elementFromPoint(ue,R)?.closest("[data-dss-dnd-delete-zone]")}function Qe(ue,R){if(O.value&&Zt(ue,R)){Ce.value=!0,xe.value=null,J.value=-1;return}Ce.value=!1;const Y=Tt(ue,R),ie=Y?.getAttribute("data-column")??null;if(!ie){xe.value=null,J.value=-1;return}xe.value=ie;const be=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let lt=be.length;for(let He=0;He<be.length;He++){const nt=be[He].getBoundingClientRect();if(R<nt.top+nt.height/2){lt=He;break}}J.value=lt}function At(ue){ue.preventDefault(),et(ue.clientX,ue.clientY),!he&&(he=requestAnimationFrame(()=>{he=null,Qe(ue.clientX,ue.clientY)}))}function ye(ue){window.removeEventListener("pointermove",At),window.removeEventListener("pointerup",ye),window.removeEventListener("pointercancel",ye),Te?.releasePointerCapture?.(ue.pointerId),ze(Te),Te=null;const R=O.value&&Zt(ue.clientX,ue.clientY);if(g.value&&R)$("delete",{item:g.value});else{const ie=Tt(ue.clientX,ue.clientY)?.getAttribute("data-column")??null;if(g.value&&ie){const be=g.value[N.columnKey],lt=ie,nt=(Z.value[lt]||[]).filter(Ut=>Ut[N.itemKey]!==g.value[N.itemKey]),Me=Math.max(0,Math.min(J.value,nt.length)),tt=Ye(lt,Me),it=g.value[N.itemKey];$("move",{item:g.value,from:be,to:lt,position:tt,index:Me}),Ae&&clearTimeout(Ae),X.value={id:it,from:be,to:lt},Ae=setTimeout(()=>{X.value=null},3500)}}ge&&(ge.remove(),ge=null),Ze!==null&&(document.body.style.cursor=Ze,Ze=""),Nt()}function ft(ue,R){ue.preventDefault();const Y=ue.target.closest(".dss-dnd-item");if(!Y)return;const ie=Y.getBoundingClientRect();q=ue.clientX-ie.left,Re=ue.clientY-ie.top,Ze=document.body.style.cursor,document.body.style.cursor="grabbing",g.value=R,Te=Y,ke(Y,ue.clientX,ue.clientY),requestAnimationFrame(()=>at(Y)),Y.setPointerCapture?.(ue.pointerId),window.addEventListener("pointermove",At),window.addEventListener("pointerup",ye,{once:!0}),window.addEventListener("pointercancel",ye,{once:!0})}function Je(){Be&&(window.removeEventListener("pointermove",ct),window.removeEventListener("pointerup",ot),window.removeEventListener("pointercancel",ot),Be=null)}function ct(ue){if(!Be||ue.pointerId!==Be.pointerId)return;const R=ue.clientX-Be.startX,Y=ue.clientY-Be.startY;if(Math.abs(R)>=Ue||Math.abs(Y)>=Ue){const ie=Be.item;Je(),ft(ue,ie)}}function ot(ue){!Be||ue.pointerId!==Be.pointerId||Je()}function ht(ue,R){Je(),Be={item:R,startX:ue.clientX,startY:ue.clientY,pointerId:ue.pointerId},window.addEventListener("pointermove",ct),window.addEventListener("pointerup",ot),window.addEventListener("pointercancel",ot)}function ut(ue,R){pe.value.useHandle||ht(ue,R)}function Gt(ue,R){ht(ue,R)}function xt(){he&&(cancelAnimationFrame(he),he=null)}function Nt(){xt(),g.value=null,xe.value=null,Ce.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{xt(),Je(),Ae&&clearTimeout(Ae),ge&&(ge.remove(),ge=null)}),(ue,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(rt.value)},[O.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(ue.$slots,"delete-zone",{isDragging:!!g.value,isOver:Ce.value})],2),[[e.vShow,!!g.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.columns,Y=>(e.openBlock(),e.createElementBlock("div",{key:Y.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":xe.value==Y.value},Y.class||""]]),style:e.normalizeStyle(te(Y))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",qp,[e.renderSlot(ue.$slots,"column-header",{column:Y,items:Z.value[Y.value]||[]},()=>[e.createElementVNode("span",Zp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",Up,e.toDisplayString((Z.value[Y.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Y.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value[Y.value],ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie.key},[ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Xp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ie.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:be=>ut(be,ie.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(be=>Gt(be,ie.item),["stop"])},[e.renderSlot(ue.$slots,"handle",{},()=>[R[0]||(R[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Kp)):e.createCommentVNode("",!0),e.createElementVNode("div",Gp,[e.renderSlot(ue.$slots,"item",{item:ie.item,column:Y,justDropped:X.value?.id===ie.item[B.itemKey],droppedFrom:X.value?.id===ie.item[B.itemKey]?X.value.from:null,droppedTo:X.value?.id===ie.item[B.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",Qp,e.toDisplayString(ie.item[B.itemKey]),1)])])],42,jp))],64))),128)),(Z.value[Y.value]||[]).length===0&&xe.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Jp,[e.renderSlot(ue.$slots,"empty",{column:Y},()=>[R[1]||(R[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Yp)],6))),128))],6))}}),l0={name:"DSSConfetti"},n0=Object.assign(l0,{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(B){const ee=B,N=e.ref(null),$=e.ref(!1);let se=[],O=null,A=null;function pe(J,X){const he=[];for(let Ae=0;Ae<ee.count;Ae++)he.push(rt(J));return he}function rt(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ee.colors[Math.floor(Math.random()*ee.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,he,Ae){J.clearRect(0,0,X,he);for(const ge of se)J.save(),J.globalAlpha=ge.opacity*Ae,J.beginPath(),J.lineWidth=ge.r,J.strokeStyle=ge.color,J.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),J.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),J.stroke(),J.restore()}function g(J,X,he){const Ae=.3+he*.7;for(let ge=0;ge<se.length;ge++){const Te=se[ge];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*Ae,Te.x+=Math.sin(Te.d)*.5*Ae,Te.tilt=Math.sin(Te.tiltAngle)*15,he>=.99&&Te.y>X+20&&(se[ge]=rt(J))}}function xe(){$.value=!0,e.nextTick(()=>{const J=N.value;if(!J)return;const X=J.getContext("2d"),he=J.parentElement;if(!he)return;const Ae=he.getBoundingClientRect();J.width=Ae.width,J.height=Ae.height,se=pe(J.width,J.height);const ge=Date.now(),Te=ge+ee.duration,q=()=>{const Re=Date.now(),Ze=Re-ge;if(Re<Te){let Be=1;Ze>ee.fadeStart&&(Be=1-(Ze-ee.fadeStart)/(ee.duration-ee.fadeStart)),te(X,J.width,J.height,Be),g(J.width,J.height,Be),O=requestAnimationFrame(q)}else Ce()};q()})}function Ce(){O&&(cancelAnimationFrame(O),O=null),se=[],$.value=!1}return e.watch(()=>ee.trigger,J=>{J&&(A&&clearTimeout(A),A=setTimeout(xe,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),A&&clearTimeout(A)}),(J,X)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:N,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),a0={class:"dss-filter-global-inner"},o0=["placeholder","value"],s0=["title"],r0={key:0,class:"dss-filter-funnel-badge"},i0={key:1,class:"dss-filter-sortby"},c0=["value"],u0=["value"],d0=["disabled","title"],m0={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"},p0={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"},v0={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"},f0={class:"dss-filter-panel"},h0={key:0,class:"dss-filter-empty"},g0={class:"dss-filter-row-prefix"},y0={class:"dss-filter-cell"},k0=["onClick"],C0={class:"dss-filter-trigger-text"},b0=["placeholder"],w0={class:"dss-filter-popup-list"},x0=["onClick"],E0={key:0,class:"dss-filter-popup-empty"},S0={key:0,class:"dss-filter-cell"},V0=["onClick"],N0={class:"dss-filter-trigger-text"},B0={class:"dss-filter-popup-list"},_0=["onClick"],M0={key:1,class:"dss-filter-cell dss-filter-cell--value"},$0=["placeholder","onUpdate:modelValue"],D0={key:1,class:"dss-filter-date-wrap"},L0=["placeholder","onUpdate:modelValue"],T0=["placeholder","value","onInput","step"],A0={key:4,class:"dss-filter-between"},H0=["placeholder","value","onInput","step"],R0={class:"dss-filter-between-sep"},F0=["placeholder","value","onInput","step"],I0={key:5,class:"dss-filter-multiselect"},z0=["onClick"],P0={class:"dss-filter-trigger-text"},O0=["placeholder"],W0={class:"dss-filter-popup-list dss-filter-popup-list--check"},q0=["onClick"],Z0=["checked"],U0={key:0,class:"dss-filter-popup-empty"},Y0=["onClick"],X0={class:"dss-filter-foot"},j0={class:"dss-filter-cell"},K0=["placeholder"],G0={class:"dss-filter-popup-list"},Q0=["onClick"],J0={key:0,class:"dss-filter-popup-divider"},e9=["onClick"],t9=["placeholder"],l9={class:"dss-filter-popup-list"},n9=["onClick"],a9={key:0,class:"dss-filter-popup-empty"},o9=["placeholder"],s9={class:"dss-filter-popup-list"},r9=["onClick"],i9={key:0,class:"dss-filter-popup-empty"},c9={name:"DSSFilter"},u9=Object.assign(c9,{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(B,{expose:ee,emit:N}){const{t:$}=va.useI18n(),se=B,O=N,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({...A,...se.options})),rt={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"]),g=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),Ce=e.ref([]),J=e.ref(null),X=e.ref(!1),he=e.ref(null),Ae=e.ref(""),ge=e.ref(null),Te=e.ref(""),q=e.ref("asc");let Re=1;function Ze(M){const V=M.find(T=>T&&typeof T=="object");if(!V)return null;for(const T of g)if(T in V&&typeof V[T]=="string")return T;return Object.keys(V).find(T=>typeof V[T]=="string")||null}function Be(M,V){const T=V.filter(ce=>ce!=null&&ce!=="NULL");if(T.length===0)return null;if(T.every(ce=>Array.isArray(ce))){const ce=T.flatMap(Oe=>Oe).filter(Oe=>Oe!=null);return ce.length===0?null:typeof ce.find(Oe=>Oe!=null)=="object"?"arraySelect":"arrayText"}return T.every(ce=>typeof ce=="boolean")?"boolean":T.every(ce=>typeof ce=="number")?new Set(T).size<=pe.value.maxUniqueForEnum?"select":"range":T.every(ce=>typeof ce=="string")?new Set(T).size<=pe.value.maxUniqueForSelect?"select":"text":T.some(ce=>typeof ce=="object"&&!Array.isArray(ce))?null:"text"}const Ue=e.computed(()=>{if(!se.data?.length)return[];const M=new Set;for(const j of se.data)if(j&&typeof j=="object")for(const Oe of Object.keys(j))M.add(Oe);const V=new Set(se.exclude),T=[];for(const j of M){if(V.has(j))continue;const Oe=se.config[j]||{},kt=se.data.map(St=>St?.[j]),st=Oe.type||Be(j,kt);if(!st)continue;const Xe=Oe.filterMode||"contain",Et=Xe==="date"?"date":Xe==="string"?"text":st,Ct={key:j,label:Oe.label||Mt(j),type:Et,filterMode:Xe};if(st==="select"){const St=kt.filter($t=>$t!=null&&$t!=="NULL");Ct.uniqueValues=[...new Set(St)].sort(($t,bt)=>typeof $t=="number"&&typeof bt=="number"?$t-bt:String($t).localeCompare(String(bt)))}else if(st==="range"||st==="int"){const St=kt.filter($t=>typeof $t=="number");Ct.min=Math.min(...St),Ct.max=Math.max(...St)}else if(st==="arraySelect"){const St=Oe.displayKey||Ze(kt.flatMap($t=>Array.isArray($t)?$t:[]));if(Ct.displayKey=St,Array.isArray(Oe.uniqueValues)&&Oe.uniqueValues.length>0)Ct.uniqueValues=Oe.uniqueValues.map($t=>String($t));else{const $t=kt.flatMap(bt=>Array.isArray(bt)?bt:[]).filter(bt=>bt!=null).map(bt=>St&&typeof bt=="object"?bt[St]:String(bt)).filter(bt=>bt!=null&&bt!=="");Ct.uniqueValues=[...new Set($t)].sort((bt,Vt)=>String(bt).localeCompare(String(Vt)))}}T.push(Ct)}const ce=se.config._order;return ce&&T.sort((j,Oe)=>{const kt=ce.indexOf(j.key),st=ce.indexOf(Oe.key);return kt===-1&&st===-1?0:kt===-1?1:st===-1?-1:kt-st}),T}),Z=e.computed(()=>{const M={};for(const V of Ue.value)M[V.key]=V;return M}),De=e.computed(()=>Array.isArray(se.config.groups)&&se.config.groups.length>0),Ye=e.computed(()=>{if(!De.value)return[];const M=new Set(Ue.value.map(V=>V.key));return se.config.groups.map(V=>({...V,keys:V.keys.filter(T=>M.has(T))})).filter(V=>V.keys.length>0)}),ke=e.computed(()=>{if(!De.value)return[];const M=new Set(se.config.groups.flatMap(V=>V.keys));return Ue.value.filter(V=>!M.has(V.key))}),et=e.computed(()=>{if(!ge.value)return[];const M=new Set(ge.value.keys),V=Ue.value.filter(ce=>M.has(ce.key));if(!Ae.value)return V;const T=Ae.value.toLowerCase();return V.filter(ce=>ce.label.toLowerCase().includes(T))}),at=e.computed(()=>{if(!Ae.value)return Ue.value;const M=Ae.value.toLowerCase();return Ue.value.filter(V=>V.label.toLowerCase().includes(M))}),ze=e.computed(()=>Ue.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),Tt=e.computed(()=>Te.value?q.value==="asc"?"Ascending":"Descending":"No sort selected");function Zt(M){J.value===M?Qe():(J.value=M,Ae.value="",ge.value=null)}function Qe(){J.value=null,Ae.value="",ge.value=null}function At(M){const V=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!V&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&Qe(),X.value&&he.value&&!he.value.contains(M.target)&&(V||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",At)),e.onBeforeUnmount(()=>document.removeEventListener("click",At));function ye(M){return Z.value[M]?.label||Mt(M)}function ft(M){return Z.value[M.key]?.filterMode||"contain"}function Je(M){return $(`filter.operators.${M}`)}function ct(M){const V=Z.value[M.key];return(rt[V?.type]||rt.text).map(T=>({...T,label:$(`filter.operators.${T.value}`)}))}function ot(M){return te.has(M)}function ht(M){const V=Z.value[M.key];return V?V.type==="date"?"date":V.type==="boolean"?"boolean":V.type==="text"||V.type==="arrayText"?"text":V.type==="select"||V.type==="arraySelect"?"multiselect":V.type==="range"||V.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function ut(M){return rt[M]?.[0]?.value||"contains"}function Gt(M,V){return te.has(V)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&V==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function xt(M){return Z.value[M.key]?.uniqueValues||[]}function Nt(M){const V=xt(M);if(!Ae.value)return V;const T=Ae.value.toLowerCase();return V.filter(ce=>String(ce).toLowerCase().includes(T))}function ue(M){const V=M.value;return!V||V.length===0?$("filter.select"):V.length<=2?V.join(", "):$("filter.selectedCount",{count:V.length})}function R(M){const V=Z.value[M],T=V?.filterMode||"contain",ce=V?.type||"text",j=T==="string"?"contains":ut(ce);Ce.value.push(e.reactive({id:Re++,key:M,operator:j,value:Gt(ce,j)})),Qe()}function Y(M){Ce.value=Ce.value.filter(V=>V.id!==M)}function ie(M,V){const ce=Z.value[V]?.type||"text";M.key=V,M.operator=ut(ce),M.value=Gt(ce,M.operator),Qe()}function be(M,V){const T=ht(M);M.operator=V;const ce=ht(M);if(T!==ce||te.has(V)){const j=Z.value[M.key];M.value=Gt(j?.type||"text",V)}Qe()}function lt(M,V){const T=V.target.value;M.value=T===""?null:Number(T)}function He(M,V,T){const ce=T.target.value,j=ce===""?null:Number(ce);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[V]:isNaN(j)?null:j}}function nt(M,V){const T=M.value||[],ce=T.indexOf(V);M.value=ce>=0?T.filter(j=>j!==V):[...T,V]}function Me(){Ce.value=[],xe.value="",Qe()}function tt(M){xe.value=M.target.value}function it(M){Te.value=M.target.value}function Ut(){q.value=q.value==="asc"?"desc":"asc"}const ae=e.computed(()=>{if(!se.data)return[];let M=se.data;if(xe.value){const V=xe.value.toLowerCase();M=M.filter(T=>{for(const ce of Object.keys(T)){const j=T[ce];if(typeof j=="string"&&j.toLowerCase().includes(V)||typeof j=="number"&&String(j).includes(V)||Array.isArray(j)&&j.some(Oe=>Oe!=null&&(typeof Oe=="string"?Oe.toLowerCase().includes(V):typeof Oe=="object"?Object.values(Oe).some(kt=>typeof kt=="string"&&kt.toLowerCase().includes(V)):!1)))return!0}return!1})}for(const V of Ce.value){if(!re(V))continue;const T=Z.value[V.key];T&&(M=M.filter(ce=>Se(ce,V,T)))}if(se.showSortBy&&Te.value){const V=Te.value,T=q.value==="asc"?1:-1;M=[...M].sort((ce,j)=>Q(ce?.[V],j?.[V])*T)}return M});function Q(M,V){const T=oe(M),ce=oe(V);return T==null&&ce==null?0:T==null?1:ce==null?-1:typeof T=="number"&&typeof ce=="number"?T-ce:String(T).localeCompare(String(ce),void 0,{numeric:!0,sensitivity:"base"})}function oe(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function re(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 Se(M,V,T){const ce=M?.[V.key],j=V.value,Oe=V.operator;if(Oe==="is_empty")return Qt(ce);if(Oe==="is_not_empty")return!Qt(ce);const kt=T.type;if(kt==="text"||kt==="arrayText"){const st=kt==="arrayText"&&Array.isArray(ce)?ce.filter(Ct=>Ct!=null).map(String).join(" "):ce!=null?String(ce):"",Xe=String(j).toLowerCase(),Et=st.toLowerCase();switch(Oe){case"contains":return Et.includes(Xe);case"not_contains":return!Et.includes(Xe);case"equals":return Et===Xe;case"not_equals":return Et!==Xe;case"starts_with":return Et.startsWith(Xe);case"ends_with":return Et.endsWith(Xe);default:return!0}}if(kt==="select")switch(Oe){case"is_any_of":return j.includes(ce);case"is_none_of":return!j.includes(ce);default:return!0}if(kt==="range"||kt==="int"){const st=typeof ce=="number"?ce:Number(ce);if(typeof st!="number"||isNaN(st))return!1;if(Oe==="between"){const Et=j?.min!=null?Number(j.min):null,Ct=j?.max!=null?Number(j.max):null,St=Et!=null&&!isNaN(Et)?Et:null,$t=Ct!=null&&!isNaN(Ct)?Ct:null;return(St==null||st>=St)&&($t==null||st<=$t)}const Xe=typeof j=="number"&&!isNaN(j)?j:Number(j);if(Oe==="contains"||Oe==="not_contains"){const Et=String(st),Ct=String(j??"").toLowerCase(),St=Et.toLowerCase().includes(Ct);return Oe==="contains"?St:!St}if(typeof Xe!="number"||isNaN(Xe))return!1;switch(Oe){case"eq":return st===Xe;case"neq":return st!==Xe;case"gt":return st>Xe;case"gte":return st>=Xe;case"lt":return st<Xe;case"lte":return st<=Xe;default:return!0}}if(kt==="arraySelect"){if(!Array.isArray(ce))return!1;const st=ce.filter(Xe=>Xe!=null).map(Xe=>T.displayKey&&typeof Xe=="object"?Xe[T.displayKey]:String(Xe));switch(Oe){case"contains_any":return st.some(Xe=>j.includes(Xe));case"contains_all":return j.every(Xe=>st.includes(Xe));case"not_contains_any":return!st.some(Xe=>j.includes(Xe));default:return!0}}if(kt==="date"){const st=Ke(j);if(!st||isNaN(st.getTime()))return!1;const Xe=Ke(ce);if(!Xe||isNaN(Xe.getTime()))return!1;const Et=_t(Xe),Ct=_t(st);switch(Oe){case"eq":return Et===Ct;case"before":return Et<Ct;case"after":return Et>Ct;default:return!0}}if(kt==="boolean"){const st=ce===!0||ce==="true"||ce===1,Xe=ce===!1||ce==="false"||ce===0;switch(Oe){case"is_true":return st;case"is_false":return Xe;default:return!0}}return!0}function Ke(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 V=new Date(M);return isNaN(V.getTime())?null:V}return null}function _t(M){const V=M.getFullYear(),T=String(M.getMonth()+1).padStart(2,"0"),ce=String(M.getDate()).padStart(2,"0");return`${V}-${T}-${ce}`}function Qt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(V=>V==null))}e.watch(ae,M=>O("update:modelValue",M),{immediate:!0}),e.watch(()=>se.data,()=>{Ce.value=[],xe.value="",X.value=!1,Te.value="",q.value="asc",Qe()});function Mt(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,V=>V.toUpperCase())}function ul(){const M=V=>{if(V==null)return V;if(V instanceof Date)return{_type:"Date",value:V.toISOString(),local:V.toLocaleDateString()};if(Array.isArray(V))return V.map(M);if(typeof V=="object"&&!Array.isArray(V)){const T={};for(const ce of Object.keys(V))T[ce]=M(V[ce]);return T}return V};return{globalSearch:xe.value,rows:Ce.value.map(V=>({key:V.key,operator:V.operator,value:M(V.value),defType:Z.value[V.key]?.type,defFilterMode:Z.value[V.key]?.filterMode})),filteredCount:ae.value?.length??0}}return ee({getDebugState:ul}),(M,V)=>(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:he},[e.createElementVNode("div",a0,[V[20]||(V[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($)("filter.searchAcrossFields"),value:xe.value,onInput:tt},null,40,o0),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:V[0]||(V[0]=T=>xe.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":se.showSortBy}]),onClick:V[1]||(V[1]=T=>X.value=!X.value),type:"button",title:X.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[V[14]||(V[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",r0,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,s0),se.showSortBy?(e.openBlock(),e.createElementBlock("div",i0,[V[19]||(V[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:Te.value,onChange:it},[V[15]||(V[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,T=>(e.openBlock(),e.createElementBlock("option",{key:T.key,value:T.key},e.toDisplayString(T.label),9,u0))),128))],40,c0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Ut,disabled:!Te.value,title:Tt.value},[Te.value?q.value==="asc"?(e.openBlock(),e.createElementBlock("svg",p0,[...V[17]||(V[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",v0,[...V[18]||(V[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",m0,[...V[16]||(V[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,d0)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:V[13]||(V[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",f0,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",h0,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(T,ce)=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"dss-filter-row"},[e.createElementVNode("span",g0,e.toDisplayString(ce===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",y0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Zt(`${T.id}:field`),["stop"])},[e.createElementVNode("span",C0,e.toDisplayString(ye(T.key)),1),V[21]||(V[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,k0),J.value===`${T.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[3]||(V[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[2]||(V[2]=j=>Ae.value=j),placeholder:e.unref($)("filter.searchAttributes")},null,8,b0),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",w0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j.key,class:"dss-filter-popup-item",onClick:Oe=>ie(T,j.key)},e.toDisplayString(j.label),9,x0))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",E0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),ft(T)==="contain"||ft(T)==="date"?(e.openBlock(),e.createElementBlock("div",S0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Zt(`${T.id}:op`),["stop"])},[e.createElementVNode("span",N0,e.toDisplayString(Je(T.operator)),1),V[22]||(V[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,V0),J.value===`${T.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[4]||(V[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",B0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct(T),j=>(e.openBlock(),e.createElementBlock("li",{key:j.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:T.operator===j.value}]),onClick:Oe=>be(T,j.value)},e.toDisplayString(j.label),11,_0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ot(T.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",M0,[ft(T)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":j=>T.value=j},null,8,$0)),[[e.vModelText,T.value]]):ft(T)==="date"?(e.openBlock(),e.createElementBlock("div",D0,[e.createVNode(yo,{mode:"single",modelValue:T.value,"onUpdate:modelValue":j=>T.value=j},null,8,["modelValue","onUpdate:modelValue"])])):ht(T)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":j=>T.value=j},null,8,L0)),[[e.vModelText,T.value]]):ht(T)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:T.value,onInput:j=>lt(T,j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,T0)):ht(T)==="between"?(e.openBlock(),e.createElementBlock("div",A0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:T.value?.min,onInput:j=>He(T,"min",j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,H0),e.createElementVNode("span",R0,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:T.value?.max,onInput:j=>He(T,"max",j),step:Z.value[T.key]?.type==="int"?1:void 0},null,40,F0)])):ht(T)==="multiselect"?(e.openBlock(),e.createElementBlock("div",I0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(j=>Zt(`${T.id}:val`),["stop"])},[e.createElementVNode("span",P0,e.toDisplayString(ue(T)),1),V[23]||(V[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,z0),J.value===`${T.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[6]||(V[6]=e.withModifiers(()=>{},["stop"]))},[xt(T).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[5]||(V[5]=j=>Ae.value=j),placeholder:e.unref($)("filter.search")},null,8,O0)),[[e.vModelText,Ae.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",W0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt(T),j=>(e.openBlock(),e.createElementBlock("li",{key:j,class:"dss-filter-popup-item",onClick:Oe=>nt(T,j)},[e.createElementVNode("input",{type:"checkbox",checked:(T.value||[]).includes(j),tabindex:"-1"},null,8,Z0),e.createElementVNode("span",null,e.toDisplayString(j),1)],8,q0))),128)),Nt(T).length===0?(e.openBlock(),e.createElementBlock("li",U0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:j=>Y(T.id)},[...V[24]||(V[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,Y0)]))),128)),e.createElementVNode("div",X0,[e.createElementVNode("div",j0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:V[7]||(V[7]=e.withModifiers(T=>Zt("add"),["stop"]))},e.toDisplayString(e.unref($)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:V[12]||(V[12]=e.withModifiers(()=>{},["stop"]))},[De.value&&!ge.value&&!Ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[8]||(V[8]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,K0),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",G0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ce=>ge.value=T},[e.createElementVNode("span",null,e.toDisplayString(T.label),1),V[25]||(V[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,Q0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",J0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,e9))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:V[9]||(V[9]=T=>ge.value=null)},[V[26]||(V[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(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[10]||(V[10]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,t9),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",l9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,n9))),128)),et.value.length===0?(e.openBlock(),e.createElementBlock("li",a9,e.toDisplayString(e.unref($)("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":V[11]||(V[11]=T=>Ae.value=T),placeholder:e.unref($)("filter.searchAttributes")},null,8,o9),[[e.vModelText,Ae.value]]),e.createElementVNode("ul",s9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ce=>R(T.key)},e.toDisplayString(T.label),9,r9))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",i9,e.toDisplayString(e.unref($)("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:Me},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),d9={class:"dss-pill-field__pills"},m9=["data-value"],p9=["disabled"],v9={class:"dss-pill-field__pill-text"},f9={key:0,class:"dss-pill-field__pill-actions"},h9=["onClick"],g9=["onClick"],y9=["placeholder","disabled"],k9=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(B,{emit:ee}){const N=B,$=ee,se=e.ref(""),O=e.ref([...N.modelValue]),A=e.ref(null);let pe=null;const rt=e.ref(null),te=e.ref(""),g=e.ref(null),xe=e.ref(null),Ce=e.computed(()=>{if(!xe.value)return;const{width:De,height:Ye}=xe.value;return{minWidth:`${De}px`,height:`${Ye}px`}});function J(De,Ye){rt.value===Ye&&(g.value=De)}function X(){rt.value=null,te.value="",xe.value=null,g.value=null}const he=e.computed(()=>new Set(O.value.map(De=>De.trim()).filter(Boolean)));function Ae(De){A.value=De,pe&&clearTimeout(pe),pe=setTimeout(()=>{A.value=null,pe=null},900)}function ge(De){const Ye=De.trim();return Ye?he.value.has(Ye)?(Ae(Ye),!1):(O.value=[...O.value,Ye],$("update:modelValue",[...O.value]),!0):!1}function Te(De){const Ye=De.split(/\r?\n/g).map(ze=>ze.trim()).filter(Boolean);if(!Ye.length)return;const ke=new Set(O.value.map(ze=>ze.trim()).filter(Boolean)),et=[...O.value];let at=null;for(const ze of Ye){if(ke.has(ze)){at??=ze;continue}ke.add(ze),et.push(ze)}et.length!==O.value.length&&(O.value=et,$("update:modelValue",[...O.value])),at&&Ae(at)}function q(De){N.disabled||(rt.value===De&&X(),O.value=O.value.filter((Ye,ke)=>ke!==De),$("update:modelValue",[...O.value]))}async function Re(De,Ye){if(N.disabled)return;const ke=Ye.currentTarget.closest(".dss-pill-field__pill");ke&&(xe.value={width:ke.offsetWidth,height:ke.offsetHeight}),rt.value=De,te.value=O.value[De]??"",await e.nextTick();const et=g.value;if(!et)return;et.focus();const at=et.value.length;et.setSelectionRange(at,at)}function Ze(){X()}function Be(){if(N.disabled||rt.value===null)return;const De=rt.value,Ye=O.value[De]??"",ke=te.value.trim();if(X(),ke!==Ye&&he.value.has(ke)){Ae(ke);return}if(!ke){O.value=O.value.filter((at,ze)=>ze!==De),$("update:modelValue",[...O.value]);return}const et=O.value.map((at,ze)=>ze===De?ke:at);O.value=et,$("update:modelValue",[...O.value])}function Ue(De){De.preventDefault(),!N.disabled&&(ge(se.value),se.value="")}function Z(De){if(N.disabled)return;const Ye=De.clipboardData?.getData("text")??"";!Ye.includes(`
120
+ `)&&!Ye.includes("\r")||(De.preventDefault(),Te(Ye),se.value="")}return e.watch(()=>N.modelValue,De=>{O.value=Array.isArray(De)?[...De]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),(De,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":De.disabled}])},[e.createElementVNode("div",d9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(ke,et)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===ke,"dss-pill-field__pill--editing":rt.value===et}]),style:e.normalizeStyle(rt.value===et&&xe.value?Ce.value:void 0)},[rt.value===et?(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:at=>J(at,et),"onUpdate:modelValue":Ye[0]||(Ye[0]=at=>te.value=at),class:"dss-pill-field__pill-edit",type:"text",disabled:De.disabled,onKeydown:[e.withKeys(Be,["enter"]),e.withKeys(Ze,["esc"])],onBlur:Be},null,40,p9),[[e.vModelText,te.value]])],8,m9)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",v9,e.toDisplayString(ke),1),De.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",f9,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:at=>Re(et,at)},[...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,h9),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:at=>q(et)}," × ",8,g9)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ke=>se.value=ke),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":De.placeholder,disabled:De.disabled,onPaste:Z,onKeydown:e.withKeys(Ue,["enter"])},null,40,y9),[[e.vModelText,se.value]])])],2))}}),C9={key:0,class:"dss-title dss-title--separator"},b9={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:B=>["main","separator","subtitle"].includes(B)},h:{type:Number,default:null,validator:B=>B===null||Number.isInteger(B)&&B>=1&&B<=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(B,{expose:ee,emit:N}){const $=B,se=N,O=e.ref(null),A=e.computed(()=>`dss-title--${$.type}`),pe=e.computed(()=>$.h!=null?`dss-title--h${$.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>$.h!=null?`h${$.h}`:rt[$.type]??"div"),g=e.computed(()=>$.editable?"plaintext-only":void 0),xe=e.computed(()=>{const ge={};return $.size!=null&&(ge.fontSize=typeof $.size=="number"?`${$.size}px`:$.size),$.weight!=null&&(ge.fontWeight=$.weight),$.color!=null&&(ge.color=$.color),Object.keys(ge).length?ge:void 0}),Ce=e.computed(()=>$.editable?{input:X,keydown:he,paste:Ae}:{}),J=()=>{const ge=O.value;!$.editable||!ge||document.activeElement!==ge&&(ge.innerText=$.modelValue??"")},X=ge=>{const Te=ge.target.innerText;se("update:modelValue",Te),se("change",Te)},he=ge=>{ge.key==="Enter"&&ge.preventDefault()},Ae=ge=>{ge.preventDefault();const Te=(ge.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Te)};return e.watch(()=>$.modelValue,()=>{J()}),e.watch(()=>$.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),ee({focus:()=>O.value?.focus()}),(ge,Te)=>B.type==="separator"?(e.openBlock(),e.createElementBlock("div",C9,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",pe.value,{"dss-title--editable":B.editable}],style:xe.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[A.value,pe.value,{"dss-title--editable":B.editable}]],style:xe.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},w9={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"}},x9={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"},E9={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"}},S9={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",clear:"Clear date",comparison:{compareTo:"Compare to",active:"Comparison",previousPeriod:"Previous period",previousYear:"Previous year",custom:"Custom"},quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",lastMonth:"Last 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",in7Days:"In 7 days",in14Days:"In 14 days",in30Days:"In 30 days"}},V9={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"}},fa={chart:w9,table:x9,filter:E9,datepicker:S9,textEditor:V9},N9={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"}},B9={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"},_9={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"}},M9={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",clear:"Effacer la date",comparison:{compareTo:"Comparer à",active:"Comparaison",previousPeriod:"Période précédente",previousYear:"Année précédente",custom:"Personnalisée"},quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",lastMonth:"Mois dernier",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",in7Days:"Dans 7 jours",in14Days:"Dans 14 jours",in30Days:"Dans 30 jours"}},$9={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"}},ha={chart:N9,table:B9,filter:_9,datepicker:M9,textEditor:$9},D9={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"}},L9={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"},T9={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"}},A9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",clear:"Datum wissen",comparison:{compareTo:"Vergelijken met",active:"Vergelijking",previousPeriod:"Vorige periode",previousYear:"Vorig jaar",custom:"Aangepast"},quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",lastMonth:"Vorige 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",in7Days:"Over 7 dagen",in14Days:"Over 14 dagen",in30Days:"Over 30 dagen"}},H9={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"}},ga={chart:D9,table:L9,filter:T9,datepicker:A9,textEditor:H9},Za={en:fa,fr:ha,nl:ga};function Io(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Za).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Za[N])})}const Ua={en:{textEditor:fa.textEditor},fr:{textEditor:ha.textEditor},nl:{textEditor:ga.textEditor}};function zo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Ua).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Ua[N])})}const Ya={en:{table:fa.table},fr:{table:ha.table},nl:{table:ga.table}};function Po(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Ya).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Ya[N])})}const Xa={en:{datepicker:fa.datepicker},fr:{datepicker:ha.datepicker},nl:{datepicker:ga.datepicker}};function Oo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(Xa).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,Xa[N])})}const ja={en:{filter:fa.filter},fr:{filter:ha.filter},nl:{filter:ga.filter}};function Wo(B){if(!B||!B.global)return;const ee=B.global.availableLocales||[];Object.keys(ja).forEach(N=>{ee.includes(N)&&B.global.mergeLocaleMessage(N,ja[N])})}const R9={chart:Za,textEditor:Ua,table:Ya,datepicker:Xa,filter:ja};function F9(B){!B||!B.global||(Io(B),zo(B),Po(B),Oo(B),Wo(B))}const I9={en:{...fa},fr:{...ha},nl:{...ga}};va.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:I9});exports.DSSChart=Pu;exports.DSSChartMessages=Za;exports.DSSColorPicker=_p;exports.DSSConfetti=n0;exports.DSSDatepicker=yo;exports.DSSDatepickerMessages=Xa;exports.DSSDnd=t0;exports.DSSFilter=u9;exports.DSSFilterMessages=ja;exports.DSSLoader=Op;exports.DSSMessages=R9;exports.DSSModal=go;exports.DSSPillField=k9;exports.DSSSkeleton=Wp;exports.DSSStepBar=Fo;exports.DSSTable=c1;exports.DSSTableMessages=Ya;exports.DSSTextEditor=pp;exports.DSSTextEditorMessages=Ua;exports.DSSTitle=b9;exports.addDSSChartTranslations=Io;exports.addDSSDatepickerTranslations=Oo;exports.addDSSFilterTranslations=Wo;exports.addDSSTableTranslations=Po;exports.addDSSTextEditorTranslations=zo;exports.addDSSTranslations=F9;