dsp-semactic 0.7.15 → 0.7.16

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"),ha=require("vue-i18n"),xs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Es=["value"],Ss=["placeholder","value","disabled"],Vs=["aria-label"],Ns=["placeholder","value"],Bs={key:0,class:"dss-datepicker__range-values"},_s=["placeholder","value"],Ms={key:0,class:"dss-datepicker__comparison-range"},$s={class:"dss-datepicker__comparison-date"},Ds={class:"dss-datepicker__comparison-date"},Ls=["placeholder","value"],Ts=["aria-label","aria-pressed"],As=["aria-selected","onClick"],Hs={class:"dss-datepicker__list-item-label"},Rs={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"},Fs={key:1,class:"dss-datepicker__list-empty"},Is={key:1,class:"dss-datepicker__double-wrap"},zs={key:0,class:"dss-datepicker__side-panel"},Ps={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Os=["disabled","onClick"],Ws={key:1,class:"dss-datepicker__comparison-panel"},qs={key:0,class:"dss-datepicker__comparison-modes"},Zs=["onClick"],Us={class:"dss-datepicker__double-content"},Ys={class:"dss-datepicker__double-calendars"},Xs={class:"dss-datepicker__double-calendar"},js={class:"dss-datepicker__calendar-header"},Ks=["aria-label"],Gs={class:"dss-datepicker__month-year-row"},Qs=["aria-label"],Js={class:"dss-datepicker__weekdays"},er={class:"dss-datepicker__grid"},tr=["disabled","onClick","onMouseenter"],lr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},nr={class:"dss-datepicker__double-calendar"},ar={class:"dss-datepicker__calendar-header"},or=["aria-label"],sr={class:"dss-datepicker__month-year-row"},rr=["aria-label"],ir={class:"dss-datepicker__weekdays"},cr={class:"dss-datepicker__grid"},ur=["disabled","onClick","onMouseenter"],dr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},mr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--bottom"},pr={key:0,class:"dss-datepicker__comparison-modes dss-datepicker__comparison-modes--inline"},vr=["onClick"],fr={key:0,class:"dss-datepicker__side-panel"},hr={class:"dss-datepicker__quick-select","aria-label":"Quick date"},gr=["disabled","onClick"],yr={class:"dss-datepicker__single-calendar"},kr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--single"},Cr={key:0,class:"dss-datepicker__comparison-modes"},br=["onClick"],wr={class:"dss-datepicker__calendar-header"},xr=["aria-label"],Er={class:"dss-datepicker__month-year-row"},Sr=["aria-label"],Vr={class:"dss-datepicker__weekdays"},Nr={class:"dss-datepicker__grid"},Br=["disabled","onClick","onMouseenter"],_r={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Mr={class:"dss-datepicker__calendar-header"},$r={class:"dss-datepicker__month-year-row"},Dr={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Lr={class:"dss-datepicker__months-grid"},Tr=["onClick"],Ar={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Hr={class:"dss-datepicker__month-year"},Rr={class:"dss-datepicker__years-grid"},Fr=["data-year","onClick"],Ao=27,Kn=8,go={__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:J}){const N=B,L=J,{t:ne,locale:W}=ha.useI18n(),R=e.ref(!1),ue=e.ref("days"),rt=new Date,ee=e.computed(()=>N.minDate instanceof Date?N.minDate:rt),g=e.ref(ee.value.getMonth()),we=e.ref(ee.value.getFullYear()),ke=e.ref(ee.value.getMonth()),G=e.ref(ee.value.getFullYear()),j=e.ref(ee.value.getMonth()),fe=e.ref(ee.value.getFullYear()),He=e.ref("start"),he=e.ref("start"),Te=e.ref(null),Z=e.ref(null),Fe=e.ref(!1),qe=e.ref("previousPeriod"),Me=e.ref("primary"),Ze=e.ref({start:null,end:null});function U(){const k=ee.value,C=k.getMonth(),x=k.getFullYear(),d=C===11?0:C+1,f=C===11?x+1:x;return{left:{month:C,year:x},right:{month:d,year:f}}}const Ae=e.ref(null),Ye=e.ref(null),Ce=e.ref(null),$e=e.ref(null),lt=e.ref(null),ft=e.ref(null),it=e.ref(null),Xt=e.ref(null),xe=new Date().getFullYear(),Lt=e.computed(()=>["single","singleFromAvailable"].includes(N.mode)),Ke=e.computed(()=>["range","rangeFromAvailable"].includes(N.mode)),Je=e.computed(()=>N.mode==="listFromAvailable"),mt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(N.mode))return null;const k=N.modelValue;return k instanceof Date?k:null}),Tt=e.computed(()=>{if(!Ke.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}}),at=e.computed(()=>Ct(N.comparisonValue)),pt=e.computed(()=>N.comparisonEnabled&&Ke.value),ct=e.computed(()=>pt.value&&N.comparisonControlsPlacement==="side"),Ut=e.computed(()=>pt.value&&N.comparisonControlsPlacement==="bottom"),ht=e.computed(()=>pt.value&&Fe.value&&qe.value==="custom"&&Me.value==="comparison"),Rt={previousPeriod:"datepicker.comparison.previousPeriod",previousYear:"datepicker.comparison.previousYear",custom:"datepicker.comparison.custom"},me=[{id:"previousPeriod",labelKey:"datepicker.comparison.previousPeriod"},{id:"previousYear",labelKey:"datepicker.comparison.previousYear"},{id:"custom",labelKey:"datepicker.comparison.custom"}],F=e.computed(()=>{const C=(Array.isArray(N.comparisonModeOptions)&&N.comparisonModeOptions.length?N.comparisonModeOptions:me).map(x=>typeof x=="string"?{id:x,labelKey:Rt[x]}:!x||typeof x!="object"||!x.id?null:{...x,labelKey:x.labelKey||Rt[x.id]}).filter(x=>x&&Rt[x.id]);return C.length?C:me});function Y(k){return k.label?k.label:k.labelKey?ne(k.labelKey):k.id}function re(k){return F.value.some(C=>C.id===k)}function ve(){if(re(qe.value))return;const k=F.value[0]?.id||"previousPeriod";qe.value=k,Me.value=k==="custom"?"comparison":"primary",Fe.value&&k!=="custom"&&an()}function Re(k){if(!k||!(k instanceof Date))return"";const C=k.getDate(),x=k.getMonth()+1,d=k.getFullYear(),f=b=>String(b).padStart(2,"0");return`${f(C)}/${f(x)}/${d}`}function Ge(k){return k instanceof Date&&!Number.isNaN(k.getTime())?new Date(k.getFullYear(),k.getMonth(),k.getDate()):null}function Ct(k){return!k||typeof k!="object"?{start:null,end:null}:{start:Ge(k.start),end:Ge(k.end)}}function Se(k){const C=Ct(k),{start:x,end:d}=C;return x&&d&&x>d?{start:d,end:x}:C}function tt(k){const{start:C,end:x}=Se(k);return!C&&!x?"":!C||!x?Re(C||x):C&&x&&ml(C,x)?Re(C):`${Re(C||x)} - ${Re(x||C)}`}const gt=e.computed(()=>Re(mt.value)),jt=e.computed(()=>tt(Tt.value)),se=e.computed(()=>{const{start:k,end:C}=Se(at.value);return!k||!C?null:{start:Re(k),end:Re(C)}}),X=e.computed(()=>{if(N.mode!=="readonly")return"—";const k=N.modelValue;if(k instanceof Date)return Re(k)||"—";if(k&&typeof k=="object"&&("start"in k||"end"in k)){const C=k.start instanceof Date?k.start:null,x=k.end instanceof Date?k.end:null;if(!C&&!x)return"—";const d=!x||C&&C<=x?C:x,f=!C||x&&x>=C?x:C;return ml(d,f)?Re(d):`${Re(d)} - ${Re(f)}`}return"—"});e.computed(()=>{const k=new Date(we.value,g.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const te=e.computed(()=>Z.value==="left"?ke.value:Z.value==="right"?j.value:g.value),ie=e.computed(()=>Z.value==="left"?G.value:Z.value==="right"?fe.value:we.value),Ne=e.computed(()=>{const k=new Date(we.value,g.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),et=e.computed(()=>{const k=new Date(ie.value,te.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),yt=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{month:"short"});return Array.from({length:12},(C,x)=>k.format(new Date(2024,x,1)))}),al=e.computed(()=>{const C=(Z.value?ie.value:we.value)-Math.floor(Ao/2);return Array.from({length:Ao},(x,d)=>C+d)}),xt=e.computed(()=>{const k=al.value;return k.length?`${k[0]} – ${k[k.length-1]}`:""});function el(k){return k===7?0:k}function H(k){try{const C=new Intl.Locale(k);if(C.weekInfo?.firstDay!=null)return el(C.weekInfo.firstDay)}catch{}return 1}function V(k){const C=new Date(2024,0,1),x=(C.getDay()-k+7)%7,d=new Date(C);return d.setDate(C.getDate()-x),d}const M=e.computed(()=>H(W.value)),ae=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{weekday:"short"}),C=V(M.value),x=[];for(let d=0;d<7;d++){const f=new Date(C);f.setDate(C.getDate()+d),x.push(k.format(f).slice(0,2))}return x});function oe(k,C,x){const d=new Date(k,C,1),f=new Date(k,C+1,0),b=(d.getDay()-x+7)%7,_=f.getDate(),$=[];for(let ye=0;ye<b;ye++)$.push(null);for(let ye=1;ye<=_;ye++)$.push(new Date(k,C,ye));return $}const Ue=e.computed(()=>oe(we.value,g.value,M.value)),bt=e.computed(()=>oe(G.value,ke.value,M.value)),ot=e.computed(()=>oe(fe.value,j.value,M.value));e.computed(()=>{const k=new Date(G.value,ke.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)}),e.computed(()=>{const k=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const Xe=e.computed(()=>{const k=new Date(G.value,ke.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),Nt=e.computed(()=>{const k=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),wt=e.computed(()=>N.availableDates&&N.availableDates.length>0),ut={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(()=>Lt.value&&!wt.value?[{id:"in7Days",labelKey:"datepicker.quickSelect.in7Days"},{id:"in14Days",labelKey:"datepicker.quickSelect.in14Days"},{id:"in30Days",labelKey:"datepicker.quickSelect.in30Days"}]:wt.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"}]),$t=e.computed(()=>(Array.isArray(N.quickSelectOptions)&&N.quickSelectOptions.length?N.quickSelectOptions:_t.value).map(C=>typeof C=="string"?{id:C,labelKey:ut[C]}:!C||typeof C!="object"||!C.id?null:{...C,labelKey:C.labelKey||ut[C.id]}).filter(C=>C&&C.id));function Et(k){return k.label?k.label:k.labelKey?ne(k.labelKey):k.id}const kl=e.ref({top:0,left:0}),Zl=e.ref("left");let bl=null;function tl(){R.value&&e.nextTick(()=>{R.value&&(bl!==null&&window.cancelAnimationFrame(bl),bl=window.requestAnimationFrame(()=>{bl=null,ol()}))})}function ol(){if(!lt.value||!R.value)return;const k=lt.value.getBoundingClientRect(),C=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight;let d=k.left,f=k.bottom+4;const b=ft.value;if(b){const _=b.offsetWidth,$=b.offsetHeight;Zl.value==="right"||d+_>C-Kn?(Zl.value="right",d=k.right-_):Zl.value="left";const ge=Math.max(Kn,C-_-Kn);if(d=Math.min(Math.max(d,Kn),ge),f+$>x-Kn){const st=k.top-4-$;st>=Kn?f=st:f=Math.max(Kn,x-$-Kn)}}kl.value={top:f,left:d}}const un=e.computed(()=>!lt.value||!R.value?{}:{position:"fixed",left:`${kl.value.left}px`,top:`${kl.value.top}px`,zIndex:1002});function ml(k,C){return!k||!C?!1:k.getFullYear()===C.getFullYear()&&k.getMonth()===C.getMonth()&&k.getDate()===C.getDate()}function dt(k){return new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime()}function Hl(k){return!N.availableDates||!N.availableDates.length?!0:N.availableDates.some(C=>C instanceof Date&&ml(C,k))}function Ul(k){const C=dt(k);return!(N.minDate instanceof Date&&C<dt(N.minDate)||N.maxDate instanceof Date&&C>dt(N.maxDate))}function Ll(k){const C=new Date(k);return new Date(C.getFullYear(),C.getMonth(),C.getDate())}function Wn(k){return Math.floor(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())/864e5)}function Yl(k,C){return new Date(k.getFullYear(),k.getMonth(),k.getDate()+C)}function bn(k){return k.filter(C=>Ul(C))}function $n(k,C){if(!(k instanceof Date)||!(C instanceof Date))return null;let x=dt(k),d=dt(C);if(x>d&&([x,d]=[d,x]),N.minDate instanceof Date){const f=dt(N.minDate);x=Math.max(x,f),d=Math.max(d,f)}if(N.maxDate instanceof Date){const f=dt(N.maxDate);x=Math.min(x,f),d=Math.min(d,f)}return x>d?null:{start:Ll(x),end:Ll(d)}}function tn(k){return!N.exceptDates||!N.exceptDates.length?!1:N.exceptDates.some(C=>C instanceof Date&&ml(C,k))}function _l(k){return tn(k)?!1:["singleFromAvailable","rangeFromAvailable"].includes(N.mode)?Hl(k)&&Ul(k):Ul(k)}function dn(k){const C=mt.value,x=Tt.value,d=at.value,f=dt(k),b=Ke.value&&x.start&&x.end&&f>Math.min(dt(x.start),dt(x.end))&&f<Math.max(dt(x.start),dt(x.end)),_=Ke.value&&x.start&&ml(k,x.start),$=Ke.value&&x.end&&ml(k,x.end),ye=_&&$,ge=pt.value&&Fe.value,st=ge&&d.start&&ml(k,d.start),Ve=ge&&d.end&&ml(k,d.end),Qe=st&&Ve,Q=ge&&d.start&&d.end&&f>Math.min(dt(d.start),dt(d.end))&&f<Math.max(dt(d.start),dt(d.end)),Zt=Lt.value&&C&&ml(k,C)||_||$;let Oe=!1,Jn=!1;const ea=ht.value?d:x;if(Ke.value&&ea.start&&!ea.end&&Te.value){const xn=dt(ea.start),yn=dt(Te.value),En=Math.min(xn,yn),Tn=Math.max(xn,yn);ht.value?Jn=f>En&&f<Tn:Oe=f>En&&f<Tn}return{"dss-datepicker__day--comparison-start":st&&!Qe&&!Zt,"dss-datepicker__day--comparison-end":Ve&&!Qe&&!Zt,"dss-datepicker__day--comparison-single":Qe&&!Zt,"dss-datepicker__day--in-comparison-range":Q&&!st&&!Ve&&!_&&!$,"dss-datepicker__day--in-comparison-preview":Jn&&!st&&!Ve&&!Q&&!_&&!$,"dss-datepicker__day--selected":Zt&&!ye,"dss-datepicker__day--range-start":_&&!ye,"dss-datepicker__day--range-end":$&&!ye,"dss-datepicker__day--range-single":ye,"dss-datepicker__day--in-range":b&&!_&&!$,"dss-datepicker__day--in-range-preview":Oe&&!_&&!$&&!b,"dss-datepicker__day--disabled":!_l(k)}}function wl(k){if(!Ke.value)return;const C=ht.value?at.value:Tt.value;if(!C.start||C.end){Te.value=null;return}if(!_l(k)){Te.value=null;return}Te.value=new Date(k.getFullYear(),k.getMonth(),k.getDate())}function mn(){Te.value=null}function zl(k=Tt.value){if(!N.doubleCalendar||!Ke.value)return;const C=Ct(k),{start:x,end:d}=C;if(x&&d){const _=x<=d?x:d,$=x<=d?d:x,ye=_.getMonth(),ge=_.getFullYear(),st=$.getMonth(),Ve=$.getFullYear();if(ye!==st||ge!==Ve){const Qe=ke.value===ye&&G.value===ge,Q=j.value===st&&fe.value===Ve;if(Qe&&Q)return;ke.value=ye,G.value=ge,j.value=st,fe.value=Ve}else{const Qe=ye===0?11:ye-1,Q=ye===0?ge-1:ge;ke.value===Qe&&G.value===Q&&j.value===ye&&fe.value===ge||(ke.value=ye,G.value=ge,ye===11?(j.value=0,fe.value=ge+1):(j.value=ye+1,fe.value=ge))}return}const f=x||d;if(f){const _=f.getMonth(),$=f.getFullYear(),ye=ke.value===_&&G.value===$,ge=j.value===_&&fe.value===$;if(ye||ge)return;ke.value=_,G.value=$,_===11?(j.value=0,fe.value=$+1):(j.value=_+1,fe.value=$);return}const b=U();ke.value=b.left.month,G.value=b.left.year,j.value=b.right.month,fe.value=b.right.year}const pn=e.computed(()=>new Intl.DateTimeFormat(W.value,{day:"2-digit",month:"long",year:"numeric"})),ln=e.computed(()=>{if(!Je.value)return[];const k=(N.availableDates||[]).filter(x=>x instanceof Date&&!Number.isNaN(x.getTime())).filter(x=>!tn(x)&&Ul(x)).map(x=>new Date(x.getFullYear(),x.getMonth(),x.getDate()));k.sort((x,d)=>d.getTime()-x.getTime());const C=mt.value;return k.map(x=>({date:x,ts:x.getTime(),label:pn.value.format(x),selected:!!(C&&ml(x,C))}))});function ll(){if(R.value){Rl();return}lt.value=$e.value?.closest(".dss-datepicker__input-wrap"),Zl.value="left",R.value=!0,tl(),e.nextTick(()=>{Xt.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Gn(k){if(!(k instanceof Date))return;const C=new Date(k.getFullYear(),k.getMonth(),k.getDate());L("update:modelValue",C),Rl()}function qn(k="start"){if(N.mode==="readonly")return;He.value=k;const C=mt.value,x=Tt.value;if(Lt.value&&C)g.value=C.getMonth(),we.value=C.getFullYear();else if(Ke.value)if(N.doubleCalendar)zl();else{const d=k==="start"&&x.start?x.start:x.end||x.start;d&&(g.value=d.getMonth(),we.value=d.getFullYear())}lt.value=Lt.value?Ae.value?.closest(".dss-datepicker__input-wrap"):Ye.value,ue.value="days",Z.value=null,Zl.value="left",R.value=!0,tl()}function Rl(){ue.value="days",Z.value=null,Te.value=null,R.value=!1}function vn(k,C){Z.value=k,ue.value=C}function Ml(){ue.value="days",Z.value=null}function Qn(k,C,x,d){switch(k){case"today":return new Date(C,x,d);case"in7Days":return new Date(C,x,d+7);case"in14Days":return new Date(C,x,d+14);case"in30Days":return new Date(C,x,d+30);default:return null}}function nn(k,C,x,d){const f=new Date(C,x,d);let b,_;switch(k){case"today":b=f,_=f;break;case"lastWeek":b=new Date(C,x,d-6),_=f;break;case"last15Days":b=new Date(C,x,d-14),_=f;break;case"last30Days":b=new Date(C,x,d-29),_=f;break;case"thisMonth":b=new Date(C,x,1),_=f;break;case"lastMonth":b=new Date(C,x-1,1),_=new Date(C,x,0);break;case"last3Months":b=new Date(C,x-3,1),_=new Date(C,x,0);break;case"last6Months":b=new Date(C,x-6,1),_=new Date(C,x,0);break;case"last12Months":b=new Date(C,x-12,1),_=new Date(C,x,0);break;case"lastYear":b=new Date(C-1,0,1),_=new Date(C-1,11,31);break;default:return null}return{start:b,end:_}}function sl(k){const C=new Date,x=C.getFullYear(),d=C.getMonth(),f=C.getDate();let b,_;if(wt.value){const $=bn([...N.availableDates].filter(ye=>ye instanceof Date).map(ye=>new Date(ye.getFullYear(),ye.getMonth(),ye.getDate()))).sort((ye,ge)=>ye.getTime()-ge.getTime());if($.length===0)return null;if(k==="all")b=$[0],_=$[$.length-1];else{const ye=parseInt(k.replace("last",""),10);if(Number.isInteger(ye)&&ye>=2&&ye<=5){const ge=$.slice(-ye);if(ge.length===0)return null;b=ge[0],_=ge[ge.length-1]}else{const ge=nn(k,x,d,f);if(!ge)return null;const st=hn(ge);if(!st.length)return null;b=st[0],_=st[st.length-1]}}}else{const $=nn(k,x,d,f);if(!$)return null;b=$.start,_=$.end}return{start:b,end:_}}function Wt(k){const C=new Date,x=Qn(k,C.getFullYear(),C.getMonth(),C.getDate()),d=Ge(x);return!d||!_l(d)?null:d}function qt(k){const C=sl(k);return C?$n(C.start,C.end):null}function vl(k){return Lt.value?Wt(k)!==null:qt(k)!==null}function Pl(k){const C=Wt(k);C&&(L("update:modelValue",C),Rl())}function Dt(k){if(Lt.value){Pl(k);return}xl(k)}function kt(){L("update:modelValue",null)}function xl(k){const C=qt(k);C&&(L("update:modelValue",C),zl())}function El(k){return!!(k&&k.start instanceof Date&&k.end instanceof Date)}function gl(k){L("update:comparisonValue",Ct(k))}function Xl(k=at.value){const C=Ct(k);El(C)&&(Ze.value=C)}function Fl(){return El(Ze.value)?(gl(Ze.value),N.doubleCalendar&&zl(Ze.value),!0):!1}function fn(k){const C=Se(k);return El(C)?_l(C.start)&&_l(C.end):!1}function hn(k){const C=Se(k);if(!El(C))return[];const x=dt(C.start),d=dt(C.end);return(N.availableDates||[]).filter(f=>f instanceof Date&&!Number.isNaN(f.getTime())).map(f=>Ge(f)).filter(f=>{const b=dt(f);return b>=x&&b<=d&&_l(f)}).sort((f,b)=>dt(f)-dt(b))}function $l(k){if(!(k instanceof Date))return null;const C=new Date(k.getFullYear()-1,k.getMonth(),k.getDate());return C.getMonth()!==k.getMonth()?new Date(k.getFullYear()-1,k.getMonth()+1,0):C}function Yt(k=qe.value){const C=Se(Tt.value);if(!El(C))return{start:null,end:null};let x,d;if(k==="previousPeriod"){const b=Wn(C.end)-Wn(C.start)+1;d=Yl(C.start,-1),x=Yl(d,-(b-1))}else if(k==="previousYear")x=$l(C.start),d=$l(C.end);else return at.value;let f=Se({start:x,end:d});if(N.mode==="rangeFromAvailable"&&N.availableDates?.length){const b=hn(f);if(!b.length)return{start:null,end:null};f={start:b[0],end:b[b.length-1]}}return fn(f)?f:{start:null,end:null}}function an(){!pt.value||!Fe.value||qe.value==="custom"||gl(Yt())}function Sl(){if(pt.value){if(Fe.value=!Fe.value,!Fe.value){qe.value==="custom"&&Xl(),Me.value="primary",gl({start:null,end:null});return}if(qe.value==="custom"){Me.value="comparison",Fl();return}Me.value="primary",an()}}function St(k){if(re(k)){if(qe.value=k,Te.value=null,k==="custom"){if(Me.value="comparison",Fl())return;N.doubleCalendar&&El(at.value)&&zl(at.value);return}Me.value="primary",an()}}function Dn(k,C,x){const d=Ct(k);return!d.start&&!d.end?(x.value="end",{start:C,end:null}):d.start&&d.end?(x.value="end",{start:C,end:null}):x.value==="start"?(x.value="end",Se({start:C,end:d.end})):(x.value="start",Se({start:d.start,end:C}))}function Kt(k){Z.value==="left"?ke.value=k:Z.value==="right"?j.value=k:g.value=k,Ml()}function Vl(k){Z.value==="left"?G.value=k:Z.value==="right"?fe.value=k:we.value=k,Ml()}function gn(){g.value===0?(g.value=11,we.value--):g.value--}function wn(){g.value===11?(g.value=0,we.value++):g.value++}function on(){ke.value===0?(ke.value=11,G.value--):ke.value--}function yl(){ke.value===11?(ke.value=0,G.value++):ke.value++}function Ln(){j.value===0?(j.value=11,fe.value--):j.value--}function jl(){j.value===11?(j.value=0,fe.value++):j.value++}function sn(k){if(!_l(k))return;const C=new Date(k.getFullYear(),k.getMonth(),k.getDate());if(Lt.value){L("update:modelValue",C),Rl();return}if(ht.value){const d=Dn(at.value,C,he);El(d)&&Xl(d),gl(d);return}Me.value="primary";const x=Dn(Tt.value,C,He);L("update:modelValue",x)}e.watch(Tt,()=>{N.doubleCalendar&&Ke.value&&R.value&&zl(),an()},{deep:!0}),e.watch(()=>N.comparisonEnabled,k=>{if(ve(),!k){Fe.value=!1,Me.value="primary";return}El(at.value)?Fe.value=!0:Fe.value&&qe.value!=="custom"&&an()}),e.watch(F,()=>{ve()},{deep:!0}),e.watch(at,k=>{pt.value&&El(k)&&(Fe.value=!0,qe.value==="custom"&&Xl(k))},{deep:!0,immediate:!0});let Tl=null,Kl=null,nl=null;function Ol(){Tl&&(document.removeEventListener("keydown",Tl),Tl=null),Kl&&(window.removeEventListener("resize",Kl),Kl=null),nl&&(window.removeEventListener("scroll",nl,!0),nl=null)}return e.watch(ue,k=>{k==="years"&&e.nextTick(()=>{it.value?.querySelector(`[data-year="${ie.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[R.value,ue.value,g.value,we.value,ke.value,G.value,j.value,fe.value,Z.value,N.doubleCalendar,N.quickSelect,N.quickSelectOptions,N.comparisonControlsPlacement],()=>{tl()}),e.watch(R,k=>{Ol(),k&&(Tl=C=>{C.key==="Escape"&&(ue.value==="years"||ue.value==="months"?Ml():Rl())},Kl=()=>{ol()},nl=()=>{ol()},document.addEventListener("keydown",Tl),window.addEventListener("resize",Kl),window.addEventListener("scroll",nl,!0))}),e.onBeforeUnmount(()=>{bl!==null&&(window.cancelAnimationFrame(bl),bl=null),Ol()}),(k,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":B.mode==="readonly"}])},[B.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",xs,[C[10]||(C[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:X.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Es)])):Lt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--open":R.value}]),onClick:C[0]||(C[0]=x=>qn("start"))},[C[12]||(C[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:Ae,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(ne)("datepicker.selectDate"),value:gt.value,readonly:"",disabled:B.mode==="readonly"},null,8,Ss),B.clearable&&mt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-datepicker__clear","aria-label":e.unref(ne)("datepicker.clear"),onClick:e.withModifiers(kt,["stop"])},[...C[11]||(C[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,Vs)):e.createCommentVNode("",!0)],2)):Je.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":R.value}]),onClick:ll},[C[14]||(C[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:$e,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(ne)("datepicker.selectFromList"),value:gt.value,readonly:""},null,8,Ns),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":R.value}]),"aria-hidden":"true"},[...C[13]||(C[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)):Ke.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":pt.value,"dss-datepicker__input-wrap--comparison-active":pt.value&&Fe.value,"dss-datepicker__input-wrap--open":R.value}]),onClick:C[1]||(C[1]=x=>qn("start"))},[C[17]||(C[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)),pt.value?(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ce,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(ne)("datepicker.selectRange"),value:jt.value,readonly:""},null,8,_s),Fe.value&&se.value?(e.openBlock(),e.createElementBlock("div",Ms,[e.createElementVNode("span",$s,e.toDisplayString(se.value.start),1),C[15]||(C[15]=e.createElementVNode("span",{class:"dss-datepicker__comparison-sep"},"/",-1)),e.createElementVNode("span",Ds,e.toDisplayString(se.value.end),1)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRangeRef",ref:Ce,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(ne)("datepicker.selectRange"),value:jt.value,readonly:""},null,8,Ls)),pt.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":Fe.value}]),"aria-label":Fe.value?e.unref(ne)("datepicker.comparison.active"):e.unref(ne)("datepicker.comparison.compareTo"),"aria-pressed":Fe.value,onClick:e.withModifiers(Sl,["stop"])},[...C[16]||(C[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,Ts)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Rl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ft,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":B.doubleCalendar&&Ke.value&&ue.value==="days","dss-datepicker__dropdown--quick-select":ue.value==="days"&&(B.doubleCalendar&&Ke.value&&(B.quickSelect||ct.value)||Lt.value&&B.quickSelect),"dss-datepicker__dropdown--list":Je.value}]),onClick:C[9]||(C[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(un.value)},[Je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ln.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:Xt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.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=>Gn(x.date)},[e.createElementVNode("span",Hs,e.toDisplayString(x.label),1),x.selected?(e.openBlock(),e.createElementBlock("svg",Rs,[...C[18]||(C[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,As))),128))],512)):(e.openBlock(),e.createElementBlock("div",Fs,e.toDisplayString(e.unref(ne)("datepicker.noAvailableDates")),1))],64)):ue.value==="days"&&B.doubleCalendar&&Ke.value?(e.openBlock(),e.createElementBlock("div",Is,[B.quickSelect||ct.value?(e.openBlock(),e.createElementBlock("div",zs,[B.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!vl(x.id),onClick:d=>Dt(x.id)},e.toDisplayString(Et(x)),9,Os))),128))])):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("div",Ws,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Fe.value}]),onClick:Sl},e.toDisplayString(Fe.value?e.unref(ne)("datepicker.comparison.active"):e.unref(ne)("datepicker.comparison.compareTo")),3),Fe.value?(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":qe.value===x.id}]),onClick:d=>St(x.id)},e.toDisplayString(Y(x)),11,Zs))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Us,[e.createElementVNode("div",Ys,[e.createElementVNode("div",Xs,[e.createElementVNode("div",js,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.prevMonth"),onClick:on}," ‹ ",8,Ks),e.createElementVNode("div",Gs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[2]||(C[2]=x=>vn("left","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[3]||(C[3]=x=>vn("left","years"))},e.toDisplayString(G.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.nextMonth"),onClick:yl}," › ",8,Qs)]),e.createElementVNode("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.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",dn(x)]),disabled:!_l(x),onClick:f=>sn(x),onMouseenter:f=>wl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,tr)):(e.openBlock(),e.createElementBlock("span",lr))],64))),128))])]),e.createElementVNode("div",nr,[e.createElementVNode("div",ar,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.prevMonth"),onClick:Ln}," ‹ ",8,or),e.createElementVNode("div",sr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[4]||(C[4]=x=>vn("right","months"))},e.toDisplayString(Nt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[5]||(C[5]=x=>vn("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.nextMonth"),onClick:jl}," › ",8,rr)]),e.createElementVNode("div",ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.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",dn(x)]),disabled:!_l(x),onClick:f=>sn(x),onMouseenter:f=>wl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,ur)):(e.openBlock(),e.createElementBlock("span",dr))],64))),128))])])]),Ut.value?(e.openBlock(),e.createElementBlock("div",mr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Fe.value}]),onClick:Sl},e.toDisplayString(Fe.value?e.unref(ne)("datepicker.comparison.active"):e.unref(ne)("datepicker.comparison.compareTo")),3),Fe.value?(e.openBlock(),e.createElementBlock("div",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":qe.value===x.id}]),onClick:d=>St(x.id)},e.toDisplayString(Y(x)),11,vr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):ue.value==="days"?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass({"dss-datepicker__double-wrap":B.quickSelect&&Lt.value})},[B.quickSelect&&Lt.value?(e.openBlock(),e.createElementBlock("div",fr,[e.createElementVNode("nav",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!vl(x.id),onClick:d=>Dt(x.id)},e.toDisplayString(Et(x)),9,gr))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",yr,[pt.value?(e.openBlock(),e.createElementBlock("div",kr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Fe.value}]),onClick:Sl},e.toDisplayString(Fe.value?e.unref(ne)("datepicker.comparison.active"):e.unref(ne)("datepicker.comparison.compareTo")),3),Fe.value?(e.openBlock(),e.createElementBlock("div",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":qe.value===x.id}]),onClick:d=>St(x.id)},e.toDisplayString(Y(x)),11,br))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",wr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.prevMonth"),onClick:gn}," ‹ ",8,xr),e.createElementVNode("div",Er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[6]||(C[6]=x=>ue.value="months")},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[7]||(C[7]=x=>ue.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ne)("datepicker.nextMonth"),onClick:wn}," › ",8,Sr)]),e.createElementVNode("div",Vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.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(Ue.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",dn(x)]),disabled:!_l(x),onClick:f=>sn(x),onMouseenter:f=>wl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,Br)):(e.openBlock(),e.createElementBlock("span",_r))],64))),128))])])],2)):ue.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Mr,[e.createElementVNode("div",$r,[e.createElementVNode("span",Dr,e.toDisplayString(et.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:C[8]||(C[8]=x=>ue.value="years")},e.toDisplayString(ie.value),1)])]),e.createElementVNode("div",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.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===te.value}]),onClick:f=>Kt(d)},e.toDisplayString(x),11,Tr))),128))])],64)):ue.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ar,[e.createElementVNode("span",Hr,e.toDisplayString(xt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:it},[e.createElementVNode("div",Rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(al.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":x===ie.value,"dss-datepicker__year-cell--current":x===e.unref(xe)}]),"data-year":x,onClick:d=>Vl(x)},e.toDisplayString(x),11,Fr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ir={class:"dss-step-bar__layout"},zr={class:"dss-step-bar__header"},Pr={class:"dss-step-bar__label"},Or={key:0,class:"dss-step-bar__counter"},Wr={class:"dss-step-bar__track-wrapper"},qr=["aria-valuemax","aria-valuenow","aria-label"],Zr=["onMouseenter"],Ro={__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 J=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"}}},L=F=>F&&typeof F=="object"&&!Array.isArray(F),ne=(F,Y)=>{const re=Object.assign({},F);return!L(F)||!L(Y)||Object.keys(Y).forEach(ve=>{if(L(Y[ve])){ve in F?re[ve]=ne(F[ve],Y[ve]):Object.assign(re,{[ve]:Y[ve]});return}Object.assign(re,{[ve]:Y[ve]})}),re},W=e.computed(()=>ne(N,J.options)),R=e.computed(()=>Math.max(1,Number(J.steps)||1)),ue=e.computed(()=>Math.min(R.value,Math.max(0,Number(J.currentStep)||0))),rt=e.computed(()=>Array.isArray(J.segments)&&J.segments.length>0),ee=e.computed(()=>{if(!rt.value)return[];const F=J.segments.map((Y,re)=>{const ve=Number(Y?.value);return{label:Y?.label||`Step ${re+1}`,value:Number.isFinite(ve)&&ve>0?ve:0,color:Y?.color||J.activeColor,marker:Y?.marker}});return J.segmentOrder==="desc"?[...F].sort((Y,re)=>re.value-Y.value):J.segmentOrder==="asc"?[...F].sort((Y,re)=>Y.value-re.value):F}),g=e.computed(()=>rt.value?ee.value.reduce((F,Y)=>F+Y.value,0):ue.value),we=e.computed(()=>rt.value?Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0?Number(J.totalValue):Math.max(1,g.value):R.value),ke=e.computed(()=>rt.value&&Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0),G=e.computed(()=>ke.value?Math.max(0,Number(J.totalValue)-g.value):0),j=e.computed(()=>typeof J.remainderLabel=="string"&&J.remainderLabel.trim().length>0),fe=e.computed(()=>G.value>0),He=e.computed(()=>ee.value.reduce((F,Y)=>Math.max(F,Number(Y.value)||0),0)),he=e.computed(()=>ee.value.filter(F=>F.value>0).map(F=>`${F.label}: ${Je(F.value)}`).join(" | ")),Te=e.computed(()=>rt.value?ke.value?ee.value.filter(F=>F.value>0):ee.value:[]),Z=e.computed(()=>{if(!J.counterAsPercentage)return`${g.value} / ${we.value}`;const F=Number(we.value);if(!Number.isFinite(F)||F<=0)return"0%";const Y=Math.round(Number(g.value)/F*100);return`${Math.min(Math.max(Y,0),100)}%`}),Fe=e.computed(()=>g.value),qe=e.computed(()=>we.value),Me=e.reactive({visible:!1,x:0,y:0,content:""}),Ze=e.computed(()=>J.orientation==="vertical"),U=e.computed(()=>{const F=J.barHeight;return F==null||F===""?"200px":typeof F=="number"?`${F}px`:String(F)}),Ae=e.computed(()=>{const F=J.sideLabelMaxWidth;if(!(F==null||F===""))return typeof F=="number"?`${F}px`:String(F)}),Ye=e.computed(()=>{const F=J.sideLabelWrapWidth;return F==null||F===""?"18ch":typeof F=="number"?`${F}ch`:String(F)}),Ce=e.computed(()=>({left:`${Me.x}px`,top:`${Me.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),$e=F=>Ze.value?{flex:`${F} 0 0`,minHeight:F>0?"6px":"0",minWidth:"0"}:{flex:`${F} 0 0`,minWidth:F>0?"6px":"0"},lt=F=>{const Y=F?.parentElement;if(!Y)return{x:0,y:0};const re=Y.getBoundingClientRect();return{x:re.left+re.width/2,y:re.top}},ft=F=>{const Y=F.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},it=F=>{if(ke.value){const ve=Math.max(0,Number(F.value)||0);return{...$e(ve),backgroundColor:F.color}}const Y=g.value,re=F.value>0?F.value:Y>0?1e-4:1;return{...$e(re),backgroundColor:F.color}},Xt=F=>Number(F?.value||0)>0&&Number(F?.value||0)===He.value,xe=F=>{const Y=L(F?.marker)?F.marker:{},re=F?.marker===!0||Y.enabled===!0,ve=Xt(F)&&W.value.maxSegment?.marker?.enabled===!0;if(!(re||ve))return{enabled:!1};const Ge=Y.backgroundColor??(ve?W.value.maxSegment?.marker?.backgroundColor:W.value.segmentMarker?.backgroundColor),Ct=Y.borderColor??(ve?W.value.maxSegment?.marker?.borderColor:W.value.segmentMarker?.borderColor),Se=Y.color??(ve?W.value.maxSegment?.marker?.color:W.value.segmentMarker?.color),tt=Y.width??(ve?W.value.maxSegment?.marker?.width:W.value.segmentMarker?.width),gt=Y.height??(ve?W.value.maxSegment?.marker?.height:W.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ge,borderColor:Ct,color:Se,width:tt,height:gt,icon:Y.icon??null,...Y}},Lt=F=>{const Y=xe(F);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},Ke=F=>{const Y=xe(F);return{width:Y.width??void 0,height:Y.height??void 0}},Je=F=>`${F}${J.valueLabel}`,mt=e.computed(()=>({...$e(G.value),backgroundColor:J.inactiveColor})),Tt=(F,Y)=>{J.disableTooltips||ct(F,Y)},at=F=>{J.disableTooltips||Ut(F)},pt=()=>{J.disableTooltips||ht()},ct=(F,Y)=>{if(!F||!Y?.currentTarget)return;const re=Y.currentTarget;if(J.remainderTooltipSummary){const Re=lt(re);Me.x=Re.x,Me.y=Re.y,Me.content=he.value,Me.visible=!!Me.content;return}const ve=ft(re);Me.x=ve.x,Me.y=ve.y,Me.content=`${F.label}: ${Je(F.value)}`,Me.visible=!0},Ut=F=>{if(!G.value||!F?.currentTarget)return;const Y=F.currentTarget;if(J.remainderTooltipSummary){const ve=lt(Y);Me.x=ve.x,Me.y=ve.y,Me.content=he.value,Me.visible=!!Me.content;return}const re=ft(Y);Me.x=re.x,Me.y=re.y,j.value&&(Me.content=`${J.remainderLabel}: ${Je(G.value)}`,Me.visible=!0)},ht=()=>{Me.visible=!1},Rt=()=>{Me.visible&&ht()};e.onMounted(()=>{window.addEventListener("scroll",Rt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Rt,!0)});const me=e.computed(()=>({"--dss-step-bar-label-color":J.labelColor??void 0,"--dss-step-bar-counter-color":J.counterColor??void 0,"--dss-step-bar-active-color":J.activeColor,"--dss-step-bar-inactive-color":J.inactiveColor,"--dss-step-bar-bar-height":Ze.value?U.value:void 0,"--dss-step-bar-side-label-max-width":Ae.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(F,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(me.value)},[e.createElementVNode("div",Ir,[e.createElementVNode("div",zr,[e.createElementVNode("span",Pr,[e.renderSlot(F.$slots,"label",{label:B.label},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])]),B.showCounter?(e.openBlock(),e.createElementBlock("span",Or,[e.renderSlot(F.$slots,"counter",{counterDisplay:Z.value},()=>[e.createTextVNode(e.toDisplayString(Z.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Wr,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":qe.value,"aria-valuenow":Fe.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,(re,ve)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${ve}-${re.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Xt(re),"dss-step-bar__segment--marker-enabled":xe(re).enabled}]),style:e.normalizeStyle(it(re)),onMouseenter:Re=>Tt(re,Re),onMouseleave:pt},[xe(re).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Lt(re)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Ke(re))},[e.renderSlot(F.$slots,"segment-marker-icon",{segment:re,index:ve,marker:xe(re)},()=>[e.renderSlot(F.$slots,"max-segment-icon",{segment:re,index:ve,marker:xe(re)},()=>[e.createTextVNode(e.toDisplayString(xe(re).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Zr))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(mt.value),onMouseenter:Y[0]||(Y[0]=re=>at(re)),onMouseleave:pt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R.value,re=>(e.openBlock(),e.createElementBlock("div",{key:re,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":re<=ue.value}])},null,2))),128))],8,qr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!B.disableTooltips&&Me.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(Ce.value)},e.toDisplayString(Me.content),5)):e.createCommentVNode("",!0)]))],6))}},Ur=["data-chart-type"],Yr={class:"dss-chart-header-titles"},Xr={key:0,class:"dss-chart-title"},jr={key:1,class:"dss-chart-subtitle"},Kr=["onClick","onMouseenter"],Gr={class:"dss-legend-text"},Qr=["onClick","onMouseenter"],Jr={class:"dss-legend-text"},ei=["title"],ti=["src"],li={class:"dss-chart-area-wrapper"},ni={key:0,class:"dss-chart-z-axis-label"},ai=["width","height","data-smooth","data-animated"],oi=["id"],si=["y","width","height"],ri=["id"],ii=["d"],ci=["id"],ui=["d"],di={key:0},mi=["clip-path"],pi=["x1","x2","y1","y2"],vi=["clip-path"],fi=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],hi={class:"dss-axes"},gi=["x1","x2","y1","y2"],yi=["x1","x2","y1","y2"],ki=["x1","x2","y1","y2"],Ci={class:"dss-axis-labels"},bi=["x","y"],wi=["x","y"],xi=["x","y"],Ei=["x","y"],Si=["y","transform"],Vi=["x","y","transform"],Ni={key:2,class:"dss-flag-markers"},Bi=["clip-path"],_i=["x1","x2","y1","y2","onMouseover"],Mi=["x1","x2","y1","y2","onMouseover"],$i=["x1","x2","y1","y2","onMouseover"],Di=["cx","cy","onMouseover"],Li=["cx","cy","fill","onMouseover"],Ti=["x","y"],Ai=["clip-path"],Hi={key:0},Ri=["d","onMouseover"],Fi=["x","y","width","height","fill","onMouseover"],Ii={class:"dss-line-chart"},zi=["d","stroke","stroke-width","stroke-dasharray"],Pi=["d","stroke","stroke-width","opacity"],Oi=["cx","cy","r","fill","onMouseover"],Wi={key:1},qi=["d","stroke","stroke-width","stroke-dasharray"],Zi=["d","stroke","stroke-width","stroke-dasharray"],Ui=["d","stroke","stroke-width","opacity"],Yi=["cx","cy","r","fill","onMouseover"],Xi={key:2},ji=["id"],Ki=["x","y","width","height"],Gi=["d","fill","fill-opacity","mask"],Qi=["d","stroke","stroke-width"],Ji=["d","fill","onMouseover"],ec=["x","y","width","height","onMouseover"],tc=["clip-path"],lc=["x1","x2","y1","y2","stroke"],nc=["cx","cy","r","fill"],ac={key:1,class:"dss-bubble-chart"},oc={key:0,class:"dss-bubble-group"},sc=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rc=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ic=["transform"],cc=["cx","cy","r"],uc=["data-chart-type","clip-path"],dc=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],mc={key:1,class:"dss-radial-segment-data-labels"},pc=["x","y"],vc=["x","y","font-size","fill"],fc=["x1","y1","x2","y2","stroke"],hc=["x1","y1","x2","y2","stroke"],gc=["x","y","text-anchor","font-size"],yc=["transform"],kc={key:0,class:"dss-spider-grid"},Cc=["cx","cy","r"],bc={class:"dss-spider-grid-labels"},wc=["x","y"],xc=["x","y"],Ec=["x1","x2","y1","y2"],Sc={class:"dss-spider-labels"},Vc=["x","y","text-anchor","dominant-baseline"],Nc=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Bc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],_c={class:"dss-chart-logos"},Mc=["cx","cy","r","fill"],$c=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Dc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},Lc=["onClick","onMouseenter"],Tc=["src"],Ac={class:"dss-marker-tooltip-category"},Hc={key:0,class:"dss-marker-tooltip-description"},Rc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Fc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ic={class:"dss-tooltip-series-name"},zc={class:"dss-tooltip-series-value"},Pc={key:1,class:"dss-tooltip-section"},Oc={key:0,class:"dss-tooltip-title"},Wc={class:"dss-bubble-tooltip-data"},qc={key:2,class:"dss-tooltip-section"},Zc={class:"dss-tooltip-title"},Uc={class:"dss-tooltip-value"},Yc={key:0,class:"dss-tooltip-section"},Xc={class:"dss-tooltip-section-title"},jc={class:"dss-tooltip-group-header"},Kc={class:"dss-tooltip-item-content"},Gc={class:"dss-tooltip-item-text"},Qc={key:1,class:"dss-tooltip-section"},Jc={class:"dss-tooltip-section-title"},eu={class:"dss-tooltip-item-content"},tu={class:"dss-tooltip-item-title"},lu={key:0,class:"dss-tooltip-item-description"},nu={class:"dss-tooltip-section"},au={class:"dss-tooltip-title"},ou={key:0,class:"dss-bubble-tooltip-data"},su={class:"dss-tooltip-series-name"},ru={class:"dss-tooltip-series-value"},iu={key:0,class:"dss-tooltip-section"},cu={class:"dss-tooltip-section-title"},uu={class:"dss-tooltip-group-header"},du={class:"dss-tooltip-item-content"},mu={class:"dss-tooltip-item-text"},pu={key:1,class:"dss-tooltip-section"},vu={class:"dss-tooltip-section-title"},fu={class:"dss-tooltip-item-content"},hu={class:"dss-tooltip-item-title"},gu={key:0,class:"dss-tooltip-item-description"},yu=["onClick","onMouseenter"],ku={class:"dss-legend-text"},Cu={key:1,class:"dss-context-menu-separator"},bu={key:0,class:"dss-context-menu-separator"},wu={key:0,class:"dss-context-menu-separator"},xu=["onClick"],Eu=["innerHTML"],Su={key:0,class:"dss-context-menu-icon"},Vu={class:"dss-marker-modal-header"},Nu={class:"dss-marker-modal-body"},Bu={class:"dss-form-group"},_u={class:"dss-form-group"},Mu={for:"dss-marker-description"},$u={key:0,class:"dss-form-text-display"},Du=["placeholder"],Lu={class:"dss-marker-modal-footer"},Tu={class:"modal-footer-left"},Au={class:"dss-modal-footer-right"},Hu=["disabled"],Ru={name:"DSSChart"},Fu=Object.assign(Ru,{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:J}){const{t:N,locale:L}=ha.useI18n(),ne=J,W=e.ref(null),R=e.ref(null);let ue=null;const rt=()=>{ue&&(ue(),ue=null);const t=R.value;if(!t||xe.value!=="stepbar")return;const a=l=>$a(l);t.addEventListener("wheel",a,{passive:!1}),ue=()=>t.removeEventListener("wheel",a)},ee=e.ref(null),g=e.ref(null),we=e.ref(0),ke=e.ref(0);let G=null,j=null;const fe=20,He=e.computed(()=>{if(ke.value,we.value,!W.value||!ee.value)return 0;try{const t=W.value.getBoundingClientRect();return ee.value.getBoundingClientRect().top-t.top}catch{return 0}}),he=e.computed(()=>`chart-clip-${Z.chartId}`),Te=e.computed(()=>`url(#${he.value})`),Z=B,Fe={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 qe(t,a){const l=Object.assign({},t);return Ze(t)&&Ze(a)&&Object.keys(a).forEach(r=>{Ze(a[r])?r in t?l[r]=qe(t[r],a[r]):Object.assign(l,{[r]:a[r]}):Object.assign(l,{[r]:a[r]})}),l}const Me=()=>{let t=20,a=0,l=0;if(Ke.value&&(t+=30),Je.value&&(t+=25),ve.value&&Z.series.length>0){const r=Z.series.filter((p,h)=>!_.value.has(h)).length;if(Re.value==="top"||Re.value==="bottom"){if(Ge.value==="horizontal"){const h=Math.floor($e.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 Ze(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>qe(Fe,Z.options)),Ae=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),Ye=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),Ce=e.computed(()=>{const t=U.value;return t?.chart?.type==="stepbar"&&t?.chart?.height==="fit"}),$e=e.computed(()=>{const t=U.value;return Ae.value?we.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),lt=e.ref(fe),ft=e.computed(()=>{if(Ye.value){const t=ft.value;return t??Math.max(0,(ke.value||400)-lt.value*5)}}),it=e.computed(()=>{const t=U.value;if(xe.value==="mini-radial")return $e.value;if(Ce.value)return un.value;if(Ye.value){const a=ft.value;return a??Math.max(0,(ke.value||400)-lt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Xt=e.computed(()=>{if(Ye.value&&xe.value==="semi-radial"&&ft.value!=null)return lt.value+it.value+"px";if(Ye.value)return"100%";if(Cl.value)return lt.value+it.value+"px";if(ve.value&&Re.value==="bottom"){const t=Me();return it.value+(t.legendHeight||35)+"px"}return it.value+(ve.value?20:0)+"px"}),xe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Lt=e.computed(()=>{const t=Z.series.map(a=>a.type||xe.value);return new Set(t).size>1}),Ke=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),Je=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),mt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Tt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),at=e.computed(()=>{const a=U.value?.yAxis?.title?.text;return a==null||String(a).trim()===""?"":String(a)}),pt=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ct=e.computed(()=>{const t=pt.value;return t&&t.title&&t.title.text?t.title.text:""}),Ut=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Dl;const a=t.yAxis.min;return typeof a=="number"||a===Dl?a:Dl}),ht=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Dl;const a=t.yAxis.max;return typeof a=="number"||a===Dl?a:Dl}),Rt=e.computed(()=>{const t=pt.value;if(!t)return Dl;const a=t.min;return typeof a=="number"||a===Dl?a:Dl}),me=e.computed(()=>{const t=pt.value;if(!t)return Dl;const a=t.max;return typeof a=="number"||a===Dl?a:Dl}),F=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Y=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),re=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),ve=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),Re=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ge=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ct=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Se=e.computed(()=>{const t=U.value;if(!t)return!1;if(xe.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"}),tt=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),gt=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),jt=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),se=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),X=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),te=e.computed(()=>{if(!Cl.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ie=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ne=e.computed(()=>{const{maxX:t}=Vt.value;return t===0}),et=(t,a)=>Ne.value&&a===0?5:a,yt=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},al=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xt=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),el=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),H=e.computed(()=>{const t=U.value;return xt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=U.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),M=e.computed(()=>U.value?.stepbar||{}),ae=e.computed(()=>{const t=M.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),oe=e.computed(()=>{const t=Number(M.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),Ue=e.computed(()=>M.value?.showRemainder!==!1),bt=e.computed(()=>M.value?.remainderLabel||"Remaining"),ot=e.computed(()=>M.value?.remainderColor||"#E5E7EB"),Xe=e.computed(()=>{const t=Number(M.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),Nt=e.computed(()=>{const t=Number(M.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),wt=e.computed(()=>{const t=Number(M.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(M.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const ut=e.computed(()=>M.value?.axisBars||{}),_t=e.computed(()=>ut.value?.show!==!1);e.computed(()=>ut.value?.showVertical===!0);const $t=e.computed(()=>ut.value?.color||"#d6d6d6"),Et=e.computed(()=>{const t=Number(ut.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),kl=e.computed(()=>{const t=Number(ut.value?.width);return Number.isFinite(t)&&t>0?t:1}),Zl=e.computed(()=>ut.value?.dashArray||"3,4"),bl=e.computed(()=>{const t=Number(M.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),tl=e.computed(()=>{const t=Number(M.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),ol=e.computed(()=>{const t=Number(M.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),un=e.computed(()=>{let t=0;Ke.value&&(t+=15),Je.value&&(t+=10);const a=50+t,l=tl.value+8;return a+ol.value+l}),ml=e.computed(()=>Math.max(P.value.height,0)),dt=e.computed(()=>{const t=Number(M.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const a=Xe.value,l=Nt.value,r=wt.value;return Math.max(l,Math.min(r,a))}),Hl=e.computed(()=>{const t=Number(M.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,dt.value);const a=Number(M.value?.barWidth);return Number.isFinite(Number(M.value?.columnWidth))&&Number(M.value?.columnWidth)>0&&Number.isFinite(a)&&a>0?Math.min(a,dt.value):Math.min(dt.value,Math.max(10,Math.round(dt.value*.32)))}),Ul=e.computed(()=>({width:`${dt.value}px`,flex:`0 0 ${dt.value}px`,"--dss-step-bar-track-thickness":`${Hl.value}px`,"--dss-stepbar-label-height":`${tl.value}px`})),Ll=e.computed(()=>{const t=Yl.value.length;return t?t*dt.value+Math.max(0,t-1)*bl.value:0}),Wn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Yl=e.computed(()=>xe.value!=="stepbar"?[]:zn.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}))}))),bn=e.computed(()=>{if(xe.value!=="stepbar")return[];const{minY:t,maxY:a}=Vt.value,l=5,r=[];for(let p=0;p<=l;p++){const h=t+(a-t)*(p/l);r.push({top:Xn(h)-P.value.top,value:h})}return r}),$n=e.computed(()=>({top:`${P.value.top}px`,left:`${P.value.left}px`,width:`${P.value.width}px`,height:`${ml.value+tl.value}px`})),tn=e.computed(()=>({width:`${Ll.value}px`,minHeight:`${ml.value+tl.value}px`})),_l=e.computed(()=>xe.value==="stepbar"&&Se.value&&Ve.value.show&&!Q.value.isZooming),dn=e.computed(()=>{const t=dt.value+bl.value;return{left:`${Ve.value.categoryIndex*t+dt.value/2}px`,height:`${ml.value}px`,borderColor:tt.value}}),wl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),mn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),zl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),pn=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ln=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),ll=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Gn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),qn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Rl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),vn=e.computed(()=>U.value?.spider?.gridSteps||5),Ml=e.computed(()=>{const t=[],a=vn.value;for(let l=1;l<=a;l++)t.push(nt.value/a*l);return t}),Qn=t=>{const a=nn.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const l=Ml.value[t];return Math.round(l/nt.value*100)+"%"},nn=e.computed(()=>U.value?.spider?.gridLabels||null),sl=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Wt=e.computed(()=>{const t=U.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),qt=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),vl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Dn.value}),Pl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Dt=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),kt=e.computed(()=>{const a=U.value?.valueFormat?.extension;return typeof a=="string"?a:""}),xl=t=>{const a=kt.value;if(t==null)return"";const l=String(t);return a?l+a:l},El=e.computed(()=>!Q.value.isZooming);e.computed(()=>Zt.value.map(t=>{if(t.categoryIndex!==void 0&&(Bl.value||Ft.value)){const a=fl(t.categoryIndex),l=He.value+P.value.bottom-Dt.value/2;return{...t,x:a,y:l}}return t}));function gl(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("-"),q=Number(S?.length===2?`20${S}`:S);l=new Date(q,Number(E)-1,Number(h))}else return 0;let r=0,p=1/0;return a.forEach((h,E)=>{const[S,q,A]=h.split("-"),z=Number(A?.length===2?`20${A}`:A),T=new Date(z,Number(q)-1,Number(S)),K=Math.abs(T-l);K<p&&(p=K,r=E)}),r}const Xl=e.computed(()=>{const t=Z.markers.map(l=>{const r=gl(l.marker_date,Z.categories),p=fl(r),h=He.value+P.value.bottom-Dt.value/2;return{...l,x:p,y:h,categoryIndex:r,source:"props"}}),a=Zt.value.map(l=>{if(l.categoryIndex!==void 0&&(Bl.value||Ft.value)){const r=fl(l.categoryIndex),p=He.value+P.value.bottom-Dt.value/2;return{...l,x:r,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...a]}),Fl=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),fn=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),hn=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),$l=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Yt=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let a,l;const r=String(hn.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}}),an=e.computed(()=>{const{width:t,height:a}=Yt.value,l=$l.value;let r,p;const h=P.value.left,E=P.value.right,S=P.value.top,q=P.value.bottom,A=P.value.width,z=P.value.height;switch(l){case"center":r=h+(A-t)/2,p=S+(z-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=q-a-5;break;case"bottom-right":default:r=E-t-15,p=q-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Sl=t=>!Z.flags||!Z.flags.length?[]:Z.flags.filter(a=>a.categoryIndex===t),St=t=>{const a=Sl(t),l=Ja(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"}))}},Dn=e.computed(()=>{const t=Z.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"),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">
2
2
  <path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
3
3
  <path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
4
4
  <path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
@@ -15,7 +15,7 @@
15
15
  <rect width="57" height="57" fill="white"/>
16
16
  </clipPath>
17
17
  </defs>
18
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Kt=e.computed(()=>{const t=Z.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Nn=e.computed(()=>{const t=q.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
20
20
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
21
21
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -41,23 +41,23 @@
41
41
  <rect width="45" height="45" fill="white" transform="translate(0 1)"/>
42
42
  </clipPath>
43
43
  </defs>
44
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Vl=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),gn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const wn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),on=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),yl=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Ln=e.computed(()=>{const a=U.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),jl=e.computed(()=>{const a=U.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),sn=e.computed(()=>{const a=U.value?.radialBar?.dataCenter;return Yn.value?!0:_n.value&&a&&(a.show===!0||a.enabled===!0)}),Tl=e.computed(()=>{if(!sn.value||!Pn.value.length)return"";if(Yn.value){const r=Pn.value[1]??Pn.value[0];return xl(r?.value??0)}const l=U.value?.radialBar?.dataCenter?.showValueOnly===!0?Pn.value[0]?.value??0:Pn.value.reduce((r,p)=>r+(p.value??0),0);return xl(l)}),Kl=e.computed(()=>{const a=U.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),nl=e.computed(()=>({x:It.value,y:Yn.value?Mt.value:Mt.value-Kl.value/2})),Ol=e.computed(()=>{const a=U.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),k=e.computed(()=>{if(!Ln.value||!Cl.value||!Pn.value.length)return[];const t=jl.value*Math.PI/180,a=(pl.value+nt.value)/2;return Pn.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,h=It.value+Math.cos(l.midAngle)*a,E=Mt.value+Math.sin(l.midAngle)*a;return{value:xl(l.value),x:h,y:E,show:p,color:l.color,contrastColor:Xo(l.color)}})}),C=e.computed(()=>{if(!Z.flags||!Z.flags.length)return[];const t=new Map;return Z.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=fl(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
- `)}})}),x=e.ref({show:!1,x:0,y:0,content:"",count:0}),d=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),f=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),b=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),_=e.ref(new Set),$=e.ref(null),ye=e.ref(!1),ge=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),st=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ve=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Qe=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),Q=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Zt=e.ref([]),Oe=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Pl.value&&t.push(...Object.keys(Pl.value)),t}),e.computed(()=>{if(!Z.categories||Z.categories.length===0){const{maxX:t}=Vt.value;return Array.from({length:t+1},(a,l)=>N("chart.fallback.item",{number:l+1}))}return Z.categories});const Jn=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.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)}),ea=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.categories[Z.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)}),xn=e.computed(()=>Oe.value.editingMarkerId!==null),yn=e.computed(()=>Oe.value.readonly),En=t=>{_.value.has(t)||(po.value=!0,$.value=t)},Tn=()=>{po.value=!1,$.value=null},ja=t=>{if(Ba.value||Pa.value){Ve.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top,h=Ft.value?r>=P.value.left-50&&r<=P.value.right+50&&p>=P.value.top-50&&p<=P.value.bottom+100:cl.value?r>=P.value.left&&r<=P.value.right&&p>=P.value.top&&p<=P.value.bottom+tl.value:r>=P.value.left&&r<=P.value.right&&p>=P.value.top&&p<=P.value.bottom;if(ye.value=h,Ft.value){if(!Se.value||!h||Q.value.isDragging||Q.value.isZooming){Ve.value.show=!1;return}if(Ia.value.find(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-r,2)+Math.pow(pe.y-p,2))<=pe.radius+3))Ve.value.show=!1;else{const pe=Ia.value.filter(be=>!be||be.isHidden?!1:Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2))<=250);if(pe.length>0){let be=pe[0],Ee=Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2));pe.forEach(ze=>{const Le=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-p,2));Le<Ee&&(Ee=Le,be=ze)});const de=30,je=Ia.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-be.x)<=de).sort((ze,Le)=>ze.y-Le.y);Ve.value={show:!0,x:be.x,categoryIndex:Math.round(be.originalX),data:(()=>{const ze=d.value,Le=f.value,_e=[];return je.forEach(Ie=>{ze.forEach(Bt=>{const Pt=Le[Bt]||Bt,Jl=No(Bt,Ie);Jl&&_e.push({seriesName:Ie.seriesName,label:Ie.label,value:`${Pt}: ${Jl}`,color:Ie.color,y:Ie.y})})}),_e})()}}else Ve.value.show=!1}return}if(cl.value){if(!Se.value||!h||Q.value.isDragging||Q.value.isZooming){Ve.value.show=!1;return}const We=R.value;if(!We){Ve.value.show=!1;return}const pe=We.getBoundingClientRect(),be=t.clientX-pe.left+We.scrollLeft,Ee=dt.value+bl.value,de=Math.floor(be/Ee);if(de<0||de>=Yl.value.length){Ve.value.show=!1;return}const je=zn.value[de];if(!je){Ve.value.show=!1;return}const ze=de*Ee+dt.value/2,Le=pe.left+ze-We.scrollLeft-l.left;Ve.value={show:!0,x:Le,categoryIndex:de,data:je.segments.filter(_e=>!_e.isRemainder).map(_e=>({seriesName:_e.label,value:_e.value,color:_e.color,y:null}))};return}if(Q.value.isDragging&&Q.value.scale>1&&Bl.value&&gt.value&&!cl.value){Ve.value.show=!1;const We=t.clientX-Q.value.lastMouseX,{minX:pe,maxX:be}=Vt.value,Ee=be-pe||1,je=We*.8;Q.value.offsetX+=je;const ze=Ee/Q.value.scale,Le=Ee-ze,_e=0,Ie=-Le/Ee*P.value.width,Bt=_e;Q.value.offsetX=Math.max(Ie,Math.min(Bt,Q.value.offsetX)),Q.value.lastMouseX=t.clientX,Q.value.lastMouseY=t.clientY;return}if(!Se.value||!Bl.value||cl.value||Q.value.isDragging||Q.value.isZooming||!h){Ve.value.show=!1;return}const{minX:E,maxX:S}=Vt.value,q=S-E||1,A=q/Q.value.scale,z=E-Q.value.offsetX/P.value.width*q,T=(r-P.value.left)/P.value.width,K=z+T*A,Be=Math.round(K);if(Be>=0&&Be<=S){const We=fl(Be),pe=zt.value.map((be,Ee)=>{const de=Z.series.findIndex(ze=>ze===be),je=be.data[Be];return{seriesName:be.name,value:je!==void 0?je:null,color:Jt(de),y:je!==void 0?Cn(be,je):null}}).filter(be=>be.value!==null);Ve.value={show:!0,x:We,categoryIndex:Be,data:pe}}},Ka=()=>{Ve.value.show&&(Ve.value.show=!1)},$a=t=>{const a=R.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},Da=()=>Yl.value[Ve.value.categoryIndex]?.label||N("chart.fallback.item",{number:Ve.value.categoryIndex+1}),La=()=>{Ve.value.show=!1,ye.value=!1,Pa.value=!1,Ba.value||(x.value.show=!1),Q.value.isDragging&&(Q.value.isDragging=!1),Q.value.zoomTimeout&&(clearTimeout(Q.value.zoomTimeout),Q.value.zoomTimeout=null),Q.value.isZooming=!1,setTimeout(()=>{$.value=null,ge.value.show=!1},150)},Ga=t=>{if(t.preventDefault(),t.stopPropagation(),!sl.value)return;const a=t.currentTarget.getBoundingClientRect(),l=t.clientX-a.left,r=t.clientY-a.top;if(Cl.value){Qe.value.show=!1,e.nextTick(()=>{Qe.value.show=!0,Qe.value.x=t.clientX,Qe.value.y=t.clientY,Qe.value.categoryIndex=null});return}const p=Math.max(0,P.value.left-20),h=P.value.right,E=P.value.top,S=P.value.bottom+80;l>=p&&l<=h&&r>=E&&r<=S&&(Qe.value.show=!1,e.nextTick(()=>{Qe.value.show=!0,Qe.value.x=t.clientX,Qe.value.y=t.clientY,Qe.value.categoryIndex=null;const q=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,z=P.value.width/oo.value.length,T=Math.floor(q/z);T>=0&&T<oo.value.length&&(Qe.value.categoryIndex=T)}))},Sn=t=>{if(!(t&&t.button===2)){if(Qe.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}Qe.value.show=!1}},Qa=t=>{if(typeof t.template=="function"){const a={series:Z.series,categories:Z.categories,markers:Zt.value},l={chartX:Qe.value.chartX,chartY:Qe.value.chartY,dataX:Qe.value.mouseDataX,dataY:Qe.value.mouseDataY,categoryIndex:Qe.value.categoryIndex};return t.template(a,l)}return t.template||t.label||""},Ta=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Zn=t=>t.style||{},sa=t=>t.type&&Pl.value[t.type]?Pl.value[t.type]:t.customIcon?t.customIcon:vl.value,ra=t=>t==null?"":Z.categories&&Z.categories[t]?Z.categories[t]:"",Ja=t=>Zt.value.length?Zt.value.filter(a=>a.categoryIndex===t):[],eo=t=>{if(!Bl.value&&!Ft.value)return{x:0,y:0};const a=fl(t),l=He.value+P.value.bottom-Dt.value/2;return{x:a,y:l}},Ca=()=>{Zt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Bl.value||Ft.value)){const a=eo(t.categoryIndex);t.x=a.x,t.y=a.y}})},Vn=()=>{if(Oe.value.description&&Oe.value.description.length&&Oe.value.date){if(xn.value){const t=Zt.value.findIndex(a=>a.id===Oe.value.editingMarkerId);t!==-1?(Zt.value[t].description=Oe.value.description||"",Zt.value[t].color=Oe.value.color||"",Zt.value[t].type=Oe.value.type||"default",ne("update-marker",Zt.value[t])):ne("update-marker",{id:Oe.value.editingMarkerId,description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=gl(Oe.value.date,Z.categories||[]);if(Ft.value){const{maxX:E}=Vt.value;a=Math.max(0,Math.min(a,Math.floor(E)))}else Bl.value&&(a=Math.max(0,Math.min(a,Vt.value.maxX)));const l=fl(a),r=He.value+P.value.bottom-Dt.value/2,p=Array.isArray(Z.categories)?Z.categories[a]:null,h={id:t,title:"",description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default",categoryIndex:a,x:l,y:r,marker_date:p||null};Oe.value.categoryIndex=a,Zt.value.push(h),ne("add-marker",h)}Al(),ba()}},Al=()=>{Oe.value.show=!1,Oe.value.title="",Oe.value.description="",Oe.value.color="#FF6B6B",Oe.value.type="default",Oe.value.editingMarkerId=null,Oe.value.readonly=!1,Oe.value.categoryIndex=null,Oe.value.fromButton=!1,Oe.value.date=null},An=()=>{xn.value&&(ta(Oe.value.editingMarkerId),Al())},ta=t=>{const a=Zt.value.findIndex(l=>l.id===t);a!==-1&&(Zt.value.splice(a,1),ba()),ne("delete-marker",t)},rl=t=>{if(Oe.value.show=!0,Oe.value.title=t?.title??t?.comment??"",Oe.value.description=t?.description??t?.comment??"",Oe.value.color=t?.color??"",Oe.value.type=t?.type??"default",Oe.value.editingMarkerId=t?.id??t?.marker_id??null,Oe.value.readonly=t?.readonly??!1,Oe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[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?Oe.value.date=new Date(p,E,h):Oe.value.date=null}else Oe.value.date=null},ba=()=>{try{const t=`dss-chart-markers-${Z.chartId}`;localStorage.setItem(t,JSON.stringify(Zt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Aa=()=>{try{const t=`dss-chart-markers-${Z.chartId}`,a=localStorage.getItem(t);if(a){const l=JSON.parse(a);Array.isArray(l)&&(Zt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Zt.value=[]}},Gl=t=>{const a=Ke.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}`},Nn=()=>{const t=Ve.value.show,a=ge.value.show;return Ve.value.show=!1,ge.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Wl=t=>{Ve.value.show=t.originalCrosshair,ge.value.show=t.originalTooltip},Hn=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"),q=S.getContext("2d");S.width=a,S.height=l,q.fillStyle="#fafafa",q.fillRect(0,0,a,l),q.drawImage(h,0,0,a,l);const A=S.toDataURL("image/png");r(A)}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}),Un=async()=>{try{const t=Nn();setTimeout(async()=>{try{const a=ee.value;if(!a){console.error("Chart SVG element not found"),Wl(t);return}const l=Me(),r=$e.value,p=it.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(de=>de.remove());const S=h.querySelectorAll("image"),q=Array.from(S).map(async de=>{const je=de.getAttribute("xlink:href")||de.getAttribute("href");if(je&&!je.startsWith("data:"))try{const ze=await Hn(je,32,32);de.setAttribute("xlink:href",ze),de.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(q);const z=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let T="",K=30;if(Ke.value&&(T+=`
46
- <text x="24" y="${K}"
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+=`
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
- ${Ke.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,K+=30),Je.value&&(T+=`
53
- <text x="24" y="${K}"
51
+ ${Je.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,G+=30),ut.value&&(D+=`
53
+ <text x="24" y="${G}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${Je.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,K+=25),ve.value&&Z.series.length>0){let de=r-200,je=Ke.value||Je.value?35:25;const ze=Math.floor((r-250)/120);let Le=0;Z.series.forEach((_e,Ie)=>{if(!_.value.has(Ie)){const Bt=Jt(Ie),Pt=_e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");T+=`<circle cx="${de+6}" cy="${je-4}" r="6" fill="${Bt}"/>`,T+=`<text x="${de+18}" y="${je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Pt}</text>`,Le++,Le%ze===0?(de=r-200,je+=20):de+=Math.min(120,Pt.length*8+35)}})}let Be="";if(Fl.value)try{const{width:de,height:je}=Yt.value,ze=$l.value,Le=P.value.left,_e=P.value.right,Ie=P.value.top,Bt=P.value.bottom,Pt=P.value.width,Jl=P.value.height;let hl,en;switch(ze){case"center":hl=Le+(Pt-de)/2,en=Ie+(Jl-je)/2;break;case"top-left":hl=Le+15,en=Ie+5;break;case"top-right":hl=_e-de-5,en=Ie+5;break;case"bottom-left":hl=Le+15,en=Bt-je-5;break;case"bottom-right":default:hl=_e-de-5,en=Bt-je-5;break}Be=`
59
- <g opacity="${fn.value}">
60
- <g transform="translate(${hl}, ${en}) scale(${de/499})">
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}">
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"/>
63
63
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -72,7 +72,7 @@
72
72
  <path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
73
73
  <path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
74
74
  </g>
75
- </g>`}catch(de){console.warn("Watermark processing failed, skipping watermark in SVG:",de),Be=""}const We=`<?xml version="1.0" encoding="UTF-8"?>
75
+ </g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),Ve=""}const qe=`<?xml version="1.0" encoding="UTF-8"?>
76
76
  <svg width="${r}" height="${p}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -84,37 +84,37 @@
84
84
  </style>
85
85
  </defs>
86
86
  <rect width="100%" height="100%" fill="#fafafa"/>
87
- ${T}
87
+ ${D}
88
88
  <g transform="translate(0, ${l.height})">
89
- ${z}
90
- ${Be}
89
+ ${I}
90
+ ${Ve}
91
91
  </g>
92
- </svg>`,pe=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(pe),Ee=document.createElement("a");Ee.href=be,Ee.download=Gl("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(be),Wl(t),Sn()}catch(a){console.error("Error downloading SVG:",a),Wl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},to=async()=>{try{const t=Nn();W.value&&W.value.offsetHeight,await new Promise(de=>setTimeout(de,300));const a=Me(),l=$e.value,r=it.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(Ke.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Ke.value,24,S),S+=30),Je.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText(Je.value,24,S),S+=25),ve.value&&Z.series.length>0){let de=l-200,je=Ke.value||Je.value?35:25;const ze=Math.floor((l-250)/120);let Le=0;h.font="12px Arial, sans-serif",Z.series.forEach((_e,Ie)=>{if(!_.value.has(Ie)){const Bt=Jt(Ie);h.beginPath(),h.arc(de+6,je-4,6,0,2*Math.PI),h.fillStyle=Bt,h.fill(),h.fillStyle="#333",h.fillText(_e.name,de+18,je),Le++,Le%ze===0?(de=l-200,je+=20):de+=Math.min(120,_e.name.length*8+35)}})}const A=ee.value.cloneNode(!0),z=A.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),T=A.querySelectorAll(".dss-crosshair"),K=A.querySelectorAll('[class*="tooltip"]');z.forEach(de=>de.remove()),T.forEach(de=>de.remove()),K.forEach(de=>de.remove()),A.querySelectorAll("image").forEach((de,je)=>{const ze=de.getAttribute("xlink:href")||de.getAttribute("href");if(ze&&!ze.startsWith("data:")){const Le=za.value[je],_e=Le?Jt(Le.seriesIndex):"#3B82F6",Ie=de.getAttribute("x")||0,Bt=de.getAttribute("y")||0,Pt=de.getAttribute("width")||32,Jl=de.getAttribute("height")||32,hl=document.createElementNS("http://www.w3.org/2000/svg","circle");hl.setAttribute("cx",parseFloat(Ie)+parseFloat(Pt)/2),hl.setAttribute("cy",parseFloat(Bt)+parseFloat(Jl)/2),hl.setAttribute("r",Math.min(parseFloat(Pt),parseFloat(Jl))/2-1),hl.setAttribute("fill",_e),hl.setAttribute("stroke","#fafafa"),hl.setAttribute("stroke-width","2"),de.parentNode.replaceChild(hl,de)}});const We=new XMLSerializer().serializeToString(A),pe=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(pe),Ee=new Image;return new Promise((de,je)=>{Ee.onload=async()=>{try{if(h.drawImage(Ee,0,a.height),za.value.forEach(ze=>{const Le=ze.x,_e=ze.y+a.height,Ie=(ze.width||32)/2,Bt=Jt(ze.seriesIndex);h.save(),h.beginPath(),h.arc(Le,_e,Ie-1,0,2*Math.PI),h.fillStyle=Bt,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),Fl.value){const ze=new Image,Le=()=>{const{width:Ie,height:Bt}=Yt.value,Pt=$l.value,Jl=P.value.left,hl=P.value.right,en=P.value.top,Wa=P.value.bottom,bs=P.value.width,ws=P.value.height;let va,fa;switch(Pt){case"center":va=Jl+(bs-Ie)/2,fa=en+a.height+(ws-Bt)/2;break;case"top-left":va=Jl+15,fa=en+a.height+10;break;case"top-right":va=hl-Ie-5,fa=en+a.height+10;break;case"bottom-left":va=Jl+15,fa=Wa+a.height-Bt-5;break;case"bottom-right":default:va=hl-Ie-5,fa=Wa+a.height-Bt-5;break}h.globalAlpha=fn.value,h.drawImage(ze,va,fa,Ie,Bt),h.globalAlpha=1,_e()},_e=()=>{p.toBlob(Ie=>{const Bt=URL.createObjectURL(Ie),Pt=document.createElement("a");Pt.href=Bt,Pt.download=Gl("png"),document.body.appendChild(Pt),Pt.click(),document.body.removeChild(Pt),URL.revokeObjectURL(Bt),URL.revokeObjectURL(be),Wl(t),Sn(),de()},"image/png")};ze.onload=Le,ze.onerror=_e,ze.src=Kt.value}else p.toBlob(ze=>{const Le=URL.createObjectURL(ze),_e=document.createElement("a");_e.href=Le,_e.download=Gl("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Le),URL.revokeObjectURL(be),Wl(t),Sn(),de()},"image/png")}catch(ze){URL.revokeObjectURL(be),Wl(t),je(ze)}},Ee.onerror=()=>{URL.revokeObjectURL(be),Wl(t),je(new Error("Failed to load SVG image"))},Ee.src=be})}catch(t){console.error("Error downloading PNG:",t)}},lo=()=>{try{let t="";if(Ke.value&&(t+=`# ${N("chart.csv.chartTitle")}: ${Ke.value}
93
- `),Je.value&&(t+=`# ${N("chart.csv.chartSubtitle")}: ${Je.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=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}
94
94
  `),t+=`# ${N("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,cl.value){t+=`Category,Segment,Value
97
- `,zn.value.forEach(q=>{q.segments.forEach(A=>{const z=String(q.label||"").replace(/"/g,'""'),T=String(A.label||"").replace(/"/g,'""');t+=`"${z}","${T}",${A.value}
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=Gl("csv"),document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(E),Sn();return}t+="Category",Z.series.forEach(h=>{const E=h.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
99
- `;const a=Math.max(...Z.series.map(h=>h.data?.length||0));for(let h=0;h<a;h++){let q='"'+(Z.categories[h]||N("chart.fallback.item",{number:h+1})).toString().replace(/"/g,'""')+'"';Z.series.forEach(A=>{const z=A.data&&A.data[h]!==void 0?A.data[h]:"";q+=","+z}),t+=q+`
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=Gl("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),Sn()}catch(t){console.error("Error downloading CSV:",t)}},la=t=>{if(typeof t.action=="function"){const a={series:Z.series,categories:Z.categories,markers:Zt.value},l={chartX:Qe.value.chartX,chartY:Qe.value.chartY,dataX:Qe.value.mouseDataX,dataY:Qe.value.mouseDataY,categoryIndex:clampedCategoryIndex||Qe.value.categoryIndex};t.action(a,l)}Sn()},Ha=()=>{Al(),Oe.value.show=!0,Oe.value.categoryIndex=Qe.value.categoryIndex,Oe.value.fromButton=!1,Sn()},na=()=>{Al(),Oe.value.show=!0,Oe.value.categoryIndex=0,Oe.value.fromButton=!0},wa=t=>{if(Qe.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(Qe.value.show=!1)}},xa=t=>{Qe.value.show&&!t.target.closest(".context-menu")&&(Qe.value.show=!1)},Ra=t=>{if(!Bl.value||!gt.value||cl.value)return;t.preventDefault(),t.stopPropagation(),Q.value.isZooming=!0,Ve.value.show=!1,Q.value.zoomTimeout&&clearTimeout(Q.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,p=t.clientY-l.top;if(r<P.value.left-50||r>P.value.right+50||p<P.value.top-50||p>P.value.bottom+100){Q.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,E=Math.max(Q.value.minScale,Math.min(Q.value.maxScale,Q.value.scale*h));if(E!==Q.value.scale){const{minX:S,maxX:q}=Vt.value,A=q-S||1,z=A/Q.value.scale,T=S-Q.value.offsetX/P.value.width*A,K=(r-P.value.left)/P.value.width,Be=T+K*z;Q.value.scale=E;const We=A/Q.value.scale,pe=Be-K*We;Q.value.offsetX=-(pe-S)/A*P.value.width,Q.value.scale<=1.01&&(Q.value.scale=1,Q.value.offsetX=0)}Q.value.zoomTimeout=setTimeout(()=>{Q.value.isZooming=!1,Q.value.zoomTimeout=null},300)},ia=t=>{if(!Bl.value||!gt.value||Q.value.scale<=1)return;Ve.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,Q.value.isDragging=!0,Q.value.lastMouseX=t.clientX,Q.value.lastMouseY=t.clientY,t.preventDefault()},Ea=()=>{Q.value.isDragging=!1},aa=()=>{!Bl.value||!gt.value||(Q.value.scale=1,Q.value.offsetX=0,Q.value.isDragging=!1,Q.value.zoomTimeout&&(clearTimeout(Q.value.zoomTimeout),Q.value.zoomTimeout=null),Q.value.isZooming=!1)},no=()=>!Bl.value||!ye.value||!gt.value?"default":Q.value.isDragging?"grabbing":Q.value.scale>1?"grab":"dss-crosshair",ca=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*el.value,q=p.y+(h.y-r.y)/6*el.value,A=h.x-(E.x-p.x)/6*el.value,z=h.y-(E.y-p.y)/6*el.value;a+=` C ${S} ${q} ${A} ${z} ${h.x} ${h.y}`}return a},Nl=e.computed(()=>{const a=U.value?.chart?.padding,l=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let h=p+(Tt.value?30:0)+60;if(il.value){const T={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??T.left,top:r.top??T.top,right:r.right??T.right,bottom:r.bottom??T.bottom}:T}if(Cl.value){const T=!ve.value,K=Vl.value,Be=K?wn.value+on.value+Math.max(24,gn.value+16):0,We=T?12:p;let pe=0;Ke.value&&(pe+=T?8:15),Je.value&&(pe+=T?6:10);const be=Me();let Ee=We+(T?4:16)+(K?Be:0),de=We+(K?Be:0);ve.value&&Re.value==="left"?Ee+=be.legendWidth||150:ve.value&&Re.value==="right"&&(de+=be.legendWidth||150);const ze=xe.value==="semi-radial"?K?Be:8:K?Be:T?8:p+80,Le=K?14:0,_e=We+pe+Le,Ie={left:Ee,top:_e,right:de,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Ie.left,top:r.top??Ie.top,right:r.right??Ie.right,bottom:r.bottom??Ie.bottom}:Ie}let E=0;Ke.value&&(E+=15),Je.value&&(E+=10);const S=Me();let q=p+16+(at.value?30:0),A=p+(ct.value?30:0);ve.value&&Re.value==="left"?q+=S.legendWidth||150:ve.value&&Re.value==="right"&&(A+=S.legendWidth||150),In.value&&(A+=44),xe.value==="stepbar"&&(h=tl.value+8);const z={left:q,top:p+E,right:A,bottom:h};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??z.left,top:r.top??z.top,right:r.right??z.right,bottom:r.bottom??z.bottom}:z}),P=e.computed(()=>({left:Nl.value.left,top:Nl.value.top,right:$e.value-Nl.value.right,bottom:it.value-Nl.value.bottom,width:$e.value-(Nl.value.left+Nl.value.right),height:it.value-(Nl.value.top+Nl.value.bottom)})),Bl=e.computed(()=>["line","area","bar","stepbar"].includes(xe.value)||Lt.value),ql=e.computed(()=>Lt.value),Yn=e.computed(()=>xe.value==="mini-radial"),Cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(xe.value)),il=e.computed(()=>xe.value==="spider"),Ft=e.computed(()=>xe.value==="bubble"),cl=e.computed(()=>xe.value==="stepbar");e.watch([R,cl,()=>Z.series],()=>{e.nextTick(rt)},{deep:!0});const ul=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(xe.value==="bar"||ql.value)),Bn=t=>{const{minY:a,maxY:l}=Vt.value,r=l-a||1;return P.value.left+(t-a)/r*P.value.width},Rn=t=>{const{maxX:a}=Vt.value,l=a+1,p=P.value.height/l;return P.value.top+(t+.5)*p},It=e.computed(()=>Cl.value?Nl.value.left+($e.value-Nl.value.left-Nl.value.right)/2:$e.value/2),Mt=e.computed(()=>il.value?it.value/2-40:Cl.value?Nl.value.top+(it.value-Nl.value.top-Nl.value.bottom)/2:it.value/2),nt=e.computed(()=>{if(il.value){const t=P.value.width-80,a=P.value.height-80;return Math.min(t,a)/2}return Math.min(P.value.width,P.value.height)/2}),pl=e.computed(()=>{const t=U.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof a=="number"&&a>=0&&a<=1?a:.45;return nt.value*l}),Fn=e.computed(()=>{const t=U.value,a=typeof Z.innerSize=="number"?Z.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Cl.value||il.value)?1:1+a/100}),ua=e.computed(()=>{const t=Fn.value;if(t===1||t<=0)return;const a=It.value,l=Mt.value;return`translate(${a}, ${l}) scale(${t}) translate(${-a}, ${-l})`}),oa=e.ref(0),da=e.computed(()=>`semi-radial-fill-clip-${Z.chartId}`),_n=e.computed(()=>xe.value==="semi-radial"),o=e.computed(()=>_n.value&&wl.value&&!On.value),n=e.computed(()=>_n.value&&wl.value&&!On.value&&mn.value==="fill"),s=e.computed(()=>{const t=o.value?oa.value:1,a=It.value,l=Mt.value,r=pl.value,p=nt.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),q=l+p*Math.sin(h),A=a+p*Math.cos(E),z=l+p*Math.sin(E),T=a+r*Math.cos(E),K=l+r*Math.sin(E),Be=a+r*Math.cos(h),We=l+r*Math.sin(h),pe=t>.5?1:0;return`M ${a} ${l} L ${S} ${q} A ${p} ${p} 0 ${pe} 1 ${A} ${z} L ${T} ${K} A ${r} ${r} 0 ${pe} 1 ${Be} ${We} Z`}),i=e.computed(()=>{if(!(!_n.value||!o.value)&&!n.value)return`url(#${da.value})`}),c=t=>{if(!(!n.value||t!==0))return`url(#${da.value})`},m=e.ref(0),u=e.computed(()=>`radial-reveal-clip-${Z.chartId}`),v=e.computed(()=>xe.value==="radial"),y=e.computed(()=>{const t=v.value?m.value:1,a=It.value,l=Mt.value,r=Math.max(nt.value*1.5,$e.value,it.value);if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;if(t>=1){const T=a-r,K=a+r;return`M ${T} ${l} A ${r} ${r} 0 0 1 ${K} ${l} A ${r} ${r} 0 0 1 ${T} ${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),q=a+r*Math.cos(h),A=l+r*Math.sin(h),z=t>=.5?1:0;return`M ${a} ${l} L ${E} ${S} A ${r} ${r} 0 ${z} 1 ${q} ${A} Z`}),w=e.computed(()=>{if(i.value)return i.value;if(v.value)return`url(#${u.value})`});let I=null;const O=()=>{if(!o.value)return;oa.value=0;const t=zl.value,a=performance.now(),l=r=>{const p=r-a,h=Math.min(1,p/t);oa.value=vo(ln.value,h),h<1&&(I=requestAnimationFrame(l))};I=requestAnimationFrame(l)},D=e.computed(()=>U.value?.bubbles?.minSize||8),ce=e.computed(()=>U.value?.bubbles?.maxSize||50),le=e.computed(()=>U.value?.bubbles?.opacity||.7),Pe=(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)},De=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},vt=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Ot=e.computed(()=>Z.series),zt=e.computed(()=>Z.series.filter((t,a)=>!_.value.has(a))),Gt=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},dl=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,At=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,Qt=e.computed(()=>{const a=U.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}}),rn=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?Qt.value.bubbleSize:ie.value,kn=(t,a)=>At(t)&&Qt.value.usePrimaryColor?Jt(0):Jt(a),Il=(t,a)=>il.value&&At(t)?kn(t,a):Jt(a),Sa=e.computed(()=>zt.value.filter(t=>Gt(t)==="primary")),Va=e.computed(()=>zt.value.filter(t=>Gt(t)==="secondary")),In=e.computed(()=>!ul.value&&!!pt.value&&Va.value.length>0),Na=(t,a=0)=>{const l=Number(t);return Number.isFinite(l)?l:a},yo=(t,a,l)=>{if(!Array.isArray(t))return[];const r=t.map((p,h)=>{const E=p&&typeof p=="object"&&!Array.isArray(p),S=Na(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||Jt(h):Jt(l),marker:E?p.marker:null,isRemainder:!1}}).filter(Boolean);return ae.value==="asc"?r.sort((p,h)=>p.value-h.value):ae.value==="desc"?r.sort((p,h)=>h.value-p.value):r},Fa=(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:Jt(r)}],E=yo(h,l,r),S=E.reduce((T,K)=>T+K.value,0),q=Na(p?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,oe.value),A=Math.max(q,S,1);Ue.value&&A>S&&E.push({key:`${r}-${a}-remainder`,label:bt.value,value:A-S,color:ot.value,marker:null,isRemainder:!0});const z=E.filter(T=>!T.isRemainder).reduce((T,K)=>!T||K.value>T.value?K:T,null);return{key:`${r}-${a}`,label:p?t.label||t.name||Z.categories?.[a]||N("chart.fallback.item",{number:a+1}):Z.categories?.[a]||N("chart.fallback.item",{number:a+1}),axisLabel:p?t.xLabel??t.label??t.name??Z.categories?.[a]??N("chart.fallback.item",{number:a+1}):Z.categories?.[a]||N("chart.fallback.item",{number:a+1}),yLabel:p?t.yLabel??null:null,totalValue:A,usedValue:S,segments:E,maxSegmentKey:z?.key||null,seriesName:l?.name||"",seriesIndex:r}},zn=e.computed(()=>{if(!cl.value)return[];const t=[];return Ot.value.forEach((a,l)=>{_.value.has(l)||!Array.isArray(a?.data)||a.data.forEach(r=>{const p=Fa(r,t.length,a,l);p.segments.length>0&&t.push(p)})}),t}),Dl="auto",cn=(t,a,l,r=0,p=100)=>{let h=1/0,E=-1/0;if(t.forEach(A=>{A?.data?.length&&A.data.forEach(z=>{typeof z=="number"&&Number.isFinite(z)&&(h=Math.min(h,z),E=Math.max(E,z))})}),h===1/0)return{minY:r,maxY:p};let S;if(a===Dl){const A=E-h,z=A>0?A*.1:1;S=Math.max(0,h-z)}else if(typeof a=="number")S=a;else{const A=E-h,z=A>0?A*.1:1;S=Math.max(0,h-z)}let q;if(l===Dl){const A=E-h,z=A>0?A*.1:2;q=E+z}else if(typeof l=="number")q=l;else{const A=E-h,z=A>0?A*.1:2;q=E+z}return{minY:S,maxY:q}},Vt=e.computed(()=>{if(Ft.value)return Wo();if(cl.value)return Ql();if(!zt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;zt.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),Z.categories.length>0&&(t=Math.max(t,Z.categories.length-1));const a=cn(Sa.value.length?Sa.value:zt.value,Ut.value,ht.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Ql=()=>{const t=zn.value,a=t.reduce((h,E)=>Math.max(h,E.totalValue),oe.value),l=typeof Ut.value=="number"?Ut.value:0,r=typeof ht.value=="number"?ht.value:a,p=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:p}},ao=e.computed(()=>In.value?cn(Va.value,Rt.value,me.value,Vt.value.minY,Vt.value.maxY):{minY:Vt.value.minY,maxY:Vt.value.maxY}),Wo=()=>{if(!zt.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(zt.value.forEach((Be,We)=>{Be?.data?.length&&Be.data.forEach((pe,be)=>{let Ee,de,je;if(typeof pe=="object"&&pe!==null&&!Array.isArray(pe))Ee=typeof pe.x=="number"?pe.x:be,de=typeof pe.y=="number"?pe.y:0,je=typeof pe.size=="number"?pe.size:20;else if(Array.isArray(pe)&&pe.length>=3)Ee=typeof pe[0]=="number"?pe[0]:be,de=typeof pe[1]=="number"?pe[1]:0,je=typeof pe[2]=="number"?pe[2]:20;else if(typeof pe=="number")Ee=be,de=pe,je=Pe(We,be);else return;isFinite(Ee)&&isFinite(de)&&isFinite(je)&&(t=Math.min(t,Ee),a=Math.max(a,Ee),l=Math.min(l,de),r=Math.max(r,de),p=Math.min(p,je),h=Math.max(h,je),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,Z.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const S=a-t,q=r-l;let A,z,T,K;return F.value!==null?A=F.value:A=t-S*.1,Y.value!==null?z=Y.value:z=a+S*.1,Ut.value!==null&&typeof Ut.value=="number"?T=Ut.value:T=Math.max(0,l-q*.1),ht.value!==null&&typeof ht.value=="number"?K=ht.value:K=r+q*.1,{minX:A,maxX:z,minY:T,maxY:K,minSize:p,maxSize:h}},fl=t=>{if(Ft.value){const{minX:S,maxX:q}=Vt.value,A=q-S||1;return P.value.left+(t-S)/A*P.value.width}const{minX:a,maxX:l}=Vt.value,r=l-a;if(l===0||r===0)return P.value.left+P.value.width/2;const p=r/Q.value.scale,h=a-Q.value.offsetX/P.value.width*r,E=(t-h)/p;return P.value.left+E*P.value.width},Xn=t=>{const{minY:a,maxY:l}=Vt.value,r=l-a||1;return P.value.bottom-(t-a)/r*P.value.height},ko=t=>{const{minY:a,maxY:l}=ao.value,r=l-a||1;return P.value.bottom-(t-a)/r*P.value.height},Cn=(t,a)=>In.value&&Gt(t)==="secondary"?ko(a):Xn(a),qo=t=>{if(!Ft.value)return ie.value||4;const{maxSize:a}=Vt.value,l=Math.max(1,a),r=Math.min(1,Math.max(0,t/l));return D.value+r*(ce.value-D.value)},ma=(t,a=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);ma.canvas||(ma.canvas=document.createElement("canvas"));const r=ma.canvas.getContext("2d");return r?(r.font=`${a}px ${l}`,r.measureText(t).width):t.length*(a*.62)},Co=(t,a,l=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||ma(t,l)<=a)return t;const r="..";if(ma(r,l)>=a)return r;let h=t.length;for(;h>0;){const E=`${t.slice(0,h)}${r}`;if(ma(E,l)<=a)return E;h-=1}return r},Zo=e.computed(()=>so.value.map(t=>({y:t.y}))),bo=e.computed(()=>!cl.value||!_t.value?[]:so.value.map(t=>({y:t.y}))),oo=e.computed(()=>{if(Ft.value)return Uo();if(cl.value)return[];if(xe.value==="bar"){if(ul.value){const _e=[],{minY:Ie,maxY:Bt}=Vt.value,Pt=5,Jl=Bt-Ie||1;for(let hl=0;hl<=Pt;hl++){const en=Ie+Jl*(hl/Pt),Wa=Bn(en);_e.push({x:Wa,y:P.value.bottom+20,text:xl(Math.round(en))})}return _e}const be=[],{maxX:Ee}=Vt.value,de=Ee+1,je=5,Le=(P.value.width-je*2)/de;for(let _e=0;_e<=Ee;_e++){const Ie=P.value.left+je+(_e+.5)*Le;be.push({x:Ie,y:P.value.bottom+20,text:Co(Z.categories[_e]||N("chart.fallback.item",{number:_e+1}),Math.max(Le-8,24))})}return be}const t=[],{minX:a,maxX:l}=Vt.value,r=F.value!==null?F.value:a,p=Y.value!==null?Y.value:l,h=p-r||1,E=h/Q.value.scale,S=r-Q.value.offsetX/P.value.width*h,q=S+E,A=Math.max(0,Math.floor(S-2)),z=Math.min(p,Math.ceil(q+2)),T=z-A,K=P.value.width,We=Math.floor(K/60);let pe=1;T>We&&(pe=Math.ceil(T/We));for(let be=A;be<=z;be+=pe)if(be>=0&&be<=p){const Ee=fl(be);Ee>=P.value.left-100&&Ee<=P.value.right+100&&t.push({x:Ee,y:P.value.bottom+20,text:Z.categories[be]||`Item ${be+1}`})}return t}),Uo=()=>{const t=[],{minX:a,maxX:l}=Vt.value,r=l-a||1,p=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let h=0;h<=p;h++){const E=a+r*h/p,S=fl(E);if(S>=P.value.left-10&&S<=P.value.right+10){const q=Math.round(E),A=Z.categories?.[q];t.push({x:S,y:P.value.bottom+20,text:A||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},so=e.computed(()=>{if(ul.value){const p=[],{maxX:h}=Vt.value;for(let E=0;E<=h;E++)p.push({x:P.value.left-10,y:Rn(E),text:Co(Z.categories[E]||`Item ${E+1}`,Math.max(P.value.left-28,40))});return p}const t=[],{minY:a,maxY:l}=Vt.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:P.value.left-10,y:Xn(h),text:xl(E)})}return t}),Yo=e.computed(()=>{if(!In.value||ul.value)return[];const t=[],{minY:a,maxY:l}=ao.value,r=5;for(let p=0;p<=r;p++){const h=a+(l-a)*(p/r),E=Math.round(h);t.push({x:P.value.right+10,y:ko(h),text:xl(E)})}return t}),Jt=t=>{const a=V.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]},Xo=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 q=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(q){let A=q[1];A.length===3&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),l=parseInt(A.slice(0,2),16)/255,r=parseInt(A.slice(2,4),16)/255,p=parseInt(A.slice(4,6),16)/255}else if(typeof document<"u"){const A=document.createElement("span");A.style.color=a,A.style.display="none",document.body.appendChild(A);const z=getComputedStyle(A).color;document.body.removeChild(A);const T=z.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(T)l=Number(T[1])/255,r=Number(T[2])/255,p=Number(T[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},ro=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))),q=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[E,S,q].map(A=>A.toString(16).padStart(2,"0")).join("")}`}return a},io=(t,a)=>{const r=U.value?.stroke?.color;return r==null?ro(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??ro(a):ro(a)},co=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},wo=e.computed(()=>xe.value==="line"||ql.value?(ql.value?Z.series.filter(a=>(a.type||xe.value)==="line"):Ot.value).map((a,l)=>{const r=Z.series.findIndex(T=>T===a),p=[];let h=[];a.data.forEach((T,K)=>{T==null?h.length>0&&(p.push([...h]),h=[]):h.push({x:ul.value?Bn(T):fl(K),y:ul.value?Rn(K):Cn(a,T),index:K})}),h.length>0&&p.push(h);let E="";p.forEach(T=>{if(T.length>0){let K="";xt.value?K=ca(T):K=`M ${T[0].x} ${T[0].y}`+T.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),E+=(E?" ":"")+K}});const S=p.reduce((T,K)=>T+co(K),0),q=_.value.has(r),A=$.value===r,z=$.value!==null&&$.value!==r;return{path:E,color:Jt(r),strokeDasharray:dl(a),pathLength:S,seriesIndex:r,animationDelay:l*ll.value,isHighlighted:A,isDimmed:z,isHidden:q}}):[]),xo=e.computed(()=>{if(!(xe.value==="line"||ql.value))return[];const t=ql.value?Z.series.filter(l=>(l.type||xe.value)==="line"):Ot.value,a=[];return t.forEach((l,r)=>{const p=Z.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,q=0;for(let A=h+1;A<l.data.length;A++){const z=l.data[A];if(z==null)q++;else{S=A;break}}if(q>0&&S!==-1){const A=l.data[S],z=ul.value?Bn(E):fl(h),T=ul.value?Rn(h):Cn(l,E),K=ul.value?Bn(A):fl(S),Be=ul.value?Rn(S):Cn(l,A),We=_.value.has(p),pe=$.value===p,be=$.value!==null&&$.value!==p;a.push({path:`M ${z} ${T} L ${K} ${Be}`,color:Jt(p),seriesIndex:p,animationDelay:r*ll.value,isHighlighted:pe,isDimmed:be,isHidden:We,gapSize:q}),h=S-1}}}}),a}),jo=e.computed(()=>xe.value==="line"||ql.value?!wl.value||On.value||Ht.value.hasAnimated?[]:(ql.value?Z.series.filter(a=>(a.type||xe.value)==="line"):Ot.value).map((a,l)=>{const r=Z.series.findIndex(q=>q===a);let p="",h=null;a.data.forEach((q,A)=>{if(q!=null){const z={x:ul.value?Bn(q):fl(A),y:ul.value?Rn(A):Cn(a,q)};h===null?p+=`M ${z.x} ${z.y}`:p+=` L ${z.x} ${z.y}`,h=z}else if(h!==null){const z=a.data.findIndex((T,K)=>K>A&&T!==null&&T!==void 0);if(z!==-1){const T={x:ul.value?Bn(a.data[z]):fl(z),y:ul.value?Rn(z):Cn(a,a.data[z])};p+=` L ${T.x} ${T.y}`,h=T}}});const E=a.data.map((q,A)=>q==null?null:{x:ul.value?Bn(q):fl(A),y:ul.value?Rn(A):Cn(a,q)}).filter(q=>q!==null),S=co(E);return{path:p,pathLength:S,color:Jt(r),strokeDasharray:dl(a),animationDelay:l*ll.value,seriesIndex:r}}):[]),Ko=e.computed(()=>{if(xe.value!=="line")return[];const t=[];return Ot.value.forEach((a,l)=>{const r=$.value===l,p=$.value!==null&&$.value!==l,h=_.value.has(l);a.data.forEach((E,S)=>{E!=null&&t.push({x:fl(S),y:Cn(a,E),color:Jt(l),value:E,label:Z.categories[S]||S.toString(),seriesName:a.name,categoryIndex:S,dataIndex:S,animationDelay:(l*a.data.length+S)*(ll.value/8),isHighlighted:r,isDimmed:p,isHidden:h})})}),t}),Go=e.computed(()=>{if(!ql.value)return[];const t=[];return Z.series.filter(l=>(l.type||xe.value)==="line").forEach((l,r)=>{const p=Z.series.findIndex(q=>q===l),h=$.value===p,E=$.value!==null&&$.value!==p,S=_.value.has(p);l.data.forEach((q,A)=>{q!=null&&t.push({x:fl(A),y:Cn(l,q),color:Jt(p),value:q,label:Z.categories[A]||A.toString(),seriesName:l.name,categoryIndex:A,dataIndex:A,animationDelay:(r*l.data.length+A)*(ll.value/8),isHighlighted:h,isDimmed:E,isHidden:S})})}),t}),Ia=e.computed(()=>{if(!Ft.value)return[];const t=[];return Ot.value.forEach((a,l)=>{if(!a?.data?.length)return;const r=$.value,p=r!==null&&r===l,h=r!==null&&r!==l,E=_.value.has(l);a.data.forEach((S,q)=>{let A,z,T,K,Be;if(typeof S=="object"&&S!==null&&!Array.isArray(S))A=typeof S.x=="number"?S.x:q,z=typeof S.y=="number"?S.y:0,T=typeof S.size=="number"?S.size:20,K=S.label||Z.categories?.[q]||`Point ${q+1}`,Be=S.image||S.imageUrl;else if(Array.isArray(S)&&S.length>=3)A=typeof S[0]=="number"?S[0]:q,z=typeof S[1]=="number"?S[1]:0,T=typeof S[2]=="number"?S[2]:20,K=S[3]||Z.categories?.[q]||`Point ${q+1}`,Be=S[4];else if(typeof S=="number")A=q,z=S,T=Pe(l,q),K=Z.categories?.[q]||`Point ${q+1}`;else return;!isFinite(A)||!isFinite(z)||!isFinite(T)||t.push({x:fl(A),y:Xn(z),radius:qo(T),originalX:A,originalY:z,originalSize:T,color:Jt(l),seriesName:a.name||`Series ${l+1}`,label:K,imageUrl:Be,seriesIndex:l,dataIndex:q,categoryIndex:Math.round(A),isHighlighted:p,isDimmed:h,isHidden:E,opacity:le.value})})}),t}),uo=e.computed(()=>xe.value!=="area"?[]:Ot.value.map((t,a)=>{const l=[];let r=[];if(t.data.forEach((T,K)=>{T==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:fl(K),y:Cn(t,T),index:K})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Jt(a),isHidden:_.value.has(a)};const p=P.value.bottom+1;let h="",E="";l.forEach((T,K)=>{if(T.length===0)return;let Be=`M ${T[0].x} ${T[0].y}`;xt.value&&T.length>1?Be=ca(T):T.slice(1).forEach(pe=>{Be+=` L ${pe.x} ${pe.y}`}),h+=(h?" ":"")+Be;let We=`M ${T[0].x} ${p}`;if(We+=` L ${T[0].x} ${T[0].y}`,xt.value&&T.length>1){const pe=ca(T),be=pe.substring(pe.indexOf("C")||pe.indexOf("Q")||pe.indexOf("L"));be?We+=" "+be:T.slice(1).forEach(Ee=>{We+=` L ${Ee.x} ${Ee.y}`})}else T.slice(1).forEach(pe=>{We+=` L ${pe.x} ${pe.y}`});We+=` L ${T[T.length-1].x} ${p} Z`,E+=(E?" ":"")+We});const S=$.value===a,q=$.value!==null&&$.value!==a,A=_.value.has(a),z=l.reduce((T,K)=>T+co(K),0);return{linePath:h,areaPath:E,color:Jt(a),pathLength:z,isHighlighted:S,isDimmed:q,isHidden:A}})),Eo=e.computed(()=>{if(!(["bar"].includes(xe.value)||ql.value))return[];const t=[],{maxX:a}=Vt.value,l=ql.value?Z.series.filter(p=>(p.type||xe.value)==="bar"):Ot.value,r=l.length;if(ul.value){const p=a+1,E=P.value.height/p,S=E*(2/3),q=Math.min(4,S/r*.15),A=S-(r-1)*q,z=Math.max(4,A/r);l.forEach((T,K)=>{const Be=Z.series.findIndex(Ee=>Ee===T),We=$.value===Be,pe=$.value!==null&&$.value!==Be,be=_.value.has(Be);T.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=P.value.top+(de+.5)*E-S/2+K*(z+q),_e=P.value.left,Ie=Math.abs(Bn(Ee)-P.value.left);let Bt="";if(xt.value&&Ie>0){const Pt=Math.min(H.value,z/2,Ie/2);Bt=[`M ${_e} ${Le}`,`L ${_e+Ie-Pt} ${Le}`,`Q ${_e+Ie} ${Le} ${_e+Ie} ${Le+Pt}`,`L ${_e+Ie} ${Le+z-Pt}`,`Q ${_e+Ie} ${Le+z} ${_e+Ie-Pt} ${Le+z}`,`L ${_e} ${Le+z}`,"Z"].join(" ")}t.push({x:_e,y:Le,width:Ie,height:z,color:Jt(r===1?de:Be),value:Ee,label:Z.categories[de]||de.toString(),seriesName:T.name,animationDelay:(K*l.length+de)*(ll.value/4),isHighlighted:We,isDimmed:pe,isHidden:be,barPath:Bt,isSmooth:xt.value&&Ie>0})})})}else{const p=a+1,E=P.value.width/p,S=E*.8,q=S/r,A=q*.05,z=q-A;l.forEach((T,K)=>{const Be=Z.series.findIndex(Ee=>Ee===T),We=$.value===Be,pe=$.value!==null&&$.value!==Be,be=_.value.has(Be);T.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=P.value.left+(de+.5)*E-S/2+K*q+A/2,_e=Xn(Math.max(0,Ee)),Ie=Math.abs(Xn(0)-Xn(Ee));let Bt="";if(xt.value&&Ie>0){const Pt=Math.min(H.value,z/2,Ie/2);Bt=[`M ${Le} ${_e+Ie}`,`L ${Le} ${_e+Pt}`,`Q ${Le} ${_e} ${Le+Pt} ${_e}`,`L ${Le+z-Pt} ${_e}`,`Q ${Le+z} ${_e} ${Le+z} ${_e+Pt}`,`L ${Le+z} ${_e+Ie}`,"Z"].join(" ")}t.push({x:Le,y:_e,width:z,height:Ie,color:Jt(r===1?de:Be),value:Ee,label:Z.categories[de]||de.toString(),seriesName:T.name,animationDelay:(K*l.length+de)*(ll.value/4),isHighlighted:We,isDimmed:pe,isHidden:be,barPath:Bt,isSmooth:xt.value&&Ie>0})})})}return t}),Pn=e.computed(()=>{if(!Cl.value)return[];const t=Ot.value.map((E,S)=>({series:E,originalIndex:S})).filter(({originalIndex:E})=>!_.value.has(E));if(t.length===0)return[];let a=xe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=xe.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(E,S,q,A,z,T)=>{const K=E+(S-E)/2,Be=S-E,We=It.value+Math.cos(E)*pl.value,pe=Mt.value+Math.sin(E)*pl.value,be=It.value+Math.cos(S)*pl.value,Ee=Mt.value+Math.sin(S)*pl.value,de=It.value+Math.cos(S)*nt.value,je=Mt.value+Math.sin(S)*nt.value,ze=It.value+Math.cos(E)*nt.value,Le=Mt.value+Math.sin(E)*nt.value,_e=Be>Math.PI?1:0,Ie=[`M ${We} ${pe}`,`A ${pl.value} ${pl.value} 0 ${_e} 1 ${be} ${Ee}`,`L ${de} ${je}`,`A ${nt.value} ${nt.value} 0 ${_e} 0 ${ze} ${Le}`,"Z"].join(" "),Bt=T||Jt(q);return{path:Ie,color:Bt,strokeWidth:te.value,strokeColor:io(r.length,Bt),value:z,seriesName:A,opacity:.8,isHighlighted:$.value===q,isDimmed:$.value!==null&&$.value!==q,isHidden:!1,startAngle:E,endAngle:S,midAngle:K}};if(Yn.value){const{series:E,originalIndex:S}=t[0],q=Number(E?.data?.[0]??0),A=Number.isFinite(q)?Math.min(Math.max(q,0),100):0,z=U.value,T=Math.min(Math.max(Number(z?.miniRadial?.minVisiblePercent??1),0),100),Be=(A<=0?T:A)/100*l,We=Number(z?.miniRadial?.thresholds?.low??33),pe=Number(z?.miniRadial?.thresholds?.medium??66),be=z?.miniRadial?.colors?.low||"#E53E3E",Ee=z?.miniRadial?.colors?.medium||"#ED8936",de=z?.miniRadial?.colors?.high||"#38A169",je=A<=We?be:A<=pe?Ee:de,ze=z?.miniRadial?.trackColor||"#E5E7EB",Le=E?.name||"Score";return r.push(p(a,a+l-.001,S+1,"Track",100,ze)),r.push(p(a,a+Be,S,Le,A,je)),r}if(t.length===1){const{series:E,originalIndex:S}=t[0],q=E.data[0]||0,A=a,z=a+l-.001,T=A+l/2,K=It.value+Math.cos(A)*pl.value,Be=Mt.value+Math.sin(A)*pl.value,We=It.value+Math.cos(z)*pl.value,pe=Mt.value+Math.sin(z)*pl.value,be=It.value+Math.cos(z)*nt.value,Ee=Mt.value+Math.sin(z)*nt.value,de=It.value+Math.cos(A)*nt.value,je=Mt.value+Math.sin(A)*nt.value,ze=1,Le=[`M ${K} ${Be}`,`A ${pl.value} ${pl.value} 0 ${ze} 1 ${We} ${pe}`,`L ${be} ${Ee}`,`A ${nt.value} ${nt.value} 0 ${ze} 0 ${de} ${je}`,"Z"].join(" "),_e=Jt(S);return r.push({path:Le,color:_e,strokeWidth:te.value,strokeColor:io(0,_e),value:q,seriesName:E.name,opacity:.8,isHighlighted:$.value===S,isDimmed:!1,isHidden:!1,startAngle:A,endAngle:z,midAngle:T}),r}if(n.value&&t.length===2){const E=t[0],S=t[1],q=Math.min(100,Math.max(0,E.series.data[0]||0)),A=q/100*l;return r.push(p(a,a+A,E.originalIndex,E.series.name,q)),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 q=E.data[0]||0,A=q/h*l,z=a,T=a+A,K=z+A/2,Be=It.value+Math.cos(z)*pl.value,We=Mt.value+Math.sin(z)*pl.value,pe=It.value+Math.cos(T)*pl.value,be=Mt.value+Math.sin(T)*pl.value,Ee=It.value+Math.cos(T)*nt.value,de=Mt.value+Math.sin(T)*nt.value,je=It.value+Math.cos(z)*nt.value,ze=Mt.value+Math.sin(z)*nt.value,Le=A>Math.PI?1:0,_e=[`M ${Be} ${We}`,`A ${pl.value} ${pl.value} 0 ${Le} 1 ${pe} ${be}`,`L ${Ee} ${de}`,`A ${nt.value} ${nt.value} 0 ${Le} 0 ${je} ${ze}`,"Z"].join(" "),Ie=Jt(S);r.push({path:_e,color:Ie,strokeWidth:te.value,strokeColor:io(r.length,Ie),value:q,seriesName:E.name,opacity:.8,isHighlighted:$.value===S,isDimmed:$.value!==null&&$.value!==S,isHidden:!1,startAngle:z,endAngle:T,midAngle:K}),a=T}),r)}),Qo=e.computed(()=>{const t=Pn.value;return n.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,l)=>({segment:a,originalIndex:l}))}),Jo=e.computed(()=>{if(!Vl.value||!Cl.value)return[];const t=gn.value,a=wn.value,l=on.value,r=yl.value,p=15,h=t*1.3,E=.55,S=(T,K)=>{const Be=It.value+Math.cos(T.midAngle)*nt.value,We=Mt.value+Math.sin(T.midAngle)*nt.value,pe=It.value+Math.cos(T.midAngle)*(nt.value+a),be=Mt.value+Math.sin(T.midAngle)*(nt.value+a),de=pe+l*(K?1:-1),je=K?pe+p:pe-p,ze=be-r,Le=`${T.seriesName}: ${xl(T.value)}`,_e=Le.length*t*E;return{pointerStartX:Be,pointerStartY:We,pointerEndX:pe,pointerEndY:be,horizontalEndX:de,horizontalEndY:be,textX:je,textY:ze,text:Le,textWidth:_e,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(pe-Be,be-We),horizontalLineLength:Math.hypot(de-pe,0)}},q=(T,K)=>{const Be=Math.abs(T.textY-K.textY)<h,We=T.isRightSide?T.textX:T.textX-T.textWidth,pe=T.isRightSide?T.textX+T.textWidth:T.textX,be=K.isRightSide?K.textX:K.textX-K.textWidth,Ee=K.isRightSide?K.textX+K.textWidth:K.textX,de=We<Ee&&be<pe;return Be&&de},A=Pn.value.filter(T=>!T.isHidden),z=[];for(let T=0;T<A.length;T++){const K=A[T];let Be=Math.cos(K.midAngle)>=0;if(T>0){const pe=z[T-1],be=S(K,Be);q(pe,be)&&(Be=!Be)}const We=S(K,Be);z.push({...We,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return z}),es=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||le.value||.7;return $.value===null||$.value===void 0?a:$.value!==null?t.seriesIndex===$.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},ts=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return $.value!==null?t.seriesIndex===$.value?Math.min(1,a+.1):a*.7:a},So=(t,a)=>{if(t)try{if($.value===t.seriesIndex?$.value=null:$.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:Z.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},ls=(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(" ")},Vo=(t,a)=>{if(!t||(a.stopPropagation(),Pa.value=!0,$.value=t.seriesIndex,Ve.value.show=!1,!Ct.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>$e.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 q=d.value,A=f.value,z=q.map(T=>{const K=A[T]||T,Be=No(T,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${K}: ${Be}`,color:t.color}:null}).filter(Boolean);ge.value={show:!0,x:p,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:z,categoryIndex:void 0,spiderAreas:[]}},No=(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=b.value[t];if(typeof r=="function")return r(l,a);if(typeof l=="number"){const p=l.toFixed(1);return kt.value?p+kt.value:p}return l?.toString()||""},ns=()=>{if(!Ft.value||!Ve.value.data||Ve.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Ve.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"},Bo=(t,a)=>{t&&(Pa.value=!1,$.value=null,ge.value.show=!1,ge.value.bubbleData=[])},as=(t,a)=>{const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),p=ra(t.categoryIndex),h=t.description||t.comment||"";let E=a.clientX-r.left+15,S=a.clientY-r.top-10;const q=200,A=h?80:50;E+q>$e.value&&(E=a.clientX-r.left-q-15),S+A>it.value&&(S=a.clientY-r.top-A-10),E<0&&(E=10),S<0&&(S=10),st.value={show:!0,x:E,y:S,categoryValue:p,description:h}},os=()=>{st.value.show=!1},pa=e.computed(()=>Z.categories.length||Math.max(...zt.value.map(t=>t.data.length))),ss=e.computed(()=>{let t=0;return zt.value.forEach(a=>{a.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),_o=e.computed(()=>{const t=[],a=pa.value;for(let l=0;l<a;l++){const r=l*2*Math.PI/a-Math.PI/2,p=It.value+Math.cos(r)*nt.value,h=Mt.value+Math.sin(r)*nt.value;t.push({x:p,y:h,angle:r,index:l})}return t}),rs=e.computed(()=>{const t=[],a=pa.value;return _o.value.forEach((l,r)=>{const p=nt.value+15,h=r*2*Math.PI/a-Math.PI/2,E=It.value+Math.cos(h)*p,S=Mt.value+Math.sin(h)*p+5;let q="middle",A="middle";Math.abs(Math.cos(h))>.5&&(q=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(A=Math.sin(h)>0?"hanging":"auto"),t.push({x:E,y:S,text:Z.categories[r]||`Axis ${r+1}`,anchor:q,baseline:A})}),t}),is=e.ref(new Set),cs=(t,a,l)=>{const r=`current-${l}`,p=is.value.has(r),h=a.fillOpacity??Rl.value;return!p&&$.value===null?h:a.isHighlighted||p?a.isComparison?h:h+.15:a.isDimmed?h*.3:h},Mo=e.computed(()=>{if(!il.value)return[];const t=[],a=pa.value;return Ot.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const h=At(r.series)?0:1,E=At(p.series)?0:1;return h-E}).forEach(({series:r,seriesIndex:p})=>{const h=At(r),E=[],S=[],q=[],A=$.value===p,z=$.value!==null&&$.value!==p,T=_.value.has(p);for(let K=0;K<a;K++){const Be=r.data[K]||0,pe=Be/ss.value*nt.value,be=K*2*Math.PI/a-Math.PI/2,Ee=It.value+Math.cos(be)*pe,de=Mt.value+Math.sin(be)*pe;E.push(`${Ee},${de}`),S.push({x:Ee,y:de}),q.push({x:Ee,y:de,value:Be,label:Z.categories[K]||`Axis ${K+1}`,seriesName:r.name})}t.push({points:E.join(" "),polygonPoints:S,dataPoints:q,color:kn(r,p),fillOpacity:h?Qt.value.fillOpacity:Rl.value,strokeDasharray:h?dl(r)||Qt.value.strokeDasharray:null,pointRadius:rn(r,h),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:A,isDimmed:z,isHidden:T,isComparison:h,seriesIndex:p})}),t}),us=(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,q=a[p].y;E>t.y!=q>t.y&&t.x<(S-h)*(t.y-E)/(q-E)+h&&(l=!l)}return l},ds=t=>{if(!il.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const l=a.getBoundingClientRect(),r=ee.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,h=t.clientY-r.top,E=Mo.value.filter(S=>S.isHidden?!1:us({x:p,y:h},S.polygonPoints));if(E.length>0){E.length,$.value=E[0].seriesIndex;const S=t.clientX-l.left+10,q=t.clientY-l.top-10,A=E.length>1?460:260,z=70+pa.value*20;let T=S,K=q;T+A>$e.value&&(T=t.clientX-l.left-A-10),K+z>it.value&&(K=t.clientY-l.top-z-10),T<0&&(T=10),K<0&&(K=10);const Be=E.map(We=>({seriesName:We.seriesName,color:We.color,points:We.dataPoints.map(pe=>({label:pe.label,value:xl(pe.value)}))}));ge.value={show:!0,x:T,y:K,title:"",value:"",bubbleData:[],spiderAreas:Be}}else Mn()},za=e.computed(()=>{const t=U.value;return t.logos.map((a,l)=>{const r=Z.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||_.value.has(a.seriesIndex))return null;let p,h;if(Bl.value){let S=-1,q=null;for(let z=r.data.length-1;z>=0;z--)if(r.data[z]!==null&&r.data[z]!==void 0){S=z,q=r.data[z];break}if(S===-1||q===null)return null;const A=r.data.map((z,T)=>z==null?null:{x:fl(T),y:Cn(r,z),index:T}).filter(z=>z!==null);if(t.animations.enabled&&!On.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ht.value.isAnimating||!Ht.value.hasAnimated))if(Ht.value.isAnimating){const z=Ht.value.currentFrame/Ht.value.totalFrames,T=vo(t.animations.easing,Math.min(z,1)),K=Cs(A,T);p=K.x+(a.offsetX||0),h=K.y+(a.offsetY||0)}else p=A[0].x+(a.offsetX||0),h=A[0].y+(a.offsetY||0);else p=fl(S)+(a.offsetX||0),h=Xn(q)+(a.offsetY||0)}else if(Cl.value||il.value){const S=Math.PI*2/t.logos.length*l;p=It.value+Math.cos(S)*(nt.value+30)+(a.offsetX||0),h=Mt.value+Math.sin(S)*(nt.value+30)+(a.offsetY||0)}return{...a,x:p,y:h,seriesIndex:a.seriesIndex}}).filter(Boolean)}),ms=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")},ps=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},mo=t=>{_.value.has(t)?_.value.delete(t):_.value.add(t)},vs=e.computed(()=>{if(!ge.value.show&&!(Se.value&&Ve.value.show&&!Q.value.isZooming))return{display:"none"};let t,a;if(Se.value&&Ve.value.show&&!Q.value.isZooming){t=Ve.value.x+15,a=P.value.top;const l=Ft.value?200:150;t+l>$e.value&&(t=Ve.value.x-l-15),t<0&&(t=10),a<10&&(a=10)}else t=ge.value.x,a=ge.value.y;return{left:t+"px",top:a+"px"}}),jn=(t,a)=>{if(!Ct.value||Ba.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,q=$e.value,A=it.value;p+E>q&&(p=a.clientX-r.left-E-10),h+S>A&&(h=a.clientY-r.top-S-10),p<0&&(p=10),h<0&&(h=10);let z;typeof t.categoryIndex=="number"?z=t.categoryIndex:typeof t.dataIndex=="number"?z=t.dataIndex:t.label&&Z.categories.includes(t.label)&&(z=Z.categories.indexOf(t.label));let T=t.seriesName||t.label||"";(ul.value||xe.value==="bar")&&t.label&&(T=t.label),t.tooltipTitle&&(T=t.tooltipTitle),ge.value={show:!0,x:p,y:h,title:T,value:xl(t.value)||"",categoryIndex:z,spiderAreas:[]}},po=e.ref(!1),Pa=e.ref(!1),Mn=()=>{ge.value.show=!1,ge.value.spiderAreas=[],ge.value.bubbleData=[],Ve.value.show=!1,po.value||($.value=null)},Ba=e.ref(!1),_a=(t,a)=>{Ba.value=!0,ge.value.show=!1,Ve.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>$e.value&&(p=a.clientX-r.left-E-15),p<0&&(p=10),h<0&&(h=10),x.value={show:!0,x:p,y:h,content:t.texts,count:t.totalCount}},Ma=()=>{Ba.value=!1,x.value.show=!1},Ht=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),vo=(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}},On=e.computed(()=>qn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),$o=()=>{if(!wl.value||On.value){Ht.value.hasAnimated=!0,v.value&&(m.value=1);return}v.value&&(m.value=0),Ht.value.isAnimating=!0,Ht.value.currentFrame=0,Ht.value.totalFrames=Math.ceil(zl.value/16.67);const t=()=>{const a=Ht.value.currentFrame/Ht.value.totalFrames,l=vo(ln.value,Math.min(a,1));fs(l),v.value&&(m.value=l),a<1?(Ht.value.currentFrame++,Ht.value.animationId=requestAnimationFrame(t)):hs()};Ht.value.animationId=requestAnimationFrame(t)},fs=t=>{const a=W.value;a&&a.style.setProperty("--dss-animation-progress",t)},hs=()=>{Ht.value.isAnimating=!1,Ht.value.hasAnimated=!0,v.value&&(m.value=1),Ht.value.animationId&&(cancelAnimationFrame(Ht.value.animationId),Ht.value.animationId=null)},fo=e.computed(()=>!Cl.value||Ht.value.hasAnimated?!0:v.value?m.value>=1:_n.value?oa.value>=1:!0),Do=e.computed(()=>Vl.value&&fo.value),Oa=e.ref(!1);e.watch(Do,t=>{t?(Oa.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Oa.value=!0})})):Oa.value=!1},{immediate:!0});const gs=e.computed(()=>{if(!wl.value||On.value||Ht.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${zl.value}ms`,t["--dss-animation-easing"]=ys(ln.value),t["--dss-stagger-delay"]=`${ll.value}ms`,t}),ys=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ks=()=>{if(!wl.value||On.value)return"";const t=["dss-chart-animated"];return Ht.value.hasAnimated||t.push(`dss-animate-${mn.value}`),Ht.value.hasAnimated||(Cl.value&&xe.value!=="semi-radial"?t.push("dss-animate-fill"):Cl.value||t.push(`dss-animate-${mn.value}`)),Ht.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>Z.series,(t,a)=>{Gn.value&&a&&Ht.value.hasAnimated&&(Ht.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>$o(),pn.value)}))},{deep:!0}),e.watch(()=>Q.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Ca()},50)}),e.watch(()=>[Q.value.scale,Q.value.offsetX],()=>{!Q.value.isZooming&&!Q.value.isDragging&&Ca()},{flush:"post"}),e.watch([jt,se],([t,a])=>{Q.value.minScale=t,Q.value.maxScale=a,(Q.value.scale<t||Q.value.scale>a)&&aa()},{immediate:!0}),e.watch(()=>Z.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>Qe.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",xa)}):document.removeEventListener("click",xa)}),e.onMounted(()=>{$.value=null,v.value&&(!wl.value||On.value)&&(m.value=1),Aa(),e.nextTick(rt),W.value&&typeof ResizeObserver<"u"&&(G=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(j&&cancelAnimationFrame(j),j=requestAnimationFrame(()=>{j=null;const{width:l,height:r}=a.contentRect;we.value=Math.round(l),ke.value=Math.round(r),g.value&&(lt.value=g.value.offsetHeight||fe)}))}),G.observe(W.value)),wl.value&&!On.value?xe.value==="semi-radial"?setTimeout(()=>O(),pn.value):setTimeout(()=>$o(),pn.value):(Ht.value.hasAnimated=!0,xe.value==="semi-radial"&&(oa.value=1)),document.addEventListener("mousemove",Lo),document.addEventListener("mouseup",To),document.addEventListener("click",wa)}),e.onUnmounted(()=>{ue&&(ue(),ue=null),j&&cancelAnimationFrame(j),G&&W.value&&(G.unobserve(W.value),G.disconnect(),G=null),Ht.value.animationId&&cancelAnimationFrame(Ht.value.animationId),I&&(cancelAnimationFrame(I),I=null),Q.value.zoomTimeout&&clearTimeout(Q.value.zoomTimeout),document.removeEventListener("mousemove",Lo),document.removeEventListener("mouseup",To),document.removeEventListener("click",wa),document.removeEventListener("click",xa)});const Lo=t=>{if(Q.value.isDragging&&Q.value.scale>1&&Bl.value){Ve.value.show=!1;const a=t.clientX-Q.value.lastMouseX,{minX:l,maxX:r}=Vt.value,p=r-l||1,E=a*.8;Q.value.offsetX+=E;const S=p/Q.value.scale,q=p-S,A=0,z=-q/p*P.value.width,T=A;Q.value.offsetX=Math.max(z,Math.min(T,Q.value.offsetX)),Q.value.lastMouseX=t.clientX,Q.value.lastMouseY=t.clientY}},To=()=>{Q.value.isDragging&&(Q.value.isDragging=!1,setTimeout(()=>{!Q.value.isDragging&&Q.value.isZooming},100))},Cs=(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 q=l[S].x-l[S-1].x,A=l[S].y-l[S-1].y,z=Math.sqrt(q*q+A*A);p.push(z),r+=z}const h=r*a;let E=0;for(let S=0;S<p.length;S++){const q=E+p[S];if(h<=q){const A=(h-E)/p[S],z=l[S],T=l[S+1];return{x:z.x+(T.x-z.x)*A,y:z.y+(T.y-z.y)*A}}E=q}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",[ks(),{"dss-chart-fill-width":Ae.value,"dss-chart-fill-height":Ye.value,"dss-chart-compact":Cl.value&&!ve.value}]]),style:e.normalizeStyle({width:Ae.value?"100%":$e.value+"px",height:Xt.value,...Ae.value||Ye.value?{overflow:Cl.value?"visible":(cl.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...gs.value,cursor:no()}),"data-chart-type":xe.value,ref_key:"containerEl",ref:W,onWheel:Ra,onMousedown:ia,onMousemove:ja,onMouseup:Ea,onMouseleave:La,onDblclick:aa,onContextmenu:e.withModifiers(Ga,["prevent"]),onClick:e.withModifiers(Sn,["left"]),onWheelCapture:Ra},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:g},[e.createElementVNode("div",Yr,[Ke.value?(e.openBlock(),e.createElementBlock("div",Xr,e.toDisplayString(Ke.value),1)):e.createCommentVNode("",!0),Je.value?(e.openBlock(),e.createElementBlock("div",jr,e.toDisplayString(Je.value),1)):e.createCommentVNode("",!0)]),ve.value&&Re.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ge.value==="horizontal","dss-legend-vertical":Ge.value==="vertical","dss-legend-top":Re.value==="top","dss-legend-bottom":Re.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":_.value.has(r),"dss-legend-hovered":$.value===r,"dss-legend-dimmed":$.value!==null&&$.value!==r}]),onClick:p=>mo(r),onMouseenter:p=>En(r),onMouseleave:Tn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":il.value&&At(l)}]),style:e.normalizeStyle({backgroundColor:il.value&&At(l)?"transparent":Il(l,r),borderColor:Il(l,r)})},null,6),e.createElementVNode("span",Gr,e.toDisplayString(l.name),1)],46,Kr))),128))],2)):e.createCommentVNode("",!0),ve.value&&(Re.value==="left"||Re.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Re.value==="left","dss-legend-right":Re.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":_.value.has(r),"dss-legend-hovered":$.value===r,"dss-legend-dimmed":$.value!==null&&$.value!==r}]),onClick:p=>mo(r),onMouseenter:p=>En(r),onMouseleave:Tn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":il.value&&At(l)}]),style:e.normalizeStyle({backgroundColor:il.value&&At(l)?"transparent":Il(l,r),borderColor:Il(l,r)})},null,6),e.createElementVNode("span",Jr,e.toDisplayString(l.name),1)],46,Qr))),128))],2)):e.createCommentVNode("",!0)],512),B.showAddMarkerButton&&sl.value&&Wt.value.addMarker&&(Bl.value||Ft.value)&&!cl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:na,title:e.unref(N)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:vl.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,ti),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,ei)):e.createCommentVNode("",!0),e.createElementVNode("div",li,[Ft.value&&mt.value?(e.openBlock(),e.createElementBlock("div",ni,"Bubble size: "+e.toDisplayString(mt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:$e.value,height:it.value,class:"dss-chart-svg","data-smooth":xt.value,"data-animated":wl.value,ref_key:"svgEl",ref:ee},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:he.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:$e.value,height:P.value.height*4},null,8,si)],8,oi),_n.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:da.value},[e.createElementVNode("path",{d:s.value},null,8,ii)],8,ri)):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:u.value},[e.createElementVNode("path",{d:y.value},null,8,ui)],8,ci)):e.createCommentVNode("",!0)]),Bl.value||Ft.value?(e.openBlock(),e.createElementBlock("g",di,[re.value&&!cl.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(Zo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:P.value.left,x2:P.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,pi))),128))],8,mi)):e.createCommentVNode("",!0),cl.value&&bo.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(bo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:P.value.left,x2:P.value.right,y1:l.y,y2:l.y,stroke:$t.value,"stroke-width":kl.value,"stroke-dasharray":Zl.value,opacity:Et.value},null,8,fi))),128))],8,vi)):e.createCommentVNode("",!0),e.createElementVNode("g",hi,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,gi),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,yi),In.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:P.value.right,x2:P.value.right,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ki)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Ci,[cl.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(oo.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,bi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.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,wi))),128)),In.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Yo.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,xi))),128)):e.createCommentVNode("",!0),Tt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Tt.value),9,Ei)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(at.value),9,Si)):e.createCommentVNode("",!0),In.value&&ct.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:$e.value-15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${$e.value-15}, ${P.value.top+P.value.height/2})`},e.toDisplayString(ct.value),9,Vi)):e.createCommentVNode("",!0)]),C.value.length>0?(e.openBlock(),e.createElementBlock("g",Ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.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:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_a(l,r),onMouseleave:Ma},null,40,_i)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_a(l,r),onMouseleave:Ma},null,40,Mi)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_a(l,r),onMouseleave:Ma},null,40,$i)):e.createCommentVNode("",!0)],8,Bi),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>_a(l,r),onMouseleave:Ma},null,40,Di)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,P.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=>_a(l,r),onMouseleave:Ma},null,40,Li),e.createElementVNode("text",{x:l.x,y:Math.max(15,P.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,Ti)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Te.value},[ql.value?(e.openBlock(),e.createElementBlock("g",Hi,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ul.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.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=>jn(l,p),onMouseleave:Mn},null,46,Ri)):(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=>jn(l,p),onMouseleave:Mn},null,46,Fi))],64))),128))],2),e.createElementVNode("g",Ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,zi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,Pi))),128)),ie.value>0||Ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Go.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:yt(l.isHighlighted?et(l,ie.value)+2:et(l,ie.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=>jn(l,p),onMouseleave:Mn},null,46,Oi))),128)):e.createCommentVNode("",!0)])])):xe.value==="line"?(e.openBlock(),e.createElementBlock("g",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":X.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ht.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,qi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,Zi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,Ui))),128)),ie.value>0||Ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ko.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:yt(l.isHighlighted?et(l,ie.value)+2:et(l,ie.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=>jn(l,p),onMouseleave:Mn},null,46,Yi))),128)):e.createCommentVNode("",!0)])):xe.value==="area"?(e.openBlock(),e.createElementBlock("g",Xi,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${B.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Ki)],8,ji))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?al.value+.2:al.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,Gi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*ll.value}ms`})},null,14,Qi))),128))])):xe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ul.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.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=>jn(l,p),onMouseleave:Mn},null,46,Ji)):(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=>jn(l,p),onMouseleave:Mn},null,46,ec))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ai),Se.value&&Ve.value.show&&!Q.value.isZooming&&!cl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Te.value},[e.createElementVNode("line",{x1:Ve.value.x,x2:Ve.value.x,y1:P.value.top,y2:P.value.bottom,stroke:tt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,lc),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Ve.value.x,cy:l.y,r:yt(ie.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,nc))),128))],8,tc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("g",ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ia.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",oc,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:yt(l.radius),fill:l.color,"fill-opacity":es(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(ls(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Vo(l,p),onMouseleave:p=>Bo(l),onClick:p=>So(l,p)},null,42,sc),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:ts(l)}),onLoad:p=>De(r),onError:p=>vt(r),onMouseenter:p=>Vo(l,p),onMouseleave:p=>Bo(l),onClick:p=>So(l,p)},null,46,rc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ua.value},[xe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:It.value,cy:Mt.value,r:nt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cc)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":xe.value,"clip-path":w.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qo.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":c(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=>jn(l.segment,p),onMouseleave:Mn},null,42,dc))),128))],8,uc),Ln.value&&fo.value?(e.openBlock(),e.createElementBlock("g",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.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,pc)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),sn.value&&(fo.value||_n.value||Yn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:nl.value.x,y:nl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Kl.value,fill:Ol.value,class:"dss-radial-data-center"},e.toDisplayString(Tl.value),9,vc)):e.createCommentVNode("",!0),Do.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Oa.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.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,fc),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,hc),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":gn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,gc)],6))),128))],2)):e.createCommentVNode("",!0)],8,ic)):e.createCommentVNode("",!0),il.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ua.value},[re.value?(e.openBlock(),e.createElementBlock("g",kc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ml.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:It.value,cy:Mt.value,r:yt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Cc))),128)),e.createElementVNode("g",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ml.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:It.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,wc),e.createElementVNode("text",{x:It.value,y:Mt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Qn(r)),9,xc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_o.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:It.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Ec))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rs.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/pa.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/pa.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,Vc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ds,onMouseleave:Mn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":cs("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*ll.value}ms`,transition:"all 0.2s ease"})},null,14,Nc),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:yt(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*ll.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>jn(p,E),onMouseleave:Mn},null,46,Bc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,yc)):e.createCommentVNode("",!0),e.createElementVNode("g",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(za.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:yt(l.width/2),fill:Jt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Mc))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(za.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=>ms(r),onError:p=>ps(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,$c))),128))])],8,ai)),cl.value&&Yl.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle($n.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:R,class:"dss-stepbar-scroll",onScroll:Ka},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(tn.value)},[_t.value?(e.openBlock(),e.createElementBlock("div",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.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:$t.value,borderTopWidth:`${kl.value}px`,borderTopStyle:"dashed",opacity:Et.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${bl.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,l=>(e.openBlock(),e.createBlock(Ro,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(Ul.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":kt.value,orientation:"vertical","label-position":"down","bar-height":ml.value,"segment-order":ae.value,"remainder-label":bt.value,"inactive-color":ot.value,options:Wn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),_l.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(dn.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),Fl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:$e.value+"px",height:it.value+"px",backgroundImage:`url('${Kt.value}')`,backgroundRepeat:"no-repeat",...an.value,opacity:fn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.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:Dt.value+"px",height:Dt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>rl(l),["stop"]),onMouseenter:p=>as(l,p),onMouseleave:os},[e.createElementVNode("img",{src:sa(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Tc)],44,Lc)),[[e.vShow,El.value]])),128)),st.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:st.value.x+"px",top:st.value.y+"px"})},[e.createElementVNode("div",Ac,e.toDisplayString(st.value.categoryValue),1),st.value.description?(e.openBlock(),e.createElementBlock("div",Hc,e.toDisplayString(st.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ct.value&&(ge.value.show||Se.value&&Ve.value.show&&!Q.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Se.value&&Ve.value.show&&!Q.value.isZooming,"dss-spider-tooltip":il.value&&ge.value.spiderAreas&&ge.value.spiderAreas.length>0}]),style:e.normalizeStyle(vs.value)},[!Se.value||!Ve.value.show||Q.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[il.value&&ge.value.spiderAreas&&ge.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Fc,[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",Ic,e.toDisplayString(p.label),1),e.createElementVNode("span",zc,e.toDisplayString(p.value),1)]))),128))]))),128))])):Ft.value&&ge.value.bubbleData&&ge.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Pc,[ge.value.title?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(ge.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.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",qc,[e.createElementVNode("div",Zc,e.toDisplayString(ge.value.title),1),e.createElementVNode("div",Uc,e.toDisplayString(ge.value.value),1)])),ge.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[St(ge.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Yc,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xc,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ge.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",jc,[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",Kc,[e.createElementVNode("div",Gc,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(ge.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Qc,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jc,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ge.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",eu,[e.createElementVNode("div",tu,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",lu,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",nu,[e.createElementVNode("div",au,e.toDisplayString(cl.value?Da():Ft.value?ns():B.categories[Ve.value.categoryIndex]||`Category ${Ve.value.categoryIndex+1}`),1),Ft.value?(e.openBlock(),e.createElementBlock("div",ou,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.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(Ve.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",su,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",ru,e.toDisplayString(xl(l.value)),1)]))),128))]),St(Ve.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",iu,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",cu,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(Ve.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",uu,[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",du,[e.createElementVNode("div",mu,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(Ve.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",pu,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",vu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(Ve.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",fu,[e.createElementVNode("div",hu,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",gu,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Bl.value&&gt.value&&Q.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:aa},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(Q.value.scale*100))+"% "+e.toDisplayString(e.unref(N)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ur),ve.value&&Re.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ge.value==="horizontal","dss-legend-vertical":Ge.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(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":_.value.has(r),"dss-legend-hovered":$.value===r,"dss-legend-dimmed":$.value!==null&&$.value!==r}]),onClick:p=>mo(r),onMouseenter:p=>En(r),onMouseleave:Tn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":il.value&&At(l)}]),style:e.normalizeStyle({backgroundColor:il.value&&At(l)?"transparent":Il(l,r),borderColor:Il(l,r)})},null,6),e.createElementVNode("span",ku,e.toDisplayString(l.name),1)],46,yu))),128))],2)):e.createCommentVNode("",!0),Qe.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Qe.value.x+"px",top:Qe.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[Wt.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),Wt.value.addMarker&&(Wt.value.downloadSvg||Wt.value.downloadPng||Wt.value.downloadCsv||qt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Cu)):e.createCommentVNode("",!0),Wt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Un},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Wt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:to},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Wt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:lo},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),qt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Wt.value.downloadSvg||Wt.value.downloadPng||Wt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",bu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",wu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Ta(l)),style:e.normalizeStyle(Zn(l)),onClick:p=>la(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Qa(l),class:"dss-custom-menu-content"},null,8,Eu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Su,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,xu)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Al},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Vu,[e.createElementVNode("h3",null,e.toDisplayString(yn.value?e.unref(N)("chart.modalMarker.viewMarker"):xn.value?e.unref(N)("chart.modalMarker.editMarker"):e.unref(N)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Al},"×")]),e.createElementVNode("div",Nu,[e.createElementVNode("div",Bu,[e.createVNode(go,{id:"dss-marker-date",mode:"single",modelValue:Oe.value.date,"onUpdate:modelValue":a[1]||(a[1]=l=>Oe.value.date=l),"min-date":Jn.value,"max-date":ea.value,disabled:yn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",_u,[e.createElementVNode("label",Mu,e.toDisplayString(e.unref(N)("chart.modalMarker.description")),1),yn.value?(e.openBlock(),e.createElementBlock("div",$u,e.toDisplayString(Oe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=l=>Oe.value.description=l),placeholder:e.unref(N)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Du)),[[e.vModelText,Oe.value.description]])])]),e.createElementVNode("div",Lu,[e.createElementVNode("div",Tu,[xn.value&&!yn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:An},e.toDisplayString(e.unref(N)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Au,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Al},e.toDisplayString(yn.value?e.unref(N)("chart.modalMarker.close"):e.unref(N)("chart.modalMarker.cancel")),1),yn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Vn,disabled:!(Oe.value.description&&Oe.value.description.length)},e.toDisplayString(xn.value?e.unref(N)("chart.modalMarker.save"):e.unref(N)("chart.contextMenu.addMarker")),9,Hu))])])])])):e.createCommentVNode("",!0)],64))}}),Iu={class:"dss-modal-title"},zu={class:"dss-modal-actions"},ho={__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:J}){const N=B,L=J,ne=e.ref(null),W=e.ref(null),R=e.computed(()=>{const j={"max-width":N.width};return N.height!=="auto"&&(j.height=N.height,j["min-height"]="0"),j}),ue=e.computed(()=>({}));function rt(){L("close-modal")}function ee(){N.backDrop&&!ne.value&&L("close-modal")}function g(j){j.target.tagName==="INPUT"&&(ne.value=j.target.tagName)}function we(){setTimeout(()=>{ne.value=null},300)}function ke(){const j=document.body,fe=document.documentElement;W.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:fe.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${W.value.scrollY}px`,j.style.width="100%",j.style.left="0",fe.style.overflow="hidden"}function G(){if(!W.value)return;const j=document.body,fe=document.documentElement,{bodyOverflow:He,bodyPosition:he,bodyTop:Te,bodyWidth:Z,htmlOverflow:Fe,scrollY:qe}=W.value;j.style.overflow=He||"",j.style.position=he||"",j.style.top=Te||"",j.style.width=Z||"",j.style.left="",fe.style.overflow=Fe||"",window.scrollTo(0,qe||0)}return e.watch(()=>N.showModal,j=>{if(j)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",g),fe.addEventListener("focusout",we))},100);else{G(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",g),fe.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{N.showModal&&G()}),(j,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(R.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":B.headerType,"font-size":B.titleSize})},[e.createElementVNode("h1",Iu,[e.renderSlot(j.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$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(ue.value)},[e.renderSlot(j.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",zu,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,B.showModal]])])):e.createCommentVNode("",!0)]))}},Pu={key:0,class:"dss-table-toolbar"},Ou={class:"dss-table-toolbar-left"},Wu=["aria-expanded"],qu={class:"dss-pagination-select-dropdown",role:"listbox"},Zu={class:"dss-table-column-visibility-label"},Uu={class:"dss-table-checkbox-wrapper"},Yu=["checked","onChange"],Xu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},ju={class:"dss-table-column-visibility-text"},Ku={class:"dss-table-toolbar-right"},Gu=["placeholder","aria-label"],Qu=["aria-label"],Ju=["aria-label","aria-expanded"],ed={key:1,class:"dss-table-toolbar-extra"},td={class:"dss-table-thead"},ld={key:0,class:"dss-table-th dss-table-selection-column"},nd={key:0,class:"dss-table-checkbox-wrapper"},ad=["checked","indeterminate"],od={key:0,class:"dss-table-checkbox__indeterminate"},sd={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},rd=["aria-label"],id=["onClick"],cd={class:"dss-table-th-content"},ud={class:"dss-table-th-text"},dd={key:0},md={key:1},pd={key:2},vd=["data-filter-column-key","aria-expanded","aria-label","onClick"],fd={class:"dss-table-tbody"},hd=["onClick"],gd={class:"dss-table-checkbox-wrapper"},yd=["type","name","checked","disabled","onChange"],kd={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cd={key:1,class:"dss-table-checkbox__dot"},bd=["onClick"],wd=["aria-expanded","aria-label"],xd={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ed={key:0,class:"dss-table-expansion-row"},Sd=["colspan"],Vd=["colspan"],Nd={key:1,class:"dss-table-pagination"},Bd={class:"dss-table-pagination-left"},_d={key:0},Md={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},$d={class:"dss-table-pagination-center"},Dd={key:0,class:"dss-pagination-controls"},Ld=["disabled","title"],Td=["disabled","title"],Ad=["aria-label","onKeydown"],Hd={class:"dss-pagination-of"},Rd=["disabled","title"],Fd=["disabled","title"],Id={class:"dss-table-pagination-right"},zd={class:"dss-pagination-rows-label"},Pd=["aria-expanded"],Od=["aria-selected","onClick"],Wd={key:0,class:"dss-table-filter-row"},qd=["value","placeholder"],Zd=["min","max","value"],Ud=["min","max","value"],Yd={class:"dss-table-filter-double-range-values"},Xd={key:2,class:"dss-table-filter-daterange"},jd={class:"dss-table-filter-daterange-row"},Kd={class:"dss-table-filter-daterange-label"},Gd=["value"],Qd={class:"dss-table-filter-daterange-row"},Jd={class:"dss-table-filter-daterange-label"},e1=["value"],t1=["value","placeholder"],l1={class:"dss-table-filter-list"},n1=["checked","onChange"],a1={class:"dss-table-filter-actions"},o1={name:"DSSTable"},s1=Object.assign(o1,{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:J}){const{t:N,locale:L}=ha.useI18n(),ne=B,W=J,R={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 ue(d,f){const b=Object.assign({},d);return rt(d)&&rt(f)&&Object.keys(f).forEach(_=>{rt(f[_])?_ in d?b[_]=ue(d[_],f[_]):Object.assign(b,{[_]:f[_]}):Object.assign(b,{[_]:f[_]})}),b}function rt(d){return d&&typeof d=="object"&&!Array.isArray(d)}const ee=e.computed(()=>ue(R,ne.options)),g=e.computed(()=>{const d=ee.value.table.width;return d==="auto"?null:typeof d=="number"?d:null}),we=e.computed(()=>ee.value.table.height),ke=e.computed(()=>ee.value.table.rowHeight??"auto"),G=e.computed(()=>({height:ke.value})),j=e.computed(()=>ee.value.table.expandable===!0),fe=e.computed(()=>ee.value.table.expandableRowData??null),He=e.computed(()=>ee.value.table.expandableRowCondition??null),he=e.computed(()=>ee.value.table.truncated===!0),Te=e.computed(()=>ee.value.table.striped),Z=e.computed(()=>ee.value.table.bordered),Fe=e.computed(()=>ee.value.table.hoverable),qe=e.computed(()=>ee.value.table.size),Me=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const Ze=e.computed(()=>ee.value.selection.enabled),U=e.computed(()=>ee.value.selection.mode),Ae=e.computed(()=>ee.value.selection.rowCondition??null),Ye=e.computed(()=>ee.value.sorting.enabled),Ce=e.computed(()=>ee.value.sorting.mode),$e=e.computed(()=>ee.value.pagination.enabled),lt=e.computed(()=>ee.value.pagination.rows),ft=e.computed(()=>ee.value.pagination.rowsPerPageOptions),it=e.computed(()=>ee.value.pagination.showCounter!==!1),Xt=e.computed(()=>ee.value.pagination.showControlsGroup),xe=e.computed(()=>Xt.value===!1?!1:ee.value.pagination.showControls!==!1),Lt=e.computed(()=>Xt.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),Ke=e.computed(()=>$e.value&&(it.value||xe.value||Lt.value)),Je=e.computed(()=>ee.value.scrollable),mt=e.computed(()=>ee.value.emptyMessage||N("table.emptyMessage")),Tt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),at=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),pt=e.computed(()=>ee.value.toolbar?.search!==!1),ct=e.computed(()=>Tt.value||at.value||pt.value||Ut.value),Ut=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),ht=e.ref(""),Rt=e.ref(!1),me=e.ref(null);let F=null;function Y(){Rt.value?(F&&(clearTimeout(F),F=null),Rt.value=!1,ht.value="",W("search",""),me.value?.blur()):(Rt.value=!0,F=setTimeout(()=>{F=null,me.value?.focus()},80))}function re(){ht.value||(Rt.value=!1)}function ve(){ht.value="",W("search",""),me.value?.focus()}const Re=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":Z.value,"dss-table-hoverable":Fe.value,[`dss-table-${qe.value}`]:qe.value!=="default","dss-table-truncated":he.value})),Ge=(d,f)=>d?.field??d?.key??f,Ct=e.ref(new Set);function Se(){const d=new Set;return ne.columns.forEach((f,b)=>{f?.hidden!==!0&&d.add(Ge(f,b))}),d}function tt(){const d=new Set;return ne.columns.forEach((f,b)=>{d.add(Ge(f,b))}),d}function gt(d){if(!Array.isArray(d))return null;const f=tt(),b=[];return d.forEach(_=>{f.has(_)&&b.push(_)}),b}function jt(){Ct.value=Se()}const se=e.computed(()=>{const d=gt(ne.columnVisibility);return d===null?null:new Set(d)}),X=e.computed(()=>se.value??Ct.value),te=e.computed(()=>ne.columns.filter((d,f)=>X.value.has(Ge(d,f)))),ie=d=>{const f=ne.columns.findIndex(b=>b===d);return Ge(d,f>=0?f:0)},Ne=(d,f)=>X.value.has(Ge(d,f));function et(d){W("update:columnVisibility",Array.from(d))}function yt(d,f){const b=Ge(d,f),_=new Set(X.value);_.has(b)?_.delete(b):_.add(b),se.value===null&&(Ct.value=_),et(_)}const al=e.ref(null),xt=e.ref(!1);function el(d){al.value&&!al.value.contains(d.target)&&(xt.value=!1)}const H=e.computed(()=>te.value.length+(Ze.value?1:0)+(j.value?1:0)),V=(d,f)=>d?.id??d?.key??f,M=e.ref(new Set),ae=e.ref(null),oe=(d,f)=>M.value.has(V(d,f)),Ue=(d,f)=>{if(!j.value)return!1;if(typeof He.value=="function")return!!He.value(d,f);if(typeof fe.value=="string"&&fe.value.trim()){const b=k(d,fe.value.trim());return Array.isArray(b)?b.length>0:b&&typeof b=="object"?Object.keys(b).length>0:b!=null&&b!==""}return!0},bt=(d,f,b)=>{if(b&&b.stopPropagation(),!Ue(d,f))return;const _=V(d,f),$=new Set(M.value);$.has(_)?($.delete(_),W("row-collapse",{data:d,index:f})):($.add(_),W("row-expand",{data:d,index:f})),M.value=$},ot=(d,f)=>{if(!he.value)return;const b=V(d,f);ae.value!==b&&(ae.value=b)},Xe=e.ref(null),Nt=e.ref(0),wt=e.ref([]),ut=d=>{if(Ce.value==="single")return Xe.value===d.field?Nt.value:0;{const f=wt.value.find(b=>b.field===d.field);return f?f.order:0}},_t=d=>{const f=ut(d);return{"dss-sort-active":f!==0,"dss-sort-asc":f===1,"dss-sort-desc":f===-1}},$t=e.ref({}),Et=e.ref(null),kl=e.ref(null),Zl=220,bl=e.ref(null),tl=e.computed(()=>te.value.find(d=>ie(d)===Et.value)??null),ol=e.computed(()=>{if(!tl.value||tl.value.filter!=="range")return null;const d=tl.value,f=Et.value,{min:b,max:_}=mn(d),$=d.filterMin??b,ye=d.filterMax??_,ge=Hl(f),st=ge.min??$,Ve=ge.max??ye,Qe=ye-$,Q=Qe===0?0:(st-$)/Qe*100,Zt=Qe===0?100:(Ve-$)/Qe*100;return{rangeMin:$,rangeMax:ye,currentMin:st,currentMax:Ve,minPct:Q,maxPct:Zt}}),un=e.ref(null),ml=e.ref("max");function dt(d){const f=un.value,b=ol.value;if(!f||!b)return;const _=f.getBoundingClientRect(),ye=(d.clientX-_.left)/_.width*100,ge=(b.minPct+b.maxPct)/2;ml.value=ye<ge?"min":"max"}function Hl(d){return $t.value[d]??{}}function Ul(d,f){$t.value={...$t.value,[d]:f}}function Ll(d){const f=$t.value[d];return f?f.type==="string"?!!f.value?.trim():f.type==="range"?f.min!=null||f.max!=null:f.type==="dateRange"?!!(f.from||f.to):f.type==="list"?f.selected?.length>0:!1:!1}function Wn(d){const f={...$t.value};delete f[d],$t.value=f,Et.value=null,kl.value=null}function Yl(){if(!Et.value){kl.value=null;return}const d=bl.value;if(!d)return;const f=d.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Et.value}"]`);if(!f)return;const b=f.getBoundingClientRect();kl.value={top:b.bottom+6,left:Math.max(8,b.right-Zl)}}const bn=e.computed(()=>{const d=String(ht.value??"").trim().toLowerCase();return d?ne.data.filter(f=>te.value.some(b=>tn(Ol(f,b)).some($=>String($).toLowerCase().includes(d)))):ne.data}),$n=e.computed(()=>{let d=[...bn.value];const f=(ht.value??"").trim().toLowerCase();return f&&(d=d.filter(b=>ne.columns.some(_=>{if(!_||!_.field)return!1;const $=Ol(b,_);return String($??"").toLowerCase().includes(f)}))),te.value.forEach(b=>{const _=ie(b),$=$t.value[_];if(!$)return;const ye=b.field;if(ye){if($.type==="string"&&$.value?.trim()){const ge=$.value.trim().toLowerCase();d=d.filter(st=>{const Ve=Ol(st,b);return String(Ve??"").toLowerCase().includes(ge)})}else if($.type==="range")d=d.filter(ge=>{const st=k(ge,ye),Ve=Number(st);return!(Number.isNaN(Ve)||$.min!=null&&Ve<$.min||$.max!=null&&Ve>$.max)});else if($.type==="dateRange"){const ge=$.from?new Date($.from).getTime():null,st=$.to?new Date($.to).getTime():null;d=d.filter(Ve=>{const Qe=k(Ve,ye),Q=Qe?new Date(Qe).getTime():NaN;return!(Number.isNaN(Q)||ge!=null&&Q<ge||st!=null&&Q>st)})}else if($.type==="list"&&$.selected?.length){const ge=new Set($.selected);d=d.filter(st=>tn(Ol(st,b)).some(Qe=>ge.has(Qe)))}}}),d});function tn(d){if(d==null)return[""];if(Array.isArray(d))return d.flatMap(tn);if(typeof d=="object"){const f=d?.label??d?.name??d?.value??d?.title;return[f!=null?String(f):String(d)]}return[String(d)]}function _l(d){const f=new Set;return ne.data.forEach(b=>{tn(Ol(b,d)).forEach($=>f.add($))}),Array.from(f).sort((b,_)=>String(b).localeCompare(String(_)))}function dn(d,f){if(Et.value===d){Et.value=null,kl.value=null;return}if(Et.value=d,f?.currentTarget){const b=f.currentTarget.getBoundingClientRect();kl.value={top:b.bottom+6,left:Math.max(8,b.right-Zl)}}else Yl()}function wl(d,f){Ul(d,{type:"string",value:f})}function mn(d){const f=d.field;if(!f)return{min:0,max:100};let b=1/0,_=-1/0;return ne.data.forEach($=>{const ye=k($,f),ge=Number(ye);Number.isNaN(ge)||(b=Math.min(b,ge),_=Math.max(_,ge))}),{min:b===1/0?0:b,max:_===-1/0?100:_}}function zl(d,f,b){const _={...Hl(d),type:"range"},$=b===""?null:Number(b),ye=$===null||Number.isNaN($)?null:$;_[f]=ye,ye!=null&&(f==="min"&&_.max!=null&&ye>_.max&&(_.max=ye),f==="max"&&_.min!=null&&ye<_.min&&(_.min=ye)),Ul(d,_)}function pn(d,f,b){const _={...Hl(d),type:"dateRange"};_[f]=b||"",Ul(d,_)}const ln=e.reactive({});function ll(d,f){ln[d]=f}function Gn(d){const f=ie(d),b=(ln[f]??"").trim().toLowerCase(),_=_l(d);return b?_.filter($=>String($).toLowerCase().includes(b)):_}function qn(d,f){return(Hl(d).selected??[]).includes(f!=null?String(f):"")}function Rl(d,f){const _=[...Hl(d).selected??[]],$=f!=null?String(f):"",ye=_.indexOf($);ye>=0?_.splice(ye,1):_.push($),Ul(d,{type:"list",selected:_})}function vn(d){Et.value&&!d.target.closest(".dss-table-filter-wrap")&&!d.target.closest(".dss-table-filter-dropdown")&&(Et.value=null,kl.value=null)}function Ml(){Yl(),qt.value&&gl()}const Qn=d=>{if(!(d.sortable===!1||!Ye.value))if(Ce.value==="single")Xe.value===d.field?Nt.value=Nt.value===1?-1:Nt.value===-1?0:1:(Xe.value=d.field,Nt.value=1),Nt.value===0&&(Xe.value=null),W("sort",{field:Xe.value,order:Nt.value});else{const f=wt.value.findIndex(b=>b.field===d.field);f>=0?wt.value[f].order===1?wt.value[f].order=-1:wt.value.splice(f,1):wt.value.push({field:d.field,order:1}),W("sort",{multiSortMeta:wt.value})}},nn=e.computed(()=>{if(!Ye.value)return $n.value;let d=[...$n.value];return Ce.value==="single"&&Xe.value&&Nt.value!==0?d.sort((f,b)=>{const _=k(f,Xe.value),$=k(b,Xe.value);return _===$?0:_==null?1:$==null?-1:(_<$?-1:_>$?1:0)*Nt.value}):Ce.value==="multiple"&&wt.value.length>0&&d.sort((f,b)=>{for(const _ of wt.value){const $=k(f,_.field),ye=k(b,_.field);if($===ye)continue;if($==null)return 1;if(ye==null)return-1;const ge=$<ye?-1:$>ye?1:0;if(ge!==0)return ge*_.order}return 0}),d}),sl=e.ref(0),Wt=e.ref(lt.value),qt=e.ref(!1),vl=e.ref(null),Pl=e.ref(null),Dt=e.ref("bottom"),kt=e.ref(null),xl=d=>{Wt.value=d,qt.value=!1,sl.value=0,W("page",{page:0,rows:Wt.value})};function El(d){vl.value&&!vl.value.contains(d.target)&&(qt.value=!1)}function gl(){const d=vl.value,f=Pl.value;if(!d||!f)return;const b=d.querySelector(".dss-pagination-select-dropdown");if(!b)return;const _=f.getBoundingClientRect(),$=b.offsetHeight||0,ge=(window.innerHeight||document.documentElement.clientHeight)-_.bottom,st=_.top;Dt.value=ge<$+8&&st>ge?"top":"bottom",kt.value={width:`${Math.ceil(_.width)}px`,left:`${Math.max(0,Math.round(f.offsetLeft))}px`}}const Xl=e.computed(()=>nn.value.length),Fl=e.computed(()=>Math.ceil(Xl.value/Wt.value)),fn=e.computed(()=>Math.max(Fl.value,1)),hn=e.computed(()=>Xl.value===0?0:Yt.value+1),$l=e.computed(()=>an.value),Yt=e.computed(()=>$e.value?sl.value*Wt.value:0),an=e.computed(()=>$e.value?Math.min((sl.value+1)*Wt.value,Xl.value):Xl.value),Sl=e.computed(()=>{if(!$e.value)return nn.value;const d=Yt.value,f=an.value;return nn.value.slice(d,f)}),St=e.ref(new Set),Dn=e.computed(()=>nn.value.filter((d,f)=>St.value.has(V(d,f)))),Kt=(d,f)=>{const b=Ae.value;return typeof b!="function"?!0:!!b(d,f)},Vl=e.computed(()=>nn.value.map((d,f)=>({row:d,index:f})).filter(({row:d,index:f})=>Kt(d,f))),gn=e.computed(()=>{const d=Vl.value;return d.length===0?!1:d.every(({row:f,index:b})=>St.value.has(V(f,b)))}),wn=e.computed(()=>{const d=Vl.value;if(d.length===0)return!1;const f=d.filter(({row:b,index:_})=>St.value.has(V(b,_))).length;return f>0&&f<d.length}),on=(d,f)=>St.value.has(V(d,f)),yl=()=>{if(gn.value)St.value=new Set,W("unselect-all");else{const d=new Set;Vl.value.forEach(({row:f,index:b})=>d.add(V(f,b))),St.value=d,W("select-all",Dn.value)}},Ln=(d,f)=>{if(!Kt(d,f))return;const b=V(d,f),_=new Set(St.value),$=_.has(b);U.value==="single"?$?(_.delete(b),W("row-unselect",d)):(_.clear(),_.add(b),W("row-select",d)):$?(_.delete(b),W("row-unselect",d)):(_.add(b),W("row-select",d)),St.value=_},jl=e.ref("1"),sn=()=>{const d=Number.parseInt(String(jl.value),10);if(!Number.isFinite(d)){jl.value=String(sl.value+1);return}const f=Math.min(fn.value,Math.max(1,d));f!==sl.value+1?Tl(f-1):jl.value=String(f)},Tl=d=>{d<0||d>=Fl.value||(sl.value=d,W("page",{page:d,rows:Wt.value}))},Kl=(d,f,b)=>{W("row-click",{data:d,index:f,originalEvent:b}),ot(d,Yt.value+f)},nl=(d,f)=>{const b=Yt.value+f;return{"dss-table-row-selected":on(d,b),"dss-table-row-even":f%2===0,"dss-table-row-odd":f%2!==0,"dss-table-row-truncated-clickable":he.value,"dss-table-row-truncated-expanded":ae.value===V(d,b)}},Ol=(d,f)=>f.field?k(d,f.field):"",k=(d,f)=>f.split(".").reduce((b,_)=>b&&b[_],d),C=d=>{const f=d.align??Me.value;return{"dss-table-sortable":d.sortable!==!1&&Ye.value,"dss-table-align-left":f==="left","dss-table-align-center":f==="center","dss-table-align-right":f==="right",[d.className]:d.className}},x=d=>{const f={};return d.width&&(f.width=typeof d.width=="number"?`${d.width}px`:d.width),d.minWidth&&(f.minWidth=typeof d.minWidth=="number"?`${d.minWidth}px`:d.minWidth),d.maxWidth&&(f.maxWidth=typeof d.maxWidth=="number"?`${d.maxWidth}px`:d.maxWidth),f};return e.watch(()=>ne.locale,d=>{d&&d!==L.value&&(L.value=d)},{immediate:!0}),e.watch(lt,d=>{Wt.value=d,sl.value=0}),e.watch(qt,async d=>{d&&(await e.nextTick(),gl())}),e.watch(sl,d=>{jl.value=String(d+1)},{immediate:!0}),e.watch(ht,d=>{W("search",d??"")}),e.watch(()=>ne.columns,()=>{if(se.value===null){jt();return}const d=gt(ne.columnVisibility)??[];d.length!==ne.columnVisibility.length&&W("update:columnVisibility",d)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",El),document.addEventListener("click",el),document.addEventListener("click",vn),window.addEventListener("resize",Ml),window.addEventListener("scroll",Ml,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",El),document.removeEventListener("click",el),document.removeEventListener("click",vn),window.removeEventListener("resize",Ml),window.removeEventListener("scroll",Ml,!0)}),(d,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:bl,style:e.normalizeStyle({width:g.value+"px",height:we.value?we.value+"px":"auto"})},[ct.value?(e.openBlock(),e.createElementBlock("div",Pu,[e.createElementVNode("div",Ou,[Tt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:f[0]||(f[0]=b=>W("download-pdf"))},[f[22]||(f[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),at.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:f[1]||(f[1]=b=>W("download-excel"))},[f[23]||(f[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),Ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:al},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":xt.value}]),onClick:f[2]||(f[2]=b=>xt.value=!xt.value),"aria-expanded":xt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(N)("table.columnVisibility"))+" ",1),f[24]||(f[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Wu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.columns,(b,_)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(b,_),role:"option",class:"dss-table-column-visibility-option",onClick:f[3]||(f[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Zu,[e.createElementVNode("span",Uu,[e.createElementVNode("input",{type:"checkbox",checked:Ne(b,_),onChange:$=>yt(b,_),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Yu),Ne(b,_)?(e.openBlock(),e.createElementBlock("span",Xu,[...f[25]||(f[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",ju,e.toDisplayString(b.header),1)])]))),128))],512),[[e.vShow,xt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"header")]),e.createElementVNode("div",Ku,[pt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Rt.value||ht.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:me,"onUpdate:modelValue":f[4]||(f[4]=b=>ht.value=b),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(N)("table.searchPlaceholder"),"aria-label":e.unref(N)("table.searchTableAriaLabel"),onFocus:f[5]||(f[5]=b=>Rt.value=!0),onBlur:re},null,40,Gu),[[e.vModelText,ht.value]]),ht.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(N)("table.clearSearchAriaLabel"),onClick:ve},[...f[26]||(f[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Qu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(N)("table.searchAriaLabel"),"aria-expanded":Rt.value||!!ht.value,onMousedown:e.withModifiers(Y,["prevent"])},[...f[27]||(f[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,Ju)],2)):e.createCommentVNode("",!0),d.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ed,[e.renderSlot(d.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Je.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Re.value])},[e.createElementVNode("thead",td,[e.createElementVNode("tr",null,[Ze.value?(e.openBlock(),e.createElementBlock("th",ld,[U.value==="multiple"?(e.openBlock(),e.createElementBlock("span",nd,[e.createElementVNode("input",{type:"checkbox",checked:gn.value,indeterminate:wn.value,onChange:yl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ad),wn.value?(e.openBlock(),e.createElementBlock("span",od)):gn.value?(e.openBlock(),e.createElementBlock("span",sd,[...f[28]||(f[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),j.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,rd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(b,_)=>(e.openBlock(),e.createElementBlock("th",{key:ie(b),class:e.normalizeClass(["dss-table-th",C(b)]),style:e.normalizeStyle(x(b)),onClick:$=>Qn(b)},[e.createElementVNode("div",cd,[e.createElementVNode("span",ud,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)])},[ut(b)===0?(e.openBlock(),e.createElementBlock("span",dd,[...f[29]||(f[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)])])):ut(b)===1?(e.openBlock(),e.createElementBlock("span",md,[...f[30]||(f[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)])])):ut(b)===-1?(e.openBlock(),e.createElementBlock("span",pd,[...f[31]||(f[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":Et.value===ie(b)}]),onClick:f[6]||(f[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Ll(ie(b))}]),"data-filter-column-key":ie(b),"aria-expanded":Et.value===ie(b),"aria-label":e.unref(N)("table.filterColumnAriaLabel"),onClick:$=>dn(ie(b),$)},[...f[32]||(f[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,vd)],2)):e.createCommentVNode("",!0)])],14,id))),128))])]),e.createElementVNode("tbody",fd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(b,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(b,Yt.value+_)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",nl(b,_)]),style:e.normalizeStyle(G.value),onClick:$=>Kl(b,_,$)},[Ze.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:f[7]||(f[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",gd,[e.createElementVNode("input",{type:U.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${B.tableId}`,checked:on(b,Yt.value+_),disabled:!Kt(b,Yt.value+_),onChange:$=>Ln(b,Yt.value+_),class:e.normalizeClass(["dss-table-checkbox",U.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!Kt(b,Yt.value+_)}])},null,42,yd),U.value==="multiple"&&on(b,Yt.value+_)?(e.openBlock(),e.createElementBlock("span",kd,[...f[33]||(f[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)])])):U.value==="single"&&on(b,Yt.value+_)?(e.openBlock(),e.createElementBlock("span",Cd)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers($=>bt(b,Yt.value+_,$),["stop"])},[Ue(b,Yt.value+_)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(b,Yt.value+_),"aria-label":oe(b,Yt.value+_)?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":oe(b,Yt.value+_)}]),"aria-hidden":"true"},[...f[34]||(f[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,wd)):(e.openBlock(),e.createElementBlock("span",xd))],8,bd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,($,ye)=>(e.openBlock(),e.createElementBlock("td",{key:ie($),class:e.normalizeClass(["dss-table-td",C($)]),style:e.normalizeStyle(x($))},[e.renderSlot(d.$slots,`cell-${$.field}`,{data:b,column:$,rowIndex:_,isExpanded:ae.value===V(b,Yt.value+_)},()=>[e.createTextVNode(e.toDisplayString(Ol(b,$)),1)])],6))),128))],14,hd),j.value&&Ue(b,Yt.value+_)&&oe(b,Yt.value+_)?(e.openBlock(),e.createElementBlock("tr",Ed,[e.createElementVNode("td",{colspan:H.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(d.$slots,"expansion",{data:b,rowIndex:_})],8,Sd)])):e.createCommentVNode("",!0)],64))),128)),Sl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(G.value)},[e.createElementVNode("td",{colspan:H.value,class:"dss-table-empty-cell"},[e.renderSlot(d.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(mt.value),1)])],8,Vd)],4))])],2)],2),Ke.value?(e.openBlock(),e.createElementBlock("div",Nd,[e.createElementVNode("div",Bd,[it.value?(e.openBlock(),e.createElementBlock("span",_d,e.toDisplayString(e.unref(N)("table.showingRange",{start:hn.value,end:$l.value,total:Xl.value})),1)):(e.openBlock(),e.createElementBlock("span",Md," "))]),e.createElementVNode("div",$d,[xe.value?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sl.value===0,onClick:f[8]||(f[8]=b=>Tl(0)),title:e.unref(N)("table.firstPage")},[...f[35]||(f[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Ld),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sl.value===0,onClick:f[9]||(f[9]=b=>Tl(sl.value-1)),title:e.unref(N)("table.previousPage")}," ‹ ",8,Td),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[10]||(f[10]=b=>jl.value=b),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(N)("table.currentPageAriaLabel"),onBlur:sn,onKeydown:e.withKeys(e.withModifiers(sn,["prevent"]),["enter"])},null,40,Ad),[[e.vModelText,jl.value]]),e.createElementVNode("span",Hd,e.toDisplayString(e.unref(N)("table.ofPages",{total:fn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sl.value>=Fl.value-1,onClick:f[11]||(f[11]=b=>Tl(sl.value+1)),title:e.unref(N)("table.nextPage")}," › ",8,Rd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sl.value>=Fl.value-1,onClick:f[12]||(f[12]=b=>Tl(Fl.value-1)),title:e.unref(N)("table.lastPage")},[...f[36]||(f[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Fd)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Id,[Lt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:vl},[e.createElementVNode("span",zd,e.toDisplayString(e.unref(N)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":qt.value}]),onClick:f[13]||(f[13]=b=>qt.value=!qt.value),"aria-expanded":qt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Pl},[e.createTextVNode(e.toDisplayString(Wt.value)+" ",1),f[37]||(f[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Pd),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":Dt.value==="top"}]),style:e.normalizeStyle(kt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,b=>(e.openBlock(),e.createElementBlock("li",{key:b,role:"option","aria-selected":b===Wt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":b===Wt.value}]),onClick:_=>xl(b)},e.toDisplayString(b),11,Od))),128))],6),[[e.vShow,qt.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(kl.value?{top:kl.value.top+"px",left:kl.value.left+"px",width:Zl+"px"}:void 0),onClick:f[21]||(f[21]=e.withModifiers(()=>{},["stop"]))},[tl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[tl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("input",{type:"text",value:Hl(Et.value).value??"",onInput:f[14]||(f[14]=b=>wl(Et.value,b.target.value)),class:"dss-table-filter-input",placeholder:e.unref(N)("table.search")},null,40,qd)])):tl.value.filter==="range"&&ol.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ol.value.minPct+"%","--range-max-pct":ol.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:un,class:"dss-table-filter-double-range-track",onMousemove:dt,onMouseenter:dt},[e.createElementVNode("input",{type:"range",min:ol.value.rangeMin,max:ol.value.rangeMax,value:ol.value.currentMin,onInput:f[15]||(f[15]=b=>zl(Et.value,"min",b.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:ml.value==="min"?2:1})},null,44,Zd),e.createElementVNode("input",{type:"range",min:ol.value.rangeMin,max:ol.value.rangeMax,value:ol.value.currentMax,onInput:f[16]||(f[16]=b=>zl(Et.value,"max",b.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:ml.value==="max"?2:1})},null,44,Ud)],544),e.createElementVNode("div",Yd,e.toDisplayString(ol.value.currentMin)+" – "+e.toDisplayString(ol.value.currentMax),1)],4)):tl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",jd,[e.createElementVNode("label",Kd,e.toDisplayString(e.unref(N)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Hl(Et.value).from??"",onInput:f[17]||(f[17]=b=>pn(Et.value,"from",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Gd)]),e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(N)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Hl(Et.value).to??"",onInput:f[18]||(f[18]=b=>pn(Et.value,"to",b.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,e1)])])):tl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:ln[Et.value]??"",onInput:f[19]||(f[19]=b=>ll(Et.value,b.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(N)("table.search")},null,40,t1),e.createElementVNode("div",l1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gn(tl.value),b=>(e.openBlock(),e.createElementBlock("label",{key:b,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:qn(Et.value,b),onChange:_=>Rl(Et.value,b)},null,40,n1),e.createElementVNode("span",null,e.toDisplayString(b),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",a1,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:f[20]||(f[20]=b=>Wn(Et.value))},e.toDisplayString(e.unref(N)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Et.value&&tl.value&&kl.value]])]),_:1})]))],64))}}),r1="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",i1="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",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='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",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='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%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.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",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.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",p1={class:"dss-toolbar-left"},v1=["title"],f1=["title"],h1={class:"dss-toolbar-dropdown-wrapper"},g1=["title"],y1=["src"],k1=["src"],C1=["src"],b1=["src"],w1=["src"],x1=["src"],E1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},S1=["src"],V1=["src"],N1=["src"],B1=["src"],_1=["src"],M1=["src"],$1=["title"],D1=["title"],L1=["title"],T1=["title"],A1=["title"],H1=["title"],R1=["title"],F1=["title"],I1=["title"],z1={key:2,class:"dss-toolbar-separator"},P1=["title"],O1={key:4,class:"dss-toolbar-separator"},W1={key:5,class:"dss-toolbar-dropdown-wrapper"},q1=["title"],Z1={class:"dss-toolbar-dropdown-ai"},U1={class:"dss-toolbar-right"},Y1={key:0,class:"dss-toolbar-custom-group"},X1={key:1,class:"dss-toolbar-separator"},j1={class:"dss-link-modal-content"},K1={class:"dss-link-modal-field"},G1={class:"dss-link-modal-label"},Q1=["placeholder"],J1={class:"dss-link-modal-field"},em={class:"dss-link-modal-label"},tm=["placeholder"],lm={class:"dss-image-modal-tabs"},nm={key:0,class:"dss-image-tab-content"},am={class:"dss-link-modal-content"},om={class:"dss-link-modal-field"},sm={key:0,class:"dss-link-modal-label"},rm=["src"],im={class:"dss-link-modal-field"},cm={class:"dss-link-modal-label"},um=["placeholder"],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={key:1,class:"dss-image-tab-content"},ym={class:"dss-link-modal-content"},km={class:"dss-link-modal-field"},Cm={class:"dss-link-modal-label"},bm=["placeholder"],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-text-editor-title-input-container"},Dm={key:0,class:"dss-text-editor-title-preview"},Lm={key:0},Tm={key:1,class:"dss-text-editor-preview-placeholder"},Am=["value","placeholder","disabled"],Hm={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Rm={class:"dss-text-editor-description-input-container"},Fm={key:0,class:"dss-text-editor-description-preview"},Im={key:0},zm={key:1,class:"dss-text-editor-preview-placeholder"},Pm=["value","placeholder","disabled"],Om={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Wm=["data-comment-id","onMouseenter"],qm=["onClick"],Zm=["src","alt"],Um={key:1},Ym=["onClick"],Xm=["src","alt"],jm={key:1},Km=["data-has-second-user","onClick"],Gm={class:"editor-comment-marker-count"},Qm={key:7,class:"dss-text-editor-textarea-wrapper"},Jm=["value","placeholder","rows","disabled"],e2={class:"dss-text-editor-footer"},t2={class:"dss-text-editor-footer-content"},l2={class:"dss-text-editor-footer-stat"},n2={class:"dss-text-editor-footer-stat"},a2={key:8,class:"dss-text-editor-content-wrapper"},o2={key:0,class:"dss-comment-overlay-body"},s2={class:"dss-comment-selection-wrapper"},r2=["innerHTML"],i2={class:"dss-comment-messages-wrapper"},c2={key:0,class:"dss-comment-avatar-wrapper"},u2={class:"dss-comment-avatar"},d2=["src","alt"],m2={key:1},p2={class:"dss-comment-header"},v2={class:"dss-comment-header-text"},f2={class:"dss-comment-author"},h2={key:0,class:"dss-comment-date"},g2=["onClick","title"],y2={class:"dss-comment-overlay-inner"},k2=["placeholder","onKeydown"],C2={class:"dss-text-editor-footer"},b2={class:"dss-text-editor-footer-content"},w2={class:"dss-text-editor-footer-stat"},x2={class:"dss-text-editor-footer-stat"},E2=["title"],S2=["title"],V2={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:""},N2={class:"dss-image-popup-content"},B2={key:0,class:"dss-image-popup-no-alt-icon"},_2=["title"],M2=["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:""},D2={class:"dss-toolbar-left"},L2=["title"],T2=["title"],A2={class:"dss-toolbar-dropdown-wrapper"},H2=["title"],R2=["src"],F2=["src"],I2=["src"],z2=["src"],P2=["src"],O2=["src"],W2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},q2=["title"],Z2=["title"],U2=["title"],Y2=["title"],X2=["title"],j2=["title"],K2=["title"],G2=["title"],Q2=["title"],J2={key:2,class:"dss-toolbar-separator"},ep=["title"],tp={key:4,class:"dss-toolbar-separator"},lp={key:5,class:"dss-toolbar-dropdown-wrapper"},np=["title"],ap={class:"dss-toolbar-dropdown-ai"},op={key:0,class:"dss-toolbar-right"},sp={key:0,class:"dss-toolbar-separator"},rp={key:0,class:"dss-toolbar-custom-group"},ip={key:1,class:"dss-toolbar-separator"},cp={name:"DSSTextEditor"},up=Object.assign(cp,{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:J,emit:N}){const{t:L,locale:ne}=ha.useI18n(),W={h1:r1,h2:i1,h3:c1,h4:u1,h5:d1,h6:m1},R=B,ue=N,rt=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
96
+ `,gl.value){t+=`Category,Segment,Value
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
+ `})});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
+ `;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">
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),we=e.ref(null),ke=e.ref(!1),G=e.ref(!1),j=e.ref(!1),fe=e.ref(""),He=e.ref({}),he=e.ref(!1),Te=e.ref(!1),Z=e.ref(""),Fe=e.ref(""),qe=e.ref(null),Me=e.ref(null),Ze=e.ref(null),U=e.ref(null),Ae=e.ref(""),Ye=e.ref(!1),Ce=e.ref({}),$e=e.ref(!1),lt=e.ref({}),ft=e.ref(null),it=e.ref(null),Xt=e.ref(!1),xe=e.ref(""),Lt=e.ref(null),Ke=e.ref(""),Je=e.ref(""),mt=e.ref(""),Tt=e.ref(null),at=e.ref(null),pt=e.ref(null),ct=e.ref(null),Ut=e.ref(null),ht=e.ref(!1),Rt=e.ref(""),me=e.ref({}),F=e.ref(!1),Y=e.ref("upload"),re=e.ref(""),ve=e.ref(null),Re=e.ref(null),Ge=e.ref([]),Ct=e.ref([]),Se=e.ref(null),tt=e.ref(!1),gt=e.ref(""),jt=e.ref(""),se=e.ref(""),X=e.ref(""),te=e.ref(""),ie=e.ref(""),Ne=e.ref(null),et=e.ref(null),yt=e.ref(null),al=e.ref(!1),xt=e.ref(null),el=e.ref(!1),H=e.ref(!1),V=e.ref(null),M=e.ref("p"),ae=e.ref(!1),oe=e.ref([]),Ue=e.ref(null),bt=e.ref(null),ot=e.ref(null),Xe=e.ref(!1),Nt=e.ref(0),wt=100,ut=e.ref(null),_t=e.computed(()=>!!R.commentUser),$t=e.computed(()=>({"dss-text-editor-no-border":!R.border,"dss-text-editor-rounded":R.rounded,"dss-text-editor-full-height":R.fullHeight,"dss-comment-overlay-open":_t.value&&C.value!==null})),Et=e.computed(()=>({})),kl=e.computed(()=>!R.fixedHeight||R.fullHeight?{}:{height:`${1.6*14*R.rows+24+2}px`,resize:"none",overflowY:"auto"}),Zl=e.computed(()=>!R.fixedHeight||R.fullHeight?{}:{height:`${1.6*14*R.rows+32}px`,overflowY:"auto"}),bl=e.computed(()=>R.richText&&Ct.value.length>0),tl=e.computed(()=>{if(!R.modelValue)return"";if(R.richText){let o=R.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 R.modelValue}),ol=e.computed(()=>{const o=tl.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),un=e.computed(()=>tl.value.length),ml=e.computed(()=>ct.value!==null&&Y.value==="upload"&&Ke.value&&Ke.value.startsWith("data:")),dt=e.computed(()=>R.titlePlaceholder||L("textEditor.placeholders.title")),Hl=e.computed(()=>R.descriptionPlaceholder||L("textEditor.placeholders.description")),Ul=e.computed(()=>R.placeholder||L("textEditor.placeholders.startTyping")),Ll=o=>rt&&rt[o]!==void 0,Wn=o=>{for(let n=o+1;n<R.customToolbarSlots.length;n++)if(Ll(R.customToolbarSlots[n]))return!0;return!1},Yl=o=>{for(let n=o+1;n<R.customToolbarSlots.length;n++){const s=R.customToolbarSlots[n];if(Ll(s)&&bn(s))return!0}return!1},bn=o=>R.customToolbarFloatingMap.hasOwnProperty(o)?R.customToolbarFloatingMap[o]===!0:!0,$n=e.computed(()=>R.customToolbarSlots.some(o=>Ll(o)&&bn(o))),tn=e.computed(()=>Ll("title-slot")),_l=e.computed(()=>Ll("description-slot")),dn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},wl=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},mn=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())},zl=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""}},pn=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=L("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"},ln=o=>{const n=o.target.value;ue("update:modelValue",n),ue("change",n)},ll=()=>{if(!Ne.value)return;const o=Ne.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")},Gn=()=>{el.value=!0,ll()},qn=()=>{el.value=!1,Rl()},Rl=()=>{if(!Ne.value)return;const o=Ne.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")},vn=o=>{const s=o.target.value;el.value&&ll(),ue("update:title",s),ue("title-change",s),yt.value="title",R.richText&&(tt.value||(jt.value=gt.value,te.value=se.value,ie.value=X.value),Se.value&&clearTimeout(Se.value),tt.value=!0,Se.value=setTimeout(()=>{tt.value=!1,Dt()},500))},Ml=()=>{if(!et.value)return;const o=et.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")},Qn=()=>{H.value=!0,Ml()},nn=()=>{H.value=!1,sl()},sl=()=>{if(!et.value)return;const o=et.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")},Wt=o=>{const s=o.target.value;H.value&&Ml(),ue("update:description",s),ue("description-change",s),yt.value="description",R.richText&&(tt.value||(jt.value=gt.value,te.value=se.value,ie.value=X.value),Se.value&&clearTimeout(Se.value),tt.value=!0,Se.value=setTimeout(()=>{tt.value=!1,Dt()},500))},qt=()=>{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}},vl=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,v=!1;for(;!v&&(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),v=!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()}},Pl=()=>{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],v=s(u);if(v)return v}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)},Dt=(o=!1)=>{if(!g.value)return;const n=g.value.innerHTML,s=R.title||"",i=R.description||"";if(!o&&n===gt.value&&s===se.value&&i===X.value)return;const c={content:jt.value||gt.value,title:te.value!==void 0?te.value:se.value,description:ie.value!==void 0?ie.value:X.value},m=Ge.value.length>0?Ge.value[Ge.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&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Ct.value=[]),gt.value=n,se.value=s,X.value=i,jt.value=n,te.value=s,ie.value=i},kt=o=>{if(!g.value)return;xl(),g.value&&mn(g.value);let n=null;g.value&&(g.value.querySelector("p")||(n=qt(),El()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&V.value&&(V.value=null),G.value=!0;const i=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=dn(i);ue("update:modelValue",c),ue("change",c),yt.value="editor",tt.value||(jt.value=gt.value,te.value=se.value,ie.value=X.value),Se.value&&clearTimeout(Se.value),tt.value=!0,Se.value=setTimeout(()=>{tt.value=!1,Dt(),aa(),ca()},500),e.nextTick(()=>{n&&vl(n),xl();const m=["bold","italic","underline"],u=window.getSelection(),v=u.rangeCount>0?u.getRangeAt(0):null,y=v&&v.collapsed;if(m.forEach(w=>{try{if(y&&V.value?.command===w){Ce.value[w]=V.value.state;return}if(w==="bold")if(v){const I=v.commonAncestorContainer,O=I.nodeType===3?I.parentElement:I;let D=!1;if(O&&((O.tagName==="STRONG"||O.tagName==="B"||O.closest&&O.closest("strong, b"))&&(D=!0),!D&&O.style&&parseInt(O.style.fontWeight)>=600&&(D=!0),!D))try{const ce=window.getComputedStyle(O);parseInt(ce.fontWeight)>=600&&(D=!0)}catch{}Ce.value[w]=D}else Ce.value.hasOwnProperty(w)||(Ce.value[w]=!1);else if(w==="italic")if(v){const I=v.commonAncestorContainer,O=I.nodeType===3?I.parentElement:I,D=O&&(O.tagName==="EM"||O.tagName==="I"||O.closest&&O.closest("em, i"));Ce.value[w]=!!D}else{const I=document.queryCommandState(w);Ce.value[w]=I}else{const I=document.queryCommandState(w);Ce.value[w]=I}}catch{}}),nl(),gl(),$l(),rl(),Vn(),nt("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const w=o.data||"";w&&w.length===1&&setTimeout(()=>ca(w),0),(w===" "||w===`
103
- `||/[.,;:!?]/.test(w))&&setTimeout(()=>{aa()},100)}G.value=!1})},xl=()=>{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,v=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==m||c.contains(v)&&v!==m){const y=document.createRange();y.setStartAfter(c),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}}}},El=()=>{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)}})},gl=()=>{if(g.value&&!al.value){al.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 w=m.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),I=c===m||c===w;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||I||I)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let v=i.parentElement;const y=v&&v.classList.contains("dss-image-wrapper");if(y){const w=v.querySelector(".dss-image-no-alt-icon");w&&w.remove()}else{const w=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;w&&w.remove()}if(u){y?v.setAttribute("contenteditable","false"):(v=document.createElement("span"),v.className="dss-image-wrapper",v.setAttribute("contenteditable","false"),i.parentNode.insertBefore(v,i),v.appendChild(i));const w=document.createElement("div");w.className="dss-image-no-alt-icon",w.setAttribute("contenteditable","false"),w.innerHTML=ee,v.appendChild(w)}else if(y&&v.children.length===1){const w=v.parentNode;w.insertBefore(i,v),w.removeChild(v)}})}finally{al.value=!1}}},Xl=o=>{aa(),ue("blur",o),ta()},Fl=()=>{if(R.disabled||!R.richText||!g.value)return;Kt(),Se.value&&(clearTimeout(Se.value),Se.value=null),tt.value&&(Dt(),tt.value=!1);const o=yt.value==="title",n=yt.value==="description",s=yt.value==="editor";if(Ge.value.length===0){o&&Ne.value?Ne.value.focus():n&&et.value?et.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{kt()});return}const i={content:g.value.innerHTML,title:R.title||"",description:R.description||""};Ct.value.push(i);const c=Ge.value.pop();if(c!==void 0){G.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",v=typeof c=="object"&&c.description||"";g.value.innerHTML=m,gt.value=m,se.value=u,X.value=v,jt.value=m,te.value=u,ie.value=v,e.nextTick(()=>{nl(),yl(),Al(),rl();const y=dn(m);ue("update:modelValue",y),ue("update:title",u),ue("update:description",v),ue("change",y),ue("title-change",u),ue("description-change",v),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ne.value){Ne.value.focus();const w=u.length;Ne.value.setSelectionRange&&Ne.value.setSelectionRange(w,w),ll()}}else if(n){if(et.value){et.value.focus();const w=v.length;et.value.setSelectionRange(w,w)}}else if(s)Pl();else if(Ne.value&&document.activeElement===Ne.value){const w=u.length;Ne.value.setSelectionRange&&Ne.value.setSelectionRange(w,w),ll()}else if(et.value&&document.activeElement===et.value){const w=v.length;et.value.setSelectionRange(w,w)}else g.value&&Pl()},10)})})}},fn=()=>{if(R.disabled||!R.richText||!g.value)return;Kt();const o=yt.value==="title",n=yt.value==="description",s=yt.value==="editor";if(Ct.value.length===0){o&&Ne.value?Ne.value.focus():n&&et.value?et.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{kt()});return}const i={content:g.value.innerHTML,title:R.title||"",description:R.description||""};Ge.value.push(i);const c=Ct.value.pop();if(c!==void 0){G.value=!0;const m=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",v=typeof c=="object"&&c.description||"";g.value.innerHTML=m,gt.value=m,se.value=u,X.value=v,jt.value=m,te.value=u,ie.value=v,e.nextTick(()=>{nl(),yl(),Al(),rl();const y=dn(m);ue("update:modelValue",y),ue("update:title",u),ue("update:description",v),ue("change",y),ue("title-change",u),ue("description-change",v),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ne.value){Ne.value.focus();const w=u.length;Ne.value.setSelectionRange&&Ne.value.setSelectionRange(w,w),ll()}}else if(n){if(et.value){et.value.focus();const w=v.length;et.value.setSelectionRange(w,w)}}else if(s)Pl();else if(Ne.value&&document.activeElement===Ne.value){const w=u.length;Ne.value.setSelectionRange&&Ne.value.setSelectionRange(w,w),ll()}else if(et.value&&document.activeElement===et.value){const w=v.length;et.value.setSelectionRange(w,w)}else g.value&&Pl()},10)})})}},hn=()=>{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"})},$l=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Yt=()=>{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(()=>{$l()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{$l()});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(()=>{$l()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{$l()})}return!0},an=()=>{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(()=>{hn()}),!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 v=u.style.fontWeight;if(v==="normal"||v==="400"){const y=document.createElement("b");y.style.fontWeight="600";const w=document.createDocumentFragment();for(;u.firstChild;)w.appendChild(u.firstChild);y.appendChild(w),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 v=document.createElement("b");v.style.fontWeight="600",v.innerHTML="<br>",c.insertNode(v),c.setStart(v,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}hn()});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(()=>{hn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{hn()})}return!0},Sl=(o,n=null)=>{if(R.disabled||!R.richText||!g.value)return;tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt(),Kt(),g.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const m=s.getRangeAt(0);!m.collapsed&&An(m)&&(i=qt())}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=an();Ce.value.bold=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"bold",state:m}),e.nextTick(()=>{i&&(vl(i),e.nextTick(()=>{const v=St("bold");Ce.value.bold=v})),kt(),yl(),rl()});return}if(o==="italic"){const m=Yt();Ce.value.italic=m;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"italic",state:m}),e.nextTick(()=>{i&&(vl(i),e.nextTick(()=>{const v=St("italic");Ce.value.italic=v})),kt(),$l(),yl(),rl()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(i&&vl(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=St("bold");Ce.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=St("italic");Ce.value.italic=u});else{const u=document.queryCommandState(o);Ce.value[o]=u}else{const u=document.queryCommandState(o);Ce.value[o]=u}}catch{Ce.value.hasOwnProperty(o)?Ce.value[o]=!Ce.value[o]:Ce.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const y=u.getRangeAt(0),w=y.commonAncestorContainer.nodeType===1?y.commonAncestorContainer.closest("a"):y.commonAncestorContainer.parentElement?.closest("a");w&&(!w.getAttribute("href")||w.getAttribute("href")==="")&&w.setAttribute("href",n)}g.value.querySelectorAll("a").forEach(y=>{const w=y.getAttribute("href");(!w||w===""||w==="#")&&y.setAttribute("href",n)})}kt(),yl(),rl()})},St=(o,n=null)=>{if(R.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 v=m.getRangeAt(0).commonAncestorContainer;return!!(v.nodeType===1?v.tagName==="BLOCKQUOTE"?v:v.closest("blockquote"):v.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 v=c.commonAncestorContainer,y=v.nodeType===3?v.parentElement:v;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 w=window.getComputedStyle(y);parseInt(w.fontWeight)>=600&&(u=!0)}catch{}return Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.value[o]=u,u)}else{const v=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(v){const w=document.createTreeWalker(v,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let I;for(;I=w.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(I))){if(I.nodeType===3){if(!(I.textContent||"").trim())continue;y=!0;let D=I.parentElement;for(;D&&D!==g.value;){if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}D=D.parentElement}}else if(I.nodeType===1){const O=I;if(O.tagName==="STRONG"||O.tagName==="B"){u=!0;break}if(O.style&&parseInt(O.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ce.value[o]=u&&y,u&&y}}if(o==="italic"){let u=!1;if(c.collapsed){const v=c.commonAncestorContainer,y=v.nodeType===3?v.parentElement:v;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 Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.value[o]=u,u)}else{const v=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let y=!1;if(v){const w=document.createTreeWalker(v,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let I;for(;I=w.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(I))){if(I.nodeType===3){if(!(I.textContent||"").trim())continue;y=!0;let D=I.parentElement;for(;D&&D!==g.value;){if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}D=D.parentElement}}else if(I.nodeType===1){const O=I;if(O.tagName==="EM"||O.tagName==="I"){u=!0;break}if(O.style&&O.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ce.value[o]=u&&y,u&&y}}const m=document.queryCommandState(o);return c.collapsed&&Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.value[o]=m,m)}return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}catch{return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Dn=o=>{R.disabled||!R.richText||(we.value=we.value===o?null:o,o==="askAi"&&(it.value=null))},Kt=()=>{we.value=null,ve.value=null},Vl=o=>{Sl("formatBlock",o),Kt()},gn=o=>{if(!o||!g.value)return o;const n=Pe=>{let De=Pe.nodeType===Node.TEXT_NODE?Pe.parentElement:Pe;for(;De&&De!==g.value;){const vt=De.tagName;if(vt==="P"){const Ot=De.parentElement;if(Ot===g.value||Ot.tagName==="BLOCKQUOTE")return De}if(vt==="BLOCKQUOTE")break;De=De.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:Pe=>{const De=Pe.tagName;if(De==="P"){const vt=Pe.parentElement;if(vt===g.value||vt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return De==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=m.nextNode();)c.push(u);const v=c.indexOf(s),y=c.indexOf(i);if(v===-1||y===-1)return o;const w=Math.min(v,y),I=Math.max(v,y),O=c.slice(w,I+1);if(O.length===0)return o;const D=O[0],ce=O[O.length-1],le=document.createRange();return le.setStartBefore(D),le.setEndAfter(ce),le},wn=()=>{if(R.disabled||!R.richText||!g.value)return;tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt(),Kt(),g.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&An(n)&&(n=gn(n),o.removeAllRanges(),o.addRange(n));let s=null;!n.collapsed&&An(n)&&(s=qt());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 w=document.createElement("p");w.appendChild(y.cloneNode(!0)),u.insertBefore(w,c)}else if(y.nodeType===Node.TEXT_NODE&&y.textContent.trim()){const w=document.createElement("p");w.appendChild(y.cloneNode(!0)),u.insertBefore(w,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),v=n.extractContents();u.appendChild(v),n.insertNode(u);const y=[],w=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:D=>D.parentNode===u&&D.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let I;for(;I=w.nextNode();)y.push(I);if(y.forEach(D=>{const ce=document.createElement("p");D.parentNode.insertBefore(ce,D),ce.appendChild(D)}),u.querySelectorAll("p, div").forEach(D=>{D.textContent.trim()===""&&!D.querySelector("img")&&(D.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const D=document.createElement("p");D.innerHTML="<br>",u.appendChild(D)}}e.nextTick(()=>{s&&vl(s),Al(),kt(),rl()})},on=()=>{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=I=>{if(!I)return!1;const O=I.textContent||"",ce=(I.innerHTML||"").trim();return O.trim()===""||ce===""||ce==="<br>"||ce==="<br/>"||ce==="<p></p>"||ce==="<p><br></p>"||ce==="<p><br/></p>"||ce==="<p> </p>"||ce==="<p><br> </p>"||ce==="<div></div>"||ce==="<div><br></div>"||ce==="<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 I=i.lastChild;if(I.nodeType===1&&I.tagName==="BR")I.remove();else if(I.nodeType===3)if((I.textContent||"").trim()==="")I.remove();else break;else break}if(i.children.length>0)for(let I=i.children.length-1;I>=0;I--){const O=i.children[I];if((O.tagName==="P"||O.tagName==="DIV")&&c(O))O.remove();else break}let u=i.innerHTML;const v=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==v&&(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 w=document.createRange();w.selectNodeContents(y),w.collapse(!0),o.removeAllRanges(),o.addRange(w),e.nextTick(()=>{Al(),kt()})},yl=()=>{if(!g.value){ke.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},Ln=()=>{if(!g.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),U.value=qt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Z.value="",Fe.value=s,Ae.value="",Ze.value=null,Te.value=!0,Kt(),e.nextTick(()=>{qe.value&&qe.value.focus()})},jl=()=>{if(!g.value)return;tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt();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&&Ze.value&&(n=Ze.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)}Ze.value=null}else Sl("unlink");ke.value=!1,Kt(),e.nextTick(()=>{kt(),yl()})},sn=()=>{R.disabled||!R.richText||g.value&&(tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt(),Kt(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{nl(),kt(),rl()}))},Tl=()=>{R.disabled||!R.richText||g.value&&(tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt(),Kt(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{nl(),kt(),rl()}))},Kl=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},nl=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Kl(s);i!==null&&Array.from(n.children).filter(m=>m.tagName==="LI").forEach(m=>{m.setAttribute("data-parent-num",String(i))})}})},Ol=()=>{if(R.disabled||!R.richText||!g.value)return;Kt(),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(()=>{nl(),kt()});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 v=Kl(c);u.appendChild(s),v!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(v)),nl();const y=document.createRange();y.selectNodeContents(s),y.collapse(!1),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{kt(),rl()})}else document.execCommand("indent",!1),e.nextTick(()=>{nl(),kt(),rl()})},k=()=>{if(R.disabled||!R.richText||!g.value)return;Kt(),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(()=>{nl(),kt()});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(),nl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{kt(),rl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{nl(),kt(),rl()})},C=e.ref(null),x=e.ref(null),d=e.ref({}),f=e.ref(""),b=e.ref(null),_=e.ref("");e.ref("");const $=e.ref(null);e.ref("");const ye=e.ref([]),ge=e.ref(!1),st=e.ref(!1),Ve=o=>{if(!o)return"";const n=o.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Qe=()=>{if(!R.commentUser||R.disabled||!R.richText||!g.value)return;if(C.value!==null){C.value=null,f.value="",_.value="",$.value=null,ye.value=[],Fn(!0);return}Kt(),g.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!An(n))return;_.value=Ve(n)||"",$.value=qt();const s=n.getBoundingClientRect(),i=g.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),m=s.bottom-c.top,v=Math.max(m+8,0);d.value={top:`${v}px`,bottom:"auto"},C.value=Date.now(),e.nextTick(()=>{if(f.value="",b.value){const w=b.value;w.style.height="auto",w.style.height=`${w.scrollHeight}px`,w.focus()}const y=i.querySelector(".dss-comment-overlay");if(y&&i){const w=i.querySelector(".dss-text-editor-footer");if(w){const I=i.getBoundingClientRect(),O=y.getBoundingClientRect(),D=w.getBoundingClientRect(),ce=O.bottom-I.top,le=D.top-I.top,Pe=8;if(ce>le-Pe){const De=D.height;d.value={bottom:`${De+Pe}px`,top:"auto"}}else d.value={top:`${v}px`,bottom:"auto"}}}})},Q=()=>{if(!f.value.trim())return;const o=f.value.trim(),n=new Date,s={text:o,selectionText:_.value,selectionRange:$.value,commentId:C.value,user:R.commentUser||null,createdAt:n.toISOString()};ye.value=[...ye.value,s],ue("comment-submitted",s),xn(s),$.value&&!Oe($.value)&&ea(C.value,$.value),f.value="",e.nextTick(()=>{if(b.value){const i=b.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}nt("sendComment")})},Zt=(o,n)=>{if(!(!R.commentUser||!o.user||o.user.id!==R.commentUser.id)){if(ye.value=ye.value.filter((s,i)=>i!==n),C.value!==null&&g.value){const s=String(C.value),i=g.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&ye.value.length>0){const c=[],m=new Set;ye.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(ye.value.length))}else i&&ye.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(ue("comment-deleted",{comment:o,index:n,commentId:C.value}),R.comments&&Array.isArray(R.comments)){const s=R.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));ue("update:comments",s)}e.nextTick(()=>{nt("deleteComment")})}},Oe=o=>{if(!o||!g.value)return!1;try{const n=Jn(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},Jn=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 v=s+c.length;!m&&o.start>=s&&o.start<=v&&(n.setStart(c,o.start-s),m=!0),m&&o.end>=s&&o.end<=v&&(n.setEnd(c,o.end-s),u=!0),s=v}else{let v=c.childNodes.length;for(;v--;)i.push(c.childNodes[v])}return m?n:null}catch{return null}},ea=(o,n)=>{if(!(!o||!n||!g.value))try{const s=Jn(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const v=c.closest("[data-comment], [data-fake-comment]");if(v){v.getAttribute("data-comment")!==String(o)&&v.getAttribute("data-fake-comment")!==String(o)&&v.setAttribute("data-comment",String(o));return}}const m=document.createElement("span");m.setAttribute("data-comment",String(o));try{const v=s.startContainer,y=s.endContainer,w=s.startOffset,I=s.endOffset,O=v.nodeType===3?v.parentNode:v,D=y.nodeType===3?y.parentNode:y;if(O===D&&w===0&&I===(y.nodeType===3?y.length:D.childNodes.length)&&(O.tagName==="P"||O.tagName==="DIV"||O.tagName==="H1"||O.tagName==="H2"||O.tagName==="H3"||O.tagName==="H4"||O.tagName==="H5"||O.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(()=>{nt("wrapSelectionWithCommentMarker"),kt()})}catch{}},xn=o=>{if(!o||!o.commentId)return;const n=Array.isArray(R.comments)?[...R.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(v=>v.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,v={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(v)}ge.value=!0,ue("update:comments",n)},yn=(o,n=[])=>{if(!R.commentUser||R.disabled||!R.richText||!g.value)return;const s=g.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;Kt(),s.focus();const c=document.createRange();c.selectNodeContents(i);const m=window.getSelection();m&&(m.removeAllRanges(),m.addRange(c)),_.value=i.innerHTML||"",$.value=qt();const u=c.getBoundingClientRect(),v=s.parentElement;if(v){const I=v.getBoundingClientRect(),O=u.bottom-I.top,ce=Math.max(O+8,0);d.value={top:`${ce}px`,bottom:"auto"}}const y=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let w=[];if(y&&R.comments&&Array.isArray(R.comments)){const I=R.comments.find(O=>String(O.conversation_id)===String(y));if(I&&I.conversation&&Array.isArray(I.conversation)){const O=I.conversation.map(D=>({id:D.id||D.commentary_id,commentary_id:D.id||D.commentary_id,conversation_id:I.id||I.conversation_id,text:D.text,user:D.user,createdAt:D.created_at||D.createdAt,updated_at:D.updated_at||D.updatedAt}));w.push(...O)}}w.length===0&&Array.isArray(n)&&n.length>0&&(w=n.slice()),w.sort((I,O)=>{const D=Pe=>{if(!Pe)return 0;const De=new Date(Pe).getTime();return isNaN(De)?0:De},ce=D(I.createdAt),le=D(O.createdAt);return ce===le?0:ce-le}),ye.value=w,Fn(!0),C.value=y||null,i&&(x.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(f.value="",b.value){const I=b.value;I.style.height="auto",I.style.height=`${I.scrollHeight}px`,I.focus()}if(v){const I=v.querySelector(".dss-comment-overlay");if(I){const O=v.querySelector(".dss-text-editor-footer");if(O){const D=v.getBoundingClientRect(),ce=I.getBoundingClientRect(),le=O.getBoundingClientRect(),Pe=ce.bottom-D.top,De=le.top-D.top,vt=8;if(Pe>De-vt){const Ot=le.height;d.value={bottom:`${Ot+vt}px`,top:"auto"}}}}}nt("openCommentOverlayForSelector")})},En=e.ref(null),Tn=e.ref(0),ja=o=>{if(!(R.disabled||!R.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 v=document.createElement("p");v.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(v,u.nextSibling):c.appendChild(v),setTimeout(()=>{on()},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 v=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,y=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(m.contains(v)&&v!==u||m.contains(y)&&y!==u){o.preventDefault();const w=document.createRange();w.setStartAfter(m),w.collapse(!0),n.removeAllRanges(),n.addRange(w);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 v=u.previousSibling;v&&(v.classList&&v.classList.contains("dss-image-wrapper")?c=v:v.tagName==="IMG"&&(i=v,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 v=u.nextSibling;v&&(v.classList&&v.classList.contains("dss-image-wrapper")?c=v:v.tagName==="IMG"&&(i=v,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,v=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,w=c.contains(v)||v===c,O=s.cloneContents().textContent?.trim()||"",D=c.textContent?.trim()||"";(!y||!w||O.length>D.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 v=document.createRange();v.setStartAfter(u),v.collapse(!0),n.removeAllRanges(),n.addRange(v),e.nextTick(()=>{kt()});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,v=y=>{if(!y)return!1;let w=y.previousSibling;for(;w;){if(w.classList&&w.classList.contains("dss-image-wrapper")||w.tagName==="IMG"||w.querySelector&&w.querySelector(".dss-image-wrapper")||w.querySelector&&w.querySelector("img"))return!0;w=w.previousSibling}const I=y.parentElement;return I&&I!==g.value?v(I):!1};if(u.nodeType===3){const y=u.parentElement;if(y&&(v(y)||v(u))){const w=y.closest("p, div");if(w&&w!==g.value){o.preventDefault(),o.stopPropagation();let I=null;const O=s.startOffset;O<u.length&&(I=u.splitText(O));const D=document.createElement("p");if(I?D.appendChild(I):D.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}w.nextSibling?w.parentNode.insertBefore(D,w.nextSibling):w.parentNode.appendChild(D);const ce=document.createRange();I?ce.setStart(I,0):ce.setStart(D,0),ce.collapse(!0),n.removeAllRanges(),n.addRange(ce),e.nextTick(()=>{kt()});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 v=le=>{if(!le)return!1;const Pe=le.textContent||"",vt=(le.innerHTML||"").trim(),Ot=vt.replace(/<br\s*\/?>/gi,"").trim();return Pe.trim()===""||vt===""||Ot===""||vt==="<br>"||vt==="<br/>"||vt==="<p></p>"||vt==="<p><br></p>"||vt==="<p><br/></p>"||vt==="<p> </p>"||vt==="<p><br> </p>"||vt==="<div></div>"||vt==="<div><br></div>"||vt==="<div><br/></div>"},y=c.lastChild,w=y&&y.nodeType===1&&y.tagName==="BR",I=s.startContainer,O=I.nodeType===3?I.parentElement:I,D=O===c||O&&O.parentElement===c;if(u&&v(u)||w&&D){o.preventDefault(),setTimeout(()=>{on()},50);return}}}}if(o.key===" "){const n=Date.now(),s=n-Tn.value;if(En.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}}}}En.value=" ",Tn.value=n}else En.value=o.key}},Ka=o=>{if(R.disabled||!R.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,"")),Dt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let v=i.getRangeAt(0).commonAncestorContainer;v.nodeType===3&&(v=v.parentNode),c=v.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const m=u=>{const y=new DOMParser().parseFromString(u,"text/html");let w=g.value.querySelector("h1")?1:0;if(y.querySelectorAll("h1").forEach(O=>{if(w>0){const D=y.createElement("p");D.innerHTML=O.innerHTML,O.parentNode.replaceChild(D,O)}else w++}),c){const O=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],D=Array.from(y.body.children).filter(ce=>O.includes(ce.tagName));if(D.length===1){const ce=D[0].tagName,le=c.tagName,Pe=c.textContent.trim()===""&&!c.querySelector("img");let De=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?De=!0:Pe||(ce===le||ce==="P")&&(De=!0),De)return D[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 v=m(s);document.execCommand("insertHTML",!1,v)}else document.execCommand("insertText",!1,s);kt()},$a=o=>{if(we.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&Kt()}if($e.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=g.value&&s.closest(".dss-text-editor-content");!i&&!c&&ta()}if(it.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Aa()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(ve.value=null),!g.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ae.value=!i.collapsed&&An(i)}else ae.value=!1}if(C.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),v=o.clientX,y=o.clientY;i=v>=u.left&&v<=u.right&&y>=u.top&&y<=u.bottom}const c=n.closest(".dss-toolbar-button"),m=c&&c.getAttribute("title")==="Comment";!i&&!m&&(C.value=null,f.value="",_.value="",$.value=null,ye.value=[],Fn(!0))}},Da=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Re.value&&(clearTimeout(Re.value),Re.value=null),ve.value=n},La=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}Re.value&&clearTimeout(Re.value),Re.value=setTimeout(()=>{ve.value=null,Re.value=null},150)},Ga=o=>{ve.value=null};let Sn=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(v=>v.tagName==="DIV"?v.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(v.children).filter(w=>w.tagName==="BUTTON"||w.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(v=>v.tagName==="BUTTON"||v.tagName==="DIV");if(c||u){const v=`submenu-auto-${++Sn}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",v);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",v),y.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?y.dataset.originalParentRef="inside":y.dataset.originalParentRef="sibling",Array.from(y.children).forEach(I=>{(I.tagName==="BUTTON"||I.tagName==="DIV")&&!I.classList.contains("dss-toolbar-dropdown-item")&&I.classList.add("dss-toolbar-dropdown-item")}))}})},Ta=()=>{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 w=c.getAttribute("data-submenu-id");w&&Da(y,w)},v=La;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",v),c._subMenuHandlers={enter:u,leave:v}}),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=w=>{const I=c.getAttribute("data-submenu-id");I&&Da(w,I)},v=La;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",v),c._subMenuHandlers={enter:u,leave:v},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(w=>{w.addEventListener("click",Ga)})})})};let Zn=null;const sa=()=>{if(ve.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${ve.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${ve.value}"]`);o&&n&&_n(o,n)}if($e.value&&rl(),R.richText){if(Zn!==null)return;Zn=setTimeout(()=>{Zn=null,nt("handleWindowResize")},150)}},ra=()=>{if(!R.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(()=>{el.value?ll():Rl(),H.value?Ml():sl()})}),e.nextTick(()=>{Ja()}),R.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",$a),window.addEventListener("resize",sa);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,sa()},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,sa()},150))};s&&(s.addEventListener("scroll",c),g.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Ta(),ra()}),g.value.addEventListener("click",v=>{const y=v.target;y.closest("a")&&!R.disabled&&v.preventDefault();const I=y.closest(".dss-image-no-alt-icon"),O=y.closest(".dss-image-wrapper");if(I||O&&y===O){v.preventDefault(),v.stopPropagation();const D=window.getSelection(),ce=document.createRange();ce.setStartAfter(O),ce.collapse(!0),D.removeAllRanges(),D.addRange(ce)}else O&&y.tagName!=="IMG"&&(v.preventDefault(),e.nextTick(()=>{const D=window.getSelection();if(D.rangeCount>0){const le=D.getRangeAt(0).commonAncestorContainer,Pe=le.nodeType===3?le.parentElement:le;if(O.contains(Pe)&&Pe!==O.querySelector("img")){const De=document.createRange();De.setStartAfter(O),De.collapse(!0),D.removeAllRanges(),D.addRange(De)}}else{const ce=document.createRange();ce.setStartAfter(O),ce.collapse(!0),D.addRange(ce)}}))},!0),g.value.addEventListener("mousedown",v=>{const y=v.target,w=y.closest(".dss-image-no-alt-icon"),I=y.closest(".dss-image-wrapper");if(w||I&&y.tagName!=="IMG"){v.preventDefault();const O=window.getSelection(),D=document.createRange();I&&(D.setStartAfter(I),D.collapse(!0),O.removeAllRanges(),O.addRange(D))}},!0),g.value.addEventListener("paste",v=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(w=>{if(!w.closest(".dss-image-wrapper"))w.removeAttribute("alt"),w.removeAttribute("data-alt"),w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt="";else{const O=w.getAttribute("alt")||w.alt||"";if(O){const D=w.getAttribute("src")||w.src||"",ce=D.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=O===D||O===ce;(O.startsWith("http://")||O.startsWith("https://")||O.startsWith("data:")||le||le)&&(w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt="")}}}),gl()})}),g.value.addEventListener("dragstart",v=>{const y=v.target,w=y.tagName==="IMG"?y:y.closest("img"),I=w?.closest(".dss-image-wrapper");w&&g.value.contains(w)&&(xt.value=I||w,v.dataTransfer.effectAllowed="move",v.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",v=>{xt.value&&(v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",v=>{xt.value&&(v.preventDefault(),v.stopPropagation())}),g.value.addEventListener("drop",v=>{if(!xt.value||!g.value)return;v.preventDefault(),v.stopPropagation();const y=xt.value,w=y.classList?.contains("dss-image-wrapper"),I=w?y.querySelector("img"):y,O=w?y:I?.closest(".dss-image-wrapper");if(!I||!g.value.contains(I)){xt.value=null;return}let D=null;const ce=v.clientX,le=v.clientY;if(document.caretRangeFromPoint)D=document.caretRangeFromPoint(ce,le);else{const Gt=window.getSelection();Gt.rangeCount>0?D=Gt.getRangeAt(0).cloneRange():(D=document.createRange(),D.selectNodeContents(g.value),D.collapse(!1))}if(!D){xt.value=null;return}const Pe=D.commonAncestorContainer,De=Pe.nodeType===3?Pe.parentElement:Pe;if(De?.closest(".dss-image-wrapper")===O||O&&O.contains(De)){xt.value=null;return}if(O&&(De===O||O.contains(De))){xt.value=null;return}const Ot=I.getAttribute("src");let zt=null;O?zt=O.cloneNode(!0):zt=I.cloneNode(!0);try{let Gt=D.startContainer;if(Gt.nodeType===3&&(Gt=Gt.parentElement),O&&(Gt===O||O.contains(Gt))){const Qt=document.createRange();Qt.setStartAfter(O),Qt.collapse(!0),D=Qt}D.insertNode(zt);const dl=document.createRange();dl.setStartAfter(zt),dl.collapse(!0);const At=window.getSelection();At.removeAllRanges(),At.addRange(dl)}catch{if(g.value.childNodes.length===0){const dl=document.createElement("p");dl.appendChild(zt),g.value.appendChild(dl)}else{const dl=g.value.lastChild;if(dl&&dl.nodeType===1)dl.appendChild(zt);else{const At=document.createElement("p");At.appendChild(zt),g.value.appendChild(At)}}}O?O.remove():I.remove(),xt.value=null,e.nextTick(()=>{const Gt=g.value.querySelectorAll("img");let dl=!1;Gt.forEach(At=>{if(At.getAttribute("src")===Ot)if(!dl)dl=!0;else{const Qt=At.closest(".dss-image-wrapper");Qt?Qt.remove():At.remove()}}),gl(),kt()})}),g.value.addEventListener("dragend",v=>{xt.value=null});let m=null;const u=new MutationObserver(v=>{v.forEach(y=>{y.addedNodes.forEach(w=>{if(w.nodeType===1){w.tagName==="IMG"&&(w.removeAttribute("alt"),w.removeAttribute("data-alt"),w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt="");const I=w.querySelectorAll&&w.querySelectorAll("img");I&&I.forEach(O=>{O.removeAttribute("alt"),O.removeAttribute("data-alt"),O.setAttribute("alt",""),O.setAttribute("data-alt",""),O.alt=""})}})}),m&&clearTimeout(m),m=setTimeout(()=>{gl(),ra(),m=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const v=document.querySelector(".dss-text-editor-toolbar");if(v){const y=new MutationObserver(()=>{e.nextTick(()=>{ra()})});y.observe(v,{childList:!0,subtree:!0}),v._toolbarMutationObserver=y}}),R.modelValue){const v=wl(R.modelValue);g.value.innerHTML=v,El()}e.nextTick(()=>{const v=g.value.innerHTML||"",y=R.title||"",w=R.description||"";gt.value=v,se.value=y,X.value=w,te.value=y,ie.value=w,nl(),gl(),$l(),Vn(),da(),cl()}),yl(),Al(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",$a),window.removeEventListener("resize",sa),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Zn!==null&&(clearTimeout(Zn),Zn=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),Se.value&&clearTimeout(Se.value),Re.value&&clearTimeout(Re.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Ue.value&&Ue.value.disconnect(),bt.value!==null&&(cancelAnimationFrame(bt.value),bt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),ut.value!==null&&(clearTimeout(ut.value),ut.value=null),Fn(!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&&!R.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,v=u.nodeType===3?u.parentElement:u;if(i.contains(v)&&v!==i.querySelector("img")){const y=document.createRange();y.setStartAfter(i),y.collapse(!0),c.removeAllRanges(),c.addRange(y)}}gl(),yl(),Al(),rl(),Vn()}):e.nextTick(()=>{gl(),yl(),Al(),rl(),Vn()})},Ca=()=>{xl();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);ae.value=!s.collapsed&&An(s),!s.collapsed&&V.value&&(V.value=null)}else ae.value=!1;if(gl(),yl(),Al(),rl(),Vn(),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(),ae.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 v=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(v=!0),!v&&u.style&&parseInt(u.style.fontWeight)>=600&&(v=!0),!v))try{const y=window.getComputedStyle(u);parseInt(y.fontWeight)>=600&&(v=!0)}catch{}Ce.value[s]=v}else{const m=document.queryCommandState(s);Ce.value[s]=m}}}catch{}})},Vn=()=>{if(!R.richText||R.disabled||!g.value){M.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){M.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!g.value.contains(i)){M.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){M.value="p";return}const m=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(m)?M.value=m:M.value="p"}catch{M.value="p"}},Al=()=>{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}},An=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},ta=()=>{$e.value=!1},rl=()=>{if(!R.floatingToolbar||!R.richText||R.disabled){$e.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){$e.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!An(n)){$e.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){$e.value=!1;return}const i=g.value;if(!i){$e.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){$e.value=!1;return}const m=40,u=8,v=s.top-m/2+15;let y=s.left+s.width/2;const w=window.innerWidth||document.documentElement.clientWidth||0;let I=0;ft.value&&(I=ft.value.getBoundingClientRect().width);const O=(I||320)/2;let D=c.left+O,ce=c.right-O;if(ce<D){const le=c.left+c.width/2;D=le,ce=le}if(w>0){const le=O+u,Pe=w-O-u;if(D=Math.max(D,le),ce=Math.min(ce,Pe),ce<D){const De=w/2;D=De,ce=De}}y<D?y=D:y>ce&&(y=ce),lt.value={position:"fixed",top:`${Math.max(v,8)}px`,left:`${y}px`,transform:"translate(-50%, -100%)",zIndex:10003},$e.value=!0},ba=o=>{R.disabled||!R.richText||(it.value=it.value===o?null:o,o==="askAi"&&(we.value=null))},Aa=()=>{it.value=null,ve.value=null},Gl=o=>{Vl(o),Aa()};let Nn=null,Wl=null,Hn=null,Un=null;const to=o=>{if(R.disabled||!R.richText){la(),na();return}const n=o.target,s=n.closest("a"),i=n.closest("img");if(Nn&&(clearTimeout(Nn),Nn=null),Hn&&(clearTimeout(Hn),Hn=null),s&&s!==Wl){na(),Wl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Ze.value=s,fe.value=c,j.value=!0,he.value=!0,Ha(s)}else!s&&Wl?(Wl=null,Nn=setTimeout(()=>{he.value||la()},150)):s&&s===Wl&&Ha(s);if(i&&i!==Un){la(),Un=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),ct.value=i,Rt.value=c.trim()||L("textEditor.image.noAlt"),ht.value=!0,F.value=!0,wa(i)}else!i&&Un?(Un=null,Hn=setTimeout(()=>{F.value||na()},150)):i&&i===Un&&wa(i)},lo=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Wl=null,Un=null,Nn&&(clearTimeout(Nn),Nn=null),Hn&&(clearTimeout(Hn),Hn=null),la(),na())},la=()=>{he.value=!1,setTimeout(()=>{he.value||(j.value=!1,fe.value="",Te.value||(Ze.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;He.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},na=()=>{F.value=!1,setTimeout(()=>{F.value||(ht.value=!1,Rt.value="",Xt.value||(ct.value=null))},100)},wa=o=>{if(!o||!g.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,m=n.left+n.width/2;me.value={position:"fixed",top:`${c}px`,left:`${m}px`,transform:"translateX(-50%)",zIndex:10002}},xa=()=>{if(!fe.value||!Ze.value)return;let n=Ze.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ra=()=>{if(Ze.value){const o=Ze.value.textContent||"",n=Ze.value.getAttribute("href")||"",s=Ze.value;Z.value=n,Fe.value=o,Ae.value=o,he.value=!1,j.value=!1,fe.value="",Ze.value=s,Te.value=!0}else if(ke.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",m=i.getAttribute("href")||"";Z.value=m,Fe.value=c,Ae.value=c,Ze.value=i,Te.value=!0}}}else{U.value=qt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),Z.value="",Fe.value=n,Ae.value="",Ze.value=null,Te.value=!0}e.nextTick(()=>{qe.value&&(qe.value.focus(),qe.value.select())})},ia=()=>{Te.value=!1,Z.value="",Fe.value="",Ae.value="",Ze.value=null,U.value=null},Ea=()=>{if(!Z.value.trim()){ia();return}if(tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt(),Fe.value.trim()||(Fe.value=Z.value.trim()),Ze.value&&g.value&&g.value.contains(Ze.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Ze.value;if(n.setAttribute("href",Z.value.trim()),Fe.value.trim()!==Ae.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=Fe.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),kt()}else if(g.value){g.value.focus();const o=window.getSelection();o.removeAllRanges(),U.value&&vl(U.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Z.value.trim(),s.textContent=Fe.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=Z.value.trim(),m.textContent=Fe.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 v=u.nextElementSibling;if(v&&(v.innerHTML==="<br>"||v.innerHTML==="<br/>"||v.textContent.trim()==="")){v.textContent="",v.appendChild(m);const y=document.createTextNode(" ");v.appendChild(y);const w=document.createRange();w.setStartAfter(m),w.collapse(!0),o.removeAllRanges(),o.addRange(w)}else{if(n.startOffset>0){const w=s.textContent.substring(0,n.startOffset),I=w[w.length-1];if(I&&I!==" "&&I!==" "&&I!==`
104
- `){const O=document.createTextNode(" ");n.insertNode(O),n.setStartAfter(O)}}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 v=s.textContent.substring(0,n.startOffset),y=v[v.length-1];if(y&&y!==" "&&y!==" "&&y!==`
105
- `){const w=document.createTextNode(" ");n.insertNode(w),n.setStartAfter(w)}}n.insertNode(m);const u=document.createTextNode(" ");n.setStartAfter(m),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}kt()}e.nextTick(()=>{yl(),ia()})},aa=()=>{if(!g.value||G.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=qt());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:v=>{const y=v.parentElement;return!y||y.closest("a")||y.closest(".dss-image-wrapper")||!v.textContent||v.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let m;for(;m=i.nextNode();)c.push(m);let u=!1;for(let v=c.length-1;v>=0;v--){const y=c[v],w=y.textContent;s.lastIndex=0;const I=[...w.matchAll(s)];if(I.length===0)continue;const O=I.filter(le=>{const Pe=le[0],De=le.index;if(De>0&&w[De-1]==="@"||De+Pe.length<w.length&&w[De+Pe.length]==="@")return!1;const vt=y.parentElement;return!(vt&&vt.closest("a"))});if(O.length===0)continue;if(O.length===1&&O[0][0]===w.trim()){const le=O[0][0],Pe=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,De=document.createElement("a");De.href=Pe,De.textContent=le,De.style.color="#60afdf",De.style.textDecoration="underline",y.parentNode&&(y.parentNode.replaceChild(De,y),u=!0);continue}let D=0;const ce=document.createDocumentFragment();if(O.forEach(le=>{const Pe=le.index,De=le[0];if(Pe>D){const zt=w.substring(D,Pe);zt&&ce.appendChild(document.createTextNode(zt))}const vt=De.startsWith("http://")||De.startsWith("https://")?De:`https://${De}`,Ot=document.createElement("a");Ot.href=vt,Ot.textContent=De,Ot.style.color="#60afdf",Ot.style.textDecoration="underline",ce.appendChild(Ot),D=Pe+De.length}),D<w.length){const le=w.substring(D);le&&ce.appendChild(document.createTextNode(le))}y.parentNode&&ce.childNodes.length>0&&(y.parentNode.replaceChild(ce,y),u=!0)}u&&n&&e.nextTick(()=>{vl(n),yl()})},no=()=>{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,v=[...u.matchAll(o)];if(v.length===0)continue;let y=0;const w=document.createDocumentFragment();v.forEach(I=>{const O=I.index,D=I[0].startsWith("<u>")?"u":"ins",ce=I[1]||I[2]||"";O>y&&w.appendChild(document.createTextNode(u.substring(y,O)));const le=document.createElement(D);le.textContent=ce,w.appendChild(le),y=O+I[0].length}),y<u.length&&w.appendChild(document.createTextNode(u.substring(y))),m.parentNode&&w.childNodes.length>0&&m.parentNode.replaceChild(w,m)}},ca=o=>{if(!g.value||G.value)return;if(!o){no();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 zt="",Gt=0,dl=!1;const At=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:rn=>rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Qt=0;for(;At.nextNode();){const rn=At.currentNode,kn=rn.textContent||"",Il=Qt;if(Qt+=kn.length,rn===i.startContainer){zt+=kn.substring(0,i.startOffset),Gt=Il+i.startOffset,dl=!0;break}zt+=kn}return dl||(Gt=zt.length),{textBeforeCursor:zt,cursorCharOffset:Gt}},{textBeforeCursor:u}=m();if(!u.length)return;let v=null,y=null;if(u.endsWith("**")&&(v=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(v=u.match(/__(.+?)__$/s))?y="strong":u.endsWith("*")&&!u.endsWith("**")&&(v=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(v=u.match(new RegExp("(?<!_)_([^_]+)_$")))?y="em":o===">"&&((v=u.match(/<u>(.+?)<\/u>$/s))||(v=u.match(/<ins>(.+?)<\/ins>$/s)))&&(y=v[0].startsWith("<u>")?"u":"ins",v[0].startsWith("<u>"),v[0].startsWith("<u>")),!v||!v[1])return;const w=v[0],I=v[1],O=u.length-w.length,ce=(zt=>{let Gt=0;const dl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Qt=>Qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let At;for(;At=dl.nextNode();){const Qt=(At.textContent||"").length;if(Gt+Qt>=zt)return{node:At,offset:zt-Gt};Gt+=Qt}return null})(O);if(!ce)return;const le=document.createRange();le.setStart(ce.node,ce.offset),le.setEnd(i.endContainer,i.endOffset);const Pe=document.createElement(y);Pe.textContent=I,le.deleteContents(),le.insertNode(Pe);const De=window.getSelection(),vt=document.createRange();vt.setStartAfter(Pe),vt.collapse(!0),De.removeAllRanges(),De.addRange(vt);const Ot=qt();e.nextTick(()=>{kt(),Ot&&vl(Ot)})},Nl=()=>{g.value&&(Ut.value=qt(),xe.value="",Ke.value="",re.value="",Je.value="",mt.value="",Lt.value=null,ct.value=null,Y.value="upload",Xt.value=!0,Kt(),e.nextTick(()=>{Tt.value&&Tt.value.focus(),at.value&&(at.value.value="")}))},P=o=>{const n=o.target?.files?.[0];if(!n){Lt.value=null,Ke.value="";return}Lt.value=n;const s=new FileReader;s.onload=i=>{Ke.value=i.target?.result||""},s.readAsDataURL(n)},Bl=()=>{at.value&&at.value.click()},ql=()=>{Je.value&&(mt.value="")},Yn=()=>{mt.value&&(Je.value="")},Cl=()=>{let o=ct.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")||"";ct.value=o,xe.value=n.trim()===""||n.trim()==="Image"?"":n;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(re.value=s,Ke.value="",Y.value="url"):(Ke.value=s,re.value="",Y.value="upload");const c=o.style.width||o.getAttribute("width")||"",m=o.style.height||o.getAttribute("height")||"";Je.value=c.endsWith("px")?c.replace("px",""):c,mt.value=m.endsWith("px")?m.replace("px",""):m,Ut.value=null}else{Nl();return}Xt.value=!0,F.value=!1,ht.value=!1,e.nextTick(()=>{Y.value==="url"&&pt.value?(pt.value.focus(),pt.value.select()):Tt.value&&(Tt.value.focus(),Tt.value.select()),at.value&&(at.value.value="")})},il=()=>{Xt.value=!1,xe.value="",Ke.value="",re.value="",Je.value="",mt.value="",Lt.value=null,ct.value=null,Ut.value=null,Y.value="upload"},Ft=()=>{const o=(xe.value||"").trim(),n=g.value?._mutationObserver;n&&n.disconnect(),tt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Dt(),tt.value=!1):Dt();const s=Y.value==="url"?re.value.trim():Ke.value;if(ct.value&&g.value&&g.value.contains(ct.value)){s&&(ct.value.src=s),ct.value.setAttribute("alt",o),ct.value.setAttribute("data-alt",o),Je.value?(ct.value.style.width=`${Je.value}px`,ct.value.setAttribute("width",Je.value)):(ct.value.style.removeProperty("width"),ct.value.removeAttribute("width")),mt.value?(ct.value.style.height=`${mt.value}px`,ct.value.setAttribute("height",mt.value)):(ct.value.style.removeProperty("height"),ct.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ct.value),c.collapse(!0),i.addRange(c)}kt()}else{if(!s){n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),il();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(Ut.value&&(vl(Ut.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 w=document.createElement("p");w.innerHTML="<br>",g.value.appendChild(w),m.setStart(w,0),m.collapse(!0)}else m.selectNodeContents(g.value),m.collapse(!1);c&&(c.removeAllRanges(),c.addRange(m))}if(!m){il();return}const u=m.commonAncestorContainer,v=u.nodeType===3?u.parentElement:u;if(!g.value.contains(v)){if(m=document.createRange(),g.value.childNodes.length===0){const w=document.createElement("p");w.innerHTML="<br>",g.value.appendChild(w),m.setStart(w,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),Je.value&&(y.style.width=`${Je.value}px`,y.setAttribute("width",Je.value)),mt.value&&(y.style.height=`${mt.value}px`,y.setAttribute("height",mt.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 O=document.createElement("p");g.value.appendChild(O),O.appendChild(y)}else{const O=g.value.lastChild;if(O&&O.nodeType===1)O.appendChild(y);else{const D=document.createElement("p");g.value.appendChild(D),D.appendChild(y)}}const I=document.createRange();I.setStartAfter(y),I.collapse(!0),c&&(c.removeAllRanges(),c.addRange(I))}}ct.value=y,kt()}}e.nextTick(()=>{n&&g.value&&n.observe(g.value,{childList:!0,subtree:!0}),yl(),rl(),il()})};e.watch(()=>R.modelValue,o=>{if(R.richText&&g.value&&!G.value){const n=wl(o||""),i=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const m=qt();g.value.innerHTML=n,e.nextTick(()=>{El();const u=g.value.innerHTML||"",v=R.title||"",y=R.description||"";gt.value=u,se.value=v,X.value=y,jt.value=u,te.value=v,ie.value=y,Ge.value=[],Ct.value=[],Se.value&&(clearTimeout(Se.value),Se.value=null),tt.value=!1,m&&vl(m),nl(),gl(),$l(),yl(),rl(),Vn(),nt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>R.richText,o=>{o?(rl(),e.nextTick(()=>{da()})):(ta(),oe.value=[],Ue.value&&(Ue.value.disconnect(),Ue.value=null)),Vn()}),e.watch(()=>R.floatingToolbar,o=>{o?rl():ta()}),e.watch(()=>R.disabled,o=>{o&&ta(),Vn()}),e.watch(()=>R.description,()=>{e.nextTick(()=>{H.value?Ml():sl()})}),e.watch(()=>R.title,()=>{e.nextTick(()=>{el.value?ll():Rl()})}),e.watch(()=>R.customToolbarSlots,()=>{e.nextTick(()=>{ra()})},{deep:!0}),e.watch(()=>R.comments,(o,n)=>{if(R.commentUser){if(ge.value){ge.value=!1;return}st.value||R.richText&&g.value&&e.nextTick(()=>{cl()})}},{deep:!0,immediate:!1});const cl=()=>{if(R.commentUser&&!st.value&&!(!R.comments||!Array.isArray(R.comments)||R.comments.length===0)&&!(!R.richText||!g.value)){st.value=!0;try{const o=new Set,n=R.comments.filter(u=>{const v=String(u.conversation_id||u.id);return o.has(v)?!1:(o.add(v),!0)}),s=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const v=u.parentNode;if(v){for(;u.firstChild;)v.insertBefore(u.firstChild,u);v.removeChild(u)}});let c=0;const m=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const v=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!v)return;const y=String(v);if(m.has(y))return;const w=g.value.querySelector(`[data-comment="${y}"]`);if(w){Mt(w,u),m.add(y);return}try{const I=It(u.selection_range,u.selection_text);if(I&&!I.collapsed){const O=I.commonAncestorContainer,D=O.nodeType===3?O.parentElement:O;if(D){const Pe=D.closest("[data-comment], [data-fake-comment]");if(Pe){const De=Pe.getAttribute("data-comment")||Pe.getAttribute("data-fake-comment");if(String(De)===String(v)){Pe.setAttribute("data-comment",y),Pe.removeAttribute("data-fake-comment"),Mt(Pe,u),m.add(y);return}else return}}const ce=g.value.querySelector(`[data-comment="${y}"]`);if(ce){Mt(ce,u),m.add(y);return}const le=document.createElement("span");le.setAttribute("data-comment",y),Mt(le,u);try{I.surroundContents(le),c++,m.add(y)}catch{try{const De=document.createRange();De.setStart(I.startContainer,I.startOffset),De.setEnd(I.endContainer,I.endOffset),ul(De),De.surroundContents(le),c++,m.add(y)}catch{try{const vt=I.extractContents();le.appendChild(vt),I.insertNode(le),c++,m.add(y)}catch(vt){console.warn("Failed to create comment marker:",vt)}}}}}catch{}}),e.nextTick(()=>{nt("restoreCommentsFromModel"),kt(),st.value=!1})}catch{st.value=!1}}},ul=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&&!Bn(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&&!Rn(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&m<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Bn=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},Rn=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},It=(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,v=!1;for(;!v&&(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),v=!0),i=y}else{let y=m.childNodes.length;for(;y--;)c.push(m.childNodes[y])}return u?ul(s):null}}catch{return null}return null},Mt=(o,n)=>{if(!o||!n)return;const s=n.conversation||[],i=new Set,c=[],m=v=>{v&&v.id&&!i.has(v.id)&&(i.add(v.id),c.push(v))};s.length>0&&s.forEach(v=>{v.user&&m(v.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")},nt=(o="unknown")=>{if(!R.commentUser||!R.richText||!g.value){oe.value=[];return}Date.now()-Nt.value<wt&&bt.value!==null||bt.value===null&&(bt.value=requestAnimationFrame(()=>{if(bt.value=null,Nt.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=[],v=new Set;m.forEach(D=>{const ce=D.getAttribute("data-comment")||D.getAttribute("data-fake-comment");ce&&D.tagName==="SPAN"&&(v.has(ce)||(u.push(D),v.add(ce)))}),m.forEach(D=>{const ce=D.getAttribute("data-comment")||D.getAttribute("data-fake-comment");!ce||v.has(ce)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(D.tagName)?D.querySelector(`span[data-comment="${ce}"], span[data-fake-comment="${ce}"]`)||(u.push(D),v.add(ce)):D.tagName!=="SPAN"&&(u.push(D),v.add(ce)))});const y=c.getBoundingClientRect(),w=i.getBoundingClientRect();u.forEach((D,ce)=>{let le=D.getAttribute("data-comment")||D.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const cn=D.textContent?.trim(),Vt=R.comments?.find(Ql=>(typeof Ql.conversation_id=="string"&&Ql.conversation_id.startsWith("comment-")?null:Ql.conversation_id)&&Ql.selection_text?.trim()===cn);Vt?(le=String(Vt.conversation_id),D.setAttribute("data-comment",le),D.removeAttribute("data-fake-comment")):(le=String(Date.now()),D.setAttribute("data-comment",le),D.removeAttribute("data-fake-comment"))}const Pe=D.getBoundingClientRect(),De=window.getComputedStyle(D),vt=parseFloat(De.lineHeight)||parseFloat(De.fontSize)*1.2,Gt=Pe.top-w.top+vt/2-15,At=w.top-y.top+Gt;let Qt=null,rn=null,kn=0;const Il=[],Sa=new Set;if(le&&R.comments){const cn=R.comments.find(Vt=>String(Vt.conversation_id||Vt.id)===String(le));if(cn){const Vt=cn.conversation||[];Vt.length>0?(Vt.forEach(Ql=>{Ql.user&&Ql.user.id&&!Sa.has(Ql.user.id)&&(Sa.add(Ql.user.id),Il.push(Ql.user))}),kn=Vt.length):(kn=0,Qt=null,rn=null),Il.length>0?Qt=Il[0]:Qt=null,Il.length>1?rn=Il[1]:rn=null}}const Va=Pe.top+vt/2-15,In=Va+30,Na=5,Fa=In>w.top+Na&&Va<w.bottom-Na?1:0;oe.value.find(cn=>cn.id===le);let zn=D;if(!zn&&le&&g.value){const cn=String(le);zn=g.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Dl=Il.length;s[le]?(s[le].top=At,s[le].opacity=Fa,s[le].element=zn,s[le].firstUser=Qt,s[le].secondUser=rn,s[le].totalCount=kn,s[le].uniqueUserCount=Dl):s[le]={id:le,top:At,opacity:Fa,element:zn,firstUser:Qt,secondUser:rn,totalCount:kn,uniqueUserCount:Dl}});const I=Object.values(s).map(D=>{const ce=Math.max(0,(D.uniqueUserCount??0)-2);if(!D.element&&D.id&&g.value){const Pe=String(D.id);D.element=g.value.querySelector(`[data-comment="${Pe}"], [data-fake-comment="${Pe}"]`)}return{...D,firstUser:D.firstUser||null,secondUser:D.secondUser||null,totalCount:D.totalCount,additionalCount:ce}});(oe.value.length!==I.length||I.some((D,ce)=>{const le=oe.value[ce];if(!le)return!0;const Pe=(le.firstUser?.id||null)!==(D.firstUser?.id||null),De=(le.secondUser?.id||null)!==(D.secondUser?.id||null);return le.id!==D.id||Math.abs(le.top-D.top)>1||le.opacity!==D.opacity||le.totalCount!==D.totalCount||le.additionalCount!==D.additionalCount||Pe||De||le.element!==D.element}))&&(oe.value=I),Xe.value=!1}))},pl=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&&(Fn(),x.value=n,n.classList.add("editor-comment-highlighted"))},Fn=(o=!1)=>{!o&&C.value!==null&&x.value&&(x.value.getAttribute("data-comment")||x.value.getAttribute("data-fake-comment"))===C.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))},ua=o=>{if(!o||!o.element)return;Fn(!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}"]`;ue("comment-marker-clicked",{commentId:n,selector:s,element:o.element})},oa=()=>{Fn()},da=()=>{!R.richText||!g.value||(Ue.value&&Ue.value.disconnect(),ut.value!==null&&(clearTimeout(ut.value),ut.value=null),Ue.value=new MutationObserver(()=>{ut.value===null&&(ut.value=setTimeout(()=>{ut.value=null,e.nextTick(()=>{nt("MutationObserver")})},200))}),Ue.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"]}),nt("setupCommentMarkersObserver-initial"))},_n=(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,v=window.innerHeight;if(m.right>u){const y=s.left-m.width-4;o.style.left=`${y}px`}if(m.bottom>v){const y=Math.max(8,v-m.height-8);o.style.top=`${y}px`}m.top<0&&(o.style.top="8px")};return e.watch(()=>ve.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(()=>{_n(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[we.value,it.value],()=>{we.value==="askAi"||it.value==="askAi"?e.nextTick(()=>{Ta()}):(ve.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(()=>R.locale,o=>{o&&o!==ne.value&&(ne.value=o)},{immediate:!0}),J({openCommentOverlayForSelector:yn,updateCommentMarkers:nt,restoreCommentsFromModel:cl}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":_t.value},$t.value]]),style:e.normalizeStyle(Et.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",p1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Fl,title:e.unref(L)("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,v1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!bl.value}]),onClick:fn,title:e.unref(L)("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,f1),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",h1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Dn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[M.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,y1)):M.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,k1)):M.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,C1)):M.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,b1)):M.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,w1)):M.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,x1)):(e.openBlock(),e.createElementBlock("svg",E1,[...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,g1),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>Vl("<h1>"))},[e.createElementVNode("img",{src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,S1),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Vl("<h2>"))},[e.createElementVNode("img",{src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,V1),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Vl("<h3>"))},[e.createElementVNode("img",{src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,N1),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Vl("<h4>"))},[e.createElementVNode("img",{src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,B1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Vl("<h5>"))},[e.createElementVNode("img",{src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,_1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Vl("<h6>"))},[e.createElementVNode("img",{src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,M1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Vl("<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(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("bold")}]),onClick:n[9]||(n[9]=s=>Sl("bold")),title:e.unref(L)("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,$1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("italic")}]),onClick:n[10]||(n[10]=s=>Sl("italic")),title:e.unref(L)("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,D1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("underline")}]),onClick:n[11]||(n[11]=s=>Sl("underline")),title:e.unref(L)("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,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:wn,title:e.unref(L)("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,T1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:jl,title:e.unref(L)("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,H1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Ln,title:e.unref(L)("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,A1)),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":St("insertUnorderedList")}]),onClick:sn,title:e.unref(L)("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,R1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("insertOrderedList")}]),onClick:Tl,title:e.unref(L)("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,F1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Nl,title:e.unref(L)("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,I1),_t.value&&ae.value?(e.openBlock(),e.createElementBlock("div",z1)):e.createCommentVNode("",!0),_t.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:Qe},[...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,P1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",O1)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",W1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Dn("askAi")),title:e.unref(L)("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",Z1,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,q1),we.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",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Ll(s)?(e.openBlock(),e.createElementBlock("div",Y1,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Ll(s)&&i<B.customToolbarSlots.length-1&&Wn(i)?(e.openBlock(),e.createElementBlock("div",X1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&B.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Kt})):e.createCommentVNode("",!0),e.createVNode(ho,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:ia},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",j1,[e.createElementVNode("div",K1,[e.createElementVNode("label",G1,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Me,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>Fe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Ea,["enter"])},null,40,Q1),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",J1,[e.createElementVNode("label",em,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:qe,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Z.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Ea,["enter"])},null,40,tm),[[e.vModelText,Z.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:ia},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ea},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ho,{showModal:Xt.value,width:"500px",height:"80vh",onCloseModal:il},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ct.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",lm,[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(L)("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(L)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("div",am,[e.createElementVNode("div",om,[ml.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",sm,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),ml.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Bl},[e.createElementVNode("img",{src:Ke.value,alt:"Preview",class:"dss-image-preview-image"},null,8,rm),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:at,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:P},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:at,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:P},null,544))]),e.createElementVNode("div",im,[e.createElementVNode("label",cm,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Tt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ft,["enter"])},null,40,um),[[e.vModelText,xe.value]])]),e.createElementVNode("div",dm,[e.createElementVNode("label",mm,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ft,["enter"]),onInput:ql},null,40,pm),[[e.vModelText,Je.value]])]),e.createElementVNode("div",vm,[e.createElementVNode("label",fm,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ft,["enter"]),onInput:Yn},null,40,hm),[[e.vModelText,mt.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",gm,[e.createElementVNode("div",ym,[e.createElementVNode("div",km,[e.createElementVNode("label",Cm,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:pt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>re.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Ft,["enter"])},null,40,bm),[[e.vModelText,re.value]])]),e.createElementVNode("div",wm,[e.createElementVNode("label",xm,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ft,["enter"])},null,40,Em),[[e.vModelText,xe.value]])]),e.createElementVNode("div",Sm,[e.createElementVNode("label",Vm,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ft,["enter"]),onInput:ql},null,40,Nm),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Bm,[e.createElementVNode("label",_m,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ft,["enter"]),onInput:Yn},null,40,Mm),[[e.vModelText,mt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:il},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ft},e.toDisplayString(e.unref(L)("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":tn.value&&el.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",$m,[el.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Dm,[B.title?(e.openBlock(),e.createElementBlock("span",Lm,e.toDisplayString(B.title),1)):(e.openBlock(),e.createElementBlock("span",Tm,e.toDisplayString(dt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ne,value:B.title,onInput:vn,onFocus:Gn,onBlur:qn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!el.value}]),placeholder:dt.value,disabled:B.disabled,rows:"1"},null,42,Am)])],2)):e.createCommentVNode("",!0),B.showTitle&&tn.value&&el.value?(e.openBlock(),e.createElementBlock("div",Hm,[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&&H.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",Rm,[H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fm,[B.description?(e.openBlock(),e.createElementBlock("span",Im,e.toDisplayString(B.description),1)):(e.openBlock(),e.createElementBlock("span",zm,e.toDisplayString(Hl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:et,value:B.description,onInput:Wt,onFocus:Qn,onBlur:nn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!H.value}]),placeholder:Hl.value,disabled:B.disabled,rows:"1"},null,42,Pm)])],2)):e.createCommentVNode("",!0),B.showDescription&&_l.value&&H.value?(e.openBlock(),e.createElementBlock("div",Om,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),_t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(oe.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":C.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=>pl(s),onMouseleave:oa},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ua(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,Zm)):(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,qm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ua(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Xm)):(e.openBlock(),e.createElementBlock("span",jm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,Ym)):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=>ua(s),["stop"])},[e.createElementVNode("span",Gm,"+"+e.toDisplayString(s.additionalCount),1)],12,Km)):e.createCommentVNode("",!0)],46,Wm))),128)):e.createCommentVNode("",!0),B.richText?(e.openBlock(),e.createElementBlock("div",a2,[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(Zl.value),onInput:kt,onBlur:Xl,onClick:eo,onMouseup:Ca,onKeyup:Ca,onKeydown:ja,onPaste:Ka,onMousemove:to,onMouseleave:lo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[_t.value&&C.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(d.value)},[_.value||ye.value.length>0?(e.openBlock(),e.createElementBlock("div",o2,[e.createElementVNode("div",s2,[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:_.value},null,8,r2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",i2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.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",c2,[e.createElementVNode("div",u2,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,d2)):(e.openBlock(),e.createElementBlock("span",m2,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",p2,[e.createElementVNode("div",v2,[e.createElementVNode("div",f2,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",h2,e.toDisplayString(zl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":pn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),R.commentUser&&s.user&&s.user.id===R.commentUser.id&&!pn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Zt(s,i),["stop"]),title:e.unref(L)("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,g2)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",y2,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:b,"onUpdate:modelValue":n[26]||(n[26]=s=>f.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Q,["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,k2),[[e.vModelText,f.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Q,["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",C2,[e.createElementVNode("div",b2,[e.createElementVNode("span",w2,e.toDisplayString(ol.value)+" "+e.toDisplayString(ol.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",x2,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("textarea",{value:B.modelValue,onInput:ln,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":B.fixedHeight}]),placeholder:Ul.value,rows:B.rows,disabled:B.disabled,style:e.normalizeStyle(kl.value)},null,46,Jm),e.createElementVNode("div",e2,[e.createElementVNode("div",t2,[e.createElementVNode("span",l2,e.toDisplayString(ol.value)+" "+e.toDisplayString(ol.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",n2,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&fe.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(He.value),onMouseenter:n[28]||(n[28]=s=>he.value=!0),onMouseleave:la},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(xa,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,E2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ra,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",V2,[...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,S2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ht.value&&Rt.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(me.value),onMouseenter:n[29]||(n[29]=s=>F.value=!0),onMouseleave:na},[e.createElementVNode("div",N2,[Rt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",B2,[...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:Rt.value},e.toDisplayString(Rt.value),9,_2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Cl,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",$2,[...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,M2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.floatingToolbar&&B.richText&&$e.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ft,class:"dss-floating-toolbar",style:e.normalizeStyle(lt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",D2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Fl,["stop"]),title:e.unref(L)("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,L2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!bl.value}]),onClick:e.withModifiers(fn,["stop"]),title:e.unref(L)("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,T2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",A2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>ba("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[M.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,R2)):M.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,F2)):M.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,I2)):M.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,z2)):M.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,P2)):M.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,O2)):(e.openBlock(),e.createElementBlock("svg",W2,[...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,H2),it.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=>Gl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>Gl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>Gl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>Gl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>Gl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>Gl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>Gl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("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":St("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Sl("bold"),["stop"])),title:e.unref(L)("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,q2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Sl("italic"),["stop"])),title:e.unref(L)("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,Z2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Sl("underline"),["stop"])),title:e.unref(L)("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,U2),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(wn,["stop"]),title:e.unref(L)("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,Y2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(jl,["stop"]),title:e.unref(L)("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,j2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Ln,["stop"]),title:e.unref(L)("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,X2)),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":St("insertUnorderedList")}]),onClick:e.withModifiers(sn,["stop"]),title:e.unref(L)("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,K2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":St("insertOrderedList")}]),onClick:e.withModifiers(Tl,["stop"]),title:e.unref(L)("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,G2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Nl,["stop"]),title:e.unref(L)("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,Q2),_t.value?(e.openBlock(),e.createElementBlock("div",J2)):e.createCommentVNode("",!0),_t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(Qe,["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,ep)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",tp)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",lp,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>ba("askAi"),["stop"])),title:e.unref(L)("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",ap,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,np),it.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)]),$n.value?(e.openBlock(),e.createElementBlock("div",op,[B.askAi&&$n.value?(e.openBlock(),e.createElementBlock("div",sp)):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},[Ll(s)&&bn(s)?(e.openBlock(),e.createElementBlock("div",rp,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Ll(s)&&bn(s)&&i<B.customToolbarSlots.length-1&&Yl(i)?(e.openBlock(),e.createElementBlock("div",ip)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),dp={class:"dss-color-picker__section-title"},mp={class:"dss-color-picker__presets-row"},pp=["title","onClick"],vp={key:1,class:"dss-color-picker__section"},fp={class:"dss-color-picker__presets-row"},hp=["title","onClick"],gp={key:2,class:"dss-color-picker__section"},yp={class:"dss-color-picker__section-header"},kp={class:"dss-color-picker__presets-row"},Cp=["title","onClick"],bp=["onClick"],wp={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},xp=["title","onClick"],Ep={class:"dss-color-picker__input-row"},Sp=["value"],Vp={__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:J}){function N(se){const X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(se);if(!X)return{h:0,s:0,l:50};const te=parseInt(X[1],16)/255,ie=parseInt(X[2],16)/255,Ne=parseInt(X[3],16)/255,et=Math.max(te,ie,Ne),yt=Math.min(te,ie,Ne);let al=0,xt=0;const el=(et+yt)/2;if(et!==yt){const H=et-yt;switch(xt=el>.5?H/(2-et-yt):H/(et+yt),et){case te:al=((ie-Ne)/H+(ie<Ne?6:0))/6;break;case ie:al=((Ne-te)/H+2)/6;break;case Ne:al=((te-ie)/H+4)/6;break}}return{h:al*360,s:xt*100,l:el*100}}function L(se,X,te){X/=100,te/=100;const ie=X*Math.min(te,1-te),Ne=et=>{const yt=(et+se/30)%12,al=te-ie*Math.max(Math.min(yt-3,9-yt,1),-1);return Math.round(255*al).toString(16).padStart(2,"0")};return`#${Ne(0)}${Ne(8)}${Ne(4)}`}function ne(se){const X=se.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let te=X[1];return te.length===3&&(te=te.split("").map(ie=>ie+ie).join("")),"#"+te}function W(se){const X=se.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!X)return null;const te=Math.max(0,Math.min(255,Number.parseInt(X[1],10))),ie=Math.max(0,Math.min(255,Number.parseInt(X[2],10))),Ne=Math.max(0,Math.min(255,Number.parseInt(X[3],10)));return`#${te.toString(16).padStart(2,"0")}${ie.toString(16).padStart(2,"0")}${Ne.toString(16).padStart(2,"0")}`}function R(se){if(typeof se!="string")return null;const X=se.trim();return ne(X)||W(X)}function ue(se,X,te){X/=100,te/=100;const ie=te+X*Math.min(te,1-te),Ne=ie===0?0:2-2*te/ie;return{h:se,s:Ne*100,v:ie*100}}function rt(se,X,te){X/=100,te/=100;const ie=te*(1-X/2),Ne=ie===0||ie===1?0:(te-ie)/Math.min(ie,1-ie);return{h:se,s:Ne*100,l:ie*100}}const ee=B,g=J,we=e.ref(!1),ke=e.ref(!1),G=e.ref(!1),j=e.ref(-1),fe=e.ref(-1),He=e.ref(null),he=e.ref(null),Te=e.ref(null),Z=e.ref(null),Fe=e.ref({top:0,left:0}),qe=e.ref(N(ee.modelValue||"#b8a5de")),Me=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),Ze=e.computed(()=>!ee.disableCustomColors),U=e.computed(()=>Me.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:fe.value<0?null:fe.value),Ae=e.computed(()=>{const se=U.value;return se==null?!0:Math.max(0,ee.presetColors.length-se)<ee.max}),Ye=e.computed(()=>!!(ke.value||j.value>=0||!Ce.value&&ee.presetColors.length===0));e.computed(()=>{const se=U.value;return se!=null&&ee.presetColors.length>se});const Ce=e.computed(()=>Me.value||U.value!=null),$e=e.computed(()=>{const se=U.value;return se==null?[]:ee.presetColors.slice(0,se)}),lt=e.computed(()=>{const se=U.value;return se==null?[]:ee.presetColors.slice(se)});function ft(se){const X=U.value;return X!=null?X+se:-1}function it(se){const X=U.value;return X!=null&&se>=X}function Xt(se){it(se)&&(j.value=se,qe.value=N(ee.presetColors[se]),ke.value=!0,e.nextTick(()=>Z.value?.focus()))}function xe(se){if(!it(se))return;const X=ee.presetColors.filter((Ne,et)=>et!==se);g("update:presetColors",X);const te=ne(ee.modelValue),ie=ne(ee.presetColors[se]);if(te&&ie&&te.toLowerCase()===ie.toLowerCase()){const Ne=X[Math.max(0,se-1)]||X[0];Ne&&g("update:modelValue",Ne)}}function Lt(){G.value=!G.value,G.value||(j.value=-1,ke.value=!1)}function Ke(){if(!Ze.value||j.value<0)return;const se=at.value,X=ne(se);if(X){const te=[...ee.presetColors];te[j.value]=X,g("update:presetColors",te),g("update:modelValue",X),j.value=-1,ke.value=!1}}function Je(){ee.disabled||!Ze.value||(j.value=-1,ke.value=!ke.value,ke.value&&(F(),e.nextTick(()=>Z.value?.focus())))}function mt(se){const X=R(se),te=R(ee.modelValue);return X&&te&&X.toLowerCase()===te.toLowerCase()}function Tt(){if(ee.disabled||!Ze.value||!Ae.value)return;const se=at.value,X=ne(se);if(X){const te=[...ee.presetColors,X];g("update:presetColors",te),g("update:modelValue",X);const ie=U.value??fe.value;ie>=0&&te.length-ie>=ee.max&&(ke.value=!1)}}const at=e.computed(()=>{const{h:se,s:X,l:te}=qe.value;return L(se,X,te)}),pt=e.computed(()=>at.value.toLowerCase()),ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),Ut=e.computed(()=>{const se=ue(qe.value.h,qe.value.s,qe.value.l);return{left:`${se.s}%`,bottom:`${se.v}%`,transform:"translate(-50%, 50%)"}}),ht=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),Rt=e.computed(()=>({position:"fixed",left:`${Fe.value.left}px`,top:`${Fe.value.top}px`,zIndex:1002}));function me(){if(!He.value||!we.value)return;const se=He.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let te=se.bottom+4;const ie=he.value;ie&&te+ie.offsetHeight>X-8&&(te=se.top-4-ie.offsetHeight),Fe.value={top:te,left:se.left}}function F(){const se=ee.modelValue||"#b8a5de",X=R(se);X&&(qe.value=N(X))}function Y(){g("update:modelValue",at.value)}function re(){ee.disabled||(we.value=!we.value,we.value&&(F(),e.nextTick(()=>{me(),Z.value?.focus()})))}function ve(){const se=at.value,X=ne(se);if(X){if(j.value>=0){const te=[...ee.presetColors];te[j.value]=X,g("update:presetColors",te),g("update:modelValue",X)}else if(Ze.value&&(ee.presetColors.length>0||Me.value)&&ke.value&&Ae.value&&!ee.presetColors.some(ie=>ne(ie)?.toLowerCase()===X.toLowerCase())){const ie=[...ee.presetColors,X];g("update:presetColors",ie),g("update:modelValue",X)}}we.value=!1,ke.value=!1,G.value=!1,j.value=-1}function Re(se){if(!Te.value)return;const X=Te.value.getBoundingClientRect(),te=ie=>{const Ne=Math.max(0,Math.min(1,(ie.clientX-X.left)/X.width)),et=Math.max(0,Math.min(1,1-(ie.clientY-X.top)/X.height)),yt={h:qe.value.h,s:Ne*100,v:et*100};qe.value=rt(yt.h,yt.s,yt.v)};te(se),document.addEventListener("mousemove",te),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",te),Y()},{once:!0})}function Ge(se){if(!se.currentTarget)return;const te=se.currentTarget.getBoundingClientRect(),ie=Ne=>{const et=Math.max(0,Math.min(1,(Ne.clientX-te.left)/te.width));qe.value={...qe.value,h:et*360}};ie(se),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),Y()},{once:!0})}function Ct(se){const X=se.target.value,te=R(X);te&&(qe.value=N(te),g("update:modelValue",te))}function Se(se){if(ee.disabled)return;const X=R(se);X&&(qe.value=N(X),g("update:modelValue",X))}let tt=null,gt=null;function jt(){tt&&(document.removeEventListener("keydown",tt),tt=null),gt&&(window.removeEventListener("resize",gt),gt=null)}return e.watch(we,se=>{if(jt(),se){if(!Me.value&&ee.initialPresetCount==null){const X=ee.presetColors.length;X>0&&(fe.value<0||X<fe.value)&&(fe.value=X)}tt=X=>{X.key==="Escape"&&ve()},gt=me,document.addEventListener("keydown",tt),window.addEventListener("resize",gt)}}),e.watch(()=>ee.modelValue,()=>{we.value&&F()},{immediate:!1}),e.watch(lt,se=>{se.length===0&&(G.value=!1,j.value=-1,ke.value=!1)}),e.onBeforeUnmount(jt),(se,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":B.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:He,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:re},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:at.value})},[...X[0]||(X[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ve,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:he,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Rt.value)},[Ce.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Me.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.presetGroups,(te,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",dp,e.toDisplayString(te.title),1),e.createElementVNode("div",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.colors,(Ne,et)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+et,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":mt(Ne)}]),style:e.normalizeStyle({backgroundColor:Ne,"--dss-preset-color":Ne}),title:Ne,onClick:e.withModifiers(yt=>Se(Ne),["stop"])},null,14,pp))),128))])]))),128)):$e.value.length?(e.openBlock(),e.createElementBlock("div",vp,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",fp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(te,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":mt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ne=>Se(te),["stop"])},null,14,hp))),128))])])):e.createCommentVNode("",!0),Ze.value?(e.openBlock(),e.createElementBlock("div",gp,[e.createElementVNode("div",yp,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),lt.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":G.value}]),title:"Manage custom colors",onClick:e.withModifiers(Lt,["stop"])},[...X[2]||(X[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",kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,(te,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":G.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!G.value&&mt(te),"dss-color-picker__preset-bubble--editing":G.value&&j.value===ft(ie)}]),style:e.normalizeStyle({backgroundColor:j.value===ft(ie)?at.value:te,"--dss-preset-color":j.value===ft(ie)?at.value:te}),title:j.value===ft(ie)?at.value:te,onClick:e.withModifiers(Ne=>G.value?Xt(ft(ie)):Se(te),["stop"])},null,14,Cp),G.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(Ne=>xe(ft(ie)),["stop"])},[...X[4]||(X[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,bp)):e.createCommentVNode("",!0)],2))),128)),Ae.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Je,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):B.presetColors.length?(e.openBlock(),e.createElementBlock("div",wp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.presetColors,(te,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":mt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ne=>Se(te),["stop"])},null,14,xp))),128)),Ze.value&&Ae.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Je,["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:Re},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ct.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ut.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[X[5]||(X[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(ht.value)},null,4)],32),e.createElementVNode("div",Ep,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Z,type:"text",class:"dss-color-picker__hex-input",value:pt.value,onInput:Ct},null,40,Sp)]),Ze.value&&Ce.value&&(B.presetColors.length||Me.value)&&Ae.value&&j.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Tt}," Save color ")):e.createCommentVNode("",!0),Ze.value&&Ce.value&&j.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ke}," Save color ")):e.createCommentVNode("",!0),Ce.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ve}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Np={key:0,class:"dss-loader"},Bp={key:0,class:"dss-loader-label"},_p={key:1,class:"dss-loader"},Mp={key:0,class:"dss-loader-label"},$p={key:2,class:"dss-loader"},Dp={key:0,class:"dss-loader-label"},Lp={key:3,class:"dss-loader"},Tp={key:0,class:"dss-loader-label"},Ap={key:4,class:"dss-loader"},Hp={key:0,class:"dss-loader-label"},Rp={key:5,class:"dss-loader dss-loader--inline"},Fp={class:"dss-loader-inline-text"},Ip={__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 J=B,N=e.computed(()=>J.size==="small"?"dss-loaders--size-small":J.size==="large"?"dss-loaders--size-large":J.size==="medium"||J.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const ne={};if(!(J.size==="small"||J.size==="medium"||J.size==="large"||J.size==null)){const W=typeof J.size=="number"?`${J.size}px`:String(J.size);ne["--dss-loader-size"]=W}return J.color&&(ne["--dss-loader-accent"]=J.color,ne["--dss-loader-accent-soft"]=`color-mix(in srgb, ${J.color} 30%, white)`),ne});return(ne,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",N.value]),style:e.normalizeStyle(L.value)},[B.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Np,[W[0]||(W[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",Bp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="dots"?(e.openBlock(),e.createElementBlock("div",_p,[W[1]||(W[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",Mp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="battery"?(e.openBlock(),e.createElementBlock("div",$p,[W[2]||(W[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),B.label?(e.openBlock(),e.createElementBlock("span",Dp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Lp,[W[3]||(W[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",Tp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="bars"?(e.openBlock(),e.createElementBlock("div",Ap,[W[4]||(W[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",Hp,e.toDisplayString(B.label),1)):e.createCommentVNode("",!0)])):B.type==="inline"?(e.openBlock(),e.createElementBlock("div",Rp,[W[5]||(W[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Fp,[e.renderSlot(ne.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ho="dss-skeleton-item",zp={__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:Ho},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(B){const J=B,N=e.computed(()=>{const W={"dss-skeleton--loading":J.loading,"dss-skeleton--static":!J.shimmer,"dss-skeleton--multiple":J.mode==="multiple","dss-skeleton--dark":J.darkMode};return J.mode==="multiple"&&J.targetClass!==Ho&&(W[`dss-skeleton--target-${J.targetClass}`]=!0),W}),L=e.computed(()=>{const W={};return J.borderRadius&&(W.borderRadius=J.borderRadius),W}),ne=e.computed(()=>{const W={};return J.borderRadius&&(W["--dss-skeleton-border-radius"]=J.borderRadius),J.darkMode?(W["--dss-skeleton-bg"]=J.bgDark||"#322c3f",W["--dss-skeleton-shimmer"]=J.shimmerDark||"#3e3f41",W):(J.bgColor&&(W["--dss-skeleton-bg"]=J.bgColor),J.shimmerColor&&(W["--dss-skeleton-shimmer"]=J.shimmerColor),W)});return(W,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",N.value]),style:e.normalizeStyle(ne.value)},[B.loading&&B.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":B.loading&&B.mode==="single"}])},[e.renderSlot(W.$slots,"default")],2)],6))}},Pp={key:0,class:"dss-dnd-column-header"},Op={class:"dss-dnd-column-title"},Wp={class:"dss-dnd-column-count"},qp=["data-column"],Zp={key:0,class:"dss-dnd-indicator"},Up=["onPointerdown"],Yp=["onPointerdown"],Xp={class:"dss-dnd-item-content"},jp={class:"dss-dnd-item-default"},Kp={key:0,class:"dss-dnd-empty"},Gp={name:"DSSDnd"},Qp=Object.assign(Gp,{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:J}){const N=B,L=J,ne=e.useSlots(),W=e.computed(()=>!!ne["delete-zone"]),R={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},ue=e.computed(()=>({...R,...N.options})),rt=e.computed(()=>({"--dss-dnd-col-min-w":ue.value.columnMinWidth,"--dss-dnd-col-max-w":ue.value.columnMaxWidth,"--dss-dnd-col-gap":ue.value.columnGap,"--dss-dnd-indicator-color":ue.value.indicatorColor,"--dss-dnd-body-max-h":ue.value.columnBodyMaxHeight}));function ee(me){if(!ue.value.ColColor||!me)return{};const F=me.background||me.color;return F?{background:F}:{}}const g=e.ref(null),we=e.ref(null),ke=e.ref(!1),G=e.ref(-1),j=e.ref(null);let fe=null,He=null,he=null,Te=null,Z=0,Fe=0,qe="",Me=null;const Ze=5,U=e.computed(()=>{const me={};for(const F of N.columns)me[F.value]=N.items.filter(Y=>Y[N.columnKey]===F.value).sort((Y,re)=>(Y[N.positionKey]??0)-(re[N.positionKey]??0));return me}),Ae=e.computed(()=>{const me={},F=!!g.value,Y=g.value?.[N.itemKey],re=we.value,ve=G.value;for(const Re of N.columns){const Ge=U.value[Re.value]||[],Ct=[],Se=re==Re.value;let tt=0;for(let gt=0;gt<Ge.length;gt++){const jt=Ge[gt],se=F&&jt[N.itemKey]===Y;!se&&Se&&ve===tt&&Ct.push({type:"indicator",key:`ind-${tt}`}),se||tt++,Ct.push({type:"item",item:jt,isDragged:se,key:`item-${jt[N.itemKey]}`})}Se&&ve>=tt&&Ct.push({type:"indicator",key:"ind-end"}),me[Re.value]=Ct}return me});function Ye(me,F){const re=(U.value[me]||[]).filter(Ge=>Ge[N.itemKey]!==g.value?.[N.itemKey]);if(re.length===0)return 1;if(F<=0){const Ge=re[0][N.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(F>=re.length){const Ge=re[re.length-1][N.positionKey];return(Ge??0)+1}const ve=re[F-1][N.positionKey]??0,Re=re[F][N.positionKey]??0;return(ve+Re)/2}function Ce(me,F,Y){he&&he.remove();const re=me.getBoundingClientRect(),ve=me.cloneNode(!0);ve.classList.add("dss-dnd-ghost"),ve.style.cssText=`
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!==`
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=`
106
106
  position: fixed;
107
- left: ${F-Z}px;
108
- top: ${Y-Fe}px;
109
- width: ${re.width}px;
110
- height: ${re.height}px;
107
+ left: ${R-q}px;
108
+ top: ${Y-Re}px;
109
+ width: ${ie.width}px;
110
+ height: ${ie.height}px;
111
111
  z-index: 9999;
112
112
  pointer-events: none;
113
- opacity: ${ue.value.dragGhostOpacity};
113
+ opacity: ${pe.value.dragGhostOpacity};
114
114
  box-sizing: border-box;
115
115
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
116
- background-color: ${ue.value.dragSourceBackground};
116
+ background-color: ${pe.value.dragSourceBackground};
117
117
  font-family: 'Work Sans', sans-serif;
118
118
  cursor: grabbing;
119
- `,document.body.appendChild(ve),he=ve}function $e(me,F){he&&(he.style.left=`${me-Z}px`,he.style.top=`${F-Fe}px`)}function lt(me){me.classList.add("dss-dnd-item--dragging"),me.style.background=ue.value.dragSourceBackground,me.style.borderColor=ue.value.dragSourceBorder,me.style.transform="scale(0.97)"}function ft(me){me.classList.remove("dss-dnd-item--dragging"),me.style.background="",me.style.borderColor="",me.style.transform=""}function it(me,F){return document.elementFromPoint(me,F)?.closest(".dss-dnd-column-body")??null}function Xt(me,F){return!!document.elementFromPoint(me,F)?.closest("[data-dss-dnd-delete-zone]")}function xe(me,F){if(W.value&&Xt(me,F)){ke.value=!0,we.value=null,G.value=-1;return}ke.value=!1;const Y=it(me,F),re=Y?.getAttribute("data-column")??null;if(!re){we.value=null,G.value=-1;return}we.value=re;const ve=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Re=ve.length;for(let Ge=0;Ge<ve.length;Ge++){const Ct=ve[Ge].getBoundingClientRect();if(F<Ct.top+Ct.height/2){Re=Ge;break}}G.value=Re}function Lt(me){me.preventDefault(),$e(me.clientX,me.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,xe(me.clientX,me.clientY)}))}function Ke(me){window.removeEventListener("pointermove",Lt),window.removeEventListener("pointerup",Ke),window.removeEventListener("pointercancel",Ke),Te?.releasePointerCapture?.(me.pointerId),ft(Te),Te=null;const F=W.value&&Xt(me.clientX,me.clientY);if(g.value&&F)L("delete",{item:g.value});else{const re=it(me.clientX,me.clientY)?.getAttribute("data-column")??null;if(g.value&&re){const ve=g.value[N.columnKey],Re=re,Ct=(U.value[Re]||[]).filter(jt=>jt[N.itemKey]!==g.value[N.itemKey]),Se=Math.max(0,Math.min(G.value,Ct.length)),tt=Ye(Re,Se),gt=g.value[N.itemKey];L("move",{item:g.value,from:ve,to:Re,position:tt,index:Se}),He&&clearTimeout(He),j.value={id:gt,from:ve,to:Re},He=setTimeout(()=>{j.value=null},3500)}}he&&(he.remove(),he=null),qe!==null&&(document.body.style.cursor=qe,qe=""),Rt()}function Je(me,F){me.preventDefault();const Y=me.target.closest(".dss-dnd-item");if(!Y)return;const re=Y.getBoundingClientRect();Z=me.clientX-re.left,Fe=me.clientY-re.top,qe=document.body.style.cursor,document.body.style.cursor="grabbing",g.value=F,Te=Y,Ce(Y,me.clientX,me.clientY),requestAnimationFrame(()=>lt(Y)),Y.setPointerCapture?.(me.pointerId),window.addEventListener("pointermove",Lt),window.addEventListener("pointerup",Ke,{once:!0}),window.addEventListener("pointercancel",Ke,{once:!0})}function mt(){Me&&(window.removeEventListener("pointermove",Tt),window.removeEventListener("pointerup",at),window.removeEventListener("pointercancel",at),Me=null)}function Tt(me){if(!Me||me.pointerId!==Me.pointerId)return;const F=me.clientX-Me.startX,Y=me.clientY-Me.startY;if(Math.abs(F)>=Ze||Math.abs(Y)>=Ze){const re=Me.item;mt(),Je(me,re)}}function at(me){!Me||me.pointerId!==Me.pointerId||mt()}function pt(me,F){mt(),Me={item:F,startX:me.clientX,startY:me.clientY,pointerId:me.pointerId},window.addEventListener("pointermove",Tt),window.addEventListener("pointerup",at),window.addEventListener("pointercancel",at)}function ct(me,F){ue.value.useHandle||pt(me,F)}function Ut(me,F){pt(me,F)}function ht(){fe&&(cancelAnimationFrame(fe),fe=null)}function Rt(){ht(),g.value=null,we.value=null,ke.value=!1,G.value=-1}return e.onBeforeUnmount(()=>{ht(),mt(),He&&clearTimeout(He),he&&(he.remove(),he=null)}),(me,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ue.value.unstyled}]),style:e.normalizeStyle(rt.value)},[W.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(me.$slots,"delete-zone",{isDragging:!!g.value,isOver:ke.value})],2),[[e.vShow,!!g.value||ue.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":we.value==Y.value},Y.class||""]]),style:e.normalizeStyle(ee(Y))},[ue.value.showHeader?(e.openBlock(),e.createElementBlock("div",Pp,[e.renderSlot(me.$slots,"column-header",{column:Y,items:U.value[Y.value]||[]},()=>[e.createElementVNode("span",Op,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",Wp,e.toDisplayString((U.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(Ae.value[Y.value],re=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:re.key},[re.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Zp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":re.isDragged,"dss-dnd-item--no-handle":!ue.value.useHandle}]),onPointerdown:ve=>ct(ve,re.item)},[ue.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(ve=>Ut(ve,re.item),["stop"])},[e.renderSlot(me.$slots,"handle",{},()=>[F[0]||(F[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Yp)):e.createCommentVNode("",!0),e.createElementVNode("div",Xp,[e.renderSlot(me.$slots,"item",{item:re.item,column:Y,justDropped:j.value?.id===re.item[B.itemKey],droppedFrom:j.value?.id===re.item[B.itemKey]?j.value.from:null,droppedTo:j.value?.id===re.item[B.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",jp,e.toDisplayString(re.item[B.itemKey]),1)])])],42,Up))],64))),128)),(U.value[Y.value]||[]).length===0&&we.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Kp,[e.renderSlot(me.$slots,"empty",{column:Y},()=>[F[1]||(F[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,qp)],6))),128))],6))}}),Jp={name:"DSSConfetti"},e0=Object.assign(Jp,{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 J=B,N=e.ref(null),L=e.ref(!1);let ne=[],W=null,R=null;function ue(G,j){const fe=[];for(let He=0;He<J.count;He++)fe.push(rt(G));return fe}function rt(G,j){return{x:Math.random()*G,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:J.colors[Math.floor(Math.random()*J.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(G,j,fe,He){G.clearRect(0,0,j,fe);for(const he of ne)G.save(),G.globalAlpha=he.opacity*He,G.beginPath(),G.lineWidth=he.r,G.strokeStyle=he.color,G.moveTo(he.x+he.tilt+he.r/2,he.y),G.lineTo(he.x+he.tilt,he.y+he.tilt+he.r/2),G.stroke(),G.restore()}function g(G,j,fe){const He=.3+fe*.7;for(let he=0;he<ne.length;he++){const Te=ne[he];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*He,Te.x+=Math.sin(Te.d)*.5*He,Te.tilt=Math.sin(Te.tiltAngle)*15,fe>=.99&&Te.y>j+20&&(ne[he]=rt(G))}}function we(){L.value=!0,e.nextTick(()=>{const G=N.value;if(!G)return;const j=G.getContext("2d"),fe=G.parentElement;if(!fe)return;const He=fe.getBoundingClientRect();G.width=He.width,G.height=He.height,ne=ue(G.width,G.height);const he=Date.now(),Te=he+J.duration,Z=()=>{const Fe=Date.now(),qe=Fe-he;if(Fe<Te){let Me=1;qe>J.fadeStart&&(Me=1-(qe-J.fadeStart)/(J.duration-J.fadeStart)),ee(j,G.width,G.height,Me),g(G.width,G.height,Me),W=requestAnimationFrame(Z)}else ke()};Z()})}function ke(){W&&(cancelAnimationFrame(W),W=null),ne=[],L.value=!1}return e.watch(()=>J.trigger,G=>{G&&(R&&clearTimeout(R),R=setTimeout(we,J.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),R&&clearTimeout(R)}),(G,j)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:N,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),t0={class:"dss-filter-global-inner"},l0=["placeholder","value"],n0=["title"],a0={key:0,class:"dss-filter-funnel-badge"},o0={key:1,class:"dss-filter-sortby"},s0=["value"],r0=["value"],i0=["disabled","title"],c0={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u0={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"},d0={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"},m0={class:"dss-filter-panel"},p0={key:0,class:"dss-filter-empty"},v0={class:"dss-filter-row-prefix"},f0={class:"dss-filter-cell"},h0=["onClick"],g0={class:"dss-filter-trigger-text"},y0=["placeholder"],k0={class:"dss-filter-popup-list"},C0=["onClick"],b0={key:0,class:"dss-filter-popup-empty"},w0={key:0,class:"dss-filter-cell"},x0=["onClick"],E0={class:"dss-filter-trigger-text"},S0={class:"dss-filter-popup-list"},V0=["onClick"],N0={key:1,class:"dss-filter-cell dss-filter-cell--value"},B0=["placeholder","onUpdate:modelValue"],_0={key:1,class:"dss-filter-date-wrap"},M0=["placeholder","onUpdate:modelValue"],$0=["placeholder","value","onInput","step"],D0={key:4,class:"dss-filter-between"},L0=["placeholder","value","onInput","step"],T0={class:"dss-filter-between-sep"},A0=["placeholder","value","onInput","step"],H0={key:5,class:"dss-filter-multiselect"},R0=["onClick"],F0={class:"dss-filter-trigger-text"},I0=["placeholder"],z0={class:"dss-filter-popup-list dss-filter-popup-list--check"},P0=["onClick"],O0=["checked"],W0={key:0,class:"dss-filter-popup-empty"},q0=["onClick"],Z0={class:"dss-filter-foot"},U0={class:"dss-filter-cell"},Y0=["placeholder"],X0={class:"dss-filter-popup-list"},j0=["onClick"],K0={key:0,class:"dss-filter-popup-divider"},G0=["onClick"],Q0=["placeholder"],J0={class:"dss-filter-popup-list"},e9=["onClick"],t9={key:0,class:"dss-filter-popup-empty"},l9=["placeholder"],n9={class:"dss-filter-popup-list"},a9=["onClick"],o9={key:0,class:"dss-filter-popup-empty"},s9={name:"DSSFilter"},r9=Object.assign(s9,{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:J,emit:N}){const{t:L}=ha.useI18n(),ne=B,W=N,R={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},ue=e.computed(()=>({...R,...ne.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"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),g=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),ke=e.ref([]),G=e.ref(null),j=e.ref(!1),fe=e.ref(null),He=e.ref(""),he=e.ref(null),Te=e.ref(""),Z=e.ref("asc");let Fe=1;function qe(H){const V=H.find(M=>M&&typeof M=="object");if(!V)return null;for(const M of g)if(M in V&&typeof V[M]=="string")return M;return Object.keys(V).find(M=>typeof V[M]=="string")||null}function Me(H,V){const M=V.filter(ae=>ae!=null&&ae!=="NULL");if(M.length===0)return null;if(M.every(ae=>Array.isArray(ae))){const ae=M.flatMap(Ue=>Ue).filter(Ue=>Ue!=null);return ae.length===0?null:typeof ae.find(Ue=>Ue!=null)=="object"?"arraySelect":"arrayText"}return M.every(ae=>typeof ae=="boolean")?"boolean":M.every(ae=>typeof ae=="number")?new Set(M).size<=ue.value.maxUniqueForEnum?"select":"range":M.every(ae=>typeof ae=="string")?new Set(M).size<=ue.value.maxUniqueForSelect?"select":"text":M.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const Ze=e.computed(()=>{if(!ne.data?.length)return[];const H=new Set;for(const oe of ne.data)if(oe&&typeof oe=="object")for(const Ue of Object.keys(oe))H.add(Ue);const V=new Set(ne.exclude),M=[];for(const oe of H){if(V.has(oe))continue;const Ue=ne.config[oe]||{},bt=ne.data.map(ut=>ut?.[oe]),ot=Ue.type||Me(oe,bt);if(!ot)continue;const Xe=Ue.filterMode||"contain",Nt=Xe==="date"?"date":Xe==="string"?"text":ot,wt={key:oe,label:Ue.label||xt(oe),type:Nt,filterMode:Xe};if(ot==="select"){const ut=bt.filter(_t=>_t!=null&&_t!=="NULL");wt.uniqueValues=[...new Set(ut)].sort((_t,$t)=>typeof _t=="number"&&typeof $t=="number"?_t-$t:String(_t).localeCompare(String($t)))}else if(ot==="range"||ot==="int"){const ut=bt.filter(_t=>typeof _t=="number");wt.min=Math.min(...ut),wt.max=Math.max(...ut)}else if(ot==="arraySelect"){const ut=Ue.displayKey||qe(bt.flatMap(_t=>Array.isArray(_t)?_t:[]));if(wt.displayKey=ut,Array.isArray(Ue.uniqueValues)&&Ue.uniqueValues.length>0)wt.uniqueValues=Ue.uniqueValues.map(_t=>String(_t));else{const _t=bt.flatMap($t=>Array.isArray($t)?$t:[]).filter($t=>$t!=null).map($t=>ut&&typeof $t=="object"?$t[ut]:String($t)).filter($t=>$t!=null&&$t!=="");wt.uniqueValues=[...new Set(_t)].sort(($t,Et)=>String($t).localeCompare(String(Et)))}}M.push(wt)}const ae=ne.config._order;return ae&&M.sort((oe,Ue)=>{const bt=ae.indexOf(oe.key),ot=ae.indexOf(Ue.key);return bt===-1&&ot===-1?0:bt===-1?1:ot===-1?-1:bt-ot}),M}),U=e.computed(()=>{const H={};for(const V of Ze.value)H[V.key]=V;return H}),Ae=e.computed(()=>Array.isArray(ne.config.groups)&&ne.config.groups.length>0),Ye=e.computed(()=>{if(!Ae.value)return[];const H=new Set(Ze.value.map(V=>V.key));return ne.config.groups.map(V=>({...V,keys:V.keys.filter(M=>H.has(M))})).filter(V=>V.keys.length>0)}),Ce=e.computed(()=>{if(!Ae.value)return[];const H=new Set(ne.config.groups.flatMap(V=>V.keys));return Ze.value.filter(V=>!H.has(V.key))}),$e=e.computed(()=>{if(!he.value)return[];const H=new Set(he.value.keys),V=Ze.value.filter(ae=>H.has(ae.key));if(!He.value)return V;const M=He.value.toLowerCase();return V.filter(ae=>ae.label.toLowerCase().includes(M))}),lt=e.computed(()=>{if(!He.value)return Ze.value;const H=He.value.toLowerCase();return Ze.value.filter(V=>V.label.toLowerCase().includes(H))}),ft=e.computed(()=>Ze.value.filter(H=>!["arraySelect","arrayText"].includes(H.type))),it=e.computed(()=>Te.value?Z.value==="asc"?"Ascending":"Descending":"No sort selected");function Xt(H){G.value===H?xe():(G.value=H,He.value="",he.value=null)}function xe(){G.value=null,He.value="",he.value=null}function Lt(H){const V=H.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");G.value&&!V&&!H.target.closest(".dss-filter-popup")&&!H.target.closest(".dss-filter-trigger")&&!H.target.closest(".dss-filter-add-btn")&&xe(),j.value&&fe.value&&!fe.value.contains(H.target)&&(V||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",Lt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Lt));function Ke(H){return U.value[H]?.label||xt(H)}function Je(H){return U.value[H.key]?.filterMode||"contain"}function mt(H){return L(`filter.operators.${H}`)}function Tt(H){const V=U.value[H.key];return(rt[V?.type]||rt.text).map(M=>({...M,label:L(`filter.operators.${M.value}`)}))}function at(H){return ee.has(H)}function pt(H){const V=U.value[H.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"?H.operator==="between"?"between":"number":"text":"text"}function ct(H){return rt[H]?.[0]?.value||"contains"}function Ut(H,V){return ee.has(V)||H==="date"?null:H==="select"||H==="arraySelect"?[]:(H==="range"||H==="int")&&V==="between"?{min:null,max:null}:H==="range"||H==="int"?null:""}function ht(H){return U.value[H.key]?.uniqueValues||[]}function Rt(H){const V=ht(H);if(!He.value)return V;const M=He.value.toLowerCase();return V.filter(ae=>String(ae).toLowerCase().includes(M))}function me(H){const V=H.value;return!V||V.length===0?L("filter.select"):V.length<=2?V.join(", "):L("filter.selectedCount",{count:V.length})}function F(H){const V=U.value[H],M=V?.filterMode||"contain",ae=V?.type||"text",oe=M==="string"?"contains":ct(ae);ke.value.push(e.reactive({id:Fe++,key:H,operator:oe,value:Ut(ae,oe)})),xe()}function Y(H){ke.value=ke.value.filter(V=>V.id!==H)}function re(H,V){const ae=U.value[V]?.type||"text";H.key=V,H.operator=ct(ae),H.value=Ut(ae,H.operator),xe()}function ve(H,V){const M=pt(H);H.operator=V;const ae=pt(H);if(M!==ae||ee.has(V)){const oe=U.value[H.key];H.value=Ut(oe?.type||"text",V)}xe()}function Re(H,V){const M=V.target.value;H.value=M===""?null:Number(M)}function Ge(H,V,M){const ae=M.target.value,oe=ae===""?null:Number(ae);(!H.value||typeof H.value!="object")&&(H.value={min:null,max:null}),H.value={...H.value,[V]:isNaN(oe)?null:oe}}function Ct(H,V){const M=H.value||[],ae=M.indexOf(V);H.value=ae>=0?M.filter(oe=>oe!==V):[...M,V]}function Se(){ke.value=[],we.value="",xe()}function tt(H){we.value=H.target.value}function gt(H){Te.value=H.target.value}function jt(){Z.value=Z.value==="asc"?"desc":"asc"}const se=e.computed(()=>{if(!ne.data)return[];let H=ne.data;if(we.value){const V=we.value.toLowerCase();H=H.filter(M=>{for(const ae of Object.keys(M)){const oe=M[ae];if(typeof oe=="string"&&oe.toLowerCase().includes(V)||typeof oe=="number"&&String(oe).includes(V)||Array.isArray(oe)&&oe.some(Ue=>Ue!=null&&(typeof Ue=="string"?Ue.toLowerCase().includes(V):typeof Ue=="object"?Object.values(Ue).some(bt=>typeof bt=="string"&&bt.toLowerCase().includes(V)):!1)))return!0}return!1})}for(const V of ke.value){if(!ie(V))continue;const M=U.value[V.key];M&&(H=H.filter(ae=>Ne(ae,V,M)))}if(ne.showSortBy&&Te.value){const V=Te.value,M=Z.value==="asc"?1:-1;H=[...H].sort((ae,oe)=>X(ae?.[V],oe?.[V])*M)}return H});function X(H,V){const M=te(H),ae=te(V);return M==null&&ae==null?0:M==null?1:ae==null?-1:typeof M=="number"&&typeof ae=="number"?M-ae:String(M).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function te(H){return H==null||H==="NULL"?null:typeof H=="string"||typeof H=="number"||typeof H=="boolean"?H:H instanceof Date?H.getTime():null}function ie(H){return ee.has(H.operator)?!0:H.value==null||typeof H.value=="string"&&H.value===""||Array.isArray(H.value)&&H.value.length===0?!1:H.value instanceof Date?!isNaN(H.value.getTime()):!(typeof H.value=="object"&&!Array.isArray(H.value)&&H.value.min==null&&H.value.max==null)}function Ne(H,V,M){const ae=H?.[V.key],oe=V.value,Ue=V.operator;if(Ue==="is_empty")return al(ae);if(Ue==="is_not_empty")return!al(ae);const bt=M.type;if(bt==="text"||bt==="arrayText"){const ot=bt==="arrayText"&&Array.isArray(ae)?ae.filter(wt=>wt!=null).map(String).join(" "):ae!=null?String(ae):"",Xe=String(oe).toLowerCase(),Nt=ot.toLowerCase();switch(Ue){case"contains":return Nt.includes(Xe);case"not_contains":return!Nt.includes(Xe);case"equals":return Nt===Xe;case"not_equals":return Nt!==Xe;case"starts_with":return Nt.startsWith(Xe);case"ends_with":return Nt.endsWith(Xe);default:return!0}}if(bt==="select")switch(Ue){case"is_any_of":return oe.includes(ae);case"is_none_of":return!oe.includes(ae);default:return!0}if(bt==="range"||bt==="int"){const ot=typeof ae=="number"?ae:Number(ae);if(typeof ot!="number"||isNaN(ot))return!1;if(Ue==="between"){const Nt=oe?.min!=null?Number(oe.min):null,wt=oe?.max!=null?Number(oe.max):null,ut=Nt!=null&&!isNaN(Nt)?Nt:null,_t=wt!=null&&!isNaN(wt)?wt:null;return(ut==null||ot>=ut)&&(_t==null||ot<=_t)}const Xe=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(Ue==="contains"||Ue==="not_contains"){const Nt=String(ot),wt=String(oe??"").toLowerCase(),ut=Nt.toLowerCase().includes(wt);return Ue==="contains"?ut:!ut}if(typeof Xe!="number"||isNaN(Xe))return!1;switch(Ue){case"eq":return ot===Xe;case"neq":return ot!==Xe;case"gt":return ot>Xe;case"gte":return ot>=Xe;case"lt":return ot<Xe;case"lte":return ot<=Xe;default:return!0}}if(bt==="arraySelect"){if(!Array.isArray(ae))return!1;const ot=ae.filter(Xe=>Xe!=null).map(Xe=>M.displayKey&&typeof Xe=="object"?Xe[M.displayKey]:String(Xe));switch(Ue){case"contains_any":return ot.some(Xe=>oe.includes(Xe));case"contains_all":return oe.every(Xe=>ot.includes(Xe));case"not_contains_any":return!ot.some(Xe=>oe.includes(Xe));default:return!0}}if(bt==="date"){const ot=et(oe);if(!ot||isNaN(ot.getTime()))return!1;const Xe=et(ae);if(!Xe||isNaN(Xe.getTime()))return!1;const Nt=yt(Xe),wt=yt(ot);switch(Ue){case"eq":return Nt===wt;case"before":return Nt<wt;case"after":return Nt>wt;default:return!0}}if(bt==="boolean"){const ot=ae===!0||ae==="true"||ae===1,Xe=ae===!1||ae==="false"||ae===0;switch(Ue){case"is_true":return ot;case"is_false":return Xe;default:return!0}}return!0}function et(H){if(H==null)return null;if(H instanceof Date)return isNaN(H.getTime())?null:H;if(typeof H=="number")return new Date(H>1e10?H:H*1e3);if(typeof H=="string"){const V=new Date(H);return isNaN(V.getTime())?null:V}return null}function yt(H){const V=H.getFullYear(),M=String(H.getMonth()+1).padStart(2,"0"),ae=String(H.getDate()).padStart(2,"0");return`${V}-${M}-${ae}`}function al(H){return!!(H==null||H===""||H==="NULL"||Array.isArray(H)&&H.length===0||Array.isArray(H)&&H.every(V=>V==null))}e.watch(se,H=>W("update:modelValue",H),{immediate:!0}),e.watch(()=>ne.data,()=>{ke.value=[],we.value="",j.value=!1,Te.value="",Z.value="asc",xe()});function xt(H){return H.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,V=>V.toUpperCase())}function el(){const H=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(H);if(typeof V=="object"&&!Array.isArray(V)){const M={};for(const ae of Object.keys(V))M[ae]=H(V[ae]);return M}return V};return{globalSearch:we.value,rows:ke.value.map(V=>({key:V.key,operator:V.operator,value:H(V.value),defType:U.value[V.key]?.type,defFilterMode:U.value[V.key]?.filterMode})),filteredCount:se.value?.length??0}}return J({getDebugState:el}),(H,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":ue.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",t0,[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(L)("filter.searchAcrossFields"),value:we.value,onInput:tt},null,40,l0),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:V[0]||(V[0]=M=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ne.showSortBy}]),onClick:V[1]||(V[1]=M=>j.value=!j.value),type:"button",title:j.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("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)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",a0,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,n0),ne.showSortBy?(e.openBlock(),e.createElementBlock("div",o0,[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:gt},[V[15]||(V[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,M=>(e.openBlock(),e.createElementBlock("option",{key:M.key,value:M.key},e.toDisplayString(M.label),9,r0))),128))],40,s0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:jt,disabled:!Te.value,title:it.value},[Te.value?Z.value==="asc"?(e.openBlock(),e.createElementBlock("svg",u0,[...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",d0,[...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",c0,[...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,i0)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:V[13]||(V[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",m0,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",p0,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(M,ae)=>(e.openBlock(),e.createElementBlock("div",{key:M.id,class:"dss-filter-row"},[e.createElementVNode("span",v0,e.toDisplayString(ae===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",f0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>Xt(`${M.id}:field`),["stop"])},[e.createElementVNode("span",g0,e.toDisplayString(Ke(M.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,h0),G.value===`${M.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]=oe=>He.value=oe),placeholder:e.unref(L)("filter.searchAttributes")},null,8,y0),[[e.vModelText,He.value]]),e.createElementVNode("ul",k0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:Ue=>re(M,oe.key)},e.toDisplayString(oe.label),9,C0))),128)),lt.value.length===0?(e.openBlock(),e.createElementBlock("li",b0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Je(M)==="contain"||Je(M)==="date"?(e.openBlock(),e.createElementBlock("div",w0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>Xt(`${M.id}:op`),["stop"])},[e.createElementVNode("span",E0,e.toDisplayString(mt(M.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,x0),G.value===`${M.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[4]||(V[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",S0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(M),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:M.operator===oe.value}]),onClick:Ue=>ve(M,oe.value)},e.toDisplayString(oe.label),11,V0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),at(M.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",N0,[Je(M)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":oe=>M.value=oe},null,8,B0)),[[e.vModelText,M.value]]):Je(M)==="date"?(e.openBlock(),e.createElementBlock("div",_0,[e.createVNode(go,{mode:"single",modelValue:M.value,"onUpdate:modelValue":oe=>M.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):pt(M)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":oe=>M.value=oe},null,8,M0)),[[e.vModelText,M.value]]):pt(M)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:M.value,onInput:oe=>Re(M,oe),step:U.value[M.key]?.type==="int"?1:void 0},null,40,$0)):pt(M)==="between"?(e.openBlock(),e.createElementBlock("div",D0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:M.value?.min,onInput:oe=>Ge(M,"min",oe),step:U.value[M.key]?.type==="int"?1:void 0},null,40,L0),e.createElementVNode("span",T0,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:M.value?.max,onInput:oe=>Ge(M,"max",oe),step:U.value[M.key]?.type==="int"?1:void 0},null,40,A0)])):pt(M)==="multiselect"?(e.openBlock(),e.createElementBlock("div",H0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>Xt(`${M.id}:val`),["stop"])},[e.createElementVNode("span",F0,e.toDisplayString(me(M)),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,R0),G.value===`${M.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[6]||(V[6]=e.withModifiers(()=>{},["stop"]))},[ht(M).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[5]||(V[5]=oe=>He.value=oe),placeholder:e.unref(L)("filter.search")},null,8,I0)),[[e.vModelText,He.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",z0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(M),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:Ue=>Ct(M,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(M.value||[]).includes(oe),tabindex:"-1"},null,8,O0),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,P0))),128)),Rt(M).length===0?(e.openBlock(),e.createElementBlock("li",W0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Y(M.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,q0)]))),128)),e.createElementVNode("div",Z0,[e.createElementVNode("div",U0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:V[7]||(V[7]=e.withModifiers(M=>Xt("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),G.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"]))},[Ae.value&&!he.value&&!He.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]=M=>He.value=M),placeholder:e.unref(L)("filter.searchAttributes")},null,8,Y0),[[e.vModelText,He.value]]),e.createElementVNode("ul",X0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>he.value=M},[e.createElementVNode("span",null,e.toDisplayString(M.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,j0))),128)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("li",K0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M.key,class:"dss-filter-popup-item",onClick:ae=>F(M.key)},e.toDisplayString(M.label),9,G0))),128))])],64)):he.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:V[9]||(V[9]=M=>he.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(he.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[10]||(V[10]=M=>He.value=M),placeholder:e.unref(L)("filter.searchAttributes")},null,8,Q0),[[e.vModelText,He.value]]),e.createElementVNode("ul",J0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M.key,class:"dss-filter-popup-item",onClick:ae=>F(M.key)},e.toDisplayString(M.label),9,e9))),128)),$e.value.length===0?(e.openBlock(),e.createElementBlock("li",t9,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[11]||(V[11]=M=>He.value=M),placeholder:e.unref(L)("filter.searchAttributes")},null,8,l9),[[e.vModelText,He.value]]),e.createElementVNode("ul",n9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M.key,class:"dss-filter-popup-item",onClick:ae=>F(M.key)},e.toDisplayString(M.label),9,a9))),128)),lt.value.length===0?(e.openBlock(),e.createElementBlock("li",o9,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Se},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),i9={class:"dss-pill-field__pills"},c9=["data-value"],u9=["disabled"],d9={class:"dss-pill-field__pill-text"},m9={key:0,class:"dss-pill-field__pill-actions"},p9=["onClick"],v9=["onClick"],f9=["placeholder","disabled"],h9=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(B,{emit:J}){const N=B,L=J,ne=e.ref(""),W=e.ref([...N.modelValue]),R=e.ref(null);let ue=null;const rt=e.ref(null),ee=e.ref(""),g=e.ref(null),we=e.ref(null),ke=e.computed(()=>{if(!we.value)return;const{width:Ae,height:Ye}=we.value;return{minWidth:`${Ae}px`,height:`${Ye}px`}});function G(Ae,Ye){rt.value===Ye&&(g.value=Ae)}function j(){rt.value=null,ee.value="",we.value=null,g.value=null}const fe=e.computed(()=>new Set(W.value.map(Ae=>Ae.trim()).filter(Boolean)));function He(Ae){R.value=Ae,ue&&clearTimeout(ue),ue=setTimeout(()=>{R.value=null,ue=null},900)}function he(Ae){const Ye=Ae.trim();return Ye?fe.value.has(Ye)?(He(Ye),!1):(W.value=[...W.value,Ye],L("update:modelValue",[...W.value]),!0):!1}function Te(Ae){const Ye=Ae.split(/\r?\n/g).map(ft=>ft.trim()).filter(Boolean);if(!Ye.length)return;const Ce=new Set(W.value.map(ft=>ft.trim()).filter(Boolean)),$e=[...W.value];let lt=null;for(const ft of Ye){if(Ce.has(ft)){lt??=ft;continue}Ce.add(ft),$e.push(ft)}$e.length!==W.value.length&&(W.value=$e,L("update:modelValue",[...W.value])),lt&&He(lt)}function Z(Ae){N.disabled||(rt.value===Ae&&j(),W.value=W.value.filter((Ye,Ce)=>Ce!==Ae),L("update:modelValue",[...W.value]))}async function Fe(Ae,Ye){if(N.disabled)return;const Ce=Ye.currentTarget.closest(".dss-pill-field__pill");Ce&&(we.value={width:Ce.offsetWidth,height:Ce.offsetHeight}),rt.value=Ae,ee.value=W.value[Ae]??"",await e.nextTick();const $e=g.value;if(!$e)return;$e.focus();const lt=$e.value.length;$e.setSelectionRange(lt,lt)}function qe(){j()}function Me(){if(N.disabled||rt.value===null)return;const Ae=rt.value,Ye=W.value[Ae]??"",Ce=ee.value.trim();if(j(),Ce!==Ye&&fe.value.has(Ce)){He(Ce);return}if(!Ce){W.value=W.value.filter((lt,ft)=>ft!==Ae),L("update:modelValue",[...W.value]);return}const $e=W.value.map((lt,ft)=>ft===Ae?Ce:lt);W.value=$e,L("update:modelValue",[...W.value])}function Ze(Ae){Ae.preventDefault(),!N.disabled&&(he(ne.value),ne.value="")}function U(Ae){if(N.disabled)return;const Ye=Ae.clipboardData?.getData("text")??"";!Ye.includes(`
120
- `)&&!Ye.includes("\r")||(Ae.preventDefault(),Te(Ye),ne.value="")}return e.watch(()=>N.modelValue,Ae=>{W.value=Array.isArray(Ae)?[...Ae]:[]},{deep:!0}),e.onBeforeUnmount(()=>{ue&&clearTimeout(ue)}),(Ae,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Ae.disabled}])},[e.createElementVNode("div",i9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(Ce,$e)=>(e.openBlock(),e.createElementBlock("span",{key:Ce,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":R.value===Ce,"dss-pill-field__pill--editing":rt.value===$e}]),style:e.normalizeStyle(rt.value===$e&&we.value?ke.value:void 0)},[rt.value===$e?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:lt=>G(lt,$e),"onUpdate:modelValue":Ye[0]||(Ye[0]=lt=>ee.value=lt),class:"dss-pill-field__pill-edit",type:"text",disabled:Ae.disabled,onKeydown:[e.withKeys(Me,["enter"]),e.withKeys(qe,["esc"])],onBlur:Me},null,40,u9),[[e.vModelText,ee.value]])],8,c9)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",d9,e.toDisplayString(Ce),1),Ae.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",m9,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:lt=>Fe($e,lt)},[...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,p9),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:lt=>Z($e)}," × ",8,v9)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=Ce=>ne.value=Ce),class:"dss-pill-field__input",type:"text",placeholder:W.value.length?"":Ae.placeholder,disabled:Ae.disabled,onPaste:U,onKeydown:e.withKeys(Ze,["enter"])},null,40,f9),[[e.vModelText,ne.value]])])],2))}}),g9={key:0,class:"dss-title dss-title--separator"},y9={__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:J,emit:N}){const L=B,ne=N,W=e.ref(null),R=e.computed(()=>`dss-title--${L.type}`),ue=e.computed(()=>L.h!=null?`dss-title--h${L.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>L.h!=null?`h${L.h}`:rt[L.type]??"div"),g=e.computed(()=>L.editable?"plaintext-only":void 0),we=e.computed(()=>{const he={};return L.size!=null&&(he.fontSize=typeof L.size=="number"?`${L.size}px`:L.size),L.weight!=null&&(he.fontWeight=L.weight),L.color!=null&&(he.color=L.color),Object.keys(he).length?he:void 0}),ke=e.computed(()=>L.editable?{input:j,keydown:fe,paste:He}:{}),G=()=>{const he=W.value;!L.editable||!he||document.activeElement!==he&&(he.innerText=L.modelValue??"")},j=he=>{const Te=he.target.innerText;ne("update:modelValue",Te),ne("change",Te)},fe=he=>{he.key==="Enter"&&he.preventDefault()},He=he=>{he.preventDefault();const Te=(he.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Te)};return e.watch(()=>L.modelValue,()=>{G()}),e.watch(()=>L.editable,()=>{e.nextTick(G)}),e.onMounted(()=>{e.nextTick(G)}),J({focus:()=>W.value?.focus()}),(he,Te)=>B.type==="separator"?(e.openBlock(),e.createElementBlock("div",g9,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:W,class:["dss-title__separator-label",ue.value,{"dss-title--editable":B.editable}],style:we.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(he.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:W,class:["dss-title",[R.value,ue.value,{"dss-title--editable":B.editable}]],style:we.value,contenteditable:g.value,spellcheck:B.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[B.editable?e.createCommentVNode("",!0):e.renderSlot(he.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(B.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},k9={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"}},C9={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"},b9={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"}},w9={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"}},x9={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"}},ga={chart:k9,table:C9,filter:b9,datepicker:w9,textEditor:x9},E9={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"}},S9={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"},V9={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"}},N9={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"}},B9={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"}},ya={chart:E9,table:S9,filter:V9,datepicker:N9,textEditor:B9},_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"}},M9={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"},$9={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"}},D9={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"}},L9={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"}},ka={chart:_9,table:M9,filter:$9,datepicker:D9,textEditor:L9},qa={en:ga,fr:ya,nl:ka};function Fo(B){if(!B||!B.global)return;const J=B.global.availableLocales||[];Object.keys(qa).forEach(N=>{J.includes(N)&&B.global.mergeLocaleMessage(N,qa[N])})}const Za={en:{textEditor:ga.textEditor},fr:{textEditor:ya.textEditor},nl:{textEditor:ka.textEditor}};function Io(B){if(!B||!B.global)return;const J=B.global.availableLocales||[];Object.keys(Za).forEach(N=>{J.includes(N)&&B.global.mergeLocaleMessage(N,Za[N])})}const Ua={en:{table:ga.table},fr:{table:ya.table},nl:{table:ka.table}};function zo(B){if(!B||!B.global)return;const J=B.global.availableLocales||[];Object.keys(Ua).forEach(N=>{J.includes(N)&&B.global.mergeLocaleMessage(N,Ua[N])})}const Ya={en:{datepicker:ga.datepicker},fr:{datepicker:ya.datepicker},nl:{datepicker:ka.datepicker}};function Po(B){if(!B||!B.global)return;const J=B.global.availableLocales||[];Object.keys(Ya).forEach(N=>{J.includes(N)&&B.global.mergeLocaleMessage(N,Ya[N])})}const Xa={en:{filter:ga.filter},fr:{filter:ya.filter},nl:{filter:ka.filter}};function Oo(B){if(!B||!B.global)return;const J=B.global.availableLocales||[];Object.keys(Xa).forEach(N=>{J.includes(N)&&B.global.mergeLocaleMessage(N,Xa[N])})}const T9={chart:qa,textEditor:Za,table:Ua,datepicker:Ya,filter:Xa};function A9(B){!B||!B.global||(Fo(B),Io(B),zo(B),Po(B),Oo(B))}const H9={en:{...ga},fr:{...ya},nl:{...ka}};ha.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:H9});exports.DSSChart=Fu;exports.DSSChartMessages=qa;exports.DSSColorPicker=Vp;exports.DSSConfetti=e0;exports.DSSDatepicker=go;exports.DSSDatepickerMessages=Ya;exports.DSSDnd=Qp;exports.DSSFilter=r9;exports.DSSFilterMessages=Xa;exports.DSSLoader=Ip;exports.DSSMessages=T9;exports.DSSModal=ho;exports.DSSPillField=h9;exports.DSSSkeleton=zp;exports.DSSStepBar=Ro;exports.DSSTable=s1;exports.DSSTableMessages=Ua;exports.DSSTextEditor=up;exports.DSSTextEditorMessages=Za;exports.DSSTitle=y9;exports.addDSSChartTranslations=Fo;exports.addDSSDatepickerTranslations=Po;exports.addDSSFilterTranslations=Oo;exports.addDSSTableTranslations=zo;exports.addDSSTextEditorTranslations=Io;exports.addDSSTranslations=A9;
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;